summaryrefslogtreecommitdiff
path: root/fw/test/fwtest.rc
diff options
context:
space:
mode:
Diffstat (limited to 'fw/test/fwtest.rc')
-rwxr-xr-xfw/test/fwtest.rc20
1 files changed, 20 insertions, 0 deletions
diff --git a/fw/test/fwtest.rc b/fw/test/fwtest.rc
index f687295..15ea531 100755
--- a/fw/test/fwtest.rc
+++ b/fw/test/fwtest.rc
@@ -326,6 +326,26 @@ deny=* log=yes
r=`{wr $mtpt/ctl 'delete 0'}
check 'delete 0 is refused' refused $"r
+ # A rule set used to be formatted into 64K and clipped, and since
+ # every ctl edit works by formatting the set out, editing the text
+ # and parsing it back, editing one rule past the limit deleted
+ # every rule after it. This set is about 104K.
+ awk 'BEGIN{for(i = 0; i < 2000; i++)
+ printf "allow=out\tproto=tcp\tip=10.9.0.0/24\tport=%d\n", 1000+i}' \
+ > $tmp/big.ndb
+ r=`{wr $mtpt/ctl 'reload '^$tmp/big.ndb}
+ check 'a rule set larger than 64K loads' ok $"r
+ r=`{grep -c . $mtpt/rules}
+ check 'and all of it comes back' 2000 $"r
+ r=`{wr $mtpt/ctl 'append deny=out proto=udp'}
+ check 'and survives an edit' ok $"r
+ r=`{grep -c . $mtpt/rules}
+ check 'with nothing lost off the end' 2001 $"r
+ r=`{wr $mtpt/ctl 'save '^$tmp/saved.ndb}
+ check 'and saves' ok $"r
+ r=`{grep -c . $tmp/saved.ndb}
+ check 'all of itself' 2001 $"r
+
stopfw $nA $nB
}