mirror of
https://github.com/rancher/os.git
synced 2025-09-19 17:38:30 +00:00
Add an integration test for os-release
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
28
tests/os-release-test.go
Normal file
28
tests/os-release-test.go
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
package integration
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
. "gopkg.in/check.v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (s *QemuSuite) TestOsRelease(c *C) {
|
||||||
|
s.RunQemu(c)
|
||||||
|
version := ""
|
||||||
|
version = s.CheckOutput(c, version, Not(Equals), "sudo ros -v")
|
||||||
|
version = strings.Replace(version, "ros version ", "", 1)
|
||||||
|
s.CheckOutput(c, "VERSION="+version, Equals, "cat /etc/os-release | grep VERSION=")
|
||||||
|
s.CheckOutput(c, "NAME=\"RancherOS\"\n", Equals, "cat /etc/os-release | grep ^NAME=")
|
||||||
|
|
||||||
|
s.MakeCall("sudo ros console switch -f alpine")
|
||||||
|
c.Assert(s.WaitForSSH(), IsNil)
|
||||||
|
|
||||||
|
s.CheckOutput(c, "/sbin/apk\n", Equals, "which apk")
|
||||||
|
s.CheckOutput(c, "VERSION="+version, Equals, "cat /etc/os-release | grep VERSION=")
|
||||||
|
s.CheckOutput(c, "NAME=\"RancherOS\"\n", Equals, "cat /etc/os-release | grep ^NAME=")
|
||||||
|
|
||||||
|
s.Reboot(c)
|
||||||
|
|
||||||
|
s.CheckOutput(c, "/sbin/apk\n", Equals, "which apk")
|
||||||
|
s.CheckOutput(c, "VERSION="+version, Equals, "cat /etc/os-release | grep VERSION=")
|
||||||
|
s.CheckOutput(c, "NAME=\"RancherOS\"\n", Equals, "cat /etc/os-release | grep ^NAME=")
|
||||||
|
}
|
Reference in New Issue
Block a user