Debian Codegraph @

check-run3

raw
1 #!/bin/sh
2 # The IKE Scanner (ike-scan) is Copyright (C) 2003-2007 Roy Hills,
3 # NTA Monitor Ltd.
4 #
5 # This file is part of ike-scan.
6 #
7 # ike-scan is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # ike-scan is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with ike-scan. If not, see <http://www.gnu.org/licenses/>.
19 #
20 # check-run3 -- Shell script to test ike-scan's lists
21 #
22 # Author: Roy Hills
23 # Date: 13 January 2004
24 #
25 # This shell script runs ike-scan with the highest verbose level to display
26 # the contents of the internal lists: the host list, the backoff list, and
27 # the vendor id patterns list. It then checks that all of these lists are
28 # displayed.
29 #
30 TMPFILE=/tmp/ike-scan-test.$$.tmp
31 #
32 echo "Checking ike-scan internal lists ..."
33 $srcdir/ike-scan --nodns --sport=0 --dport=33434 -v -v -v --showbackoff \
34 --retry=1 --patterns=$srcdir/ike-backoff-patterns \
35 --vidpatterns=$srcdir/ike-vendor-ids 127.0.0.1 >$TMPFILE 2>&1
36 if test $? -ne 0; then
37 rm -f $TMPFILE
38 echo "FAILED - ike-scan returned non-zero exit code"
39 exit 1
40 fi
41 grep '^Total of [0-9]* host entries\.$' $TMPFILE >/dev/null
42 if test $? -ne 0; then
43 rm -f $TMPFILE
44 echo "FAILED - host list summary not found"
45 exit 1
46 fi
47 grep '^Total of [0-9]* backoff pattern entries\.$' $TMPFILE >/dev/null
48 if test $? -ne 0; then
49 rm -f $TMPFILE
50 echo "FAILED - backoff list summary not found"
51 exit 1
52 fi
53 grep '^Total of [0-9]* Vendor ID pattern entries\.$' $TMPFILE >/dev/null
54 if test $? -ne 0; then
55 rm -f $TMPFILE
56 echo "FAILED - vendor id list summary not found"
57 exit 1
58 fi
59 echo "ok"
60 #
61 rm -f $TMPFILE