From d2f3098c6f9068edfe4012387cef2e6d140ef20a Mon Sep 17 00:00:00 2001 From: Jakub Guzik Date: Mon, 22 Feb 2021 14:47:08 +0100 Subject: --no-header flag implementation for generate systemd Signed-off-by: Jakub Guzik --- test/e2e/generate_systemd_test.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'test/e2e') 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() -- cgit v1.2.3-54-g00ecf