summaryrefslogtreecommitdiff
path: root/test/apiv2/20-containers.at
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-15 12:12:48 +0200
committerGitHub <noreply@github.com>2022-09-15 12:12:48 +0200
commit2a8df49c2a65831fa2c253afa1ad2b5e1d618b09 (patch)
tree1ed9e8e76d93f4a59cb42c1755e8b2934ea5b509 /test/apiv2/20-containers.at
parentc8bd81cacacb84aa2b080e7b21991e97d5348b0a (diff)
parent60ef4ad1c873e99825dd08c9300cffb82f3b7aee (diff)
downloadpodman-2a8df49c2a65831fa2c253afa1ad2b5e1d618b09.tar.gz
podman-2a8df49c2a65831fa2c253afa1ad2b5e1d618b09.tar.bz2
podman-2a8df49c2a65831fa2c253afa1ad2b5e1d618b09.zip
Merge pull request #15811 from giuseppe/fix-memory-stats-api
stats: cap memory limit to the available memory
Diffstat (limited to 'test/apiv2/20-containers.at')
-rw-r--r--test/apiv2/20-containers.at17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index 9ace46b8b..cc238e27e 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -98,6 +98,12 @@ else
fi
fi
+# max_usage is not set for cgroupv2
+if have_cgroupsv2; then
+ t GET libpod/containers/stats?containers='[$cid]' 200 \
+ .memory_stats.max_usage=null
+fi
+
t DELETE libpod/containers/$cid 200 .[0].Id=$cid
# Issue #14676: make sure the stats show the memory limit specified for the container
@@ -111,6 +117,17 @@ if root; then
podman rm -f $CTRNAME
fi
+# Issue #15765: make sure the memory limit is capped
+if root; then
+ CTRNAME=ctr-with-limit
+ podman run --name $CTRNAME -d -m 512m -v /tmp:/tmp $IMAGE top
+
+ t GET libpod/containers/$CTRNAME/stats?stream=false 200 \
+ .memory_stats.limit!=18446744073709552000
+
+ podman rm -f $CTRNAME
+fi
+
# Issue #6799: it should be possible to start a container, even w/o args.
t POST libpod/containers/create?name=test_noargs Image=${IMAGE} 201 \
.Id~[0-9a-f]\\{64\\}