From: Jiajie Chen Date: Sat, 14 Jan 2023 03:08:46 +0000 (+0800) Subject: [PATCH] [linux] Skip unix socket/ipv4 tests if nc does not work X-Git-Tag: archive/raspbian/4.99.4+dfsg-2+rpi1~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4d040b9aa593ac635a08ff96a3916c990675f621;p=lsof.git [PATCH] [linux] Skip unix socket/ipv4 tests if nc does not work Gbp-Pq: Name netcat.patch --- diff --git a/lib/dialects/linux/tests/case-10-ux-socket-state.bash b/lib/dialects/linux/tests/case-10-ux-socket-state.bash index d47e53a..852bc79 100755 --- a/lib/dialects/linux/tests/case-10-ux-socket-state.bash +++ b/lib/dialects/linux/tests/case-10-ux-socket-state.bash @@ -11,6 +11,11 @@ if [ -z "$(nc -h 2>&1 | grep '\-U')" ]; then exit 77 fi +if [ -z "$(nc -h 2>&1 | grep '\-U')" ]; then + echo "nc does not support unix socket" >> $report + exit 2 +fi + ux=/tmp/$name-$$.sock nc -l -U $ux > /dev/null < /dev/zero & server=$! diff --git a/lib/dialects/linux/tests/case-20-inet-socket-endpoint.bash b/lib/dialects/linux/tests/case-20-inet-socket-endpoint.bash index a0a652f..38b8e85 100755 --- a/lib/dialects/linux/tests/case-20-inet-socket-endpoint.bash +++ b/lib/dialects/linux/tests/case-20-inet-socket-endpoint.bash @@ -6,6 +6,11 @@ if [ -z "$(nc -h 2>&1 | grep '\s\-4')" ]; then exit 77 fi +if [ -z "$(nc -h 2>&1 | grep '\s\-4')" ]; then + echo "nc does not support -4 option" >> $report + exit 2 +fi + nc -l -4 127.0.0.1 10000 > /dev/null < /dev/zero & server=$! sleep 1 diff --git a/lib/dialects/linux/tests/case-20-ux-socket-endpoint.bash b/lib/dialects/linux/tests/case-20-ux-socket-endpoint.bash index 50acf13..b8295a3 100755 --- a/lib/dialects/linux/tests/case-20-ux-socket-endpoint.bash +++ b/lib/dialects/linux/tests/case-20-ux-socket-endpoint.bash @@ -6,6 +6,11 @@ if [ -z "$(nc -h 2>&1 | grep '\-U')" ]; then exit 77 fi +if [ -z "$(nc -h 2>&1 | grep '\-U')" ]; then + echo "nc does not support unix socket" >> $report + exit 2 +fi + ux=/tmp/$name-$$.sock nc -l -U $ux > /dev/null < /dev/zero & server=$!