1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 14:48:55 +00:00

save the elided cmdline into an env var

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2017-03-14 12:05:07 +10:00
parent 368a13ed13
commit 73980f9c73
5 changed files with 74 additions and 7 deletions

View File

@@ -1,15 +1,39 @@
package integration
import . "gopkg.in/check.v1"
import "fmt"
func (s *QemuSuite) TestElideCmdLine(c *C) {
extra := "cc.hostname=nope rancher.password=three"
runArgs := []string{
"--fresh",
"--append",
"cc.something=yes rancher.password=two",
"--append-init",
"cc.hostname=nope rancher.debug=true",
extra,
}
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 rancher.state.dev=LABEL=RANCHER_STATE rancher.state.autoformat=[/dev/sda,/dev/vda] rancher.rm_usr -- \n", Equals, "cat /proc/cmdline")
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",
)
s.CheckOutput(c,
fmt.Sprintf("/init %s\n", extra),
Equals,
"sudo ros config get rancher.environment.EXTRA_CMDLINE",
)
// TODO: it seems that rancher.password and rancher.autologin are in `ros config export`, but accessible as `ros config get`
s.CheckOutput(c, "\n", Equals, "sudo ros config get rancher.password")
s.CheckOutput(c,
"EXTRA_CMDLINE: /init cc.hostname=nope rancher.password=three\n"+
" EXTRA_CMDLINE: /init cc.hostname=nope rancher.password=three\n"+
" password: three\n",
Equals,
"sudo ros config export | grep password",
)
// And then add a service.yml file example.
}