]> granicus.if.org Git - ipset/commitdiff
New test to verify that only the intended entries are deleted at hash types.
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 16 Feb 2017 19:52:04 +0000 (20:52 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 16 Feb 2017 19:52:04 +0000 (20:52 +0100)
tests/comment.t
tests/iphash.t
tests/runtest.sh

index 130a033e17a6674b73aae4201025b9467bac1442..46ba6c2f91c0f80eb008ad098b52a620d261f947 100644 (file)
@@ -37,7 +37,7 @@
 # Bitmap comment: Delete test set
 0 ipset destroy test
 # Bitmap comment: create set with timeout
-0 ipset create test bitmap:ip range 2.0.0.1-2.1.0.0 comment timeout 5
+0 ipset create test bitmap:ip range 2.0.0.1-2.1.0.0 comment timeout 3
 # Bitmap comment: Add multiple elements with default timeout
 0 for x in `seq 1 255`; do echo "add test 2.0.0.$x comment \\\"text message $x\\\""; done | ipset restore
 # Bitmap comment: Add multiple elements with zero timeout
index f7fdab39b97f9428aaf7728ab1e7efe592209b53..2f7efa5b400fce720942f9680a2dab70216dc5aa 100644 (file)
@@ -50,6 +50,8 @@
 0 ipset save test | sort > .foo.1
 # IP: Compare save and restore
 0 (sort iphash.t.large > .foo.2) && (cmp .foo.1 .foo.2)
+# IP: Delete all elements, one by one
+0 ipset list test | sed '1,/Members/d' | xargs -n1 ipset del test
 # IP: Delete test set
 0 ipset x test
 # Network: Create a set
index 6f5a250097d88c42a6494f4d1c57d76a3dcd0826..186f11ddeef6ddbe82e28ad1787f098e33ab9556 100755 (executable)
@@ -95,6 +95,8 @@ for types in $tests; do
        esac
        echo -ne "$types: $what: "
        cmd=`echo $cmd | sed "s|ipset|$ipset 2>.foo.err|"`
+       # For the case: ipset list | ... | xargs -n1 ipset
+       cmd=`echo $cmd | sed "s|ipset|$ipset|"`
        eval $cmd
        r=$?
        # echo $ret $r