diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-09-10 10:15:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-10 10:15:01 -0400 |
commit | 3d33923374ee39977166d9fff3ee53c58d884bbe (patch) | |
tree | 327b33269b94c9d1faec38eaedf5b78a12a26214 /test | |
parent | e1b47296daaf4148d9970b59757a86e71bf8bb10 (diff) | |
parent | ce7d2bba1f6fdc96ef7439135b3c1388b7bac297 (diff) | |
download | podman-3d33923374ee39977166d9fff3ee53c58d884bbe.tar.gz podman-3d33923374ee39977166d9fff3ee53c58d884bbe.tar.bz2 podman-3d33923374ee39977166d9fff3ee53c58d884bbe.zip |
Merge pull request #7536 from Luap99/api-network-filter
APIv2 Add network list filtering
Diffstat (limited to 'test')
-rw-r--r-- | test/apiv2/35-networks.at | 21 | ||||
-rw-r--r-- | test/e2e/network_test.go | 2 |
2 files changed, 21 insertions, 2 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 \ diff --git a/test/e2e/network_test.go b/test/e2e/network_test.go index f427afa67..55f12f16a 100644 --- a/test/e2e/network_test.go +++ b/test/e2e/network_test.go @@ -1,5 +1,3 @@ -// +build !remote - package integration import ( |