summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-07-14 21:09:00 +0200
committerGitHub <noreply@github.com>2020-07-14 21:09:00 +0200
commitc078e936bf5793433359c43498a89943ded3f8fc (patch)
treeb3a52f531068591a996140e9f7c15b65b49ebbad /test
parenta9a751feefb03834bfe6122583e8db598c4159e1 (diff)
parent05988fc74fc25f2ad2256d6e011dfb7ad0b9a4eb (diff)
downloadpodman-c078e936bf5793433359c43498a89943ded3f8fc.tar.gz
podman-c078e936bf5793433359c43498a89943ded3f8fc.tar.bz2
podman-c078e936bf5793433359c43498a89943ded3f8fc.zip
Merge pull request #6951 from mheon/check_full_command
When determining systemd mode, use full command
Diffstat (limited to 'test')
-rw-r--r--test/e2e/systemd_test.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/e2e/systemd_test.go b/test/e2e/systemd_test.go
index a1cdff70e..7b9be2275 100644
--- a/test/e2e/systemd_test.go
+++ b/test/e2e/systemd_test.go
@@ -112,5 +112,40 @@ WantedBy=multi-user.target
systemctl.WaitWithDefaultTimeout()
Expect(systemctl.ExitCode()).To(Equal(0))
Expect(strings.Contains(systemctl.OutputToString(), "State:")).To(BeTrue())
+
+ result := podmanTest.Podman([]string{"inspect", ctrName})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(0))
+ conData := result.InspectContainerToJSON()
+ Expect(len(conData)).To(Equal(1))
+ Expect(conData[0].Config.SystemdMode).To(BeTrue())
+ })
+
+ It("podman create container with systemd entrypoint triggers systemd mode", func() {
+ ctrName := "testCtr"
+ run := podmanTest.Podman([]string{"create", "--name", ctrName, "--entrypoint", "/sbin/init", ubi_init})
+ run.WaitWithDefaultTimeout()
+ Expect(run.ExitCode()).To(Equal(0))
+
+ result := podmanTest.Podman([]string{"inspect", ctrName})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(0))
+ conData := result.InspectContainerToJSON()
+ Expect(len(conData)).To(Equal(1))
+ Expect(conData[0].Config.SystemdMode).To(BeTrue())
+ })
+
+ It("podman create container with systemd=always triggers systemd mode", func() {
+ ctrName := "testCtr"
+ run := podmanTest.Podman([]string{"create", "--name", ctrName, "--systemd", "always", ALPINE})
+ run.WaitWithDefaultTimeout()
+ Expect(run.ExitCode()).To(Equal(0))
+
+ result := podmanTest.Podman([]string{"inspect", ctrName})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(0))
+ conData := result.InspectContainerToJSON()
+ Expect(len(conData)).To(Equal(1))
+ Expect(conData[0].Config.SystemdMode).To(BeTrue())
})
})