summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-09-27 09:50:07 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-09-28 13:40:22 +0200
commit05614ee139b9d5ce6d2daed50d9f0b3ed6d4e9a1 (patch)
tree09d2a8deee119a69344cd5f2772ab34292d8e37d /test/system
parente27470ba97ae3dda32fb06b408da786f2b25a25d (diff)
downloadpodman-05614ee139b9d5ce6d2daed50d9f0b3ed6d4e9a1.tar.gz
podman-05614ee139b9d5ce6d2daed50d9f0b3ed6d4e9a1.tar.bz2
podman-05614ee139b9d5ce6d2daed50d9f0b3ed6d4e9a1.zip
always add short container id as net alias
This matches what docker does. Also make sure the net aliases are also shown when the container is stopped. docker-compose uses this special alias entry to check if it is already correctly connected to the network. [1] Because we do not support static ips on network connect at the moment calling disconnect && connect will loose the static ip. Fixes #11748 [1] https://github.com/docker/compose/blob/0bea52b18dda3de8c28fcfb0c80cc08b8950645e/compose/service.py#L663-L667 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/500-networking.bats8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index ef00d0366..548f2d764 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -415,6 +415,10 @@ load helpers
run_podman inspect $cid --format "{{(index .NetworkSettings.Networks \"$netname\").MacAddress}}"
mac="$output"
+ # check network alias for container short id
+ run_podman inspect $cid --format "{{(index .NetworkSettings.Networks \"$netname\").Aliases}}"
+ is "$output" "\[${cid:0:12}\]" "short container id in network aliases"
+
run_podman network disconnect $netname $cid
# check that we cannot curl (timeout after 3 sec)
@@ -443,6 +447,10 @@ load helpers
# connect a second network
run_podman network connect $netname2 $cid
+ # check network2 alias for container short id
+ run_podman inspect $cid --format "{{(index .NetworkSettings.Networks \"$netname2\").Aliases}}"
+ is "$output" "\[${cid:0:12}\]" "short container id in network aliases"
+
# curl should work
run curl --max-time 3 -s $SERVER/index.txt
is "$output" "$random_1" "curl 127.0.0.1:/index.txt should work"