~ubuntu-branches/ubuntu/maverick/ufw/maverick

« back to all changes in this revision

Viewing changes to tests/good/reports/runtest.sh

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-02-17 09:13:35 UTC
  • mfrom: (30.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20100217091335-uv80tqs8q5r4scfs
Tags: 0.30pre1-0ubuntu1
* Pull snapshot from trunk for upcoming release. Fixes:
  LP: #436608
  - run_tests.sh: temporarily disable 'skipped' check since the pre-release
    has one skipped test
* debian/control: drop versioned depends on iptables. This helps with
  backporting now that the test suite can handle it
* debian/rules: pass interpreter to run_tests.sh
* add rsyslog support

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
#    Copyright 2010 Canonical Ltd.
 
4
#
 
5
#    This program is free software: you can redistribute it and/or modify
 
6
#    it under the terms of the GNU General Public License version 3,
 
7
#    as published by the Free Software Foundation.
 
8
#
 
9
#    This program is distributed in the hope that it will be useful,
 
10
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
#    GNU General Public License for more details.
 
13
#
 
14
#    You should have received a copy of the GNU General Public License
 
15
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 
 
17
source "$TESTPATH/../testlib.sh"
 
18
 
 
19
exit 0
 
20
 
 
21
echo "show listening" >> $TESTTMP/result
 
22
echo "(update util.py to use our cached output)" >> $TESTTMP/result
 
23
sed -i "s#rc, report = cmd.* '-enlp'.*#rc, report = cmd(['cat', '$TESTPATH/../good/reports/netstat.enlp'])#" $TESTPATH/lib/python/ufw/util.py
 
24
sed -i "s#item\['exe'\] = get_exe.*#item['exe'] = 'REMOVED_FOR_UFW_TEST'#" $TESTPATH/lib/python/ufw/util.py
 
25
sed -i "s#proc = '/proc/net/if_inet6'#proc = '$TESTPATH/../good/reports/proc_net_if_inet6'#" $TESTPATH/lib/python/ufw/util.py
 
26
sed -i "s#proc = '/proc/net/dev'#proc = '$TESTPATH/../good/reports/proc_net_dev'#" $TESTPATH/lib/python/ufw/util.py
 
27
sed -i "s#\(.*\)\(addr = .* 0x8915,.*\)#\\1if ifname == 'eth0':\n\\1\\1addr = '10.0.2.9'\n\\1elif ifname == 'eth1':\n\\1\\1addr = '10.0.2.101'\n\\1else:\n\\1\\1raise IOError\n    return normalize_address(addr, v6)[0]\n    \\2#" $TESTPATH/lib/python/ufw/util.py
 
28
 
 
29
do_cmd "0" show listening
 
30
 
 
31
echo "show listening with rules" >> $TESTTMP/result
 
32
sed -i "s/IPV6=.*/IPV6=yes/" $TESTPATH/etc/default/ufw
 
33
 
 
34
for i in "" "in on eth0" ; do
 
35
    if [ -z "$i" ]; then
 
36
        do_cmd "0" null allow in 123
 
37
        do_cmd "0" null allow in OpenNTPD
 
38
        do_cmd "0" null allow in 123/tcp
 
39
    else
 
40
        do_cmd "0" null allow out 123
 
41
        do_cmd "0" null allow out 123/udp
 
42
        do_cmd "0" null allow out 123/tcp
 
43
    fi
 
44
 
 
45
    do_cmd "0" null allow $i to any
 
46
    do_cmd "0" null allow $i to any proto udp
 
47
    do_cmd "0" null allow $i to any proto tcp
 
48
 
 
49
    do_cmd "0" null allow $i to 10.0.2.101
 
50
    do_cmd "0" null allow $i to 10.0.2.9
 
51
    do_cmd "0" null allow $i to 10.0.0.0/16
 
52
    do_cmd "0" null allow $i to 10.0.2.0/24
 
53
    do_cmd "0" null allow $i to 10.0.3.0/24
 
54
    do_cmd "0" null allow $i to fe80::211:aaaa:bbbb:d54c
 
55
 
 
56
    do_cmd "0" null allow $i to 10.0.2.101 port 123
 
57
    do_cmd "0" null allow $i to 10.0.0.0/16 port 123
 
58
    do_cmd "0" null allow $i to 10.0.2.0/24 port 123
 
59
    do_cmd "0" null allow $i to 10.0.3.0/24 port 123
 
60
    do_cmd "0" null allow $i to fe80::211:aaaa:bbbb:d54c port 123
 
61
 
 
62
    do_cmd "0" null allow $i to 10.0.2.101 port 123 proto udp
 
63
    do_cmd "0" null allow $i to 10.0.0.0/16 app OpenNTPD
 
64
    do_cmd "0" null allow $i to 10.0.2.0/24 port 123 proto udp
 
65
    do_cmd "0" null allow $i to 10.0.3.0/24 port 123 proto udp
 
66
    do_cmd "0" null allow $i to fe80::211:aaaa:bbbb:d54c port 123 proto udp
 
67
 
 
68
    do_cmd "0" null allow $i to 10.0.2.101 port 123 proto tcp
 
69
    do_cmd "0" null allow $i to 10.0.0.0/16 port 123 proto tcp
 
70
    do_cmd "0" null allow $i to 10.0.2.0/24 port 123 proto tcp
 
71
    do_cmd "0" null allow $i to 10.0.3.0/24 port 123 proto tcp
 
72
    do_cmd "0" null allow $i to fe80::211:aaaa:bbbb:d54c port 123 proto tcp
 
73
done
 
74
 
 
75
do_cmd "0" show listening
 
76
 
 
77
exit 0