mirror of
https://github.com/containers/podman.git
synced 2025-10-30 09:25:59 +08:00
Merge pull request #11751 from Luap99/net-alias
always add short container id as net alias
This commit is contained in:
@ -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"
|
||||
|
||||
Reference in New Issue
Block a user