@@ -122,13 +122,8 @@ load helpers.network
122122 # force bridge networking also for rootless
123123 # this ensures that rootless + bridge + userns + ports works
124124 network_arg=" --network bridge"
125- elif has_slirp4netns; then
126- # Issue #9828 make sure a custom slirp4netns cidr also works
127- network_arg=" --network slirp4netns:cidr=$cidr "
128- # slirp4netns interface ip is always .100
129- match=" ${cidr% .* } .100"
130125 else
131- echo " # [skipping subtest of $cidr - slirp4netns unavailable ]" >&3
126+ echo " # [skipping subtest of $cidr ]" >&3
132127 continue
133128 fi
134129
@@ -208,57 +203,6 @@ load helpers.network
208203 is " $output " " $pid " " Only ID in output (no extra errors)"
209204}
210205
211- # FIXME: random_rfc1918_subnet is not parallel-safe
212- @test " podman run with slirp4ns assigns correct addresses to /etc/hosts" {
213- has_slirp4netns || skip " slirp4netns unavailable"
214-
215- CIDR=" $( random_rfc1918_subnet) "
216- IP=$( hostname -I | cut -f 1 -d " " )
217- local conname=con-$( safename)
218- run_podman run --rm --network slirp4netns:cidr=" ${CIDR} .0/24" \
219- --name $conname --hostname $conname $IMAGE cat /etc/hosts
220- is " $output " " .*${IP} host.containers.internal" " host.containers.internal should be host address"
221- is " $output " " .*${CIDR} .100 $conname $conname " " $conname should be the cidr+100 address"
222-
223- if is_rootless; then
224- # check the slirp ip also works correct with userns
225- run_podman run --rm --userns keep-id --network slirp4netns:cidr=" ${CIDR} .0/24" \
226- --name $conname --hostname $conname $IMAGE cat /etc/hosts
227- is " $output " " .*${IP} host.containers.internal" " host.containers.internal should be host address"
228- is " $output " " .*${CIDR} .100 $conname $conname " " $conname should be the cidr+100 address"
229- fi
230- }
231-
232- # FIXME: random_rfc1918_subnet is not parallel-safe
233- @test " podman run with slirp4ns adds correct dns address to resolv.conf" {
234- has_slirp4netns || skip " slirp4netns unavailable"
235-
236- CIDR=" $( random_rfc1918_subnet) "
237- run_podman run --rm --network slirp4netns:cidr=" ${CIDR} .0/24" \
238- $IMAGE cat /etc/resolv.conf
239- assert " $output " =~ " nameserver ${CIDR} .3" " resolv.conf should have slirp4netns cidr+3 as first nameserver"
240- no_userns_out=" $output "
241-
242- if is_rootless; then
243- # check the slirp ip also works correct with userns
244- run_podman run --rm --userns keep-id --network slirp4netns:cidr=" ${CIDR} .0/24" \
245- $IMAGE cat /etc/resolv.conf
246- assert " $output " =~ " nameserver ${CIDR} .3" " resolv.conf should have slirp4netns cidr+3 as first nameserver with userns"
247- assert " $output " == " $no_userns_out " " resolv.conf should look the same for userns"
248- fi
249-
250- }
251-
252- # FIXME: random_rfc1918_subnet is not parallel-safe
253- @test " podman run with slirp4ns assigns correct ip address container" {
254- has_slirp4netns || skip " slirp4netns unavailable"
255-
256- CIDR=" $( random_rfc1918_subnet) "
257- run_podman run --rm --network slirp4netns:cidr=" ${CIDR} .0/24" \
258- $IMAGE sh -c " ip address | grep ${CIDR} "
259- is " $output " " .*inet ${CIDR} .100/24 \+" " container should have slirp4netns cidr+100 assigned to interface"
260- }
261-
262206# "network create" now works rootless, with the help of a special container
263207# FIXME: random_rfc1918_subnet is not parallel-safe
264208@test " podman network create" {
@@ -466,16 +410,6 @@ load helpers.network
466410 skip " This test needs an ipv6 nameserver in $resolve_file "
467411 fi
468412
469- if has_slirp4netns; then
470- # ipv4 slirp
471- run_podman run --rm --network slirp4netns:enable_ipv6=false $IMAGE cat /etc/resolv.conf
472- assert " $output " ! ~ " $ipv6_regex " " resolv.conf should not contain ipv6 nameserver"
473-
474- # ipv6 slirp
475- run_podman run --rm --network slirp4netns:enable_ipv6=true $IMAGE cat /etc/resolv.conf
476- assert " $output " =~ " $ipv6_regex " " resolv.conf should contain ipv6 nameserver"
477- fi
478-
479413 # ipv4 cni
480414 local mysubnet=$( random_rfc1918_subnet)
481415 local netname=testnet1-$( safename)
@@ -641,9 +575,6 @@ load helpers.network
641575 is " $output " " $netname " " output of 'network create'"
642576
643577 local -a networks=(" $netname " )
644- if has_slirp4netns; then
645- networks+=(" slirp4netns" )
646- fi
647578 for network in " ${networks[@]} " ; do
648579 # Start container with the restart always policy
649580 local cname=c-$( safename)
@@ -782,10 +713,6 @@ nameserver 8.8.8.8" "nameserver order is correct"
782713 defer-assertion-failures
783714
784715 local -a netmodes=(" bridge" )
785- # As of podman 5.0, slirp4netns is optional
786- if has_slirp4netns; then
787- netmodes+=(" slirp4netns:port_handler=slirp4netns" " slirp4netns:port_handler=rootlesskit" )
788- fi
789716 # pasta only works rootless
790717 if is_rootless; then
791718 netmodes+=(" pasta" )
@@ -1012,16 +939,9 @@ EOF
1012939 # Now make sure we can still run a container with free ips.
1013940 run_podman run --rm --network $net1 $IMAGE true
1014941
1015- # And now because of all the fun we have to check the same with slirp4netns and pasta because
942+ # And now because of all the fun we have to check the same with pasta because
1016943 # that uses slightly different code paths. Note this would deadlock before the fix.
1017944 # https://github.com/containers/podman/issues/21477
1018- if has_slirp4netns; then
1019- cname2=con2-$( safename)
1020- run_podman 1 run --name $cname2 --network slirp4netns --restart on-failure:2 --userns keep-id $IMAGE false
1021- wait_for_restart_count $cname2 2 " slirp4netns"
1022- run_podman wait $cname2
1023- fi
1024-
1025945 if is_rootless; then
1026946 # pasta can only run rootless
1027947 cname3=con3-$( safename)
0 commit comments