summaryrefslogtreecommitdiff
path: root/test/apiv2
diff options
context:
space:
mode:
authorJakub Guzik <jakubmguzik@gmail.com>2021-04-07 00:02:12 +0200
committerJakub Guzik <jakubmguzik@gmail.com>2021-04-07 22:37:49 +0200
commit84907324fa02b8ede502a47b522fc717e782a909 (patch)
treede64d203f572634501f0417ff79d0a6c9b38d652 /test/apiv2
parentd83f49ef6b8a53535257bb56f5573ef3f65e3ba9 (diff)
downloadpodman-84907324fa02b8ede502a47b522fc717e782a909.tar.gz
podman-84907324fa02b8ede502a47b522fc717e782a909.tar.bz2
podman-84907324fa02b8ede502a47b522fc717e782a909.zip
Volumes prune endpoint should use only prune filters
Volumes endpoints for HTTP compat and libpod APIs allowed usage of list HTTP endpoint filter funcs. Documentation in case of compat API does not allow that. This commit aligns code with the documentation and also ligns libpod with compat API. Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
Diffstat (limited to 'test/apiv2')
-rw-r--r--test/apiv2/30-volumes.at16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/apiv2/30-volumes.at b/test/apiv2/30-volumes.at
index 18ff31100..623e691e3 100644
--- a/test/apiv2/30-volumes.at
+++ b/test/apiv2/30-volumes.at
@@ -123,4 +123,20 @@ t POST libpod/volumes/prune 200
#After prune volumes, there should be no volume existing
t GET libpod/volumes/json 200 length=0
+# libpod api: do not use list filters for prune
+t POST libpod/volumes/prune?filters='{"name":["anyname"]}' 500 \
+ .cause="\"name\" is an invalid volume filter"
+t POST libpod/volumes/prune?filters='{"driver":["anydriver"]}' 500 \
+ .cause="\"driver\" is an invalid volume filter"
+t POST libpod/volumes/prune?filters='{"scope":["anyscope"]}' 500 \
+ .cause="\"scope\" is an invalid volume filter"
+
+# compat api: do not use list filters for prune
+t POST volumes/prune?filters='{"name":["anyname"]}' 500 \
+ .cause="\"name\" is an invalid volume filter"
+t POST volumes/prune?filters='{"driver":["anydriver"]}' 500 \
+ .cause="\"driver\" is an invalid volume filter"
+t POST volumes/prune?filters='{"scope":["anyscope"]}' 500 \
+ .cause="\"scope\" is an invalid volume filter"
+
# vim: filetype=sh