~ubuntu-branches/debian/jessie/ufw/jessie

« back to all changes in this revision

Viewing changes to tests/root/destructive/runtest.sh

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2009-07-25 07:01:56 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090725070156-sd66sj75tqtqow03
Tags: 0.28-2
debian/templates: also fix typo in master template

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
 
3
 
#    Copyright 2008-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 "These tests are destructive and should only be run in a virtual machine"
20
 
echo -n "Continue (y|N)? "
21
 
read ans
22
 
if [ "$ans" = "y" ] || [ "$ans" = "Y" ]; then
23
 
    echo "Continuing with destructive tests..."
24
 
else
25
 
    echo "Skipping destructive tests"
26
 
    exit 0
27
 
fi
28
 
 
29
 
trap "/sbin/iptables.bak /sbin/iptables" EXIT HUP INT QUIT TERM
30
 
echo "Bug #262451 (part 2)" >> $TESTTMP/result
31
 
do_cmd "0"  disable
32
 
do_cmd "0"  status
33
 
mv /sbin/iptables /sbin/iptables.bak || true
34
 
do_cmd "1"  enable
35
 
do_cmd "0"  status
36
 
mv /sbin/iptables.bak /sbin/iptables
37
 
trap - EXIT HUP INT QUIT TERM
38
 
 
39
 
trap "mount -t proc /proc /proc ; sed -i 's/do_checks = True/do_checks = False/' $TESTPATH/lib/python/ufw/backend.py" EXIT HUP INT QUIT TERM
40
 
echo "Bug #268084" >> $TESTTMP/result
41
 
sed -i 's/do_checks = False/do_checks = True/' $TESTPATH/lib/python/ufw/backend.py
42
 
do_cmd "0"  disable
43
 
umount /proc
44
 
 
45
 
mount | egrep -q '^/proc '
46
 
if [ "$?" == "0" ]; then
47
 
    echo "  Skipping (/proc still mounted)" >> $TESTTMP/result
48
 
else
49
 
    do_cmd "1"  enable
50
 
    do_cmd "0"  status
51
 
    do_cmd "0"  app update all
52
 
    mount -t proc /proc /proc
53
 
fi
54
 
sed -i 's/do_checks = True/do_checks = False/' $TESTPATH/lib/python/ufw/backend.py
55
 
trap - EXIT HUP INT QUIT TERM
56
 
 
57
 
# teardown
58
 
cleanup
59
 
 
60
 
exit 0