From e19ccefff82f5def5d66675797ff9fa0a8be55c9 Mon Sep 17 00:00:00 2001 From: Sven Dowideit Date: Thu, 22 Jun 2017 12:44:18 +1000 Subject: [PATCH] Fix ElideCmdline test by making it more robust Signed-off-by: Sven Dowideit --- tests/cmdline_test.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/cmdline_test.go b/tests/cmdline_test.go index fd007c24..d15afc23 100755 --- a/tests/cmdline_test.go +++ b/tests/cmdline_test.go @@ -1,7 +1,11 @@ package integration -import . "gopkg.in/check.v1" -import "fmt" +import ( + . "gopkg.in/check.v1" + + "fmt" + "strings" +) func (s *QemuSuite) TestElideCmdLine(c *C) { extra := "cc.hostname=nope rancher.password=three" @@ -15,11 +19,10 @@ func (s *QemuSuite) TestElideCmdLine(c *C) { s.RunQemuWith(c, runArgs...) s.CheckOutput(c, "nope\n", Equals, "hostname") - s.CheckOutput(c, - "printk.devkmsg=on rancher.debug=true rancher.password=rancher console=ttyS0 rancher.autologin=ttyS0 cc.something=yes rancher.password=two rancher.state.dev=LABEL=RANCHER_STATE rancher.state.autoformat=[/dev/sda,/dev/vda] rancher.rm_usr -- \n", - Equals, - "cat /proc/cmdline", - ) + cmdline := s.CheckOutput(c, "", Not(Equals), "cat /proc/cmdline",) + if strings.Contains(cmdline, extra) { + c.Errorf("/proc/cmdline (%s) contains info that should be elided (%s)", cmdline, extra) + } s.CheckOutput(c, fmt.Sprintf("/init %s\n", extra), Equals,