diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/generate_systemd_test.go | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/e2e/generate_systemd_test.go b/test/e2e/generate_systemd_test.go index 606d756b0..7c43e6e35 100644 --- a/test/e2e/generate_systemd_test.go +++ b/test/e2e/generate_systemd_test.go @@ -62,6 +62,42 @@ var _ = Describe("Podman generate systemd", func() { Expect(session.ErrorToString()).To(ContainSubstring("bogus is not a valid restart policy")) }) + It("podman generate systemd with --no-header=true", func() { + session := podmanTest.Podman([]string{"create", "--name", "foobar", "alpine", "top"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + session = podmanTest.Podman([]string{"generate", "systemd", "foobar", "--no-header=true"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + Expect(session.OutputToString()).NotTo(ContainSubstring("autogenerated by")) + }) + + It("podman generate systemd with --no-header", func() { + session := podmanTest.Podman([]string{"create", "--name", "foobar", "alpine", "top"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + session = podmanTest.Podman([]string{"generate", "systemd", "foobar", "--no-header"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + Expect(session.OutputToString()).NotTo(ContainSubstring("autogenerated by")) + }) + + It("podman generate systemd with --no-header=false", func() { + session := podmanTest.Podman([]string{"create", "--name", "foobar", "alpine", "top"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + session = podmanTest.Podman([]string{"generate", "systemd", "foobar", "--no-header=false"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + Expect(session.OutputToString()).To(ContainSubstring("autogenerated by")) + }) + It("podman generate systemd good timeout value", func() { session := podmanTest.Podman([]string{"create", "--name", "foobar", "alpine", "top"}) session.WaitWithDefaultTimeout() |