diff options
author | Damien Miller <djm@mindrot.org> | 2002-05-01 05:17:33 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2002-05-01 05:17:33 +0200 |
commit | 38cd4358921bd674cace17d6bae71143b716027d (patch) | |
tree | 6c5a048f13a0a413821bf75b8ad1346b7408447a /regress/proto-version.sh | |
parent | [contrib/caldera/openssh.spec] update fixUP to reflect changes in sshd_config. (diff) | |
download | openssh-38cd4358921bd674cace17d6bae71143b716027d.tar.xz openssh-38cd4358921bd674cace17d6bae71143b716027d.zip |
- (djm) Import OpenBSD regression tests. Requires BSD make to run
Diffstat (limited to 'regress/proto-version.sh')
-rw-r--r-- | regress/proto-version.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/regress/proto-version.sh b/regress/proto-version.sh new file mode 100644 index 000000000..7dc616f5f --- /dev/null +++ b/regress/proto-version.sh @@ -0,0 +1,34 @@ +# $OpenBSD: proto-version.sh,v 1.3 2002/03/15 13:08:56 markus Exp $ +# Placed in the Public Domain. + +tid="sshd version with different protocol combinations" + +# we just start sshd in inetd mode and check the banner +check_version () +{ + version=$1 + expect=$2 + banner=`echo -n | ${SSHD} -o "Protocol=${version}" -i -f ${OBJ}/sshd_proxy` + case ${banner} in + SSH-1.99-*) + proto=199 + ;; + SSH-2.0-*) + proto=20 + ;; + SSH-1.5-*) + proto=15 + ;; + *) + proto=0 + ;; + esac + if [ ${expect} -ne ${proto} ]; then + fail "wrong protocol version ${banner} for ${version}" + fi +} + +check_version 2,1 199 +check_version 1,2 199 +check_version 2 20 +check_version 1 15 |