diff options
author | Aditya R <arajan@redhat.com> | 2022-03-28 14:57:27 +0530 |
---|---|---|
committer | Aditya R <arajan@redhat.com> | 2022-03-28 15:07:02 +0530 |
commit | 82ed99b6afa9ec67539afd6e3d9e299ea5c4e74b (patch) | |
tree | 18dad596c3b540d0748d1482d4fefe1c15a7a7ca /test/e2e/rename_test.go | |
parent | 0ebf0bc56091d305ac064c59e20289d47bf56437 (diff) | |
download | podman-82ed99b6afa9ec67539afd6e3d9e299ea5c4e74b.tar.gz podman-82ed99b6afa9ec67539afd6e3d9e299ea5c4e74b.tar.bz2 podman-82ed99b6afa9ec67539afd6e3d9e299ea5c4e74b.zip |
event: generate a valid event on container rename operation
Following commit ensures that podman generates a valid event on `podman
container rename` where event specifies that it is a rename event and
container name swtichted to the latest name.
Signed-off-by: Aditya R <arajan@redhat.com>
Diffstat (limited to 'test/e2e/rename_test.go')
-rw-r--r-- | test/e2e/rename_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/e2e/rename_test.go b/test/e2e/rename_test.go index c146eb410..ef90c3f22 100644 --- a/test/e2e/rename_test.go +++ b/test/e2e/rename_test.go @@ -74,6 +74,23 @@ var _ = Describe("podman rename", func() { Expect(ps.OutputToString()).To(ContainSubstring(newName)) }) + It("Successfully rename a created container and test event generated", func() { + ctrName := "testCtr" + ctr := podmanTest.Podman([]string{"create", "--name", ctrName, ALPINE, "top"}) + ctr.WaitWithDefaultTimeout() + Expect(ctr).Should(Exit(0)) + + newName := "aNewName" + rename := podmanTest.Podman([]string{"rename", ctrName, newName}) + rename.WaitWithDefaultTimeout() + Expect(rename).Should(Exit(0)) + + result := podmanTest.Podman([]string{"events", "--stream=false", "--filter", "container=aNewName"}) + result.WaitWithDefaultTimeout() + Expect(result).Should(Exit(0)) + Expect(result.OutputToString()).To(ContainSubstring("rename")) + }) + It("Successfully rename a running container", func() { ctrName := "testCtr" ctr := podmanTest.Podman([]string{"run", "-d", "--name", ctrName, ALPINE, "top"}) |