File tree Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -1188,8 +1188,8 @@ spec:
1188
1188
EOF
1189
1189
1190
1190
# Bind the port to force a an error when starting the pod
1191
- timeout --foreground -v --kill=10 10 ncat -l 127.0.0.1 $port &
1192
- nc_pid =$!
1191
+ timeout --foreground -v --kill=10 10 socat TCP-LISTEN: $port ,bind= 127.0.0.1,fork - &
1192
+ socat_pid =$!
1193
1193
1194
1194
# Create the Quadlet file
1195
1195
local quadlet_file=$PODMAN_TMPDIR /start_err_$( safename) .kube
@@ -1214,7 +1214,7 @@ EOF
1214
1214
run -0 journalctl -eu $QUADLET_SERVICE_NAME
1215
1215
assert " $output " =~ " $port : bind: address already in use" " journal contains the real podman start error"
1216
1216
1217
- kill " $nc_pid "
1217
+ kill " $socat_pid "
1218
1218
}
1219
1219
1220
1220
# https://github.com/containers/podman/issues/25786
Original file line number Diff line number Diff line change @@ -806,26 +806,26 @@ nameserver 8.8.8.8" "nameserver order is correct"
806
806
cid=" $output "
807
807
808
808
# make sure binding the same port fails
809
- run timeout 5 ncat -l 127.0.0.1 $port
810
- assert " $status " -eq 2 " ncat unexpected exit code"
811
- assert " $output " =~ " 127.0.0.1:$port : Address already in use" " ncat error message"
809
+ run timeout 5 socat TCP-LISTEN: $port ,bind= 127.0.0.1,fork -
810
+ assert " $status " -eq 1 " socat unexpected exit code"
811
+ assert " $output " =~ " .* 127.0.0.1:$port .* Address already in use" " socat error message"
812
812
813
813
for port in $( seq $port $end_port ) ; do
814
814
run_podman exec -d $cid nc -l -p $port -e /bin/cat
815
815
816
- # we have to rety ncat as it can flake as we exec in the background so nc -l
816
+ # we have to retry socat as it can flake as we exec in the background so nc -l
817
817
# might not have bound the port yet, retry seems simpler than checking if the
818
818
# port is bound in the container, https://github.com/containers/podman/issues/21561.
819
819
retries=5
820
820
while [[ $retries -gt 0 ]]; do
821
- run ncat 127.0.0.1 $port <<< $random
821
+ run socat - TCP: 127.0.0.1: $port <<< $random
822
822
if [[ $status -eq 0 ]]; then
823
823
break
824
824
fi
825
825
sleep 0.5
826
826
retries=$(( retries - 1 ))
827
827
done
828
- is " $output " " $random " " ncat got data back (netmode=$netmode port=$port )"
828
+ is " $output " " $random " " socat got data back (netmode=$netmode port=$port )"
829
829
done
830
830
831
831
run_podman rm -f -t0 $cid
Original file line number Diff line number Diff line change @@ -86,7 +86,6 @@ Requirements
86
86
- bats
87
87
- jq
88
88
- skopeo
89
- - nmap-ncat
90
89
- httpd-tools
91
90
- openssl
92
91
- socat
You can’t perform that action at this time.
0 commit comments