1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-12 14:43:24 +00:00

UNIX-L with bind option logged INTERNAL error

This commit is contained in:
Gerhard 2025-02-08 20:55:03 +01:00
parent ed11b3d2c5
commit 676888e8cc
3 changed files with 62 additions and 0 deletions

51
test.sh
View file

@ -19446,6 +19446,57 @@ esac
N=$((N+1))
# Test for useful error message on UNIX-L with bind option
NAME=UNIX_L_BIND
case "$TESTS" in
*%$N%*|*%functions%*|*%bugs%*|*%socket%*|*%listen%*|*%unix%*|*%bind%*|*%$NAME%*)
TEST="$NAME: Test if UNIX-L with bind does not fail INTERNAL"
# Invoke Socat with a UNIX-LISTEN address with bind option.
# When there is no INTERNAL error the test succeeded.
if ! eval $NUMCOND; then :
elif ! cond=$(checkconds \
"" \
"" \
"" \
"UNIX LISTEN PIPE" \
"UNIX-LISTEN PIPE" \
"bind,accept-timeout" \
"" ); then
$PRINTF "test $F_n $TEST... ${YELLOW}$cond${NORMAL}\n" $N
cant
else
ts="$td/test$N.sock"
tb="$td/test$N.bind"
tf="$td/test$N.stdout"
te="$td/test$N.stderr"
tdiff="$td/test$N.diff"
da="test$N $(date) $RANDOM"
CMD0="$TRACE $SOCAT $opts UNIX-LISTEN:$ts,accept-timeout=0.001,bind=$tb PIPE"
printf "test $F_n $TEST... " $N
$CMD0 >/dev/null 2>"${te}0"
rc0=$?
if [ "$rc0" -eq 0 ]; then
$PRINTF "$CANT (rc0=$rc0)\n"
echo "$CMD0"
cat "${te}0" >&2
cant
elif grep " E .* INTERNAL " "${te}0" >/dev/null; then
$PRINTF "$FAILED (INTERNAL)\n"
echo "$CMD0"
cat "${te}0" >&2
failed
else
$PRINTF "$OK\n"
if [ "$VERBOSE" ]; then echo "$CMD0 &"; fi
if [ "$DEBUG" ]; then cat "${te}0" >&2; fi
ok
fi
fi # NUMCOND
;;
esac
N=$((N+1))
# end of common tests
##################################################################################