summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-25 14:40:21 -0700
committerGitHub <noreply@github.com>2021-03-25 14:40:21 -0700
commit9e23e0b3e3b219cbdc42fac4f843d6d2ec97421b (patch)
tree6986b66d1aa4e37999ffd091900b9a487e87d202 /test
parent8eb36320ca321ba514b5388cfdb11595e61a7d49 (diff)
parent429a655866ba6298935a2fb53cd6e1e8653bab4d (diff)
downloadpodman-9e23e0b3e3b219cbdc42fac4f843d6d2ec97421b.tar.gz
podman-9e23e0b3e3b219cbdc42fac4f843d6d2ec97421b.tar.bz2
podman-9e23e0b3e3b219cbdc42fac4f843d6d2ec97421b.zip
Merge pull request #9810 from jmguzik/fix-impages-filter-http-api
Fix filters list/prune in image http compat/libpod api endpoints
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/10-images.at49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/apiv2/10-images.at b/test/apiv2/10-images.at
index 4ebaeff45..f854d38ab 100644
--- a/test/apiv2/10-images.at
+++ b/test/apiv2/10-images.at
@@ -77,6 +77,55 @@ for i in $iid ${iid:0:12} $PODMAN_TEST_IMAGE_NAME; do
t GET "libpod/images/$i/get?compress=false" 200 '[POSIX tar archive]'
done
+#compat api list images sanity checks
+t GET images/json?filters='garb1age}' 500 \
+ .cause="invalid character 'g' looking for beginning of value"
+t GET images/json?filters='{"label":["testl' 500 \
+ .cause="unexpected end of JSON input"
+
+#libpod api list images sanity checks
+t GET libpod/images/json?filters='garb1age}' 500 \
+ .cause="invalid character 'g' looking for beginning of value"
+t GET libpod/images/json?filters='{"label":["testl' 500 \
+ .cause="unexpected end of JSON input"
+
+# Prune images - bad filter input
+t POST images/prune?filters='garb1age}' 500 \
+ .cause="invalid character 'g' looking for beginning of value"
+t POST libpod/images/prune?filters='garb1age}' 500 \
+ .cause="invalid character 'g' looking for beginning of value"
+
+## Prune images with illformed label
+t POST images/prune?filters='{"label":["tes' 500 \
+ .cause="unexpected end of JSON input"
+t POST libpod/images/prune?filters='{"label":["tes' 500 \
+ .cause="unexpected end of JSON input"
+
+
+#create, list and remove dangling image
+podman image build -t test:test -<<EOF
+from alpine
+RUN >file1
+EOF
+
+podman image build -t test:test --label xyz -<<EOF
+from alpine
+RUN >file2
+EOF
+
+t GET images/json?filters='{"dangling":["true"]}' 200 length=1
+t POST images/prune?filters='{"dangling":["true"]}' 200
+t GET images/json?filters='{"dangling":["true"]}' 200 length=0
+
+#label filter check in libpod and compat
+t GET images/json?filters='{"label":["xyz"]}' 200 length=1
+t GET libpod/images/json?filters='{"label":["xyz"]}' 200 length=1
+
+t DELETE libpod/images/test:test 200
+
+t GET images/json?filters='{"label":["xyz"]}' 200 length=0
+t GET libpod/images/json?filters='{"label":["xyz"]}' 200 length=0
+
# Export more than one image
# FIXME FIXME FIXME, this doesn't work:
# not ok 64 [10-images] GET images/get?names=alpine,busybox : status