Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1938 from SvenDowideit/fix-elide-cmdline-test
Browse files Browse the repository at this point in the history
Fix ElideCmdline test by making it more robust
  • Loading branch information
SvenDowideit authored Jun 23, 2017
2 parents 4c49c8f + 94a4fe7 commit 68b005b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tests/cmdline_test.go
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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,
Expand Down

0 comments on commit 68b005b

Please sign in to comment.