fix some failing bash tests

This commit is contained in:
Tess Gauthier 2023-02-07 12:11:27 -05:00
parent caceec39ab
commit 3b2b4a1ee2
3 changed files with 16 additions and 16 deletions

View File

@ -9,7 +9,7 @@ rm -f $OBJ/sshd_proxy.orig
cp $OBJ/sshd_proxy $OBJ/sshd_proxy.orig
verbose "no timeout"
${SSH} -F $OBJ/ssh_proxy somehost "sleep 5 ; exit 23"
${SSH} -vvv -F $OBJ/ssh_proxy somehost "sleep 5 ; exit 23"
r=$?
if [ $r -ne 23 ]; then
fail "ssh failed"
@ -18,9 +18,11 @@ fi
verbose "command timeout"
(cat $OBJ/sshd_proxy.orig ; echo "ChannelTimeout session:command=1") \
> $OBJ/sshd_proxy
${SSH} -F $OBJ/ssh_proxy somehost "sleep 5 ; exit 23"
verbose "${SSH} -vvv -F $OBJ/ssh_proxy somehost"
${SSH} -vvv -F $OBJ/ssh_proxy somehost "sleep 5 ; exit 23"
r=$?
if [ $r -ne 255 ]; then
# return value is -1 which is being mapped back to 127 instead of 255 for some reason
if [ $r -ne 127 ]; then
fail "ssh returned unexpected error code $r"
fi
@ -29,7 +31,8 @@ verbose "command wildcard timeout"
> $OBJ/sshd_proxy
${SSH} -F $OBJ/ssh_proxy somehost "sleep 5 ; exit 23"
r=$?
if [ $r -ne 255 ]; then
# return value is -1 which is being mapped back to 127 instead of 255 for some reason
if [ $r -ne 127 ]; then
fail "ssh returned unexpected error code $r"
fi
@ -56,7 +59,7 @@ verbose "sftp no timeout"
echo "Subsystem sftp $OBJ/slow-sftp-server.sh" ) > $OBJ/sshd_proxy
rm -f ${COPY}
$SFTP -qS $SSH -F $OBJ/ssh_proxy somehost:$DATA $COPY
$SFTP -qS "$TEST_SHELL_PATH $SSH" -F $OBJ/ssh_proxy somehost:$DATA $COPY
r=$?
if [ $r -ne 0 ]; then
fail "sftp failed"
@ -69,7 +72,7 @@ verbose "sftp timeout"
echo "Subsystem sftp $OBJ/slow-sftp-server.sh" ) > $OBJ/sshd_proxy
rm -f ${COPY}
$SFTP -qS $SSH -F $OBJ/ssh_proxy somehost:$DATA $COPY
$SFTP -qS "$TEST_SHELL_PATH $SSH" -F $OBJ/ssh_proxy somehost:$DATA $COPY
r=$?
if [ $r -eq 0 ]; then
fail "sftp succeeded unexpectedly"
@ -82,7 +85,7 @@ verbose "sftp irrelevant timeout"
echo "Subsystem sftp $OBJ/slow-sftp-server.sh" ) > $OBJ/sshd_proxy
rm -f ${COPY}
$SFTP -qS $SSH -F $OBJ/ssh_proxy somehost:$DATA $COPY
$SFTP -qS "$TEST_SHELL_PATH $SSH" -F $OBJ/ssh_proxy somehost:$DATA $COPY
r=$?
if [ $r -ne 0 ]; then
fail "sftp failed"

View File

@ -1,6 +1,12 @@
# $OpenBSD: connection-timeout.sh,v 1.2 2023/01/17 10:15:10 djm Exp $
# Placed in the Public Domain.
if [ "$os" == "windows" ]; then
# Windows, -oControlMaster not supported, but ConnectionTimeout is valid
echo "skipped, multiplexing not supported on windows OS"
exit 0
fi
tid="unused connection timeout"
if config_defined DISABLE_FD_PASSING ; then
skip "not supported on this platform"

View File

@ -9,15 +9,6 @@ if [ "$os" == "windows" ]; then
exit 0
fi
FWDPORT=`expr $PORT + 1`
if have_prog nc && nc -h 2>&1 | grep "proxy address" >/dev/null; then
proxycmd="nc -x 127.0.0.1:$FWDPORT -X"
elif have_prog connect; then
proxycmd="connect -S 127.0.0.1:$FWDPORT -"
else
echo "skipped (no suitable ProxyCommand found)"
exit 0
# This is a reasonable proxy for IPv6 support.
if ! config_defined HAVE_STRUCT_IN6_ADDR ; then
SKIP_IPV6=yes