diff options
Diffstat (limited to 'regress')
-rw-r--r-- | regress/agent-ptrace.sh | 4 | ||||
-rw-r--r-- | regress/dynamic-forward.sh | 4 | ||||
-rw-r--r-- | regress/sftp-cmds.sh | 2 | ||||
-rw-r--r-- | regress/stderr-after-eof.sh | 8 | ||||
-rw-r--r-- | regress/test-exec.sh | 17 |
5 files changed, 25 insertions, 10 deletions
diff --git a/regress/agent-ptrace.sh b/regress/agent-ptrace.sh index 4124f5844..b9d86a29d 100644 --- a/regress/agent-ptrace.sh +++ b/regress/agent-ptrace.sh | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | tid="disallow agent ptrace attach" | 4 | tid="disallow agent ptrace attach" |
5 | 5 | ||
6 | if [ -x "`which uname 2>&1`" ]; then | 6 | if have_prog uname ; then |
7 | case `uname` in | 7 | case `uname` in |
8 | Linux|HP-UX|SunOS|NetBSD|AIX|CYGWIN*) | 8 | Linux|HP-UX|SunOS|NetBSD|AIX|CYGWIN*) |
9 | echo "skipped (not supported on this platform)" | 9 | echo "skipped (not supported on this platform)" |
@@ -12,7 +12,7 @@ if [ -x "`which uname 2>&1`" ]; then | |||
12 | esac | 12 | esac |
13 | fi | 13 | fi |
14 | 14 | ||
15 | if [ ! -x "`which gdb 2>&1`" ]; then | 15 | if ! have_prog gdb ; then |
16 | echo "skipped (gdb not found)" | 16 | echo "skipped (gdb not found)" |
17 | exit 0 | 17 | exit 0 |
18 | fi | 18 | fi |
diff --git a/regress/dynamic-forward.sh b/regress/dynamic-forward.sh index 0f175b2d9..2b0b825d0 100644 --- a/regress/dynamic-forward.sh +++ b/regress/dynamic-forward.sh | |||
@@ -7,9 +7,9 @@ PORT=4242 | |||
7 | FWDPORT=4243 | 7 | FWDPORT=4243 |
8 | DATA=/bin/ls${EXEEXT} | 8 | DATA=/bin/ls${EXEEXT} |
9 | 9 | ||
10 | if [ -x "`which nc 2>&1`" ] && nc -h 2>&1 | grep "x proxy address" >/dev/null; then | 10 | if have_prog nc && nc -h 2>&1 | grep "x proxy address" >/dev/null; then |
11 | proxycmd="nc -x 127.0.0.1:$FWDPORT -X" | 11 | proxycmd="nc -x 127.0.0.1:$FWDPORT -X" |
12 | elif [ -x "`which connect 2>&1`" ]; then | 12 | elif have_prog connect; then |
13 | proxycmd="connect -S 127.0.0.1:$FWDPORT -" | 13 | proxycmd="connect -S 127.0.0.1:$FWDPORT -" |
14 | else | 14 | else |
15 | echo "skipped (no suitable ProxyCommand found)" | 15 | echo "skipped (no suitable ProxyCommand found)" |
diff --git a/regress/sftp-cmds.sh b/regress/sftp-cmds.sh index 1237720f9..1256aeb2d 100644 --- a/regress/sftp-cmds.sh +++ b/regress/sftp-cmds.sh | |||
@@ -17,7 +17,7 @@ do | |||
17 | fi | 17 | fi |
18 | done | 18 | done |
19 | 19 | ||
20 | if [ -x "`which uname 2>&1`" ] | 20 | if have_prog uname |
21 | then | 21 | then |
22 | case `uname` in | 22 | case `uname` in |
23 | CYGWIN*) | 23 | CYGWIN*) |
diff --git a/regress/stderr-after-eof.sh b/regress/stderr-after-eof.sh index ae9cf8d98..05a5ea56d 100644 --- a/regress/stderr-after-eof.sh +++ b/regress/stderr-after-eof.sh | |||
@@ -7,13 +7,13 @@ DATA=/etc/motd | |||
7 | DATA=${OBJ}/data | 7 | DATA=${OBJ}/data |
8 | COPY=${OBJ}/copy | 8 | COPY=${OBJ}/copy |
9 | 9 | ||
10 | if [ -x "`which md5sum 2>&1`" ]; then | 10 | if have_prog md5sum; then |
11 | CHECKSUM=md5sum | 11 | CHECKSUM=md5sum |
12 | elif [ -x "`which openssl 2>&1`" ]; then | 12 | elif have_prog openssl; then |
13 | CHECKSUM="openssl md5" | 13 | CHECKSUM="openssl md5" |
14 | elif [ -x "`which cksum 2>&1`" ]; then | 14 | elif have_prog cksum; then |
15 | CHECKSUM=cksum | 15 | CHECKSUM=cksum |
16 | elif [ -x "`which sum 2>&1`" ]; then | 16 | elif have_prog sum; then |
17 | CHECKSUM=sum | 17 | CHECKSUM=sum |
18 | else | 18 | else |
19 | fatal "No checksum program available, aborting $tid test" | 19 | fatal "No checksum program available, aborting $tid test" |
diff --git a/regress/test-exec.sh b/regress/test-exec.sh index b5ef3bc7c..cc7ea67fe 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh | |||
@@ -6,7 +6,7 @@ PORT=4242 | |||
6 | 6 | ||
7 | if [ -x /usr/ucb/whoami ]; then | 7 | if [ -x /usr/ucb/whoami ]; then |
8 | USER=`/usr/ucb/whoami` | 8 | USER=`/usr/ucb/whoami` |
9 | elif [ -x "`which whoami 2>&1`" ]; then | 9 | elif whoami >/dev/null 2>&1; then |
10 | USER=`whoami` | 10 | USER=`whoami` |
11 | else | 11 | else |
12 | USER=`id -un` | 12 | USER=`id -un` |
@@ -89,6 +89,21 @@ echon() | |||
89 | fi | 89 | fi |
90 | } | 90 | } |
91 | 91 | ||
92 | have_prog() | ||
93 | { | ||
94 | saved_IFS="$IFS" | ||
95 | IFS=":" | ||
96 | for i in $PATH | ||
97 | do | ||
98 | if [ -x $i/$1 ]; then | ||
99 | IFS="$saved_IFS" | ||
100 | return 0 | ||
101 | fi | ||
102 | done | ||
103 | IFS="$saved_IFS" | ||
104 | return 1 | ||
105 | } | ||
106 | |||
92 | cleanup () | 107 | cleanup () |
93 | { | 108 | { |
94 | if [ -f $PIDFILE ]; then | 109 | if [ -f $PIDFILE ]; then |