summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-03-16 14:40:02 +0100
committerGitHub <noreply@github.com>2020-03-16 14:40:02 +0100
commit412a114d33a2f0aca7ee49984afcf278d2f2574a (patch)
tree2d3c74c57531a218615d4d16b768034242cc62de /test
parent5288d112bc63bb52821a0ed9711fcc23b37df2a8 (diff)
parent194723f314f505de3d39afb7fd769bc02293fd88 (diff)
downloadpodman-412a114d33a2f0aca7ee49984afcf278d2f2574a.tar.gz
podman-412a114d33a2f0aca7ee49984afcf278d2f2574a.tar.bz2
podman-412a114d33a2f0aca7ee49984afcf278d2f2574a.zip
Merge pull request #5439 from ttys3/fixup-systemdgen-with-new-param
systemd generator: force run container detached if CreateCommand has no detach param
Diffstat (limited to 'test')
-rw-r--r--test/e2e/generate_systemd_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/e2e/generate_systemd_test.go b/test/e2e/generate_systemd_test.go
index 31131a68b..e5ab0b854 100644
--- a/test/e2e/generate_systemd_test.go
+++ b/test/e2e/generate_systemd_test.go
@@ -195,6 +195,34 @@ var _ = Describe("Podman generate systemd", func() {
Expect(found).To(BeTrue())
})
+ It("podman generate systemd --new without explicit detaching param", func() {
+ n := podmanTest.Podman([]string{"create", "--name", "foo", "alpine", "top"})
+ n.WaitWithDefaultTimeout()
+ Expect(n.ExitCode()).To(Equal(0))
+
+ session := podmanTest.Podman([]string{"generate", "systemd", "--timeout", "42", "--name", "--new", "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ // Grepping the output (in addition to unit tests)
+ found, _ := session.GrepString("--cgroups=no-conmon -d")
+ Expect(found).To(BeTrue())
+ })
+
+ It("podman generate systemd --new with explicit detaching param in middle", func() {
+ n := podmanTest.Podman([]string{"create", "--name", "foo", "-d", "alpine", "top"})
+ n.WaitWithDefaultTimeout()
+ Expect(n.ExitCode()).To(Equal(0))
+
+ session := podmanTest.Podman([]string{"generate", "systemd", "--timeout", "42", "--name", "--new", "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ // Grepping the output (in addition to unit tests)
+ found, _ := session.GrepString("--name foo -d alpine top")
+ Expect(found).To(BeTrue())
+ })
+
It("podman generate systemd --new pod", func() {
n := podmanTest.Podman([]string{"pod", "create", "--name", "foo"})
n.WaitWithDefaultTimeout()