custom_docker_test.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package integration
  2. import . "gopkg.in/check.v1"
  3. func (s *QemuSuite) TestCustomDocker(c *C) {
  4. s.RunQemu(c, "--cloud-config", "./tests/assets/test_05/cloud-config.yml")
  5. s.CheckCall(c, `
  6. set -ex
  7. docker version | grep 1.12.6
  8. sudo ros engine list | grep 1.12.6 | grep current
  9. (sudo ros engine switch invalid 2>&1 || true) | grep "invalid is not a valid engine"
  10. (sudo ros engine enable invalid 2>&1 || true) | grep "invalid is not a valid engine"
  11. docker run -d --restart=always nginx
  12. docker ps | grep nginx`)
  13. s.CheckCall(c, `
  14. set -ex
  15. sudo ros engine switch docker-1.13.1
  16. /usr/sbin/wait-for-docker
  17. docker version | grep 1.13.1
  18. sudo ros engine list | grep 1.13.1 | grep current
  19. docker ps | grep nginx`)
  20. s.Reboot(c)
  21. s.CheckCall(c, `
  22. set -ex
  23. docker version | grep 1.13.1
  24. sudo ros engine list | grep 1.13.1 | grep current
  25. docker ps | grep nginx`)
  26. }
  27. func (s *QemuSuite) TestCustomDockerInPersistentConsole(c *C) {
  28. s.RunQemu(c, "--cloud-config", "./tests/assets/test_25/cloud-config.yml")
  29. s.CheckCall(c, `
  30. set -ex
  31. apt-get --version
  32. docker version | grep 17.06.1-ce
  33. sudo ros engine list | grep 17.06.1-ce | grep current
  34. docker run -d --restart=always nginx
  35. docker ps | grep nginx`)
  36. s.CheckCall(c, `
  37. set -ex
  38. sudo ros engine switch docker-1.12.6
  39. /usr/sbin/wait-for-docker
  40. docker version | grep 1.12.6
  41. sudo ros engine list | grep 1.12.6 | grep current
  42. docker ps | grep nginx`)
  43. s.Reboot(c)
  44. s.CheckCall(c, `
  45. set -ex
  46. docker version | grep 1.12.6
  47. sudo ros engine list | grep 1.12.6 | grep current
  48. docker ps | grep nginx`)
  49. }