aboutsummaryrefslogtreecommitdiff
path: root/test/apiv2
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2020-09-02 18:13:58 +0200
committerPaul Holzinger <paul.holzinger@web.de>2020-09-07 15:39:41 +0200
commit5b8f3f2f1f863dfb58e5d3cfda95e7ecb6582b22 (patch)
treea413ccdad49a09f2bae47dff5c549d12465ccb27 /test/apiv2
parent1184cdf03d8464451d36b24643e57b65a8b97980 (diff)
downloadpodman-5b8f3f2f1f863dfb58e5d3cfda95e7ecb6582b22.tar.gz
podman-5b8f3f2f1f863dfb58e5d3cfda95e7ecb6582b22.tar.bz2
podman-5b8f3f2f1f863dfb58e5d3cfda95e7ecb6582b22.zip
APIv2 Add network list filtering
Add the filter option to the libpod endpoint. Add support for the name filter on the docker endpoint. Add apiv2 tests for the network list endpoints. Enable podman network integration tests for remote. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'test/apiv2')
-rw-r--r--test/apiv2/35-networks.at21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/apiv2/35-networks.at b/test/apiv2/35-networks.at
index 4c032c072..143d6c07b 100644
--- a/test/apiv2/35-networks.at
+++ b/test/apiv2/35-networks.at
@@ -21,6 +21,27 @@ if root; then
t POST libpod/networks/create '"Subnet":{"IP":"10.10.1.0","Mask":[0,255,255,0]}' 500 \
.cause~'.*mask is invalid'
+ # network list
+ t GET libpod/networks/json 200
+ t GET libpod/networks/json?filter=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
+ # invalid filter filters={"label":"abc"}
+ t GET networks?filters=%7B%22label%22%3A%5B%22abc%22%5D%7D 500 \
+ .cause="only the name filter for listing networks is implemented"
+ # invalid filter filters={"label":"abc","name":["network"]}
+ t GET networks?filters=%7B%22label%22%3A%22abc%22%2C%22name%22%3A%5B%22network%22%5D%7D 500 \
+ .cause="only the name filter for listing networks is implemented"
+
# clean the network
t DELETE libpod/networks/network1 200 \
.[0].Name~network1 \