diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-05-17 10:45:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-17 10:45:23 -0400 |
commit | 62a7d4b61edb64ed92b63a4d65bde9f785fd1e19 (patch) | |
tree | bbc798e98665c1dc9fcb512af714d4079c89e3ee /test/system/500-networking.bats | |
parent | 9d2bc4cae81889096f9baa66b1f9f48d6dcd942f (diff) | |
parent | c8dfcce6db0adfa2f91d979271e8c2725eb753a6 (diff) | |
download | podman-62a7d4b61edb64ed92b63a4d65bde9f785fd1e19.tar.gz podman-62a7d4b61edb64ed92b63a4d65bde9f785fd1e19.tar.bz2 podman-62a7d4b61edb64ed92b63a4d65bde9f785fd1e19.zip |
Merge pull request #9972 from bblenard/issue-5651-hostname-for-container-gateway
Add host.containers.internal entry into container's etc/hosts
Diffstat (limited to 'test/system/500-networking.bats')
-rw-r--r-- | test/system/500-networking.bats | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats index f3478fa2f..1cec50827 100644 --- a/test/system/500-networking.bats +++ b/test/system/500-networking.bats @@ -162,6 +162,27 @@ load helpers done } +@test "podman run with slirp4ns assigns correct gateway address to host.containers.internal" { + CIDR="$(random_rfc1918_subnet)" + run_podman run --network slirp4netns:cidr="${CIDR}.0/24" \ + $IMAGE grep 'host.containers.internal' /etc/hosts + is "$output" "${CIDR}.2 host.containers.internal" "host.containers.internal should be the cidr+2 address" +} + +@test "podman run with slirp4ns adds correct dns address to resolv.conf" { + CIDR="$(random_rfc1918_subnet)" + run_podman run --network slirp4netns:cidr="${CIDR}.0/24" \ + $IMAGE grep "${CIDR}" /etc/resolv.conf + is "$output" "nameserver ${CIDR}.3" "resolv.conf should have slirp4netns cidr+3 as a nameserver" +} + +@test "podman run with slirp4ns assigns correct ip address container" { + CIDR="$(random_rfc1918_subnet)" + run_podman run --network slirp4netns:cidr="${CIDR}.0/24" \ + $IMAGE sh -c "ip address | grep ${CIDR}" + is "$output" ".*inet ${CIDR}.100/24 \+" "container should have slirp4netns cidr+100 assigned to interface" +} + # "network create" now works rootless, with the help of a special container @test "podman network create" { myport=54322 |