summaryrefslogtreecommitdiff
path: root/test/e2e/systemd_test.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2021-11-24 10:35:07 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2021-11-24 14:50:12 +0100
commite648122b2986ea3bdcee33ebaef8731e574e8f54 (patch)
tree7d7b8b2bd8913a2810a3b6821e8fc4975a931054 /test/e2e/systemd_test.go
parenta66f40b4df039e94572fa38c070207a435cfa466 (diff)
downloadpodman-e648122b2986ea3bdcee33ebaef8731e574e8f54.tar.gz
podman-e648122b2986ea3bdcee33ebaef8731e574e8f54.tar.bz2
podman-e648122b2986ea3bdcee33ebaef8731e574e8f54.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>
Diffstat (limited to 'test/e2e/systemd_test.go')
-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 98def3d8f..32c2cd1b8 100644
--- a/test/e2e/systemd_test.go
+++ b/test/e2e/systemd_test.go
@@ -109,6 +109,11 @@ WantedBy=multi-user.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() {