mirror of
https://github.com/containers/podman.git
synced 2025-10-20 04:34:01 +08:00
tests: Get rid of netcat on the host and use Bash's /dev/tcp
The only remaining uses of nc now are in containers. Signed-off-by: Ricardo Branco <rbranco@suse.de>
This commit is contained in:

committed by
Matt Heon

parent
f8800b7fa8
commit
4e83155959
@ -338,7 +338,7 @@ EOF
|
|||||||
# send a random string to the container. This will cause the container
|
# send a random string to the container. This will cause the container
|
||||||
# to output the string to its logs, then exit.
|
# to output the string to its logs, then exit.
|
||||||
teststring=$(random_string 30)
|
teststring=$(random_string 30)
|
||||||
echo "$teststring" | nc 127.0.0.1 $port_out
|
echo "$teststring" > /dev/tcp/127.0.0.1/$port_out
|
||||||
|
|
||||||
# Confirm that the container log output is the string we sent it.
|
# Confirm that the container log output is the string we sent it.
|
||||||
run_podman wait $cid
|
run_podman wait $cid
|
||||||
|
@ -153,7 +153,7 @@ load helpers.network
|
|||||||
|
|
||||||
# emit random string, and check it
|
# emit random string, and check it
|
||||||
teststring=$(random_string 30)
|
teststring=$(random_string 30)
|
||||||
echo "$teststring" | nc 127.0.0.1 $myport
|
echo "$teststring" > /dev/tcp/127.0.0.1/$myport
|
||||||
|
|
||||||
run_podman logs $cid
|
run_podman logs $cid
|
||||||
# Sigh. We can't check line-by-line, because 'nc' output order is
|
# Sigh. We can't check line-by-line, because 'nc' output order is
|
||||||
@ -296,7 +296,7 @@ load helpers.network
|
|||||||
|
|
||||||
# emit random string, and check it
|
# emit random string, and check it
|
||||||
teststring=$(random_string 30)
|
teststring=$(random_string 30)
|
||||||
echo "$teststring" | nc 127.0.0.1 $myport
|
echo "$teststring" > /dev/tcp/127.0.0.1/$myport
|
||||||
|
|
||||||
run_podman logs $cid
|
run_podman logs $cid
|
||||||
# Sigh. We can't check line-by-line, because 'nc' output order is
|
# Sigh. We can't check line-by-line, because 'nc' output order is
|
||||||
|
@ -423,7 +423,7 @@ function wait_for_port() {
|
|||||||
function tcp_port_probe() {
|
function tcp_port_probe() {
|
||||||
local address="${2:-0.0.0.0}"
|
local address="${2:-0.0.0.0}"
|
||||||
|
|
||||||
: | nc "${address}" "${1}"
|
(exec echo -n >/dev/tcp/"$address/$1") >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
### Pasta Helpers ##############################################################
|
### Pasta Helpers ##############################################################
|
||||||
|
Reference in New Issue
Block a user