Call for testing.

Gert Doering gert at greenie.muc.de
Wed Feb 27 01:05:15 EST 2002


Hi,

On Tue, Feb 26, 2002 at 02:05:05PM +0100, Markus Friedl wrote:
> mkdir tmp && cd tmp
> CVS_RSH=ssh cvs -d anoncvs at anoncvs.be.openbsd.org:/cvs get src/regress/usr.bin/ssh

Thanks.

> the makefile needs probably some modifications on non-openbsd

Not only "probably" :-) - .CURDIR is a BSD-Makeism, and so is:

#.for t in ${LTESTS}
#REGRESSTARGETS+=t-${t}
#t-${t}:
#       sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/${t}.sh
#.endfor

#.include <bsd.regress.mk>

Commenting these out and replacing it with:

ltest:
        for t in $(LTESTS) ; do \
            sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$$t.sh ; \
        done

most "T<number>" tests run, except for:

T3:

ssh-keygen -ef /gnulocal/src/openssh_regress/regress/rsa_openssh.pub |\
        ssh-keygen -if /dev/stdin |\
        diff - /gnulocal/src/openssh_regress/regress/rsa_openssh.pub
/dev/stdin: No such file or directory
0a1
> ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDsilwKcaKN6wSMNd1WgQ9+HRqQEkD0kCTVttrazGu0OhBU3Uko+dFD1Ip0CxdXmN25JQWxOYF7h/Ocu8P3jzv3RTX87xKR0YzlXTLX+SLtF/ySebS3xWPrlfRUDhh03hR5V+8xxvvy9widPYKw/oItwGSueOsEq1LTczCDv2dAjQ==
gmake: *** [t3] Error 1

(no /dev/stdin on AIX)

T6:

gd at hilb0:/gnulocal/src/openssh_regress/regress> gmake t6
ssh-keygen -if /gnulocal/src/openssh_regress/regress/dsa_ssh2.prv > t6.out1
ssh_dss_sign: sign failed
xrealloc: out of memory (new_size 4026587360 bytes)
gmake: *** [t6] Error 255

(oops?!)


As for test-exec.sh, this is more tricky... - it's heavily using "echo -n"
to suppress newlines, and this does not work on SysV "echo"'s (you have
to do "echo 'bla\c'" there).

It might work to call the script with bash, which can do both, but I
have no bash installed here (yet), and AIX /bin/sh and /bin/ksh can't 
do "echo -n".

For testing, I just copied "GNU echo", which understands -n, and 
hard-coded "./gecho" into the *.sh scripts.

Further, I had to remove "Kerberosauthentication no" from the generated
ssh_config files, as the locally built ssh does not have that, and add 
"StrictModes no" to sshd_config (our shared build/source tree is group-
writeable, which I can't change).

* connect.sh - works with "SUDO=sudo" set
* proxy-connect.sh - works if run as root, doesn't work as normal user
                     (I couldn't determine whether this is a bug or
		     whether it's supposed to not work as non-root user)
* all other ltest's up to pipe-head run fine as "root".

* agent fails with a confusing error message, which could be caused by
  our non-typical setup

  /usr/bin/bsh: sshd:  not found.
  ssh_exchange_identification: Connection closed by remote host
  agent fwd proto 1 failed (exit code 0)
  /usr/bin/bsh: sshd:  not found.
  ssh_exchange_identification: Connection closed by remote host
  agent fwd proto 2 failed (exit code 0)
  failed simple agent test

* ssh-keyscan fails (root and non-root) with

  ssh-keyscan -t dsa failed with: 255
  failed keyscan

* forwarding works as root and non-root ("ok local and remote forwarding")

My diffs are appended below.

gert
-------- snip --------
Index: Makefile
===================================================================
RCS file: /cvs/src/regress/usr.bin/ssh/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- Makefile	22 Feb 2002 12:31:35 -0000	1.5
+++ Makefile	26 Feb 2002 14:06:21 -0000
@@ -23,6 +23,10 @@
 		rsa-agent rsa-agent.pub rsa1-agent rsa1-agent.pub \
 		ls.copy
 
+.CURDIR=/gnulocal/src/openssh_regress/regress
+.OBJDIR=`pwd`
+all: $(REGRESSTARGETS)
+
 t1:
 	ssh-keygen -if ${.CURDIR}/rsa_ssh2.prv | diff - ${.CURDIR}/rsa_openssh.prv
 
@@ -57,10 +61,15 @@
 	ssh-keygen -lf t7.out > /dev/null
 	ssh-keygen -Bf t7.out > /dev/null
 
-.for t in ${LTESTS}
-REGRESSTARGETS+=t-${t}
-t-${t}:
-	sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/${t}.sh
-.endfor
+ltest:
+	for t in $(LTESTS) ; do \
+    	    sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$$t.sh ; \
+	done 
+
+#.for t in ${LTESTS}
+#REGRESSTARGETS+=t-${t}
+#t-${t}:
+#	sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/${t}.sh
+#.endfor
 
-.include <bsd.regress.mk>
+#.include <bsd.regress.mk>
Index: agent.sh
===================================================================
RCS file: /cvs/src/regress/usr.bin/ssh/agent.sh,v
retrieving revision 1.5
diff -u -r1.5 agent.sh
--- agent.sh	17 Feb 2002 22:22:45 -0000	1.5
+++ agent.sh	26 Feb 2002 14:06:21 -0000
@@ -19,7 +19,7 @@
 		fail "ssh-add -l did not fail with exit code 1"
 	fi
 	trace "overwrite authorized keys"
-	echo -n > $OBJ/authorized_keys_$USER
+	./gecho -n > $OBJ/authorized_keys_$USER
 	for t in rsa rsa1; do
 		# generate user key for agent
 		rm -f $OBJ/$t-agent
Index: proto-version.sh
===================================================================
RCS file: /cvs/src/regress/usr.bin/ssh/proto-version.sh,v
retrieving revision 1.2
diff -u -r1.2 proto-version.sh
--- proto-version.sh	16 Feb 2002 01:09:47 -0000	1.2
+++ proto-version.sh	26 Feb 2002 14:06:21 -0000
@@ -8,7 +8,7 @@
 {
 	version=$1
 	expect=$2
-	banner=`echo -n | sshd -o "Protocol=${version}" -i -f ${OBJ}/sshd_proxy`
+	banner=`./gecho -n | sshd -o "Protocol=${version}" -i -f ${OBJ}/sshd_proxy`
 	case ${banner} in
 	SSH-1.99-*)
 		proto=199
Index: ssh-com.sh
===================================================================
RCS file: /cvs/src/regress/usr.bin/ssh/ssh-com.sh,v
retrieving revision 1.2
diff -u -r1.2 ssh-com.sh
--- ssh-com.sh	16 Feb 2002 01:09:47 -0000	1.2
+++ ssh-com.sh	26 Feb 2002 14:06:21 -0000
@@ -63,7 +63,7 @@
 
 # convert and append DSA hostkey
 (
-	echo -n 'ssh2-localhost-with-alias,127.0.0.1,::1 '
+	./gecho -n 'ssh2-localhost-with-alias,127.0.0.1,::1 '
 	ssh-keygen -if ${SRC}/dsa_ssh2.pub
 ) >> $OBJ/known_hosts
 
Index: test-exec.sh
===================================================================
RCS file: /cvs/src/regress/usr.bin/ssh/test-exec.sh,v
retrieving revision 1.9
diff -u -r1.9 test-exec.sh
--- test-exec.sh	18 Feb 2002 14:30:12 -0000	1.9
+++ test-exec.sh	26 Feb 2002 14:06:21 -0000
@@ -3,8 +3,8 @@
 
 PORT=4242
 USER=`id -un`
-SUDO=
-#SUDO=sudo
+#SUDO=
+SUDO=sudo
 
 OBJ=$1
 if [ "x$OBJ" = "x" ]; then
@@ -72,7 +72,7 @@
 
 fatal ()
 {
-	echo -n "FATAL: "
+	./gecho -n "FATAL: "
 	fail "$@"
 	cleanup
 	exit $RESULT
@@ -91,6 +91,7 @@
 	PidFile			$PIDFILE
 	AuthorizedKeysFile	$OBJ/authorized_keys_%u
 	LogLevel		QUIET
+	StrictModes		no
 EOF
 
 # server config for proxy connects
@@ -112,7 +113,6 @@
 	PubkeyAuthentication	yes
 	ChallengeResponseAuthentication	no
 	HostbasedAuthentication	no
-	KerberosAuthentication	no
 	PasswordAuthentication	no
 	RhostsAuthentication	no
 	RhostsRSAAuthentication	no
@@ -128,7 +128,7 @@
 
 	# known hosts file for client
 	(
-		echo -n 'localhost-with-alias,127.0.0.1,::1 '
+		./gecho -n 'localhost-with-alias,127.0.0.1,::1 '
 		cat $OBJ/$t.pub
 	) >> $OBJ/known_hosts
 

-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             gert at greenie.muc.de
fax: +49-89-35655025                        gert.doering at physik.tu-muenchen.de



More information about the openssh-unix-dev mailing list