summaryrefslogtreecommitdiff
path: root/test/apiv2/35-networks.at
diff options
context:
space:
mode:
Diffstat (limited to 'test/apiv2/35-networks.at')
-rw-r--r--test/apiv2/35-networks.at66
1 files changed, 32 insertions, 34 deletions
diff --git a/test/apiv2/35-networks.at b/test/apiv2/35-networks.at
index 7ce109913..d3bbaf32b 100644
--- a/test/apiv2/35-networks.at
+++ b/test/apiv2/35-networks.at
@@ -7,54 +7,52 @@ t GET networks/non-existing-network 404 \
.cause='network not found'
t POST libpod/networks/create?name=network1 '' 200 \
-.Filename~.*/network1\\.conflist
+ .Filename~.*/network1\\.conflist
# --data '{"Subnet":{"IP":"10.10.254.0","Mask":[255,255,255,0]},"Labels":{"abc":"val"}}'
t POST libpod/networks/create?name=network2 '"Subnet":{"IP":"10.10.254.0","Mask":[255,255,255,0]},"Labels":{"abc":"val"}' 200 \
-.Filename~.*/network2\\.conflist
+ .Filename~.*/network2\\.conflist
# test for empty mask
t POST libpod/networks/create '"Subnet":{"IP":"10.10.1.0","Mask":[]}' 500 \
-.cause~'.*cannot be empty'
+ .cause~'.*cannot be empty'
# test for invalid mask
t POST libpod/networks/create '"Subnet":{"IP":"10.10.1.0","Mask":[0,255,255,0]}' 500 \
-.cause~'.*mask is invalid'
+ .cause~'.*mask is invalid'
# network list
t GET libpod/networks/json 200
-# filters={"name":["network1"]}
-t GET libpod/networks/json?filters=%7B%22name%22%3A%5B%22network1%22%5D%7D 200 \
-length=1 \
-.[0].Name=network1
+t GET libpod/networks/json?filters='{"name":["network1"]}' 200 \
+ length=1 \
+ .[0].Name=network1
t GET networks 200
#network list docker endpoint
-#filters={"name":["network1","network2"]}
-t GET networks?filters=%7B%22name%22%3A%5B%22network1%22%2C%22network2%22%5D%7D 200 \
-length=2
-#filters={"name":["network"]}
-t GET networks?filters=%7B%22name%22%3A%5B%22network%22%5D%7D 200 \
-length=2
-# filters={"label":["abc"]}
-t GET networks?filters=%7B%22label%22%3A%5B%22abc%22%5D%7D 200 \
-length=1
-# id filter filters={"id":["a7662f44d65029fd4635c91feea3d720a57cef52e2a9fcc7772b69072cc1ccd1"]}
-t GET networks?filters=%7B%22id%22%3A%5B%22a7662f44d65029fd4635c91feea3d720a57cef52e2a9fcc7772b69072cc1ccd1%22%5D%7D 200 \
-length=1 \
-.[0].Name=network1 \
-.[0].Id=a7662f44d65029fd4635c91feea3d720a57cef52e2a9fcc7772b69072cc1ccd1
-# invalid filter filters={"dangling":["1"]}
-t GET networks?filters=%7B%22dangling%22%3A%5B%221%22%5D%7D 500 \
-.cause='invalid filter "dangling"'
+t GET networks?filters='{"name":["network1","network2"]}' 200 \
+ length=2
+t GET networks?filters='{"name":["network"]}' 200 \
+ length=2
+t GET networks?filters='{"label":["abc"]}' 200 \
+ length=1
+# old docker filter type see #9526
+t GET networks?filters='{"label":{"abc":true}}' 200 \
+ length=1
+t GET networks?filters='{"id":["a7662f44d65029fd4635c91feea3d720a57cef52e2a9fcc7772b69072cc1ccd1"]}' 200 \
+ length=1 \
+ .[0].Name=network1 \
+ .[0].Id=a7662f44d65029fd4635c91feea3d720a57cef52e2a9fcc7772b69072cc1ccd1
+# invalid filter
+t GET networks?filters='{"dangling":["1"]}' 500 \
+ .cause='invalid filter "dangling"'
# (#9293 with no networks the endpoint should return empty array instead of null)
-t GET networks?filters=%7B%22name%22%3A%5B%22doesnotexists%22%5D%7D 200 \
-"[]"
+t GET networks?filters='{"name":["doesnotexists"]}' 200 \
+ "[]"
# network inspect docker
t GET networks/a7662f44d65029fd4635c91feea3d720a57cef52e2a9fcc7772b69072cc1ccd1 200 \
-.Name=network1 \
-.Id=a7662f44d65029fd4635c91feea3d720a57cef52e2a9fcc7772b69072cc1ccd1 \
-.Scope=local
+ .Name=network1 \
+ .Id=a7662f44d65029fd4635c91feea3d720a57cef52e2a9fcc7772b69072cc1ccd1 \
+ .Scope=local
# network create docker
t POST networks/create '"Name":"net3","IPAM":{"Config":[]}' 201
@@ -63,11 +61,11 @@ t DELETE networks/net3 204
# clean the network
t DELETE libpod/networks/network1 200 \
-.[0].Name~network1 \
-.[0].Err=null
+ .[0].Name~network1 \
+ .[0].Err=null
t DELETE libpod/networks/network2 200 \
-.[0].Name~network2 \
-.[0].Err=null
+ .[0].Name~network2 \
+ .[0].Err=null
# vim: filetype=sh