summaryrefslogtreecommitdiff
path: root/test/apiv2/30-volumes.at
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-01 21:08:50 +0100
committerGitHub <noreply@github.com>2021-03-01 21:08:50 +0100
commit73044b28172fd0df23836052a9061dc41f51f39a (patch)
tree8fc40cef8828c25bd7a6621451f1d46e17958323 /test/apiv2/30-volumes.at
parent8daa014f38f7e7af2b46bef1b1a5870429de0d12 (diff)
parent9435e5b79b3dacca61118b159b06fa38cb1ac0d8 (diff)
downloadpodman-73044b28172fd0df23836052a9061dc41f51f39a.tar.gz
podman-73044b28172fd0df23836052a9061dc41f51f39a.tar.bz2
podman-73044b28172fd0df23836052a9061dc41f51f39a.zip
Merge pull request #9555 from edsantiago/apiv2_test_readability
APIv2 tests: make more maintainable
Diffstat (limited to 'test/apiv2/30-volumes.at')
-rw-r--r--test/apiv2/30-volumes.at35
1 files changed, 15 insertions, 20 deletions
diff --git a/test/apiv2/30-volumes.at b/test/apiv2/30-volumes.at
index b38810039..cf4b3d3ea 100644
--- a/test/apiv2/30-volumes.at
+++ b/test/apiv2/30-volumes.at
@@ -45,18 +45,17 @@ t GET libpod/volumes/json 200 \
.[0].Name~.* \
.[0].Mountpoint~.* \
.[0].CreatedAt~[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}.*
-# -G --data-urlencode 'filters={"name":["foo1"]}'
-t GET libpod/volumes/json?filters=%7B%22name%22%3A%5B%22foo1%22%5D%7D 200 length=1 .[0].Name=foo1
-# -G --data-urlencode 'filters={"name":["foo1","foo2"]}'
-t GET libpod/volumes/json?filters=%7B%22name%22%3A%20%5B%22foo1%22%2C%20%22foo2%22%5D%7D 200 length=2 .[0].Name=foo1 .[1].Name=foo2
-# -G --data-urlencode 'filters={"name":["nonexistent"]}'
-t GET libpod/volumes/json?filters=%7B%22name%22%3A%5B%22nonexistent%22%5D%7D 200 length=0
-# -G --data-urlencode 'filters={"label":["testlabel"]}'
-t GET libpod/volumes/json?filters=%7B%22label%22:%5B%22testlabel%22%5D%7D 200 length=2
-# -G --data-urlencode 'filters={"label":["testlabel=testonly"]}'
-t GET libpod/volumes/json?filters=%7B%22label%22:%5B%22testlabel=testonly%22%5D%7D 200 length=1
-# -G --data-urlencode 'filters={"label":["testlabel1=testonly"]}'
-t GET libpod/volumes/json?filters=%7B%22label%22:%5B%22testlabel1=testonly%22%5D%7D 200 length=1
+t GET libpod/volumes/json?filters='{"name":["foo1"]}' 200 \
+ length=1 \
+ .[0].Name=foo1
+t GET libpod/volumes/json?filters='{"name":%20["foo1",%20"foo2"]}' 200 \
+ length=2 \
+ .[0].Name=foo1 \
+ .[1].Name=foo2
+t GET libpod/volumes/json?filters='{"name":["nonexistent"]}' 200 length=0
+t GET libpod/volumes/json?filters='{"label":["testlabel"]}' 200 length=2
+t GET libpod/volumes/json?filters='{"label":["testlabel=testonly"]}' 200 length=1
+t GET libpod/volumes/json?filters='{"label":["testlabel1=testonly"]}' 200 length=1
## inspect volume
t GET libpod/volumes/foo1/json 200 \
@@ -79,16 +78,12 @@ t DELETE libpod/volumes/foo1 404 \
.response=404
## Prune volumes with label matching 'testlabel1=testonly'
-# -G --data-urlencode 'filters={"label":["testlabel1=testonly"]}'
-t POST libpod/volumes/prune?filters=%7B%22label%22:%5B%22testlabel1=testonly%22%5D%7D "" 200
-# -G --data-urlencode 'filters={"label":["testlabel1=testonly"]}'
-t GET libpod/volumes/json?filters=%7B%22label%22:%5B%22testlabel1=testonly%22%5D%7D 200 length=0
+t POST libpod/volumes/prune?filters='{"label":["testlabel1=testonly"]}' "" 200
+t GET libpod/volumes/json?filters='{"label":["testlabel1=testonly"]}' 200 length=0
## Prune volumes with label matching 'testlabel'
-# -G --data-urlencode 'filters={"label":["testlabel"]}'
-t POST libpod/volumes/prune?filters=%7B%22label%22:%5B%22testlabel%22%5D%7D "" 200
-# -G --data-urlencode 'filters={"label":["testlabel"]}'
-t GET libpod/volumes/json?filters=%7B%22label%22:%5B%22testlabel%22%5D%7D 200 length=0
+t POST libpod/volumes/prune?filters='{"label":["testlabel"]}' "" 200
+t GET libpod/volumes/json?filters='{"label":["testlabel"]}' 200 length=0
## Prune volumes
t POST libpod/volumes/prune "" 200