1
0
mirror of https://github.com/rancher/os.git synced 2025-06-25 14:31:33 +00:00
os/tests/oem_test.go

39 lines
688 B
Go
Raw Normal View History

2016-07-20 17:42:16 +00:00
package integration
2016-07-20 17:42:16 +00:00
import . "gopkg.in/check.v1"
2016-07-20 17:42:16 +00:00
func (s *QemuSuite) TestOem(c *C) {
2016-07-26 22:40:35 +00:00
err := s.RunQemu("--second-drive")
2016-07-20 17:42:16 +00:00
c.Assert(err, IsNil)
2016-07-20 17:42:16 +00:00
s.CheckCall(c, `
set -x
set -e
2016-07-26 22:40:35 +00:00
sudo mkfs.ext4 -L RANCHER_OEM /dev/vdb
sudo mount /dev/vdb /mnt
2016-04-01 01:56:18 +00:00
cat > /tmp/oem-config.yml << EOF
#cloud-config
rancher:
upgrade:
url: 'foo'
EOF
sudo cp /tmp/oem-config.yml /mnt
2016-07-20 17:42:16 +00:00
sudo umount /mnt`)
2016-07-26 22:40:35 +00:00
s.Reboot(c)
2016-07-20 17:42:16 +00:00
s.CheckCall(c, `
set -x
2016-07-26 22:40:35 +00:00
set -e
if [ ! -e /usr/share/ros/oem/oem-config.yml ]; then
echo Failed to find /usr/share/ros/oem/oem-config.yml
exit 1
fi
FOO="$(sudo ros config get rancher.upgrade.url)"
if [ "$FOO" != "foo" ]; then
echo rancher.upgrade.url is not foo
exit 1
2016-07-20 17:42:16 +00:00
fi`)
}