summaryrefslogtreecommitdiff
path: root/test/apiv2
diff options
context:
space:
mode:
Diffstat (limited to 'test/apiv2')
-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