diff options
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/pod_rm_test.go | 7 | ||||
-rw-r--r-- | test/e2e/rename_test.go | 17 |
2 files changed, 21 insertions, 3 deletions
diff --git a/test/e2e/pod_rm_test.go b/test/e2e/pod_rm_test.go index 7a0d97d28..dbb2d6d13 100644 --- a/test/e2e/pod_rm_test.go +++ b/test/e2e/pod_rm_test.go @@ -2,6 +2,7 @@ package integration import ( "fmt" + "io/fs" "io/ioutil" "os" "path/filepath" @@ -46,14 +47,14 @@ var _ = Describe("Podman pod rm", func() { Expect(result).Should(Exit(0)) // Also check that we don't leak cgroups - err := filepath.Walk("/sys/fs/cgroup", func(path string, info os.FileInfo, err error) error { + err := filepath.WalkDir("/sys/fs/cgroup", func(path string, d fs.DirEntry, err error) error { if err != nil { return err } - if !info.IsDir() { + if !d.IsDir() { Expect(err).To(BeNil()) } - if strings.Contains(info.Name(), podid) { + if strings.Contains(d.Name(), podid) { return fmt.Errorf("leaking cgroup path %s", path) } return nil 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"}) |