summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJakub Guzik <jakubmguzik@gmail.com>2021-02-22 14:47:08 +0100
committerJakub Guzik <jakubmguzik@gmail.com>2021-02-22 14:48:33 +0100
commitd2f3098c6f9068edfe4012387cef2e6d140ef20a (patch)
tree61e731bf1909984463adc2f845ac2ddcd7671328 /test
parent4aaaa6c1df3a1c90a930b97552bcc970d7d99dd4 (diff)
downloadpodman-d2f3098c6f9068edfe4012387cef2e6d140ef20a.tar.gz
podman-d2f3098c6f9068edfe4012387cef2e6d140ef20a.tar.bz2
podman-d2f3098c6f9068edfe4012387cef2e6d140ef20a.zip
--no-header flag implementation for generate systemd
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/generate_systemd_test.go36
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()