Skip to content

Commit

Permalink
Merge pull request #13696 from Luap99/apiv2-netavark
Browse files Browse the repository at this point in the history
test/apiv2: support netavark
  • Loading branch information
openshift-merge-robot authored Apr 4, 2022
2 parents 330205e + 23cdbf3 commit 839744a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/apiv2/35-networks.at
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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"'
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 839744a

Please sign in to comment.