~ubuntu-branches/ubuntu/oneiric/ufw/oneiric

« back to all changes in this revision

Viewing changes to tests/bugs/apps/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 2009 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
echo "Bug (Samba IPV4 tuple text wrong when IPV6 is enabled" >> $TESTTMP/result
 
20
sed -i 's/IPV6=.*/IPV6=yes/' $TESTPATH/etc/default/ufw
 
21
do_cmd "0" allow in on eth1 to any app Samba
 
22
grep -A2 "tuple" $TESTSTATE/user.rules >> $TESTTMP/result
 
23
grep -A2 "tuple" $TESTSTATE/user6.rules >> $TESTTMP/result
 
24
do_cmd "0" null delete allow in on eth1 to any app Samba
 
25
sed -i 's/IPV6=.*/IPV6=no/' $TESTPATH/etc/default/ufw
 
26
 
 
27
echo "Bug (inserted Samba rules out of order when IPV6 is enabled" >> $TESTTMP/result
 
28
sed -i 's/IPV6=.*/IPV6=yes/' $TESTPATH/etc/default/ufw
 
29
do_cmd "0" allow in on eth0
 
30
do_cmd "0" allow to 192.168.0.2
 
31
do_cmd "0" allow to 192.168.0.3
 
32
do_cmd "0" allow in on eth1
 
33
do_cmd "0" allow in on eth2
 
34
do_cmd "0" insert 8 deny to any app Bind9
 
35
grep "^-A .*user-input" $TESTSTATE/user.rules >> $TESTTMP/result
 
36
grep "^-A .*user-input" $TESTSTATE/user6.rules >> $TESTTMP/result
 
37
 
 
38
do_cmd "0" delete deny to any app Bind9
 
39
do_cmd "0" insert 8 deny to any app Samba
 
40
grep "^-A .*user-input" $TESTSTATE/user.rules >> $TESTTMP/result
 
41
grep "^-A .*user-input" $TESTSTATE/user6.rules >> $TESTTMP/result
 
42
 
 
43
# this insert should look the same as the above
 
44
do_cmd "0" delete deny to any app Samba
 
45
do_cmd "0" insert 5 deny to any app Bind9
 
46
grep "^-A .*user-input" $TESTSTATE/user.rules >> $TESTTMP/result
 
47
grep "^-A .*user-input" $TESTSTATE/user6.rules >> $TESTTMP/result
 
48
 
 
49
do_cmd "0" delete deny to any app Bind9
 
50
do_cmd "0" insert 5 deny to any app Samba
 
51
grep "^-A .*user-input" $TESTSTATE/user.rules >> $TESTTMP/result
 
52
grep "^-A .*user-input" $TESTSTATE/user6.rules >> $TESTTMP/result
 
53
 
 
54
do_cmd "0" delete allow in on eth0
 
55
do_cmd "0" delete allow to 192.168.0.2
 
56
do_cmd "0" delete allow to 192.168.0.3
 
57
do_cmd "0" delete allow in on eth1
 
58
do_cmd "0" delete allow in on eth2
 
59
do_cmd "0" delete deny to any app Samba
 
60
grep "^-A .*user-input" $TESTSTATE/user.rules >> $TESTTMP/result
 
61
grep "^-A .*user-input" $TESTSTATE/user6.rules >> $TESTTMP/result
 
62
sed -i 's/IPV6=.*/IPV6=no/' $TESTPATH/etc/default/ufw
 
63
 
 
64
echo "Bug #407810" >> $TESTTMP/result
 
65
cp "$TESTPATH/etc/ufw/applications.d/samba" "$TESTPATH/etc/ufw/applications.d/bug407810"
 
66
sed -i 's/Samba/bug407810/' "$TESTPATH/etc/ufw/applications.d/bug407810"
 
67
do_cmd "0" app info bug407810
 
68
do_cmd "0" null allow bug407810
 
69
grep "^-A .*user-input" $TESTSTATE/user.rules >> $TESTTMP/result
 
70
rm -f "$TESTPATH/etc/ufw/applications.d/bug407810"
 
71
do_cmd "0" null delete allow bug407810
 
72
grep "^-A .*user-input" $TESTSTATE/user.rules >> $TESTTMP/result
 
73
 
 
74
exit 0