cloud_config_install_test.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package integration
  2. import (
  3. "time"
  4. . "gopkg.in/check.v1"
  5. )
  6. func (s *QemuSuite) TestCloudConfigInstall(c *C) {
  7. s.RunQemu(c,
  8. "--iso",
  9. "--fresh",
  10. "--no-format",
  11. "--cloud-config", "./tests/assets/cloud_config_install_test/cloud-config.yml")
  12. //check we have a particular version, from iso
  13. s.CheckOutput(c, " Backing Filesystem: tmpfs\n", Equals, "sudo system-docker info | grep Filesystem")
  14. //and no persistence yet
  15. //s.CheckOutput(c, "\n", Equals, "sudo blkid")
  16. // TODO: need some way to wait for install to complete.
  17. time.Sleep(time.Second)
  18. for {
  19. result, _ := s.MakeCall("cat", "/var/log/ros-install.log")
  20. if result == "done\n" {
  21. break
  22. }
  23. time.Sleep(time.Second * 3)
  24. }
  25. //check we have persistence and that ros-install completed ok
  26. s.CheckOutput(c, "/dev/vda1:\n", Equals, "sudo blkid | grep RANCHER_STATE | cut -d ' ' -f 1")
  27. s.CheckOutput(c, "LABEL=\"RANCHER_STATE\"\n", Equals, "sudo blkid | grep vda1 | cut -d ' ' -f 2")
  28. //reboot, and check we're using the new non-iso install
  29. s.Stop(c)
  30. s.RunQemuWith(c, "--qemu", "--boothd", "--no-rm-usr")
  31. s.CheckOutput(c, "/dev/vda1:\n", Equals, "sudo blkid | grep RANCHER_STATE | cut -d ' ' -f 1")
  32. s.CheckOutput(c, "LABEL=\"RANCHER_STATE\"\n", Equals, "sudo blkid | grep vda1 | cut -d ' ' -f 2")
  33. s.CheckOutput(c, " Backing Filesystem: extfs\n", Equals, "sudo system-docker info | grep Filesystem")
  34. }