summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-11-20 09:00:22 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2021-12-21 08:50:40 -0500
commit64ce6949f23b308a432e83ec46c99ba67777ee1e (patch)
tree1da10ace481348ace677fbf0d815bc1967d7f05e /test
parentf3d6672c7d95e09b312ac8db43e54618d4dd1662 (diff)
downloadpodman-64ce6949f23b308a432e83ec46c99ba67777ee1e.tar.gz
podman-64ce6949f23b308a432e83ec46c99ba67777ee1e.tar.bz2
podman-64ce6949f23b308a432e83ec46c99ba67777ee1e.zip
Use hosts public ip address in rootless containers
Add first non localhost ipv4 of all host interfaces as destination for host.contaners.internal for rootless containers. Fixes: https://github.com/containers/podman/issues/12000 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/system/500-networking.bats3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats
index 4d36163d7..2b5ad44dc 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -139,10 +139,11 @@ load helpers
@test "podman run with slirp4ns assigns correct addresses to /etc/hosts" {
CIDR="$(random_rfc1918_subnet)"
+ IP=$(hostname -I | cut -f 1 -d " ")
local conname=con-$(random_string 10)
run_podman run --rm --network slirp4netns:cidr="${CIDR}.0/24" \
--name $conname --hostname $conname $IMAGE cat /etc/hosts
- is "$output" ".*${CIDR}.2 host.containers.internal" "host.containers.internal should be the cidr+2 address"
+ is "$output" ".*${IP} host.containers.internal" "host.containers.internal should be the cidr+2 address"
is "$output" ".*${CIDR}.100 $conname $conname" "$conname should be the cidr+100 address"
}