From 9cc974c9637554620248941642d58ff34df90ba0 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Mon, 2 Aug 2021 15:18:54 -0700 Subject: Only support containers stats using cgroups v2 Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1988252 Signed-off-by: Jhon Honce --- test/apiv2/20-containers.at | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at index c5b2f5ec1..610d3e36d 100644 --- a/test/apiv2/20-containers.at +++ b/test/apiv2/20-containers.at @@ -65,6 +65,16 @@ t GET libpod/containers/json?last=1 200 \ cid=$(jq -r '.[0].Id' <<<"$output") +if root; then + t GET libpod/containers/stats?containers='[$cid]' 200 +else + if have_cgroupsv2; then + t GET libpod/containers/stats?containers='[$cid]' 200 + else + t GET libpod/containers/stats?containers='[$cid]' 409 + fi +fi + t DELETE libpod/containers/$cid 204 # Issue #6799: it should be possible to start a container, even w/o args. -- cgit v1.2.3-54-g00ecf