diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-03-26 06:39:11 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2022-03-27 07:18:25 -0400 |
commit | d106b294b428fbb10f59d4cafe72c3dcaa4e73bb (patch) | |
tree | 3c81aa0b8452565c704629258643eb6c51b82b3e /test | |
parent | 56b2937f87bd67b46aa93109aefc08ce0edb5cf1 (diff) | |
download | podman-d106b294b428fbb10f59d4cafe72c3dcaa4e73bb.tar.gz podman-d106b294b428fbb10f59d4cafe72c3dcaa4e73bb.tar.bz2 podman-d106b294b428fbb10f59d4cafe72c3dcaa4e73bb.zip |
Switch all calls to filepath.Walk to filepath.WalkDir
WalkDir should be faster the Walk, since we often do
not need to stat files.
[NO NEW TESTS NEEDED] Existing tests should find errors.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/pod_rm_test.go | 7 |
1 files changed, 4 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 |