summaryrefslogtreecommitdiff
path: root/regress/usr.bin/ssh/proto-version.sh
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2002-02-15 14:41:39 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2002-02-15 14:41:39 +0000
commited23703db0799a89bc3ab93e5dafc07b58147ced (patch)
tree12d528e130ce9840a0feac364b874d6657767d0d /regress/usr.bin/ssh/proto-version.sh
parent1b469fee148ffc20c8465b58ea3865fb303f26d3 (diff)
we don't need a listening sshd for most of our tests, just
connect client and server w/o TCP: ssh -o 'proxycommand sshd -i -f $OBJ/sshd_proxy'
Diffstat (limited to 'regress/usr.bin/ssh/proto-version.sh')
-rw-r--r--regress/usr.bin/ssh/proto-version.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/regress/usr.bin/ssh/proto-version.sh b/regress/usr.bin/ssh/proto-version.sh
new file mode 100644
index 00000000000..6dec51f623e
--- /dev/null
+++ b/regress/usr.bin/ssh/proto-version.sh
@@ -0,0 +1,31 @@
+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