mirror of
https://github.com/containers/podman.git
synced 2025-10-25 02:04:43 +08:00
--rm option shold conflicts with --restart
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
This commit is contained in:
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user