~ubuntu-branches/ubuntu/trusty/ufw/trusty-proposed

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-01-30 09:42:05 UTC
  • mfrom: (30.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100130094205-8wsowzipc32k48yy
Tags: 0.29.3-0ubuntu1
* New upstream release. Fixes:
  LP: #490366
  LP: #512131
  LP: #488032
  LP: #513387
* debian/ufw.upstart.ubuntu: start before an interface receives traffic
* debian/postinst: don't sed or chmod a file that doesn't exist
  (LP: #503039)
* debian/after*.rules.md5sum: updated for ucf (added additional sums for
  people using the workaround in LP: #488032)

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
    sed -i "s/IPV6=.*/IPV6=$ipv6/" $TESTPATH/etc/default/ufw
135
135
    for i in "" off on low medium high full ; do
136
136
        do_cmd "0" nostats disable
137
 
        do_cmd "0" null enable
138
137
        if [ -n "$i" ]; then
139
138
            do_cmd "0" null logging $i
140
139
        fi
 
140
        do_cmd "0" null enable
141
141
        iptables-save | grep '^-' > $TESTTMP/ipt.enable
142
142
        ip6tables-save | grep '^-' > $TESTTMP/ip6t.enable
143
143
 
159
159
    done
160
160
done
161
161
 
 
162
echo "Bug #512131" >> $TESTTMP/result
 
163
for i in low on medium high full off off ; do
 
164
    do_cmd "0" null logging $i
 
165
    e="0"
 
166
    if [ "$i" = "off" ]; then
 
167
        e="1"
 
168
    fi
 
169
    iptables-save | grep -q 'UFW LIMIT BLOCK' $TESTPATH/lib/ufw/user.rules
 
170
    rc="$?"
 
171
    if [ "$rc" != "$e" ]; then
 
172
        echo "$i: got '$rc', expected '$e'"
 
173
        exit 1
 
174
    fi
 
175
done
 
176
 
 
177
echo "Bug #513387" >> $TESTTMP/result
 
178
do_cmd "0" nostats disable
 
179
$TESTSTATE/ufw-init flush-all >/dev/null
 
180
do_cmd "0" nostats enable
 
181
for b in INPUT OUTPUT FORWARD; do
 
182
    suffix=`echo $b | tr [A-Z] [a-z]`
 
183
    echo "$count: iptables -L $b -n | egrep -q 'ufw-after-logging-$suffix'" >> $TESTTMP/result
 
184
    iptables -L "$b" -n | egrep -q "ufw-after-logging-$suffix" || {
 
185
        echo "'iptables -L $b -n' does not contain 'ufw-after-logging-$suffix'"
 
186
        exit 1
 
187
    }
 
188
    echo "" >> $TESTTMP/result
 
189
    echo "" >> $TESTTMP/result
 
190
    let count=count+1
 
191
done
 
192
 
162
193
# teardown
163
194
cleanup
164
195