summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-09-09 10:18:28 -0400
committerGitHub <noreply@github.com>2020-09-09 10:18:28 -0400
commit81bc0395ad67bcaa436bc9067a64efc5dcc02683 (patch)
tree2a226735a7d4da9deff8c12d3ba405d1cb4afd81 /test
parent21cfcc4b3b19273a26cd4bb78072061109b1ed42 (diff)
parent9b8aaf88e70be9d51c11bce43c24c5d765dd2973 (diff)
downloadpodman-81bc0395ad67bcaa436bc9067a64efc5dcc02683.tar.gz
podman-81bc0395ad67bcaa436bc9067a64efc5dcc02683.tar.bz2
podman-81bc0395ad67bcaa436bc9067a64efc5dcc02683.zip
Merge pull request #7571 from vrothberg/fix-7157
generate systemd: catch `--name=foo`
Diffstat (limited to 'test')
-rw-r--r--test/e2e/generate_systemd_test.go25
1 files changed, 24 insertions, 1 deletions
diff --git a/test/e2e/generate_systemd_test.go b/test/e2e/generate_systemd_test.go
index cd3ee6e0a..da2f67754 100644
--- a/test/e2e/generate_systemd_test.go
+++ b/test/e2e/generate_systemd_test.go
@@ -189,7 +189,7 @@ var _ = Describe("Podman generate systemd", func() {
Expect(found).To(BeTrue())
})
- It("podman generate systemd --new", func() {
+ It("podman generate systemd --new --name foo", func() {
n := podmanTest.Podman([]string{"create", "--name", "foo", "alpine", "top"})
n.WaitWithDefaultTimeout()
Expect(n.ExitCode()).To(Equal(0))
@@ -202,6 +202,29 @@ var _ = Describe("Podman generate systemd", func() {
found, _ := session.GrepString("# container-foo.service")
Expect(found).To(BeTrue())
+ found, _ = session.GrepString(" --replace ")
+ Expect(found).To(BeTrue())
+
+ found, _ = session.GrepString("stop --ignore --cidfile %t/container-foo.ctr-id -t 42")
+ Expect(found).To(BeTrue())
+ })
+
+ It("podman generate systemd --new --name=foo", func() {
+ n := podmanTest.Podman([]string{"create", "--name=foo", "alpine", "top"})
+ n.WaitWithDefaultTimeout()
+ Expect(n.ExitCode()).To(Equal(0))
+
+ session := podmanTest.Podman([]string{"generate", "systemd", "-t", "42", "--name", "--new", "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ // Grepping the output (in addition to unit tests)
+ found, _ := session.GrepString("# container-foo.service")
+ Expect(found).To(BeTrue())
+
+ found, _ = session.GrepString(" --replace ")
+ Expect(found).To(BeTrue())
+
found, _ = session.GrepString("stop --ignore --cidfile %t/container-foo.ctr-id -t 42")
Expect(found).To(BeTrue())
})