Add variable for global flags to runlabel

use $GLOBAL_OPTS to pass global flags to the runlabel command.

Signed-off-by: Qi Wang <qiwan@redhat.com>
This commit is contained in:
Qi Wang
2019-04-11 15:59:30 -04:00
parent 7d05ff3fc7
commit a477a8ff75
7 changed files with 65 additions and 11 deletions

View File

@@ -18,6 +18,11 @@ var LsDockerfile = `
FROM alpine:latest
LABEL RUN ls -la`
var GlobalDockerfile = `
FROM alpine:latest
LABEL RUN echo \$GLOBAL_OPTS
`
var _ = Describe("podman container runlabel", func() {
var (
tempdir string
@@ -78,4 +83,18 @@ var _ = Describe("podman container runlabel", func() {
Expect(result.ExitCode()).ToNot(Equal(0))
})
It("podman container runlabel global options", func() {
image := "podman-global-test:ls"
podmanTest.BuildImage(GlobalDockerfile, image, "false")
result := podmanTest.Podman([]string{"--syslog", "--log-level", "debug", "container", "runlabel", "RUN", image})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
Expect(result.OutputToString()).To(ContainSubstring("--syslog true"))
Expect(result.OutputToString()).To(ContainSubstring("--log-level debug"))
result = podmanTest.Podman([]string{"rmi", image})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
})
})