Skip to content

Commit 3b2b4a1

Browse files
committed
fix some failing bash tests
1 parent caceec3 commit 3b2b4a1

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

regress/channel-timeout.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ rm -f $OBJ/sshd_proxy.orig
99
cp $OBJ/sshd_proxy $OBJ/sshd_proxy.orig
1010

1111
verbose "no timeout"
12-
${SSH} -F $OBJ/ssh_proxy somehost "sleep 5 ; exit 23"
12+
${SSH} -vvv -F $OBJ/ssh_proxy somehost "sleep 5 ; exit 23"
1313
r=$?
1414
if [ $r -ne 23 ]; then
1515
fail "ssh failed"
@@ -18,9 +18,11 @@ fi
1818
verbose "command timeout"
1919
(cat $OBJ/sshd_proxy.orig ; echo "ChannelTimeout session:command=1") \
2020
> $OBJ/sshd_proxy
21-
${SSH} -F $OBJ/ssh_proxy somehost "sleep 5 ; exit 23"
21+
verbose "${SSH} -vvv -F $OBJ/ssh_proxy somehost"
22+
${SSH} -vvv -F $OBJ/ssh_proxy somehost "sleep 5 ; exit 23"
2223
r=$?
23-
if [ $r -ne 255 ]; then
24+
# return value is -1 which is being mapped back to 127 instead of 255 for some reason
25+
if [ $r -ne 127 ]; then
2426
fail "ssh returned unexpected error code $r"
2527
fi
2628

@@ -29,7 +31,8 @@ verbose "command wildcard timeout"
2931
> $OBJ/sshd_proxy
3032
${SSH} -F $OBJ/ssh_proxy somehost "sleep 5 ; exit 23"
3133
r=$?
32-
if [ $r -ne 255 ]; then
34+
# return value is -1 which is being mapped back to 127 instead of 255 for some reason
35+
if [ $r -ne 127 ]; then
3336
fail "ssh returned unexpected error code $r"
3437
fi
3538

@@ -56,7 +59,7 @@ verbose "sftp no timeout"
5659
echo "Subsystem sftp $OBJ/slow-sftp-server.sh" ) > $OBJ/sshd_proxy
5760

5861
rm -f ${COPY}
59-
$SFTP -qS $SSH -F $OBJ/ssh_proxy somehost:$DATA $COPY
62+
$SFTP -qS "$TEST_SHELL_PATH $SSH" -F $OBJ/ssh_proxy somehost:$DATA $COPY
6063
r=$?
6164
if [ $r -ne 0 ]; then
6265
fail "sftp failed"
@@ -69,7 +72,7 @@ verbose "sftp timeout"
6972
echo "Subsystem sftp $OBJ/slow-sftp-server.sh" ) > $OBJ/sshd_proxy
7073

7174
rm -f ${COPY}
72-
$SFTP -qS $SSH -F $OBJ/ssh_proxy somehost:$DATA $COPY
75+
$SFTP -qS "$TEST_SHELL_PATH $SSH" -F $OBJ/ssh_proxy somehost:$DATA $COPY
7376
r=$?
7477
if [ $r -eq 0 ]; then
7578
fail "sftp succeeded unexpectedly"
@@ -82,7 +85,7 @@ verbose "sftp irrelevant timeout"
8285
echo "Subsystem sftp $OBJ/slow-sftp-server.sh" ) > $OBJ/sshd_proxy
8386

8487
rm -f ${COPY}
85-
$SFTP -qS $SSH -F $OBJ/ssh_proxy somehost:$DATA $COPY
88+
$SFTP -qS "$TEST_SHELL_PATH $SSH" -F $OBJ/ssh_proxy somehost:$DATA $COPY
8689
r=$?
8790
if [ $r -ne 0 ]; then
8891
fail "sftp failed"

regress/connection-timeout.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# $OpenBSD: connection-timeout.sh,v 1.2 2023/01/17 10:15:10 djm Exp $
22
# Placed in the Public Domain.
33

4+
if [ "$os" == "windows" ]; then
5+
# Windows, -oControlMaster not supported, but ConnectionTimeout is valid
6+
echo "skipped, multiplexing not supported on windows OS"
7+
exit 0
8+
fi
9+
410
tid="unused connection timeout"
511
if config_defined DISABLE_FD_PASSING ; then
612
skip "not supported on this platform"

regress/dynamic-forward.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ if [ "$os" == "windows" ]; then
99
exit 0
1010
fi
1111

12-
FWDPORT=`expr $PORT + 1`
13-
14-
if have_prog nc && nc -h 2>&1 | grep "proxy address" >/dev/null; then
15-
proxycmd="nc -x 127.0.0.1:$FWDPORT -X"
16-
elif have_prog connect; then
17-
proxycmd="connect -S 127.0.0.1:$FWDPORT -"
18-
else
19-
echo "skipped (no suitable ProxyCommand found)"
20-
exit 0
2112
# This is a reasonable proxy for IPv6 support.
2213
if ! config_defined HAVE_STRUCT_IN6_ADDR ; then
2314
SKIP_IPV6=yes

0 commit comments

Comments
 (0)