summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-30 20:51:00 +0200
committerGitHub <noreply@github.com>2021-03-30 20:51:00 +0200
commit989c8e97851c1a443270e803e19dd069fc199302 (patch)
tree6b676800286705c8fd486a5163d5ea330e6e3a96 /test
parent1d14e6ed3c49777bc2b35e7c49d9232b2810935e (diff)
parentf7d82a1f30d31830de18da14c61e85d2a0688605 (diff)
downloadpodman-989c8e97851c1a443270e803e19dd069fc199302.tar.gz
podman-989c8e97851c1a443270e803e19dd069fc199302.tar.bz2
podman-989c8e97851c1a443270e803e19dd069fc199302.zip
Merge pull request #9863 from jmguzik/fix-prune-filter-funcs
Containers prune endpoint should use only prune filters
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/20-containers.at18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index 9030f0095..58b2dff0a 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -298,7 +298,7 @@ t POST containers/prune?filters='garb1age}' 500 \
t POST libpod/containers/prune?filters='garb1age}' 500 \
.cause="invalid character 'g' looking for beginning of value"
-## Prune containers with illformed label
+# Prune containers with illformed label
t POST containers/prune?filters='{"label":["tes' 500 \
.cause="unexpected end of JSON input"
t POST libpod/containers/prune?filters='{"label":["tes' 500 \
@@ -306,6 +306,22 @@ t POST libpod/containers/prune?filters='{"label":["tes' 500 \
t GET libpod/containers/json?filters='{"label":["testlabel"]}' 200 length=0
+# libpod api: do not use list filters for prune
+t POST libpod/containers/prune?filters='{"name":["anyname"]}' 500 \
+ .cause="name is an invalid filter"
+t POST libpod/containers/prune?filters='{"id":["anyid"]}' 500 \
+ .cause="id is an invalid filter"
+t POST libpod/containers/prune?filters='{"network":["anynetwork"]}' 500 \
+ .cause="network is an invalid filter"
+
+# compat api: do not use list filters for prune
+t POST containers/prune?filters='{"name":["anyname"]}' 500 \
+ .cause="name is an invalid filter"
+t POST containers/prune?filters='{"id":["anyid"]}' 500 \
+ .cause="id is an invalid filter"
+t POST containers/prune?filters='{"network":["anynetwork"]}' 500 \
+ .cause="network is an invalid filter"
+
# Test CPU limit (NanoCPUs)
t POST containers/create Image=$IMAGE HostConfig='{"NanoCpus":500000}' 201 \
.Id~[0-9a-f]\\{64\\}