diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2017-02-16 20:52:04 +0100 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2017-02-16 20:52:04 +0100 |
commit | 414d819ebee11b52374f566434220887eb8246b7 (patch) | |
tree | 23d872397aee6468aa6c2946b5807617976558f8 | |
parent | 728fed0f689c76cb5cd77499b022764e93d91932 (diff) |
New test to verify that only the intended entries are deleted at hash types.
-rw-r--r-- | tests/comment.t | 2 | ||||
-rw-r--r-- | tests/iphash.t | 2 | ||||
-rwxr-xr-x | tests/runtest.sh | 2 |
3 files changed, 5 insertions, 1 deletions
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 |