os_release_test.go 987 B

1234567891011121314151617181920212223242526272829
  1. package integration
  2. import (
  3. . "gopkg.in/check.v1"
  4. "strings"
  5. )
  6. func (s *QemuSuite) TestOsRelease(c *C) {
  7. s.RunQemu(c)
  8. version := ""
  9. version = s.CheckOutput(c, version, Not(Equals), "sudo ros -v")
  10. version = strings.Replace(version, "ros version ", "", 1)
  11. s.CheckOutput(c, "VERSION="+version, Equals, "cat /etc/os-release | grep VERSION=")
  12. s.CheckOutput(c, "NAME=\"RancherOS\"\n", Equals, "cat /etc/os-release | grep ^NAME=")
  13. s.MakeCall("sudo ros console switch -f alpine")
  14. c.Assert(s.WaitForSSH(), IsNil)
  15. s.CheckOutput(c, "/sbin/apk\n", Equals, "which apk")
  16. s.CheckOutput(c, "VERSION="+version, Equals, "cat /etc/os-release | grep VERSION=")
  17. s.CheckOutput(c, "NAME=\"RancherOS\"\n", Equals, "cat /etc/os-release | grep ^NAME=")
  18. s.Reboot(c)
  19. s.CheckOutput(c, "/sbin/apk\n", Equals, "which apk")
  20. s.CheckOutput(c, "VERSION="+version, Equals, "cat /etc/os-release | grep VERSION=")
  21. s.CheckOutput(c, "NAME=\"RancherOS\"\n", Equals, "cat /etc/os-release | grep ^NAME=")
  22. }