summaryrefslogtreecommitdiff
path: root/regress/test-exec.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r--regress/test-exec.sh35
1 files changed, 30 insertions, 5 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index 986d99287..70250acd7 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -1,9 +1,14 @@
1# $OpenBSD: test-exec.sh,v 1.15 2004/02/24 16:56:30 markus Exp $ 1# $OpenBSD: test-exec.sh,v 1.23 2004/06/25 01:25:12 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4PORT=4242
5#SUDO=sudo 4#SUDO=sudo
6 5
6if [ ! -z "$TEST_SSH_PORT" ]; then
7 PORT="$TEST_SSH_PORT"
8else
9 PORT=4242
10fi
11
7if [ -x /usr/ucb/whoami ]; then 12if [ -x /usr/ucb/whoami ]; then
8 USER=`/usr/ucb/whoami` 13 USER=`/usr/ucb/whoami`
9elif whoami >/dev/null 2>&1; then 14elif whoami >/dev/null 2>&1; then
@@ -47,6 +52,7 @@ SSHKEYGEN=ssh-keygen
47SSHKEYSCAN=ssh-keyscan 52SSHKEYSCAN=ssh-keyscan
48SFTP=sftp 53SFTP=sftp
49SFTPSERVER=/usr/libexec/openssh/sftp-server 54SFTPSERVER=/usr/libexec/openssh/sftp-server
55SCP=scp
50 56
51if [ "x$TEST_SSH_SSH" != "x" ]; then 57if [ "x$TEST_SSH_SSH" != "x" ]; then
52 SSH="${TEST_SSH_SSH}" 58 SSH="${TEST_SSH_SSH}"
@@ -72,10 +78,16 @@ fi
72if [ "x$TEST_SSH_SFTPSERVER" != "x" ]; then 78if [ "x$TEST_SSH_SFTPSERVER" != "x" ]; then
73 SFTPSERVER="${TEST_SSH_SFTPSERVER}" 79 SFTPSERVER="${TEST_SSH_SFTPSERVER}"
74fi 80fi
81if [ "x$TEST_SSH_SCP" != "x" ]; then
82 SCP="${TEST_SSH_SCP}"
83fi
84
85# Path to sshd must be absolute for rexec
86SSHD=`which sshd`
75 87
76# these should be used in tests 88# these should be used in tests
77export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER 89export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER SCP
78#echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER 90#echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER $SCP
79 91
80# helper 92# helper
81echon() 93echon()
@@ -156,15 +168,23 @@ trap fatal 3 2
156 168
157# create server config 169# create server config
158cat << EOF > $OBJ/sshd_config 170cat << EOF > $OBJ/sshd_config
171 StrictModes no
159 Port $PORT 172 Port $PORT
160 ListenAddress 127.0.0.1 173 ListenAddress 127.0.0.1
161 #ListenAddress ::1 174 #ListenAddress ::1
162 PidFile $PIDFILE 175 PidFile $PIDFILE
163 AuthorizedKeysFile $OBJ/authorized_keys_%u 176 AuthorizedKeysFile $OBJ/authorized_keys_%u
164 LogLevel QUIET 177 LogLevel QUIET
165 StrictModes no 178 AcceptEnv _XXX_TEST_*
179 AcceptEnv _XXX_TEST
180 Subsystem sftp $SFTPSERVER
166EOF 181EOF
167 182
183if [ ! -z "$TEST_SSH_SSHD_CONFOPTS" ]; then
184 trace "adding sshd_config option $TEST_SSH_SSHD_CONFOPTS"
185 echo "$TEST_SSH_SSHD_CONFOPTS" >> $OBJ/sshd_config
186fi
187
168# server config for proxy connects 188# server config for proxy connects
169cp $OBJ/sshd_config $OBJ/sshd_proxy 189cp $OBJ/sshd_config $OBJ/sshd_proxy
170 190
@@ -190,6 +210,11 @@ Host *
190 StrictHostKeyChecking yes 210 StrictHostKeyChecking yes
191EOF 211EOF
192 212
213if [ ! -z "$TEST_SSH_SSH_CONFOPTS" ]; then
214 trace "adding ssh_config option $TEST_SSH_SSHD_CONFOPTS"
215 echo "$TEST_SSH_SSH_CONFOPTS" >> $OBJ/ssh_config
216fi
217
193rm -f $OBJ/known_hosts $OBJ/authorized_keys_$USER 218rm -f $OBJ/known_hosts $OBJ/authorized_keys_$USER
194 219
195trace "generate keys" 220trace "generate keys"