summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-03 09:16:19 -0500
committerGitHub <noreply@github.com>2021-03-03 09:16:19 -0500
commit5fd8a849491e12de3747a16c238236e23fb44593 (patch)
tree52c2097fc2831bf049e9f3d2e31eae3fe41fdc91 /test
parentaed632cb8ca4be2a57e8159041ef31829b3d2b2c (diff)
parent43e899c2ec2a874b9cb16f42bfd1e676981353b1 (diff)
downloadpodman-5fd8a849491e12de3747a16c238236e23fb44593.tar.gz
podman-5fd8a849491e12de3747a16c238236e23fb44593.tar.bz2
podman-5fd8a849491e12de3747a16c238236e23fb44593.zip
Merge pull request #9575 from mheon/rewrite_rename
Rewrite Rename backend in a more atomic fashion
Diffstat (limited to 'test')
-rw-r--r--test/e2e/rename_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/e2e/rename_test.go b/test/e2e/rename_test.go
index f19413221..14696c0f6 100644
--- a/test/e2e/rename_test.go
+++ b/test/e2e/rename_test.go
@@ -89,4 +89,25 @@ var _ = Describe("podman rename", func() {
Expect(ps.ExitCode()).To(Equal(0))
Expect(ps.OutputToString()).To(ContainSubstring(newName))
})
+
+ It("Rename a running container with exec sessions", func() {
+ ctrName := "testCtr"
+ ctr := podmanTest.Podman([]string{"run", "-d", "--name", ctrName, ALPINE, "top"})
+ ctr.WaitWithDefaultTimeout()
+ Expect(ctr.ExitCode()).To(Equal(0))
+
+ exec := podmanTest.Podman([]string{"exec", "-d", ctrName, "top"})
+ exec.WaitWithDefaultTimeout()
+ Expect(exec.ExitCode()).To(Equal(0))
+
+ newName := "aNewName"
+ rename := podmanTest.Podman([]string{"rename", ctrName, newName})
+ rename.WaitWithDefaultTimeout()
+ Expect(rename.ExitCode()).To(Equal(0))
+
+ ps := podmanTest.Podman([]string{"ps", "-aq", "--filter", fmt.Sprintf("name=%s", newName), "--format", "{{ .Names }}"})
+ ps.WaitWithDefaultTimeout()
+ Expect(ps.ExitCode()).To(Equal(0))
+ Expect(ps.OutputToString()).To(ContainSubstring(newName))
+ })
})