summaryrefslogtreecommitdiff
path: root/test/apiv2
diff options
context:
space:
mode:
authorJakub Guzik <jakubmguzik@gmail.com>2021-03-30 10:19:22 +0200
committerJakub Guzik <jakubmguzik@gmail.com>2021-03-30 10:19:22 +0200
commitf7d82a1f30d31830de18da14c61e85d2a0688605 (patch)
tree86be25e45d7564afc183e43df0ce5c4d3a12135b /test/apiv2
parent08eab3f8f77d8206e3c788fa0a8f455ef854db1c (diff)
downloadpodman-f7d82a1f30d31830de18da14c61e85d2a0688605.tar.gz
podman-f7d82a1f30d31830de18da14c61e85d2a0688605.tar.bz2
podman-f7d82a1f30d31830de18da14c61e85d2a0688605.zip
Containers prune endpoint should use only prune filters
Containers endpoints for HTTP compad and libpod APIs allowed usage of list HTTP endpoint filter funcs. Documentation in case of libpod and compat API does not allow that. This commit aligns code with the documentation. Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
Diffstat (limited to 'test/apiv2')
-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\\}