summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2021-03-03 16:34:18 -0500
committerMatthew Heon <matthew.heon@pm.me>2021-03-04 12:32:09 -0500
commit8453424e2cfbe54b204b6fdb3515ea9f7f001023 (patch)
tree45d23bd9fea8be40d4f7a7921f58f460ef2f575d /test
parent87e20560ac885c541784af1341098ce8e1e7a940 (diff)
downloadpodman-8453424e2cfbe54b204b6fdb3515ea9f7f001023.tar.gz
podman-8453424e2cfbe54b204b6fdb3515ea9f7f001023.tar.bz2
podman-8453424e2cfbe54b204b6fdb3515ea9f7f001023.zip
Respect NanoCpus in Compat Create
The NanoCpus field in HostConfig was not wired up. It conflicts with CPU period and quota (it hard-codes period to a specific value and then sets the user-specified value as Quota). Fixes #9523 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/20-containers.at9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index 18364a47d..f73d03123 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -263,3 +263,12 @@ t GET containers/json 200 \
.[0].Ports[0].Type="tcp"
podman stop bar
+
+# Test CPU limit (NanoCPUs)
+t POST containers/create '"Image":"'$IMAGE'","HostConfig":{"NanoCpus":500000}' 201 \
+ .Id~[0-9a-f]\\{64\\}
+cid=$(jq -r '.Id' <<<"$output")
+t GET containers/$cid/json 200 \
+ .HostConfig.NanoCpus=500000
+
+t DELETE containers/$cid?v=true 204