1
0
mirror of https://github.com/rancher/os.git synced 2025-09-02 15:24:32 +00:00

add an example service using EXTRA_CMDLINE

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2017-03-14 12:56:23 +10:00
parent 73980f9c73
commit 4c2d21275a
2 changed files with 33 additions and 0 deletions

View File

@@ -36,4 +36,23 @@ func (s *QemuSuite) TestElideCmdLine(c *C) {
)
// And then add a service.yml file example.
s.CheckCall(c,
`echo 'test:
image: alpine
command: echo "tell me a secret ${EXTRA_CMDLINE}"
labels:
io.rancher.os.scope: system
environment:
- EXTRA_CMDLINE
' > test.yml`)
s.CheckCall(c, "sudo mv test.yml /var/lib/rancher/conf/test.yml")
s.CheckCall(c, "sudo ros service enable /var/lib/rancher/conf/test.yml")
s.CheckCall(c, "sudo ros service up test")
s.CheckOutput(c,
"test_1 | tell me a secret /init cc.hostname=nope rancher.password=three\n",
Equals,
"sudo ros service logs test | grep secret",
)
// TODO: add a test showing we have the right password set
}