summaryrefslogtreecommitdiff
path: root/test/apiv2
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-03-29 18:07:47 +0200
committerPaul Holzinger <pholzing@redhat.com>2022-03-30 13:38:47 +0200
commit23cdbf322d3978388166ee2ed68a18dbc4857615 (patch)
tree6acf3a5df3176d25d1eba261f71e8a427358043c /test/apiv2
parent0eff4b70d0429c0dd1d95bc0a15f679cef351cb5 (diff)
downloadpodman-23cdbf322d3978388166ee2ed68a18dbc4857615.tar.gz
podman-23cdbf322d3978388166ee2ed68a18dbc4857615.tar.bz2
podman-23cdbf322d3978388166ee2ed68a18dbc4857615.zip
test/apiv2: support netavark
Since netavark does not support dhcp yet we have to create a macvlan network with a static subnet. Since we do not use the network to run containers the actual subnet does not matter. Also stop hard coding the network id. Unlike the cni backend the netavark backend creates random ids that are not predictable. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/apiv2')
-rw-r--r--test/apiv2/35-networks.at13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/apiv2/35-networks.at b/test/apiv2/35-networks.at
index 3502b89e0..4aad4563d 100644
--- a/test/apiv2/35-networks.at
+++ b/test/apiv2/35-networks.at
@@ -10,6 +10,8 @@ t POST libpod/networks/create name='"network1"' 200 \
.name=network1 \
.created~[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}.*
+network1_id=$(jq -r '.id' <<<"$output")
+
t POST /v3.4.0/libpod/networks/create name='"bad_version"' 400 \
.cause='given version is not supported'
@@ -71,10 +73,10 @@ t GET networks?filters='{"label":["abc"]}' 200 \
# old docker filter type see #9526
t GET networks?filters='{"label":{"abc":true}}' 200 \
length=1
-t GET networks?filters='{"id":["a7662f44d65029fd4635c91feea3d720a57cef52e2a9fcc7772b69072cc1ccd1"]}' 200 \
+t GET networks?filters="{\"id\":[\"$network1_id\"]}" 200 \
length=1 \
.[0].Name=network1 \
- .[0].Id=a7662f44d65029fd4635c91feea3d720a57cef52e2a9fcc7772b69072cc1ccd1
+ .[0].Id=$network1_id
# invalid filter
t GET networks?filters='{"dangling":["1"]}' 500 \
.cause='invalid filter "dangling"'
@@ -83,9 +85,9 @@ t GET networks?filters='{"name":["doesnotexists"]}' 200 \
"[]"
# network inspect docker
-t GET networks/a7662f44d65029fd4635c91feea3d720a57cef52e2a9fcc7772b69072cc1ccd1 200 \
+t GET networks/$network1_id 200 \
.Name=network1 \
- .Id=a7662f44d65029fd4635c91feea3d720a57cef52e2a9fcc7772b69072cc1ccd1 \
+ .Id=$network1_id \
.Scope=local
# network create docker
@@ -158,7 +160,8 @@ t POST networks/prune?filters='{"until":["5000000000"]}' 200
t GET networks?filters='{"label":["zaq"]}' 200 length=0
# test macvlan network response
-t POST libpod/networks/create name='"macvlan1"' driver="macvlan" 200 \
+# we have to use a static subnet because of netavark does not support dhcp yet
+t POST libpod/networks/create name='"macvlan1"' driver="macvlan" subnets='[{"subnet":"10.10.135.0/24"}]' 200 \
.name=macvlan1 \
.driver=macvlan