summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-02 14:28:25 -0400
committerGitHub <noreply@github.com>2020-10-02 14:28:25 -0400
commit819a4e02888b92c3120f513f398993a165f69028 (patch)
treeef5fdac26037186d025ef002ff907166eb77ee9e /test
parent1132bcfeb5a8dca56d99c50882abc6e7775ac897 (diff)
parent1492f3c936a0f6180db61a6500371aceebc37e39 (diff)
downloadpodman-819a4e02888b92c3120f513f398993a165f69028.tar.gz
podman-819a4e02888b92c3120f513f398993a165f69028.tar.bz2
podman-819a4e02888b92c3120f513f398993a165f69028.zip
Merge pull request #7895 from zhangguanzhang/run-ctr-restartPolicy-with-rm
[podman run] --rm option shold conflicts with --restart
Diffstat (limited to 'test')
-rw-r--r--test/e2e/run_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 292df529c..05aede122 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -67,6 +67,30 @@ var _ = Describe("Podman run", func() {
Expect(session.ExitCode()).To(Equal(0))
})
+ It("podman run --rm with --restart", func() {
+ session := podmanTest.Podman([]string{"run", "--rm", "--restart", "", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"run", "--rm", "--restart", "no", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ // the --rm option conflicts with --restart, when the restartPolicy is not "" and "no"
+ // so the exitCode should not equal 0
+ session = podmanTest.Podman([]string{"run", "--rm", "--restart", "on-failure", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+
+ session = podmanTest.Podman([]string{"run", "--rm", "--restart", "always", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+
+ session = podmanTest.Podman([]string{"run", "--rm", "--restart", "unless-stopped", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+ })
+
It("podman run a container based on on a short name with localhost", func() {
tag := podmanTest.Podman([]string{"tag", nginx, "localhost/libpod/alpine_nginx:latest"})
tag.WaitWithDefaultTimeout()