diff options
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r-- | regress/test-exec.sh | 45 |
1 files changed, 6 insertions, 39 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh index cc7ea67fe..a7a8ddbe6 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh | |||
@@ -2,16 +2,10 @@ | |||
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | PORT=4242 | 4 | PORT=4242 |
5 | USER=`id -un` | ||
6 | SUDO= | ||
5 | #SUDO=sudo | 7 | #SUDO=sudo |
6 | 8 | ||
7 | if [ -x /usr/ucb/whoami ]; then | ||
8 | USER=`/usr/ucb/whoami` | ||
9 | elif whoami >/dev/null 2>&1; then | ||
10 | USER=`whoami` | ||
11 | else | ||
12 | USER=`id -un` | ||
13 | fi | ||
14 | |||
15 | OBJ=$1 | 9 | OBJ=$1 |
16 | if [ "x$OBJ" = "x" ]; then | 10 | if [ "x$OBJ" = "x" ]; then |
17 | echo '$OBJ not defined' | 11 | echo '$OBJ not defined' |
@@ -78,32 +72,6 @@ export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER | |||
78 | #echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER | 72 | #echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER |
79 | 73 | ||
80 | # helper | 74 | # helper |
81 | echon() | ||
82 | { | ||
83 | if [ "x`echo -n`" = "x" ]; then | ||
84 | echo -n "$@" | ||
85 | elif [ "x`echo '\c'`" = "x" ]; then | ||
86 | echo "$@\c" | ||
87 | else | ||
88 | fatal "Don't know how to echo without newline." | ||
89 | fi | ||
90 | } | ||
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 | |||
107 | cleanup () | 75 | cleanup () |
108 | { | 76 | { |
109 | if [ -f $PIDFILE ]; then | 77 | if [ -f $PIDFILE ]; then |
@@ -143,7 +111,7 @@ fail () | |||
143 | 111 | ||
144 | fatal () | 112 | fatal () |
145 | { | 113 | { |
146 | echon "FATAL: " | 114 | echo -n "FATAL: " |
147 | fail "$@" | 115 | fail "$@" |
148 | cleanup | 116 | cleanup |
149 | exit $RESULT | 117 | exit $RESULT |
@@ -162,7 +130,6 @@ cat << EOF > $OBJ/sshd_config | |||
162 | PidFile $PIDFILE | 130 | PidFile $PIDFILE |
163 | AuthorizedKeysFile $OBJ/authorized_keys_%u | 131 | AuthorizedKeysFile $OBJ/authorized_keys_%u |
164 | LogLevel QUIET | 132 | LogLevel QUIET |
165 | StrictModes no | ||
166 | EOF | 133 | EOF |
167 | 134 | ||
168 | # server config for proxy connects | 135 | # server config for proxy connects |
@@ -202,7 +169,7 @@ for t in rsa rsa1; do | |||
202 | 169 | ||
203 | # known hosts file for client | 170 | # known hosts file for client |
204 | ( | 171 | ( |
205 | echon 'localhost-with-alias,127.0.0.1,::1 ' | 172 | echo -n 'localhost-with-alias,127.0.0.1,::1 ' |
206 | cat $OBJ/$t.pub | 173 | cat $OBJ/$t.pub |
207 | ) >> $OBJ/known_hosts | 174 | ) >> $OBJ/known_hosts |
208 | 175 | ||
@@ -222,7 +189,7 @@ chmod 644 $OBJ/authorized_keys_$USER | |||
222 | # create a proxy version of the client config | 189 | # create a proxy version of the client config |
223 | ( | 190 | ( |
224 | cat $OBJ/ssh_config | 191 | cat $OBJ/ssh_config |
225 | echo proxycommand ${SUDO} ${SSHD} -i -f $OBJ/sshd_proxy | 192 | echo proxycommand ${SSHD} -i -f $OBJ/sshd_proxy |
226 | ) > $OBJ/ssh_proxy | 193 | ) > $OBJ/ssh_proxy |
227 | 194 | ||
228 | # check proxy config | 195 | # check proxy config |
@@ -236,7 +203,7 @@ start_sshd () | |||
236 | 203 | ||
237 | trace "wait for sshd" | 204 | trace "wait for sshd" |
238 | i=0; | 205 | i=0; |
239 | while [ ! -f $PIDFILE -a $i -lt 10 ]; do | 206 | while [ ! -f $PIDFILE -a $i -lt 5 ]; do |
240 | i=`expr $i + 1` | 207 | i=`expr $i + 1` |
241 | sleep $i | 208 | sleep $i |
242 | done | 209 | done |