summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-02-16 05:17:52 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2021-02-16 06:26:51 -0500
commit4a9bd7a18f2db7db103a94287ef34cbd1be1626b (patch)
treebb55c84c2e37c1fdb9b03c56d38078020ab78f58 /test/e2e
parentdf8ba7f4a92750bfb173b5486a663d1735d70b2d (diff)
downloadpodman-4a9bd7a18f2db7db103a94287ef34cbd1be1626b.tar.gz
podman-4a9bd7a18f2db7db103a94287ef34cbd1be1626b.tar.bz2
podman-4a9bd7a18f2db7db103a94287ef34cbd1be1626b.zip
When stopping a container, print rawInput
When we stop a container we are printing the full id, this does not match Docker behaviour or the start behavior. We should be printing the users rawInput when we successfully stop the container. Fixes: https://github.com/containers/podman/issues/9386 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/start_test.go17
-rw-r--r--test/e2e/stop_test.go6
2 files changed, 19 insertions, 4 deletions
diff --git a/test/e2e/start_test.go b/test/e2e/start_test.go
index a6f22e007..74be105d8 100644
--- a/test/e2e/start_test.go
+++ b/test/e2e/start_test.go
@@ -95,6 +95,23 @@ var _ = Describe("Podman start", func() {
Expect(session.OutputToString()).To(Equal(shortID))
})
+ It("podman container start single container by short id", func() {
+ session := podmanTest.Podman([]string{"container", "create", ALPINE, "ls"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ cid := session.OutputToString()
+ shortID := cid[0:10]
+ session = podmanTest.Podman([]string{"container", "start", shortID})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Equal(shortID))
+
+ session = podmanTest.Podman([]string{"stop", shortID})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Equal(shortID))
+ })
+
It("podman start single container by name", func() {
name := "foobar99"
session := podmanTest.Podman([]string{"create", "--name", name, ALPINE, "ls"})
diff --git a/test/e2e/stop_test.go b/test/e2e/stop_test.go
index 750d38ffb..337fd651d 100644
--- a/test/e2e/stop_test.go
+++ b/test/e2e/stop_test.go
@@ -149,13 +149,12 @@ var _ = Describe("Podman stop", func() {
session := podmanTest.RunTopContainer("test4")
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- cid1 := session.OutputToString()
session = podmanTest.Podman([]string{"stop", "--time", "1", "test4"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
output := session.OutputToString()
- Expect(output).To(ContainSubstring(cid1))
+ Expect(output).To(ContainSubstring("test4"))
finalCtrs := podmanTest.Podman([]string{"ps", "-q"})
finalCtrs.WaitWithDefaultTimeout()
@@ -167,14 +166,13 @@ var _ = Describe("Podman stop", func() {
session := podmanTest.Podman([]string{"run", "-d", "--name", "test5", ALPINE, "sleep", "100"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- cid1 := session.OutputToString()
session = podmanTest.Podman([]string{"stop", "--timeout", "1", "test5"})
// Without timeout container stops in 10 seconds
// If not stopped in 5 seconds, then --timeout did not work
session.Wait(5)
Expect(session.ExitCode()).To(Equal(0))
output := session.OutputToString()
- Expect(output).To(ContainSubstring(cid1))
+ Expect(output).To(ContainSubstring("test5"))
finalCtrs := podmanTest.Podman([]string{"ps", "-q"})
finalCtrs.WaitWithDefaultTimeout()