oem_test.go 662 B

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