@@ -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" {
@@ -463,16 +407,6 @@ load helpers.network
463407 skip " This test needs an ipv6 nameserver in $resolve_file "
464408 fi
465409
466- if has_slirp4netns; then
467- # ipv4 slirp
468- run_podman run --rm --network slirp4netns:enable_ipv6=false $IMAGE cat /etc/resolv.conf
469- assert " $output " ! ~ " $ipv6_regex " " resolv.conf should not contain ipv6 nameserver"
470-
471- # ipv6 slirp
472- run_podman run --rm --network slirp4netns:enable_ipv6=true $IMAGE cat /etc/resolv.conf
473- assert " $output " =~ " $ipv6_regex " " resolv.conf should contain ipv6 nameserver"
474- fi
475-
476410 # ipv4 cni
477411 local mysubnet=$( random_rfc1918_subnet)
478412 local netname=testnet1-$( safename)
@@ -638,9 +572,6 @@ load helpers.network
638572 is " $output " " $netname " " output of 'network create'"
639573
640574 local -a networks=(" $netname " )
641- if has_slirp4netns; then
642- networks+=(" slirp4netns" )
643- fi
644575 for network in " ${networks[@]} " ; do
645576 # Start container with the restart always policy
646577 local cname=c-$( safename)
@@ -779,10 +710,6 @@ nameserver 8.8.8.8" "nameserver order is correct"
779710 defer-assertion-failures
780711
781712 local -a netmodes=(" bridge" )
782- # As of podman 5.0, slirp4netns is optional
783- if has_slirp4netns; then
784- netmodes+=(" slirp4netns:port_handler=slirp4netns" " slirp4netns:port_handler=rootlesskit" )
785- fi
786713 # pasta only works rootless
787714 if is_rootless; then
788715 netmodes+=(" pasta" )
@@ -1009,16 +936,9 @@ EOF
1009936 # Now make sure we can still run a container with free ips.
1010937 run_podman run --rm --network $net1 $IMAGE true
1011938
1012- # And now because of all the fun we have to check the same with slirp4netns and pasta because
939+ # And now because of all the fun we have to check the same with pasta because
1013940 # that uses slightly different code paths. Note this would deadlock before the fix.
1014941 # https://github.com/containers/podman/issues/21477
1015- if has_slirp4netns; then
1016- cname2=con2-$( safename)
1017- run_podman 1 run --name $cname2 --network slirp4netns --restart on-failure:2 --userns keep-id $IMAGE false
1018- wait_for_restart_count $cname2 2 " slirp4netns"
1019- run_podman wait $cname2
1020- fi
1021-
1022942 if is_rootless; then
1023943 # pasta can only run rootless
1024944 cname3=con3-$( safename)
0 commit comments