diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-07-11 13:23:14 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-07-11 18:07:49 +0200 |
commit | 7b75796a6056e5ef65518c37008a1176417d2797 (patch) | |
tree | 81e52496fc0a9666ae7cdedde5a5e8aea206cab9 /test/e2e/pod_rm_test.go | |
parent | 1601100b3e9935f4239529c9117c76b8dd5d762a (diff) | |
download | podman-7b75796a6056e5ef65518c37008a1176417d2797.tar.gz podman-7b75796a6056e5ef65518c37008a1176417d2797.tar.bz2 podman-7b75796a6056e5ef65518c37008a1176417d2797.zip |
cgroups: fix a leak when using cgroupfs
be sure to load all the existing handlers, so that they can also be
freed in addition to the handlers we treat differently.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test/e2e/pod_rm_test.go')
-rw-r--r-- | test/e2e/pod_rm_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/e2e/pod_rm_test.go b/test/e2e/pod_rm_test.go index 0d3f47f30..f0689f152 100644 --- a/test/e2e/pod_rm_test.go +++ b/test/e2e/pod_rm_test.go @@ -3,6 +3,8 @@ package integration import ( "fmt" "os" + "path/filepath" + "strings" . "github.com/containers/libpod/test/utils" . "github.com/onsi/ginkgo" @@ -40,6 +42,21 @@ var _ = Describe("Podman pod rm", func() { result := podmanTest.Podman([]string{"pod", "rm", podid}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) + + // Also check that we don't leak cgroups + err := filepath.Walk("/sys/fs/cgroup", func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if !info.IsDir() { + Expect(err).To(BeNil()) + } + if strings.Contains(info.Name(), podid) { + return fmt.Errorf("leaking cgroup path %s", path) + } + return nil + }) + Expect(err).To(BeNil()) }) It("podman pod rm latest pod", func() { |