summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAditya Rajan <arajan@redhat.com>2021-09-27 15:17:38 +0530
committerAditya Rajan <arajan@redhat.com>2021-09-27 17:27:15 +0530
commit8fca626e33670d49b4e8f06e09f0a87df3dca1fe (patch)
tree4fb15cfae95226a5b51d4af2d88aa483c8d627ac /test
parent869cb9a65413cc99bf8ed0e158c0e2f7b0df513a (diff)
downloadpodman-8fca626e33670d49b4e8f06e09f0a87df3dca1fe.tar.gz
podman-8fca626e33670d49b4e8f06e09f0a87df3dca1fe.tar.bz2
podman-8fca626e33670d49b4e8f06e09f0a87df3dca1fe.zip
stop: Do nothing if container was never created in runtime
Following commit ensures we silently return container id on `stop` if container was never created in OCI runtime. Following behaviour ensures that we are in parity with docker. Signed-off-by: Aditya Rajan <arajan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/stop_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/e2e/stop_test.go b/test/e2e/stop_test.go
index a984bf6d0..7f178d719 100644
--- a/test/e2e/stop_test.go
+++ b/test/e2e/stop_test.go
@@ -234,6 +234,17 @@ var _ = Describe("Podman stop", func() {
Expect(strings.TrimSpace(finalCtrs.OutputToString())).To(Equal(""))
})
+ It("podman stop should return silent success on stopping configured containers", func() {
+ // following container is not created on OCI runtime
+ // so we return success and assume that is is stopped
+ session2 := podmanTest.Podman([]string{"create", "--name", "stopctr", ALPINE, "/bin/sh"})
+ session2.WaitWithDefaultTimeout()
+ Expect(session2).Should(Exit(0))
+ session3 := podmanTest.Podman([]string{"stop", "stopctr"})
+ session3.WaitWithDefaultTimeout()
+ Expect(session3).Should(Exit(0))
+ })
+
It("podman stop --cidfile", func() {
tmpDir, err := ioutil.TempDir("", "")