From 414d819ebee11b52374f566434220887eb8246b7 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Thu, 16 Feb 2017 20:52:04 +0100 Subject: New test to verify that only the intended entries are deleted at hash types. --- tests/comment.t | 2 +- tests/iphash.t | 2 ++ tests/runtest.sh | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/comment.t b/tests/comment.t index 130a033..46ba6c2 100644 --- a/tests/comment.t +++ b/tests/comment.t @@ -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 diff --git a/tests/iphash.t b/tests/iphash.t index f7fdab3..2f7efa5 100644 --- a/tests/iphash.t +++ b/tests/iphash.t @@ -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 diff --git a/tests/runtest.sh b/tests/runtest.sh index 6f5a250..186f11d 100755 --- a/tests/runtest.sh +++ b/tests/runtest.sh @@ -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 -- cgit v1.2.3