3
# Copyright 2008-2009 Canonical Ltd.
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.
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.
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/>.
17
source "$TESTPATH/../testlib.sh"
19
echo "These tests are destructive and should only be run in a virtual machine"
20
echo -n "Continue (y|N)? "
22
if [ "$ans" = "y" ] || [ "$ans" = "Y" ]; then
23
echo "Continuing with destructive tests..."
25
echo "Skipping destructive tests"
29
trap "/sbin/iptables.bak /sbin/iptables" EXIT HUP INT QUIT TERM
30
echo "Bug #262451 (part 2)" >> $TESTTMP/result
33
mv /sbin/iptables /sbin/iptables.bak || true
36
mv /sbin/iptables.bak /sbin/iptables
37
trap - EXIT HUP INT QUIT TERM
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
45
mount | egrep -q '^/proc '
46
if [ "$?" == "0" ]; then
47
echo " Skipping (/proc still mounted)" >> $TESTTMP/result
51
do_cmd "0" app update all
52
mount -t proc /proc /proc
54
sed -i 's/do_checks = True/do_checks = False/' $TESTPATH/lib/python/ufw/backend.py
55
trap - EXIT HUP INT QUIT TERM