summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2021-11-24 10:35:07 +0100
committerMatthew Heon <mheon@redhat.com>2021-12-06 15:26:18 -0500
commit905eabf0bef95d5202483464779680f01a3cc1a1 (patch)
treeb8c34e4c6f15e06132ec589b8abb0d58e75efd24 /test
parente3a50e760998cdcda6be6510cfa6f1ca93ba7633 (diff)
downloadpodman-905eabf0bef95d5202483464779680f01a3cc1a1.tar.gz
podman-905eabf0bef95d5202483464779680f01a3cc1a1.tar.bz2
podman-905eabf0bef95d5202483464779680f01a3cc1a1.zip
libpod: improve heuristic to detect cgroup
improve the heuristic to detect the scope that was created for the container. This is necessary with systemd running as PID 1, since it moves itself to a different sub-cgroup, thus stats would not account for other processes in the same container. Closes: https://github.com/containers/podman/issues/12400 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> <MH: Fixed cherry-pick conflicts> Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/systemd_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/e2e/systemd_test.go b/test/e2e/systemd_test.go
index 7212f8843..bb2cd11f2 100644
--- a/test/e2e/systemd_test.go
+++ b/test/e2e/systemd_test.go
@@ -109,6 +109,11 @@ WantedBy=default.target
stats := podmanTest.Podman([]string{"stats", "--no-stream", ctrName})
stats.WaitWithDefaultTimeout()
Expect(stats).Should(Exit(0))
+
+ cgroupPath := podmanTest.Podman([]string{"inspect", "--format='{{.State.CgroupPath}}'", ctrName})
+ cgroupPath.WaitWithDefaultTimeout()
+ Expect(cgroupPath).Should(Exit(0))
+ Expect(result.OutputToString()).To(Not(ContainSubstring("init.scope")))
})
It("podman create container with systemd entrypoint triggers systemd mode", func() {