diff options
Diffstat (limited to 'test/apiv2')
-rw-r--r-- | test/apiv2/30-volumes.at | 20 | ||||
-rw-r--r-- | test/apiv2/35-networks.at | 48 |
2 files changed, 67 insertions, 1 deletions
diff --git a/test/apiv2/30-volumes.at b/test/apiv2/30-volumes.at index 1a40b3cdf..18ff31100 100644 --- a/test/apiv2/30-volumes.at +++ b/test/apiv2/30-volumes.at @@ -86,14 +86,34 @@ t DELETE libpod/volumes/foo1 404 \ .message~.* \ .response=404 +#compat api list volumes sanity checks +t GET volumes?filters='garb1age}' 500 \ + .cause="invalid character 'g' looking for beginning of value" +t GET volumes?filters='{"label":["testl' 500 \ + .cause="unexpected end of JSON input" + +#libpod api list volumes sanity checks +t GET libpod/volumes/json?filters='garb1age}' 500 \ + .cause="invalid character 'g' looking for beginning of value" +t GET libpod/volumes/json?filters='{"label":["testl' 500 \ + .cause="unexpected end of JSON input" + # Prune volumes - bad filter input t POST volumes/prune?filters='garb1age}' 500 \ .cause="invalid character 'g' looking for beginning of value" +t POST libpod/volumes/prune?filters='garb1age}' 500 \ + .cause="invalid character 'g' looking for beginning of value" ## Prune volumes with label matching 'testlabel1=testonly' 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 illformed label +t POST volumes/prune?filters='{"label":["tes' 500 \ + .cause="unexpected end of JSON input" +t POST libpod/volumes/prune?filters='{"label":["tes' 500 \ + .cause="unexpected end of JSON input" + ## Prune volumes with label matching 'testlabel' t POST libpod/volumes/prune?filters='{"label":["testlabel"]}' 200 t GET libpod/volumes/json?filters='{"label":["testlabel"]}' 200 length=0 diff --git a/test/apiv2/35-networks.at b/test/apiv2/35-networks.at index ce7ca628a..21840a42d 100644 --- a/test/apiv2/35-networks.at +++ b/test/apiv2/35-networks.at @@ -16,6 +16,20 @@ t POST libpod/networks/create?name=network2 \ 200 \ .Filename~.*/network2\\.conflist +# --data '{"Subnet":{"IP":"10.10.133.0","Mask":[255,255,255,0]},"Labels":{"xyz":"val"}}' +t POST libpod/networks/create?name=network3 \ + Subnet='{"IP":"10.10.133.0","Mask":[255,255,255,0]}' \ + Labels='{"xyz":"val"}' \ + 200 \ + .Filename~.*/network3\\.conflist + +# --data '{"Subnet":{"IP":"10.10.134.0","Mask":[255,255,255,0]},"Labels":{"zaq":"val"}}' +t POST libpod/networks/create?name=network4 \ + Subnet='{"IP":"10.10.134.0","Mask":[255,255,255,0]}' \ + Labels='{"zaq":"val"}' \ + 200 \ + .Filename~.*/network4\\.conflist + # test for empty mask t POST libpod/networks/create Subnet='{"IP":"10.10.1.0","Mask":[]}' 500 \ .cause~'.*cannot be empty' @@ -38,7 +52,7 @@ t GET libpod/networks/network1/json 200 \ t GET networks?filters='{"name":["network1","network2"]}' 200 \ length=2 t GET networks?filters='{"name":["network"]}' 200 \ - length=2 + length=4 t GET networks?filters='{"label":["abc"]}' 200 \ length=1 # old docker filter type see #9526 @@ -66,6 +80,38 @@ t POST networks/create Name=net3\ IPAM='{"Config":[]}' 201 # network delete docker t DELETE networks/net3 204 +#compat api list networks sanity checks +t GET networks?filters='garb1age}' 500 \ + .cause="invalid character 'g' looking for beginning of value" +t GET networks?filters='{"label":["testl' 500 \ + .cause="unexpected end of JSON input" + +#libpod api list networks sanity checks +t GET libpod/networks/json?filters='garb1age}' 500 \ + .cause="invalid character 'g' looking for beginning of value" +t GET libpod/networks/json?filters='{"label":["testl' 500 \ + .cause="unexpected end of JSON input" + +# Prune networks compat api +t POST networks/prune?filters='garb1age}' 500 \ + .cause="invalid character 'g' looking for beginning of value" +t POST networks/prune?filters='{"label":["tes' 500 \ + .cause="unexpected end of JSON input" + +# Prune networks libpod api +t POST libpod/networks/prune?filters='garb1age}' 500 \ + .cause="invalid character 'g' looking for beginning of value" +t POST libpod/networks/prune?filters='{"label":["tes' 500 \ + .cause="unexpected end of JSON input" + +# prune networks using filter - compat api +t POST networks/prune?filters='{"label":["xyz"]}' 200 +t GET networks/json?filters='{"label":["xyz"]}' 404 + +# prune networks using filter - libpod api +t POST libpod/networks/prune?filters='{"label":["zaq=val"]}' 200 +t GET libpod/networks/json?filters='{"label":["zaq=val"]}' 200 length=0 + # clean the network t DELETE libpod/networks/network1 200 \ .[0].Name~network1 \ |