Debian Codegraph @

check-run2

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-run2 -- Shell script to test ike-scan to localhost
21 #
22 # Author: Roy Hills
23 # Date: 13 January 2004
24 #
25 # This shell script runs ike-scan against a port on localhost (127.0.0.1),
26 # which is unlikely to be listening, and checks that it reports correctly.
27 #
28 TMPFILE=/tmp/ike-scan-test.$$.tmp
29 #
30 echo "Checking ike-scan --sport=0 --dport=33434 127.0.0.1 ..."
31 $srcdir/ike-scan --nodns --retry=1 --sport=0 --dport=33434 127.0.0.1 >$TMPFILE 2>&1
32 if test $? -ne 0; then
33 rm -f $TMPFILE
34 echo "FAILED"
35 exit 1
36 fi
37 grep '^Ending ike-scan.* 0 returned handshake; 0 returned notify$' $TMPFILE >/dev/null
38 if test $? -ne 0; then
39 rm -f $TMPFILE
40 echo "FAILED"
41 exit 1
42 fi
43 echo "ok"
44 #
45 rm -f $TMPFILE