2016-07-20 17:42:16 +00:00
|
|
|
package integration
|
2016-04-22 23:11:54 +00:00
|
|
|
|
2016-07-20 17:42:16 +00:00
|
|
|
import . "gopkg.in/check.v1"
|
2016-04-22 23:11:54 +00:00
|
|
|
|
2016-07-20 17:42:16 +00:00
|
|
|
func (s *QemuSuite) TestRosConfig(c *C) {
|
2016-10-22 03:34:30 +00:00
|
|
|
s.RunQemu(c, "--cloud-config", "./tests/assets/test_14/cloud-config.yml")
|
2016-04-22 23:11:54 +00:00
|
|
|
|
2016-07-20 17:42:16 +00:00
|
|
|
s.CheckCall(c, `
|
2016-04-22 23:11:54 +00:00
|
|
|
set -x -e
|
|
|
|
|
|
|
|
if [ "$(sudo ros config get hostname)" == "hostname3
|
|
|
|
" ]; then
|
|
|
|
sudo ros config get hostname
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
sudo ros config set hostname rancher-test
|
|
|
|
if [ "$(sudo ros config get hostname)" == "rancher-test
|
|
|
|
" ]; then
|
|
|
|
sudo ros config get hostname
|
|
|
|
exit 1
|
2016-07-20 17:42:16 +00:00
|
|
|
fi`)
|
2016-04-22 23:11:54 +00:00
|
|
|
|
2016-07-20 17:42:16 +00:00
|
|
|
s.CheckCall(c, `
|
2016-04-22 23:11:54 +00:00
|
|
|
set -x -e
|
|
|
|
|
|
|
|
if [ "$(sudo ros config get rancher.log)" == "true
|
|
|
|
" ]; then
|
|
|
|
sudo ros config get rancher.log
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
sudo ros config set rancher.log false
|
|
|
|
if [ "$(sudo ros config get rancher.log)" == "false
|
|
|
|
" ]; then
|
|
|
|
sudo ros config get rancher.log
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$(sudo ros config get rancher.debug)" == "false
|
|
|
|
" ]; then
|
|
|
|
sudo ros config get rancher.debug
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
sudo ros config set rancher.debug true
|
|
|
|
if [ "$(sudo ros config get rancher.debug)" == "true
|
|
|
|
" ]; then
|
|
|
|
sudo ros config get rancher.debug
|
|
|
|
exit 1
|
2016-07-20 17:42:16 +00:00
|
|
|
fi`)
|
2016-04-22 23:11:54 +00:00
|
|
|
|
2016-07-20 17:42:16 +00:00
|
|
|
s.CheckCall(c, `
|
2016-04-22 23:11:54 +00:00
|
|
|
set -x -e
|
|
|
|
|
|
|
|
sudo ros config set rancher.network.dns.search '[a,b]'
|
|
|
|
if [ "$(sudo ros config get rancher.network.dns.search)" == "- a
|
|
|
|
- b
|
|
|
|
|
|
|
|
" ]; then
|
|
|
|
sudo ros config get rancher.network.dns.search
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
sudo ros config set rancher.network.dns.search '[]'
|
|
|
|
if [ "$(sudo ros config get rancher.network.dns.search)" == "[]
|
|
|
|
" ]; then
|
|
|
|
sudo ros config get rancher.network.dns.search
|
|
|
|
exit 1
|
2016-07-20 17:42:16 +00:00
|
|
|
fi`)
|
2016-06-01 01:10:56 +00:00
|
|
|
|
2016-07-20 17:42:16 +00:00
|
|
|
s.CheckCall(c, `
|
2016-06-01 01:10:56 +00:00
|
|
|
set -x -e
|
|
|
|
|
|
|
|
if sudo ros config export | grep "PRIVATE KEY"; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
sudo ros config export --private | grep "PRIVATE KEY"
|
|
|
|
|
|
|
|
sudo ros config export --full | grep "udev"
|
|
|
|
sudo ros config export --private --full | grep "ntp"
|
|
|
|
sudo ros config export --full | grep "labels"
|
|
|
|
|
2016-07-20 17:42:16 +00:00
|
|
|
sudo ros config export --private --full | grep "PRIVATE KEY"`)
|
|
|
|
}
|