summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-11-23 10:39:32 -0500
committerGitHub <noreply@github.com>2021-11-23 10:39:32 -0500
commit400ccc62059849fa17e82da981caedd5c2fb3ca9 (patch)
tree020dcd548a7e321b2b7da83da2cde1c9474a08db /test
parentee612806655d0d0a0a3d2a782a000ea5c6b08f33 (diff)
parentab56a7c4b75e3f4c083da420cc9b7a85be4303c8 (diff)
downloadpodman-400ccc62059849fa17e82da981caedd5c2fb3ca9.tar.gz
podman-400ccc62059849fa17e82da981caedd5c2fb3ca9.tar.bz2
podman-400ccc62059849fa17e82da981caedd5c2fb3ca9.zip
Merge pull request #12328 from serverwentdown/fix-compat-ipaddress
compat: Add subnet mask behind IP address to match Docker API
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/35-networks.at27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/apiv2/35-networks.at b/test/apiv2/35-networks.at
index fd8dfd32b..713f677fa 100644
--- a/test/apiv2/35-networks.at
+++ b/test/apiv2/35-networks.at
@@ -170,4 +170,31 @@ t DELETE libpod/networks/macvlan1 200 \
.[0].Name~macvlan1 \
.[0].Err=null
+#
+# test networks with containers
+#
+podman pull $IMAGE &>/dev/null
+
+# Ensure clean slate
+podman rm -a -f &>/dev/null
+
+# create a network
+podman network create --subnet 10.10.253.0/24 --gateway 10.10.253.1 network5
+t GET libpod/networks/json?filters='{"name":["network5"]}' 200 \
+ .[0].id~[0-9a-f]\\{64\\}
+nid=$(jq -r '.[0].id' <<<"$output")
+# create a pod on a network
+CNAME=mynettest
+podman run --network network5 --name $CNAME --ip 10.10.253.2 --mac-address 0a:01:73:78:43:18 -td $IMAGE top
+t GET libpod/containers/json?all=true 200 \
+ .[0].Id~[0-9a-f]\\{64\\}
+cid=$(jq -r '.[0].Id' <<<"$output")
+# compat api inspect network
+t GET networks/$nid 200 .Name="network5" \
+ .Containers[\"$cid\"].Name=$CNAME \
+ .Containers[\"$cid\"].MacAddress=0a:01:73:78:43:18 \
+ .Containers[\"$cid\"].IPv4Address=10.10.253.2/24
+# clean the network
+podman network rm -f network5
+
# vim: filetype=sh