mirror of
https://github.com/rancher/os.git
synced 2025-08-09 18:48:05 +00:00
Merge pull request #1540 from SvenDowideit/fix-os-release
Add an integration test for os-release
This commit is contained in:
commit
353fa604ab
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=")
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user