consoles_test.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package integration
  2. import . "gopkg.in/check.v1"
  3. func (s *QemuSuite) TestCloudConfigConsole(c *C) {
  4. err := s.RunQemu("--cloud-config", "./tests/assets/test_03/cloud-config.yml")
  5. c.Assert(err, IsNil)
  6. s.CheckCall(c, "apt-get --version")
  7. s.CheckCall(c, `
  8. sudo ros console list | grep default | grep disabled
  9. sudo ros console list | grep debian | grep current`)
  10. }
  11. func (s *QemuSuite) TestConsoleCommand(c *C) {
  12. err := s.RunQemu()
  13. c.Assert(err, IsNil)
  14. s.CheckCall(c, `
  15. sudo ros console list | grep default | grep current
  16. sudo ros console list | grep debian | grep disabled`)
  17. s.MakeCall("sudo ros console switch -f debian")
  18. c.Assert(s.WaitForSSH(), IsNil)
  19. s.CheckCall(c, "apt-get --version")
  20. s.CheckCall(c, `
  21. sudo ros console list | grep default | grep disabled
  22. sudo ros console list | grep debian | grep current`)
  23. s.Reboot(c)
  24. s.CheckCall(c, "apt-get --version")
  25. s.CheckCall(c, `
  26. sudo ros console list | grep default | grep disabled
  27. sudo ros console list | grep debian | grep current`)
  28. s.MakeCall("sudo ros console switch -f default")
  29. c.Assert(s.WaitForSSH(), IsNil)
  30. s.CheckCall(c, `
  31. sudo ros console list | grep default | grep current
  32. sudo ros console list | grep debian | grep disabled`)
  33. s.CheckCall(c, "sudo ros console enable debian")
  34. s.CheckCall(c, "sudo ros console list | grep default | grep current")
  35. s.CheckCall(c, "sudo ros console list | grep debian | grep enabled")
  36. s.Reboot(c)
  37. s.CheckCall(c, `
  38. sudo ros console list | grep default | grep disabled
  39. sudo ros console list | grep debian | grep current`)
  40. }