From 202ca992312b908e410bed9a480e715e3bca660b Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Fri, 8 Apr 2011 15:53:02 +0200 Subject: [PATCH] Testsuite changes: keep temporary files Keep temporary files in the tests and erase them only after successfully running the testsuite. This makes simpler to analyze failed tests. --- tests/bitmap:ip.t | 14 +++++++------- tests/hash:ip,port,ip.t | 4 ++-- tests/hash:ip,port,net.t | 2 +- tests/hash:ip,port.t | 6 +++--- tests/hash:ip.t | 8 ++++---- tests/hash:ip6,port,ip6.t | 4 ++-- tests/hash:ip6,port,net6.t | 2 +- tests/hash:ip6,port.t | 4 ++-- tests/hash:ip6.t | 12 ++++++------ tests/hash:net,port.t | 2 +- tests/hash:net.t | 4 ++-- tests/hash:net6,port.t | 6 +++--- tests/hash:net6.t | 4 ++-- tests/iphash.t | 10 +++++----- tests/ipmap.t | 10 +++++----- tests/ipporthash.t | 4 ++-- tests/ipportiphash.t | 4 ++-- tests/ipportnethash.t | 4 ++-- tests/iptree.t | 2 +- tests/iptreemap.t | 2 +- tests/macipmap.t | 8 ++++---- tests/nethash.t | 2 +- tests/portmap.t | 8 ++++---- tests/runtest.sh | 2 +- tests/setlist.t | 8 ++++---- 25 files changed, 68 insertions(+), 68 deletions(-) diff --git a/tests/bitmap:ip.t b/tests/bitmap:ip.t index 271bf893..341ebf05 100644 --- a/tests/bitmap:ip.t +++ b/tests/bitmap:ip.t @@ -37,13 +37,13 @@ # Range: List set 0 ipset list test | sed 's/timeout ./timeout x/' > .foo # Range: Check listing -0 diff -I 'Size in memory.*' .foo bitmap:ip.t.list4 && rm .foo +0 diff -I 'Size in memory.*' .foo bitmap:ip.t.list4 # Sleep 5s so that entries can time out 0 sleep 5s # Range: List set after timeout 0 ipset list test > .foo # Range: Check listing -0 diff -I 'Size in memory.*' .foo bitmap:ip.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo bitmap:ip.t.list0 # Range: Flush test set 0 ipset flush test # Range: Delete test set @@ -79,13 +79,13 @@ # Network: List set 0 ipset list test | sed 's/timeout ./timeout x/' > .foo # Network: Check listing -0 diff -I 'Size in memory.*' .foo bitmap:ip.t.list5 && rm .foo +0 diff -I 'Size in memory.*' .foo bitmap:ip.t.list5 # Sleep 5s so that entries can time out 0 sleep 5s # Network: List set 0 ipset list test > .foo # Network: Check listing -0 diff -I 'Size in memory.*' .foo bitmap:ip.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo bitmap:ip.t.list1 # Network: Flush test set 0 ipset flush test # Network: Delete test set @@ -121,13 +121,13 @@ # Subnets: List set 0 ipset list test | sed 's/timeout ./timeout x/' > .foo # Subnets: Check listing -0 diff -I 'Size in memory.*' .foo bitmap:ip.t.list6 && rm .foo +0 diff -I 'Size in memory.*' .foo bitmap:ip.t.list6 # Sleep 5s so that entries can time out 0 sleep 5s # Subnets: List set 0 ipset list test > .foo # Subnets: Check listing -0 diff -I 'Size in memory.*' .foo bitmap:ip.t.list2 && rm .foo +0 diff -I 'Size in memory.*' .foo bitmap:ip.t.list2 # Subnets: Flush test set 0 ipset flush test # Subnets: Delete test set @@ -147,7 +147,7 @@ # Full: List set 0 ipset list test > .foo # Full: Check listing -0 diff -I 'Size in memory.*' .foo bitmap:ip.t.list3 && rm .foo +0 diff -I 'Size in memory.*' .foo bitmap:ip.t.list3 # Full: flush set 0 ipset flush test # Full: add element with 1s timeout diff --git a/tests/hash:ip,port,ip.t b/tests/hash:ip,port,ip.t index 951cf26c..76a5def2 100644 --- a/tests/hash:ip,port,ip.t +++ b/tests/hash:ip,port,ip.t @@ -37,13 +37,13 @@ # List set 0 ipset list test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo hash:ip,port,ip.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip,port,ip.t.list0 # Sleep 5s so that elements can time out 0 sleep 5 # List set 0 ipset list test > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo hash:ip,port,ip.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip,port,ip.t.list1 # Flush test set 0 ipset flush test # Add multiple elements in one step diff --git a/tests/hash:ip,port,net.t b/tests/hash:ip,port,net.t index 97eae8da..abc1b762 100644 --- a/tests/hash:ip,port,net.t +++ b/tests/hash:ip,port,net.t @@ -29,7 +29,7 @@ # List set 0 ipset list test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo hash:ip,port,net.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip,port,net.t.list0 # Sleep 5s so that elements can time out 0 sleep 5 # List set diff --git a/tests/hash:ip,port.t b/tests/hash:ip,port.t index 020be729..5c1bf812 100644 --- a/tests/hash:ip,port.t +++ b/tests/hash:ip,port.t @@ -29,13 +29,13 @@ # List set 0 ipset list test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo hash:ip,port.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip,port.t.list0 # Sleep 5s so that elements can time out 0 sleep 5 # List set 0 ipset list test > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo hash:ip,port.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip,port.t.list1 # Flush test set 0 ipset flush test # Add multiple elements in one step @@ -71,7 +71,7 @@ # List set 0 ipset list test > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo hash:ip,port.t.list2 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip,port.t.list2 # Delete set 0 ipset destroy test # eof diff --git a/tests/hash:ip.t b/tests/hash:ip.t index ce8b14b8..5c65915c 100644 --- a/tests/hash:ip.t +++ b/tests/hash:ip.t @@ -21,13 +21,13 @@ # IP: List set 0 ipset -L test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # IP: Check listing -0 diff -I 'Size in memory.*' .foo hash:ip.t.list2 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip.t.list2 # Sleep 5s so that element can time out 0 sleep 5 # IP: List set 0 ipset -L test 2>/dev/null > .foo0 && ./sort.sh .foo0 # IP: Check listing -0 diff -I 'Size in memory.*' .foo hash:ip.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip.t.list0 # IP: Flush test set 0 ipset -F test # IP: Add multiple elements in one step @@ -87,13 +87,13 @@ # Network: List set 0 ipset -L test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # Network: Check listing -0 diff -I 'Size in memory.*' -I 'Size in memory.*' .foo hash:ip.t.list3 && rm .foo +0 diff -I 'Size in memory.*' -I 'Size in memory.*' .foo hash:ip.t.list3 # Sleep 5s so that elements can time out 0 sleep 5 # Network: List set 0 ipset -L test > .foo # Network: Check listing -0 diff -I 'Size in memory.*' .foo hash:ip.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip.t.list1 # Network: Flush test set 0 ipset -F test # Network: add element with 1s timeout diff --git a/tests/hash:ip6,port,ip6.t b/tests/hash:ip6,port,ip6.t index 93d2861c..85c1e02f 100644 --- a/tests/hash:ip6,port,ip6.t +++ b/tests/hash:ip6,port,ip6.t @@ -37,13 +37,13 @@ # List set 0 ipset list test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo hash:ip6,port,ip6.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip6,port,ip6.t.list0 # Sleep 5s so that elements can time out 0 sleep 5 # List set 0 ipset list test > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo hash:ip6,port,ip6.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip6,port,ip6.t.list1 # Flush test set 0 ipset flush test # Add multiple elements in one step diff --git a/tests/hash:ip6,port,net6.t b/tests/hash:ip6,port,net6.t index 4980b3ba..5c561076 100644 --- a/tests/hash:ip6,port,net6.t +++ b/tests/hash:ip6,port,net6.t @@ -37,7 +37,7 @@ # Range: List set 0 ipset -L test > .foo0 && ./sort.sh .foo0 # Range: Check listing -0 diff -I 'Size in memory.*' .foo hash:ip6,port,net6.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip6,port,net6.t.list0 # Range: Flush test set 0 ipset -F test # Range: Delete test set diff --git a/tests/hash:ip6,port.t b/tests/hash:ip6,port.t index 26d53001..ade34705 100644 --- a/tests/hash:ip6,port.t +++ b/tests/hash:ip6,port.t @@ -29,13 +29,13 @@ # List set 0 ipset list test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo hash:ip6,port.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip6,port.t.list0 # Sleep 5s so that elements can time out 0 sleep 5 # List set 0 ipset list test > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo hash:ip6,port.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip6,port.t.list1 # Flush test set 0 ipset flush test # Add multiple elements in one step diff --git a/tests/hash:ip6.t b/tests/hash:ip6.t index 991a899d..952965af 100644 --- a/tests/hash:ip6.t +++ b/tests/hash:ip6.t @@ -23,7 +23,7 @@ # IP: List set 0 ipset -L test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # IP: Check listing -0 diff -I 'Size in memory.*' .foo hash:ip6.t.list2 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip6.t.list2 # IP: Save set 0 ipset save test > hash:ip6.t.restore # Sleep 5s so that element can time out @@ -31,7 +31,7 @@ # IP: List set 0 ipset -L test 2>/dev/null > .foo0 && ./sort.sh .foo0 # IP: Check listing -0 diff -I 'Size in memory.*' .foo hash:ip6.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip6.t.list0 # IP: Destroy set 0 ipset x test # IP: Restore saved set @@ -39,7 +39,7 @@ # IP: List set 0 ipset -L test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # IP: Check listing -0 diff -I 'Size in memory.*' .foo hash:ip6.t.list2 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip6.t.list2 # IP: Flush test set 0 ipset -F test # IP: Try to add multiple elements in one step @@ -75,13 +75,13 @@ # Network: List set 0 ipset -L test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # Network: Check listing -0 diff -I 'Size in memory.*' .foo hash:ip6.t.list3 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip6.t.list3 # Sleep 5s so that elements can time out 0 sleep 5 # Network: List set 0 ipset -L test > .foo # Network: Check listing -0 diff -I 'Size in memory.*' .foo hash:ip6.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:ip6.t.list1 # Network: Flush test set 0 ipset -F test # Network: Delete test set @@ -95,7 +95,7 @@ # List restored set b 0 ipset l b > .foo0 && ./sort.sh .foo0 # Check listing of set b -0 diff -I 'Size in memory.*' .foo restore.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo restore.t.list1 # Destroy by restore 0 ipset restore < restore.t.destroy # eof diff --git a/tests/hash:net,port.t b/tests/hash:net,port.t index e0f922df..7624e2a7 100644 --- a/tests/hash:net,port.t +++ b/tests/hash:net,port.t @@ -43,7 +43,7 @@ # IP: List set 0 ipset -L test 2>/dev/null > .foo0 && ./sort.sh .foo0 # IP: Check listing -0 diff -I 'Size in memory.*' .foo hash:net,port.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:net,port.t.list1 # Flush test set 0 ipset flush test # Add multiple elements in one step diff --git a/tests/hash:net.t b/tests/hash:net.t index 9edd3c90..d4ac559a 100644 --- a/tests/hash:net.t +++ b/tests/hash:net.t @@ -35,13 +35,13 @@ # List set 0 ipset list test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo hash:net.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:net.t.list0 # Sleep 5s so that element can time out 0 sleep 5 # IP: List set 0 ipset -L test 2>/dev/null > .foo0 && ./sort.sh .foo0 # IP: Check listing -0 diff -I 'Size in memory.*' .foo hash:net.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:net.t.list1 # Flush test set 0 ipset flush test # Delete test set diff --git a/tests/hash:net6,port.t b/tests/hash:net6,port.t index 12a37cbc..8e844e0a 100644 --- a/tests/hash:net6,port.t +++ b/tests/hash:net6,port.t @@ -39,13 +39,13 @@ # Save set 0 ipset save test > hash:net6,port.t.restore # Check listing -0 diff -I 'Size in memory.*' .foo hash:net6,port.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:net6,port.t.list0 # Sleep 5s so that element can time out 0 sleep 5 # IP: List set 0 ipset -L test 2>/dev/null > .foo0 && ./sort.sh .foo0 # IP: Check listing -0 diff -I 'Size in memory.*' .foo hash:net6,port.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:net6,port.t.list1 # Destroy set 0 ipset x test # Restore set @@ -53,7 +53,7 @@ # List set 0 ipset list test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo hash:net6,port.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:net6,port.t.list0 # Flush test set 0 ipset flush test # Add multiple elements in one step diff --git a/tests/hash:net6.t b/tests/hash:net6.t index ecb415e6..f8509e00 100644 --- a/tests/hash:net6.t +++ b/tests/hash:net6.t @@ -35,13 +35,13 @@ # List set 0 ipset list test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo hash:net6.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:net6.t.list0 # Sleep 5s so that element can time out 0 sleep 5 # IP: List set 0 ipset -L test 2>/dev/null > .foo0 && ./sort.sh .foo0 # IP: Check listing -0 diff -I 'Size in memory.*' .foo hash:net6.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo hash:net6.t.list1 # Flush test set 0 ipset flush test # Delete test set diff --git a/tests/iphash.t b/tests/iphash.t index 96ae49b6..5f58b454 100644 --- a/tests/iphash.t +++ b/tests/iphash.t @@ -25,7 +25,7 @@ # IP: List set 0 ipset -L test 2>/dev/null > .foo0 && ./sort.sh .foo0 # IP: Check listing -0 diff -I 'Size in memory.*' .foo iphash.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo iphash.t.list0 # IP: Flush test set 0 ipset -F test # IP: Delete test set @@ -33,13 +33,13 @@ # IP: Restore values so that rehashing is triggered, old format 0 ipset -R < iphash.t.restore.old # IP: Check that all values are restored -0 (grep add iphash.t.restore | sort > .foo.1) && (ipset -S test | grep add | sort > .foo.2) && cmp .foo.1 .foo.2 && rm .foo.* +0 (grep add iphash.t.restore | sort > .foo.1) && (ipset -S test | grep add | sort > .foo.2) && cmp .foo.1 .foo.2 # IP: Delete test set 0 ipset -X test # IP: Restore values so that rehashing is triggered 0 ipset -R < iphash.t.restore # IP: Check that all values are restored -0 (grep add iphash.t.restore | sort > .foo.1) && (ipset -S test | grep add | sort > .foo.2) && cmp .foo.1 .foo.2 && rm .foo.* +0 (grep add iphash.t.restore | sort > .foo.1) && (ipset -S test | grep add | sort > .foo.2) && cmp .foo.1 .foo.2 # IP: Flush test set 0 ipset -F test # IP: Delete test set @@ -49,7 +49,7 @@ # IP: Save the restored set 0 ipset save test | sort > .foo.1 # IP: Compare save and restore -0 (sort iphash.t.large > .foo.2) && (cmp .foo.1 .foo.2) && rm .foo.* +0 (sort iphash.t.large > .foo.2) && (cmp .foo.1 .foo.2) # IP: Delete test set 0 ipset x test # Network: Create a set @@ -79,7 +79,7 @@ # Network: List set 0 ipset -L test > .foo0 && ./sort.sh .foo0 # Network: Check listing -0 diff -I 'Size in memory.*' .foo iphash.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo iphash.t.list1 # Network: Flush test set 0 ipset -F test # Network: Delete test set diff --git a/tests/ipmap.t b/tests/ipmap.t index 443d40dc..33311400 100644 --- a/tests/ipmap.t +++ b/tests/ipmap.t @@ -51,13 +51,13 @@ # Range: List set 0 ipset -L test > .foo # Range: Check listing -0 diff -I 'Size in memory.*' .foo ipmap.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo ipmap.t.list0 # Range: Delete a range of elements 0 ipset -! -D test 2.0.0.128-2.0.0.132 # Range: List set 0 ipset -L test > .foo # Range: Check listing -0 diff -I 'Size in memory.*' .foo ipmap.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo ipmap.t.list1 # Range: Flush test set 0 ipset -F test # Range: Delete test set @@ -93,7 +93,7 @@ # Network: List set 0 ipset -L test > .foo # Network: Check listing -0 diff -I 'Size in memory.*' .foo ipmap.t.list2 && rm .foo +0 diff -I 'Size in memory.*' .foo ipmap.t.list2 # Network: Flush test set 0 ipset -F test # Network: Delete test set @@ -129,7 +129,7 @@ # Subnets: List set 0 ipset -L test > .foo # Subnets: Check listing -0 diff -I 'Size in memory.*' .foo ipmap.t.list3 && rm .foo +0 diff -I 'Size in memory.*' .foo ipmap.t.list3 # Subnets: FLush test set 0 ipset -F test # Subnets: Delete test set @@ -155,7 +155,7 @@ # Full: List set 0 ipset -L test > .foo # Full: Check listing -0 diff -I 'Size in memory.*' .foo ipmap.t.list4 && rm .foo +0 diff -I 'Size in memory.*' .foo ipmap.t.list4 # Full: Delete test set 0 ipset -X test # eof diff --git a/tests/ipporthash.t b/tests/ipporthash.t index 052ba9d7..3ec8fb9b 100644 --- a/tests/ipporthash.t +++ b/tests/ipporthash.t @@ -33,7 +33,7 @@ # List set 0 ipset -L test > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo ipporthash.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo ipporthash.t.list0 # Flush test set 0 ipset -F test # Delete test set @@ -63,7 +63,7 @@ # List set 0 ipset -L test > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo ipporthash.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo ipporthash.t.list1 # Flush test set 0 ipset -F test # Delete test set diff --git a/tests/ipportiphash.t b/tests/ipportiphash.t index bfde875d..0ce01c62 100644 --- a/tests/ipportiphash.t +++ b/tests/ipportiphash.t @@ -41,7 +41,7 @@ # List set 0 ipset -L test > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo ipportiphash.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo ipportiphash.t.list0 # Flush test set 0 ipset -F test # Delete test set @@ -73,7 +73,7 @@ # List set 0 ipset -L test > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo ipportiphash.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo ipportiphash.t.list1 # Flush test set 0 ipset -F test # Delete test set diff --git a/tests/ipportnethash.t b/tests/ipportnethash.t index 818e3b0c..37458921 100644 --- a/tests/ipportnethash.t +++ b/tests/ipportnethash.t @@ -37,7 +37,7 @@ # Range: List set 0 ipset -L test > .foo0 && ./sort.sh .foo0 # Range: Check listing -0 diff -I 'Size in memory.*' .foo ipportnethash.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo ipportnethash.t.list0 # Range: Flush test set 0 ipset -F test # Range: Delete test set @@ -67,7 +67,7 @@ # Network: List set 0 ipset -L test > .foo0 && ./sort.sh .foo0 # Network: Check listing -0 diff -I 'Size in memory.*' .foo ipportnethash.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo ipportnethash.t.list1 # Network: Flush test set 0 ipset -F test # Network: Delete test set diff --git a/tests/iptree.t b/tests/iptree.t index b61c0c93..ee783a92 100644 --- a/tests/iptree.t +++ b/tests/iptree.t @@ -15,7 +15,7 @@ # Static: List set 0 ipset -L test > .foo0 && ./sort.sh .foo0 # Static: Check listing -0 diff -I 'Size in memory.*' .foo iptree.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo iptree.t.list0 # Static: Flush test set 0 ipset -F test # Static: Delete test set diff --git a/tests/iptreemap.t b/tests/iptreemap.t index aa8ed1e9..aa299313 100644 --- a/tests/iptreemap.t +++ b/tests/iptreemap.t @@ -51,7 +51,7 @@ # List set 0 ipset -L test > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo iptreemap.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo iptreemap.t.list0 # Flush test set 0 ipset -F test # Delete test set diff --git a/tests/macipmap.t b/tests/macipmap.t index 7332f75a..27f04b4d 100644 --- a/tests/macipmap.t +++ b/tests/macipmap.t @@ -41,7 +41,7 @@ # Range: List set 0 ipset -L test > .foo # Range: Check listing -0 diff -I 'Size in memory.*' .foo macipmap.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo macipmap.t.list0 # Range: Flush test set 0 ipset -F test # Range: Delete test set @@ -81,7 +81,7 @@ # Network: List set 0 ipset -L test > .foo # Network: Check listing -0 diff -I 'Size in memory.*' .foo macipmap.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo macipmap.t.list1 # Network: Flush test set 0 ipset -F test # Network: Delete test set @@ -121,13 +121,13 @@ # Range: List set 0 ipset -L test | sed 's/timeout ./timeout x/' > .foo # Range: Check listing -0 diff -I 'Size in memory.*' .foo macipmap.t.list3 && rm .foo +0 diff -I 'Size in memory.*' .foo macipmap.t.list3 # Range: sleep 5s so that elements can timeout 0 sleep 5 # Range: List set 0 ipset -L test | sed 's/timeout ./timeout x/' > .foo # Range: Check listing -0 diff -I 'Size in memory.*' .foo macipmap.t.list2 && rm .foo +0 diff -I 'Size in memory.*' .foo macipmap.t.list2 # Range: Flush test set 0 ipset -F test # Range: add element with 1s timeout diff --git a/tests/nethash.t b/tests/nethash.t index 537c0db3..faa25857 100644 --- a/tests/nethash.t +++ b/tests/nethash.t @@ -35,7 +35,7 @@ # List set 0 ipset -L test > .foo0 && ./sort.sh .foo0 # Check listing -0 diff -I 'Size in memory.*' .foo nethash.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo nethash.t.list0 # Flush test set 0 ipset -F test # Delete test set diff --git a/tests/portmap.t b/tests/portmap.t index 084d68ce..851e5dd8 100644 --- a/tests/portmap.t +++ b/tests/portmap.t @@ -27,7 +27,7 @@ # Range: List set 0 ipset -L test > .foo # Range: Check listing -0 diff -I 'Size in memory.*' .foo portmap.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo portmap.t.list0 # Range: Flush test set 0 ipset -F test # Range: Delete test set @@ -47,7 +47,7 @@ # Full: List set 0 ipset -L test > .foo # Full: Check listing -0 diff -I 'Size in memory.*' .foo portmap.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo portmap.t.list1 # Full: Flush test set 0 ipset -F test # Full: Delete test set @@ -71,13 +71,13 @@ # Full: List set 0 ipset -L test | sed 's/timeout ./timeout x/' > .foo # Full: Check listing -0 diff -I 'Size in memory.*' .foo portmap.t.list3 && rm .foo +0 diff -I 'Size in memory.*' .foo portmap.t.list3 # Full: sleep 5s so that elements can timeout 0 sleep 5 # Full: List set 0 ipset -L test > .foo # Full: Check listing -# 0 diff -I 'Size in memory.*' .foo portmap.t.list2 && rm .foo +# 0 diff -I 'Size in memory.*' .foo portmap.t.list2 # Full: Flush test set 0 ipset -F test # Full: add element with 1s timeout diff --git a/tests/runtest.sh b/tests/runtest.sh index cc2e9db1..ae0780ea 100755 --- a/tests/runtest.sh +++ b/tests/runtest.sh @@ -103,6 +103,6 @@ for x in $tests; do esac done rmmod ip_set >/dev/null 2>&1 -rm -f .foo.err +rm -f .foo* echo "All tests are passed" diff --git a/tests/setlist.t b/tests/setlist.t index 8dcf54a2..a4f45b51 100644 --- a/tests/setlist.t +++ b/tests/setlist.t @@ -47,7 +47,7 @@ # List set 0 ipset -L test > .foo # Check listing -0 diff -I 'Size in memory.*' .foo setlist.t.list0 && rm .foo +0 diff -I 'Size in memory.*' .foo setlist.t.list0 # Flush all sets 0 ipset -F # Delete all sets @@ -63,7 +63,7 @@ # List test set 0 ipset list test > .foo # Check listing -0 diff -I 'Size in memory.*' .foo setlist.t.list1 && rm .foo +0 diff -I 'Size in memory.*' .foo setlist.t.list1 # Test a set before b 0 ipset test test a before b # Test c set after b @@ -73,13 +73,13 @@ # List test set 0 ipset list test > .foo # Check listing -0 diff -I 'Size in memory.*' .foo setlist.t.list2 && rm .foo +0 diff -I 'Size in memory.*' .foo setlist.t.list2 # Delete c set after a 0 ipset del test c after a # List test set 0 ipset list test > .foo # Check listing -0 diff -I 'Size in memory.*' .foo setlist.t.list3 && rm .foo +0 diff -I 'Size in memory.*' .foo setlist.t.list3 # Flush sets 0 ipset flush # Destroy sets -- 2.47.3