summaryrefslogtreecommitdiff
path: root/test/e2e/rm_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/rm_test.go')
-rw-r--r--test/e2e/rm_test.go31
1 files changed, 28 insertions, 3 deletions
diff --git a/test/e2e/rm_test.go b/test/e2e/rm_test.go
index 71dacfa80..9bf742a63 100644
--- a/test/e2e/rm_test.go
+++ b/test/e2e/rm_test.go
@@ -3,7 +3,6 @@
package integration
import (
- "fmt"
"os"
. "github.com/containers/libpod/test/utils"
@@ -24,14 +23,15 @@ var _ = Describe("Podman rm", func() {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
+ podmanTest.Setup()
podmanTest.RestoreAllArtifacts()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentGinkgoTestDescription()
- timedResult := fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds())
- GinkgoWriter.Write([]byte(timedResult))
+ processTestResult(f)
+
})
It("podman rm stopped container", func() {
@@ -65,6 +65,17 @@ var _ = Describe("Podman rm", func() {
Expect(result.ExitCode()).To(Equal(0))
})
+ It("podman container rm created container", func() {
+ session := podmanTest.Podman([]string{"container", "create", ALPINE, "ls"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ cid := session.OutputToString()
+
+ result := podmanTest.Podman([]string{"container", "rm", cid})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(0))
+ })
+
It("podman rm running container with -f", func() {
session := podmanTest.RunTopContainer("")
session.WaitWithDefaultTimeout()
@@ -128,9 +139,23 @@ var _ = Describe("Podman rm", func() {
Expect(podmanTest.NumberOfContainers()).To(Equal(1))
})
+
It("podman rm bogus container", func() {
session := podmanTest.Podman([]string{"rm", "bogus"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(1))
})
+ It("podman rm bogus container and a running container", func() {
+ session := podmanTest.RunTopContainer("test1")
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"rm", "bogus", "test1"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(125))
+
+ session = podmanTest.Podman([]string{"rm", "test1", "bogus"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(125))
+ })
})