summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-22 10:17:24 -0700
committerGitHub <noreply@github.com>2021-03-22 10:17:24 -0700
commitd0bd775c02f0637b5775735c84438a01e8cf8395 (patch)
tree6377971672dd4e4881c4a73f9626e0ccbcd1ddd0 /test
parent2cd37edf02cca715df41ec915bbe0d6cfdc720e9 (diff)
parent907b34c46fe474911d4321795f029583e8daeeec (diff)
downloadpodman-d0bd775c02f0637b5775735c84438a01e8cf8395.tar.gz
podman-d0bd775c02f0637b5775735c84438a01e8cf8395.tar.bz2
podman-d0bd775c02f0637b5775735c84438a01e8cf8395.zip
Merge pull request #9773 from jmguzik/containers-prune-filters-http-api
Fix containers list/prune http api filter behaviour
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/20-containers.at26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index 478717700..9030f0095 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -280,6 +280,32 @@ t GET containers/json 200 \
podman stop bar
+#compat api list containers sanity checks
+t GET containers/json?filters='garb1age}' 500 \
+ .cause="invalid character 'g' looking for beginning of value"
+t GET containers/json?filters='{"label":["testl' 500 \
+ .cause="unexpected end of JSON input"
+
+#libpod api list containers sanity checks
+t GET libpod/containers/json?filters='garb1age}' 500 \
+ .cause="invalid character 'g' looking for beginning of value"
+t GET libpod/containers/json?filters='{"label":["testl' 500 \
+ .cause="unexpected end of JSON input"
+
+# Prune containers - bad filter input
+t POST containers/prune?filters='garb1age}' 500 \
+ .cause="invalid character 'g' looking for beginning of value"
+t POST libpod/containers/prune?filters='garb1age}' 500 \
+ .cause="invalid character 'g' looking for beginning of value"
+
+## 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 \
+ .cause="unexpected end of JSON input"
+
+t GET libpod/containers/json?filters='{"label":["testlabel"]}' 200 length=0
+
# Test CPU limit (NanoCPUs)
t POST containers/create Image=$IMAGE HostConfig='{"NanoCpus":500000}' 201 \
.Id~[0-9a-f]\\{64\\}