blob: 0b9c9500749d0677a432bdb6da631edd97c53686 [file] [log] [blame]
Darren Tucker22991ba2004-01-30 12:58:51 +11001# $OpenBSD: banner.sh,v 1.2 2003/10/11 11:49:49 dtucker Exp $
Darren Tuckerdc001a52003-10-08 17:47:19 +10002# Placed in the Public Domain.
3
4tid="banner"
5echo "Banner $OBJ/banner.in" >> $OBJ/sshd_proxy
6
Darren Tucker22991ba2004-01-30 12:58:51 +11007rm -f $OBJ/banner.out $OBJ/banner.in $OBJ/empty.in
8touch $OBJ/empty.in
9
10trace "test missing banner file"
11verbose "test $tid: missing banner file"
12( ${SSH} -2 -F $OBJ/ssh_proxy otherhost true 2>$OBJ/banner.out && \
13 cmp $OBJ/empty.in $OBJ/banner.out ) || \
14 fail "missing banner file"
15
Darren Tuckerdc001a52003-10-08 17:47:19 +100016for s in 0 10 100 1000 10000 100000 ; do
17 if [ "$s" = "0" ]; then
18 # create empty banner
Darren Tuckerdc001a52003-10-08 17:47:19 +100019 touch $OBJ/banner.in
20 elif [ "$s" = "10" ]; then
21 # create 10-byte banner file
22 echo "abcdefghi" >$OBJ/banner.in
23 else
24 # increase size 10x
25 cp $OBJ/banner.in $OBJ/banner.out
26 for i in 0 1 2 3 4 5 6 7 8 ; do
27 cat $OBJ/banner.out >> $OBJ/banner.in
28 done
29 fi
30
31 trace "test banner size $s"
32 verbose "test $tid: size $s"
Darren Tucker22991ba2004-01-30 12:58:51 +110033 ( ${SSH} -2 -F $OBJ/ssh_proxy otherhost true 2>$OBJ/banner.out && \
34 cmp $OBJ/banner.in $OBJ/banner.out ) || \
35 fail "banner size $s mismatch"
Darren Tuckerdc001a52003-10-08 17:47:19 +100036done
37
Darren Tucker22991ba2004-01-30 12:58:51 +110038trace "test suppress banner (-q)"
39verbose "test $tid: suppress banner (-q)"
40( ${SSH} -q -2 -F $OBJ/ssh_proxy otherhost true 2>$OBJ/banner.out && \
41 cmp $OBJ/empty.in $OBJ/banner.out ) || \
42 fail "suppress banner (-q)"
43
44rm -f $OBJ/banner.out $OBJ/banner.in $OBJ/empty.in