oem_test.go 688 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package integration
  2. import . "gopkg.in/check.v1"
  3. func (s *QemuSuite) TestOem(c *C) {
  4. err := s.RunQemu("--second-drive")
  5. c.Assert(err, IsNil)
  6. s.CheckCall(c, `
  7. set -x
  8. set -e
  9. sudo mkfs.ext4 -L RANCHER_OEM /dev/vdb
  10. sudo mount /dev/vdb /mnt
  11. cat > /tmp/oem-config.yml << EOF
  12. #cloud-config
  13. rancher:
  14. upgrade:
  15. url: 'foo'
  16. EOF
  17. sudo cp /tmp/oem-config.yml /mnt
  18. sudo umount /mnt`)
  19. s.Reboot(c)
  20. s.CheckCall(c, `
  21. set -x
  22. set -e
  23. if [ ! -e /usr/share/ros/oem/oem-config.yml ]; then
  24. echo Failed to find /usr/share/ros/oem/oem-config.yml
  25. exit 1
  26. fi
  27. FOO="$(sudo ros config get rancher.upgrade.url)"
  28. if [ "$FOO" != "foo" ]; then
  29. echo rancher.upgrade.url is not foo
  30. exit 1
  31. fi`)
  32. }