]> git.ipfire.org Git - thirdparty/ipset.git/commitdiff
tests: make runtest.sh work with readonly-cwd
authorFlorian Westphal <fw@strlen.de>
Thu, 9 Jul 2026 20:03:52 +0000 (22:03 +0200)
committerJozsef Kadlecsik <kadlec@netfilter.org>
Mon, 13 Jul 2026 13:21:36 +0000 (15:21 +0200)
My local test setup spawns qemu instances via virtme-ng.
The host file system is a readonly export, only /tmp is
writeable.

Make runtest.sh create a temporary dir, then export
IPSET_TMPDIR to all other scripts and use that location
to load/store temporary data.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
43 files changed:
tests/big_sort.sh
tests/bitmap:ip.t
tests/check_klog.sh
tests/comment.t
tests/hash:ip,mark.t
tests/hash:ip,port,ip.t
tests/hash:ip,port,net.t
tests/hash:ip,port.t
tests/hash:ip.t
tests/hash:ip6,mark.t
tests/hash:ip6,port,ip6.t
tests/hash:ip6,port,net6.t
tests/hash:ip6,port.t
tests/hash:ip6.t
tests/hash:mac.t
tests/hash:net,iface.t
tests/hash:net,net.t
tests/hash:net,port,net.t
tests/hash:net,port.t
tests/hash:net.t
tests/hash:net6,net6.t
tests/hash:net6,port,net6.t
tests/hash:net6,port.t
tests/hash:net6.t
tests/ignore.sh
tests/iphash.t
tests/ipmap.t
tests/ipmarkhash.t
tests/ipporthash.t
tests/ipportiphash.t
tests/ipportnethash.t
tests/iptables.sh
tests/iptree.t
tests/iptreemap.t
tests/macipmap.t
tests/match_target.t
tests/nethash.t
tests/portmap.t
tests/restore.t
tests/runtest.sh
tests/sendip.sh
tests/setlist.t
tests/sort.sh

index 05eced805dff15a9293983d8b9f8fedbb1b8eece..033198d818159fb59cdf575683ee613f482ba13c 100755 (executable)
@@ -7,8 +7,8 @@ for x in `seq 0 255`; do
         echo "a test 10.10.$x.$y"
     done
 done | ipset r
-ipset -t list > .foo
-diff .foo big_sort.terse
-ipset -s save > .foo
-diff .foo big_sort.saved
+ipset -t list > "$IPSET_TMP/.foo"
+diff "$IPSET_TMP/.foo" big_sort.terse
+ipset -s save > "$IPSET_TMP/.foo"
+diff "$IPSET_TMP/.foo" big_sort.saved
 ipset x test
index a0ca22f92c36a4d3009fc3bd4fc2fff69da3abc5..53034bbbae8941c4077eaef08b097c15a46fc327 100644 (file)
 # Range: Add a range of elements
 0 ipset -A test 2.0.0.128-2.0.0.131 timeout 4
 # Range: List set
-0 ipset list test > .foo
+0 ipset list test > "$IPSET_TMP/.foo"
 # Range: Check listing
-0 ./diff.sh .foo bitmap:ip.t.list4
+0 ./diff.sh "$IPSET_TMP/.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
+0 ipset list test > "$IPSET_TMP/.foo"
 # Range: Check listing
-0 ./diff.sh .foo bitmap:ip.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" bitmap:ip.t.list0
 # Range: Flush test set
 0 ipset flush test
 # Range: Delete test set
 # Network: Delete the same element
 0 ipset -D test 2.0.0.128
 # Network: List set
-0 ipset list test > .foo
+0 ipset list test > "$IPSET_TMP/.foo"
 # Network: Check listing
-0 ./diff.sh .foo bitmap:ip.t.list5
+0 ./diff.sh "$IPSET_TMP/.foo" bitmap:ip.t.list5
 # Sleep 5s so that entries can time out
 0 sleep 5s
 # Network: List set
-0 ipset list test > .foo
+0 ipset list test > "$IPSET_TMP/.foo"
 # Network: Check listing
-0 ./diff.sh .foo bitmap:ip.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" bitmap:ip.t.list1
 # Network: Flush test set
 0 ipset flush test
 # Network: Delete test set
 # Subnets: Add a subnet of subnets
 0 ipset -A test 10.8.0.0/16 timeout 4
 # Subnets: List set
-0 ipset list test > .foo
+0 ipset list test > "$IPSET_TMP/.foo"
 # Subnets: Check listing
-0 ./diff.sh .foo bitmap:ip.t.list6
+0 ./diff.sh "$IPSET_TMP/.foo" bitmap:ip.t.list6
 # Sleep 5s so that entries can time out
 0 sleep 5s
 # Subnets: List set
-0 ipset list test > .foo
+0 ipset list test > "$IPSET_TMP/.foo"
 # Subnets: Check listing
-0 ./diff.sh .foo bitmap:ip.t.list2
+0 ./diff.sh "$IPSET_TMP/.foo" bitmap:ip.t.list2
 # Subnets: Flush test set
 0 ipset flush test
 # Subnets: Delete test set
 # Full: Test element not added to the set
 1 ipset test test 0.1.0.0
 # Full: List set
-0 ipset list test > .foo
+0 ipset list test > "$IPSET_TMP/.foo"
 # Full: Check listing
-0 ./diff.sh .foo bitmap:ip.t.list3
+0 ./diff.sh "$IPSET_TMP/.foo" bitmap:ip.t.list3
 # Full: flush set
 0 ipset flush test
 # Full: add element with 1s timeout
index 9af5f66f28eb2e0b1bd54a183d746ff717d959ae..8ecad3eb987e6147662e54e78becc5203885493b 100755 (executable)
@@ -5,8 +5,8 @@ set -e
 
 # arguments: ipaddr proto port setname ...
 
-test -f .loglines || exit 1
-loglines=$(<.loglines)
+test -f "$IPSET_TMP/.loglines" || exit 1
+loglines=$(<"$IPSET_TMP/.loglines")
 if [ $loglines -ne 0 ]; then
     loglines=$((loglines - 1))
 fi
index 8f579198ea138d7b529392e6b5586361b1042d21..e5b664b9229bd4b2737bf300fe0bd887adbfc7a6 100644 (file)
@@ -9,9 +9,9 @@
 # Bitmap comment: Test element with comment
 0 ipset test test 2.0.0.1
 # Bitmap comment: List set
-0 ipset list test > .foo
+0 ipset list test > "$IPSET_TMP/.foo"
 # Bitmap comment: Check listing
-0 ./diff.sh .foo comment.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" comment.t.list0
 # Bitmap comment: Delete element with comment
 0 ipset del test 2.0.0.1
 # Bitmap comment: Test deleted element
@@ -31,9 +31,9 @@
 # Bitmap comment: Add multiple elements with comment
 0 for x in `seq 1 255`; do echo "add test 2.0.0.$x comment \\\"text message $x\\\""; done | ipset restore
 # Bitmap comment: List set
-0 ipset list test > .foo
+0 ipset list test > "$IPSET_TMP/.foo"
 # Bitmap comment: Check listing
-0 ./diff.sh .foo comment.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" comment.t.list1
 # Bitmap comment: Delete test set
 0 ipset destroy test
 # Bitmap comment: create set with timeout
 # Bitmap comment: Add multiple elements with zero timeout
 0 for x in `seq 1 255`; do echo "add test 2.0.1.$x timeout 0 comment \\\"text message $x\\\""; done | ipset restore
 # Bitmap comment: List set
-0 ipset list test > .foo
+0 ipset list test > "$IPSET_TMP/.foo"
 # Bitmap comment: Check listing
-0 ./diff.sh .foo comment.t.list11
+0 ./diff.sh "$IPSET_TMP/.foo" comment.t.list11
 # Sleep 5s so that entries can time out
 0 sleep 5s
 # Bitmap comment: List set
-0 ipset list test > .foo
+0 ipset list test > "$IPSET_TMP/.foo"
 # Bitmap comment: Check listing
-0 ./diff.sh .foo comment.t.list12
+0 ./diff.sh "$IPSET_TMP/.foo" comment.t.list12
 # Bitmap comment: Flush set
 0 ipset flush test
 # Bitmap comment: Delete test set
@@ -87,9 +87,9 @@
 # Hash comment: Try to add IP address
 0 ipset add test 2.0.0.1,2.0.0.2 
 # Hash comment: List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Hash comment: Check listing
-0 ./diff.sh .foo comment.t.list2
+0 ./diff.sh "$IPSET_TMP/.foo" comment.t.list2
 # Hash comment: Update element with comment
 0 ipset -! add test 2.0.0.1,2.0.0.2 comment "text 2.0.0.1,2.0.0.2"
 # Hash comment: Check updated element
 # Hash comment: Add multiple elements with zero timeout
 0 for x in `seq 0 255`; do echo "add test 2.0.1.$x timeout 0 comment \\\"text message $x\\\""; done | ipset restore
 # Hash comment: List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Hash comment: Check listing
-0 ./diff.sh .foo comment.t.list21
+0 ./diff.sh "$IPSET_TMP/.foo" comment.t.list21
 # Sleep 5s so that entries can time out
 0 sleep 5s
 # Hash comment: List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Hash comment: Check listing
-0 ./diff.sh .foo comment.t.list22
+0 ./diff.sh "$IPSET_TMP/.foo" comment.t.list22
 # Hash comment: Flush set
 0 ipset flush test
 # Hash comment: Delete test set
 # List comment: Add b set with comment
 0 ipset a test b after a comment "b set comment"
 # List comment: List sets
-0 ipset list > .foo
+0 ipset list > "$IPSET_TMP/.foo"
 # List comment: Check listing
-0 ./diff.sh .foo comment.t.list3
+0 ./diff.sh "$IPSET_TMP/.foo" comment.t.list3
 # Flush sets
 0 ipset f
 # Destroy sets
index ce94efc49f7f4f5506e350b09d397d123ec610e2..8141f69341b921b373f663b48d37a8ce13dfd1e3 100644 (file)
 # Try to add value after second random value
 0 ipset add test 2.1.0.1,0x80
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:ip,mark.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip,mark.t.list0
 # Sleep 5s so that elements can time out
 0 sleep 5
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:ip,mark.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip,mark.t.list1
 # Flush test set
 0 ipset flush test
 # Add multiple elements in one step
index fcd6985a2391cd21bd2f0f988356de8d621fc1e9..254a1a1855e1def95e206b05780fccaeb26ead52 100644 (file)
 # Try to add value after second random value
 0 ipset add test 2.1.0.1,128,2.2.2.2
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:ip,port,ip.t.list0
+0 ./diff.sh "$IPSET_TMP/.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
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:ip,port,ip.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip,port,ip.t.list1
 # Flush test set
 0 ipset flush test
 # Add multiple elements in one step
index 67d20b04ed5636a5b91bd153a646f9b92aeac138..4fb8df6cdb80f5ead7b1bd2995a6f62321e8b10b 100644 (file)
@@ -27,9 +27,9 @@
 # Try to add value after second random value
 0 ipset add test 2.1.0.1,128,10.0.0.0/17
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:ip,port,net.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip,port,net.t.list0
 # Sleep 5s so that elements can time out
 0 sleep 5
 # List set
index f65fb59116824ff92597741a19f9242d49a6ff26..3e5011b7ffc1fb3992762697b7a9d6594e7d9ac6 100644 (file)
 # Delete port by number
 0 ipset del test 2.1.0.3,25
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:ip,port.t.list0
+0 ./diff.sh "$IPSET_TMP/.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
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:ip,port.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip,port.t.list1
 # Flush test set
 0 ipset flush test
 # Add multiple elements in one step
@@ -73,9 +73,9 @@
 # Delete element with sctp
 0 ipset del test 2.0.0.1,sctp:80
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:ip,port.t.list2
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip,port.t.list2
 # Delete set
 0 ipset destroy test
 # Create set to add a range
 # Network: Delete the same network
 0 ipset -D test 200.100.0.12,22
 # Network: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Network: Check listing
-0 ./diff.sh .foo hash:ip,port.t.list3
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip,port.t.list3
 # Sleep 5s so that elements can time out
 0 sleep 5
 # Network: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Network: Check listing
-0 ./diff.sh .foo hash:ip,port.t.list4
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip,port.t.list4
 # Network: Flush test set
 0 ipset -F test
 # Network: add element with 1s timeout
 # Network: Delete the same network
 0 ipset -D test 200.100.0.12,22
 # Network: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Network: Check listing
-0 ./diff.sh .foo hash:ip,port.t.list5
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip,port.t.list5
 # Sleep 5s so that elements can time out
 0 sleep 5
 # Network: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Network: Check listing
-0 ./diff.sh .foo hash:ip,port.t.list6
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip,port.t.list6
 # Network: Flush test set
 0 ipset -F test
 # Network: add element with 1s timeout
 # Network: Test delete value
 0 ipset -D test 1.168.0.124,22
 # Network: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Network: Check listing
-0 ./diff.sh .foo hash:ip,port.t.list7
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip,port.t.list7
 # Network: Delete test set
 0 ipset -X test
 # eof
index 3771437dd267284c41526486b41afbfa9584f815..529e6b81506951bce551bf75f6c27e2c119c10cd 100644 (file)
 # IP: Delete the same value
 0 ipset -D test 200.100.0.12
 # IP: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # IP: Check listing
-0 ./diff.sh .foo hash:ip.t.list2
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip.t.list2
 # Sleep 5s so that element can time out
 0 sleep 5
 # IP: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # IP: Check listing
-0 ./diff.sh .foo hash:ip.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip.t.list0
 # IP: Flush test set
 0 ipset -F test
 # IP: Add multiple elements in one step
 # Network: Delete the same network
 0 ipset -D test 200.100.0.12
 # Network: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Network: Check listing
-0 ./diff.sh .foo hash:ip.t.list3
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip.t.list3
 # Sleep 5s so that elements can time out
 0 sleep 5
 # Network: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Network: Check listing
-0 ./diff.sh .foo hash:ip.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip.t.list1
 # Network: Flush test set
 0 ipset -F test
 # Network: add element with 1s timeout
@@ -241,15 +241,15 @@ skip which sendip
 # Network: Delete the same network
 0 ipset -D test 200.100.0.12
 # Network: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Network: Check listing
-0 ./diff.sh .foo hash:ip.t.list4
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip.t.list4
 # Sleep 5s so that elements can time out
 0 sleep 5
 # Network: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Network: Check listing
-0 ./diff.sh .foo hash:ip.t.list5
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip.t.list5
 # Network: Flush test set
 0 ipset -F test
 # Network: add element with 1s timeout
@@ -285,9 +285,9 @@ skip which sendip
 # Network: Test delete value
 0 ipset -D test 1.2.0.5
 # Network: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Network: Check listing
-0 ./diff.sh .foo hash:ip.t.list6
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip.t.list6
 # Network: Delete test set
 0 ipset -X test
 # eof
index af46d97ee4da4951c140d4b200920828d0ce7452..222afe55bff5bb61af72049c3f2e288ba69e9769 100644 (file)
 # Try to add value after second random value
 0 ipset add test 2:1:0::1,0x80
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:ip6,mark.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip6,mark.t.list0
 # Sleep 5s so that elements can time out
 0 sleep 5
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:ip6,mark.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip6,mark.t.list1
 # Delete test set
 0 ipset destroy test
 # Create set to add a range
index aaf6530a1fe45483d843ffab6466818a991b1f66..c76889871c4f3f5e4bd24449ba33934055ffc1de 100644 (file)
 # Try to add value after second random value
 0 ipset add test 2:1:0::1,128,2:2:2::2
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:ip6,port,ip6.t.list0
+0 ./diff.sh "$IPSET_TMP/.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
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:ip6,port,ip6.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip6,port,ip6.t.list1
 # Flush test set
 0 ipset flush test
 # Add multiple elements in one step
index 71dfa61937642843d32579805b90af12d7dbe118..f04ca0973b8bc080ac7ad80ad26036ec184d5e3e 100644 (file)
@@ -35,9 +35,9 @@
 # Range: Try to add value after second random value
 0 ipset -A test 2:1:0::1,128,2:2:2::2/12
 # Range: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Range: Check listing
-0 ./diff.sh .foo hash:ip6,port,net6.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip6,port,net6.t.list0
 # Range: Flush test set
 0 ipset -F test
 # Range: Delete test set
index e56e39c551214abc70f2934e26d36d9a989353ef..5ff2e9111b01604ed1ce68c092d8516ebf37984f 100644 (file)
 # Try to add value after second random value
 0 ipset add test 2:1:0::1,128
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:ip6,port.t.list0
+0 ./diff.sh "$IPSET_TMP/.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
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:ip6,port.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip6,port.t.list1
 # Flush test set
 0 ipset flush test
 # Add multiple elements in one step
index 52175a5a293887da3ba6edc461e47c12d6651ad9..17b51094dd9b0f6fcbc5d63b3814f244717e6236 100644 (file)
 # IP: Delete the same value
 0 ipset -D test 200:100:0::12
 # IP: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # IP: Check listing
-0 ./diff.sh .foo hash:ip6.t.list2
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip6.t.list2
 # IP: Save set
-0 ipset save test > hash:ip6.t.restore
+0 ipset save test > "$IPSET_TMP/hash:ip6.t.restore"
 # Sleep 5s so that element can time out
 0 sleep 5
 # IP: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # IP: Check listing
-0 ./diff.sh .foo hash:ip6.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip6.t.list0
 # IP: Destroy set
 0 ipset x test
 # IP: Restore saved set
-0 ipset restore < hash:ip6.t.restore && rm hash:ip6.t.restore
+0 ipset restore < "$IPSET_TMP/hash:ip6.t.restore" && rm "$IPSET_TMP/hash:ip6.t.restore"
 # IP: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # IP: Check listing
-0 ./diff.sh .foo hash:ip6.t.list2
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip6.t.list2
 # IP: Flush test set
 0 ipset -F test
 # IP: Try to add multiple elements in one step
 # Network: Test the deleted network
 1 ipset -T test 200:101:0::12
 # Network: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Network: Check listing
-0 ./diff.sh .foo hash:ip6.t.list3
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip6.t.list3
 # Sleep 5s so that elements can time out
 0 sleep 5
 # Network: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Network: Check listing
-0 ./diff.sh .foo hash:ip6.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:ip6.t.list1
 # Network: Flush test set
 0 ipset -F test
 # Network: Delete test set
 # Check more complex restore commands
 0 ipset restore < restore.t.restore
 # List restored set a
-0 ipset l a > .foo0 && ./sort.sh .foo0
+0 ipset l a > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing of set a
-0 ./diff.sh .foo restore.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" restore.t.list0
 # List restored set b
-0 ipset l b > .foo0 && ./sort.sh .foo0
+0 ipset l b > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing of set b
-0 ./diff.sh .foo restore.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" restore.t.list1
 # Destroy by restore
 0 ipset restore < restore.t.destroy
 # Timeout: Check that resizing keeps timeout values
index 9192af06f10a92c6c1218f30bd71d33ec595f4cf..ed0cb3d953d7374303c827f2c0c87e3738968859 100644 (file)
 # MAC: Delete the same value
 0 ipset -D test 1:2:3:4:a:b
 # MAC: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # MAC: Check listing
-0 ./diff.sh .foo hash:mac.t.list2
+0 ./diff.sh "$IPSET_TMP/.foo" hash:mac.t.list2
 # Sleep 5s so that element can time out
 0 sleep 5
 # MAC: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # MAC: Check listing
-0 ./diff.sh .foo hash:mac.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:mac.t.list0
 # MAC: Destroy test set
 0 ipset -X test
 # MAC: Create a set with skbinfo extension
@@ -45,9 +45,9 @@
 # MAC: Add element with mark, skbprio and skbqueue
 0 ipset a test 1:2:3:4:5:11 skbmark 0x11223344/0xffff0000 skbprio 2:1 skbqueue 8 
 # MAC: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # MAC: Check listing
-0 ./diff.sh .foo hash:mac.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:mac.t.list1
 # MAC: Destroy test set
 0 ipset -X test
 # MAC: Create a set with small maxelem parameter
@@ -63,9 +63,9 @@
 # MAC: Add second element with another extension value
 0 ipset -! a test 1:2:3:4:5:7 skbprio 1:12 skbqueue 8
 # MAC: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # MAC: Check listing
-0 ./diff.sh .foo hash:mac.t.list3
+0 ./diff.sh "$IPSET_TMP/.foo" hash:mac.t.list3
 # MAC: Destroy test set
 0 ipset x test
 # eof
index 444f230a77f39ff27a93f96d156d9733bda8769d..bcd0ba451c62dc100135b61083c87045f6893df9 100644 (file)
@@ -41,9 +41,9 @@
 # Try to add IP address
 0 ipset add test 2.0.0.1,eth0
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net,iface.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net,iface.t.list0
 # Flush test set
 0 ipset flush test
 # Delete test set
@@ -53,9 +53,9 @@
 # Add networks in range notation
 0 ipset add test 10.2.0.0-10.2.1.12,eth0
 # List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net,iface.t.list2
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net,iface.t.list2
 # Flush test set
 0 ipset flush test
 # Add 0/0,eth0
 # Add overlapping networks from /4 to /30
 0 (set -e; for x in `seq 4 30`; do ipset add test 192.0.0.0/$x,eth$x; done)
 # List test set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net,iface.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net,iface.t.list1
 # Test matching elements in all added networks from /30 to /24
 0 (set -e; y=2; for x in `seq 24 30 | tac`; do ipset test test 192.0.0.$y,eth$x; y=$((y*2)); done)
 # Test non-matching elements in all added networks from /30 to /24
index 41189b7080159e18e9fba94b7231ec58d89acc8d..dcfdcc7f3c71dda7643e3918bd8631739ec2eb35 100644 (file)
 # Try to add IP address
 0 ipset add test 2.0.0.1,2.0.0.2
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net,net.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net,net.t.list0
 # Sleep 5s so that element can time out
 0 sleep 5
 # List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net,net.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net,net.t.list1
 # Flush test set
 0 ipset flush test
 # Delete test set
@@ -51,9 +51,9 @@
 # Add networks in range notation
 0 ipset add test 10.2.0.0-10.2.1.12,10.3.0.0-10.3.1.12
 # List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net,net.t.list2
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net,net.t.list2
 # Delete test set
 0 ipset destroy test
 # Stress test with range notation
 # Network: Delete the same network
 0 ipset -D test 200.100.0.12,200.100.0.13
 # Network: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Network: Check listing
-0 ./diff.sh .foo hash:net,net.t.list3
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net,net.t.list3
 # Sleep 5s so that elements can time out
 0 sleep 5
 # Network: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Network: Check listing
-0 ./diff.sh .foo hash:net,net.t.list4
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net,net.t.list4
 # Network: Flush test set
 0 ipset -F test
 # Network: add element with 1s timeout
 # Network: Delete the same network
 0 ipset -D test 200.100.0.12,200.100.0.13
 # Network: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Network: Check listing
-0 ./diff.sh .foo hash:net,net.t.list5
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net,net.t.list5
 # Sleep 5s so that elements can time out
 0 sleep 5
 # Network: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Network: Check listing
-0 ./diff.sh .foo hash:net,net.t.list6
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net,net.t.list6
 # Network: Flush test set
 0 ipset -F test
 # Network: add element with 1s timeout
 # Network: Test delete value
 0 ipset -D test 1.168.12.124,122.23.0.50
 # Network: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Network: Check listing
-0 ./diff.sh .foo hash:net,net.t.list7
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net,net.t.list7
 # Network: Delete test set
 0 ipset -X test
 # eof
index 2c9516be4e27849281b8ab6d743c5bc31c0ff01c..470d91282b9dc4f24ad46141adea5882e4ed8a66 100644 (file)
@@ -27,9 +27,9 @@
 # Try to add value after second random value
 0 ipset add test 2.1.0.1,128,10.0.0.0/17
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net,port,net.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net,port,net.t.list0
 # Sleep 5s so that elements can time out
 0 sleep 5
 # List set
index 5a850e6394dde62b3e9d66a895e00ebe0ab74767..aea4fdf04a4cbc608817ffe67e70620d9be5d82a 100644 (file)
 # Test ICMP by name
 0 ipset test test 2.0.0.255,icmp:host-prohibited
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net,port.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net,port.t.list0
 # Sleep 5s so that element can time out
 0 sleep 5
 # IP: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # IP: Check listing
-0 ./diff.sh .foo hash:net,port.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net,port.t.list1
 # Flush test set
 0 ipset flush test
 # Add multiple elements in one step
index 4d96350f6dbc263f4132e9d525fe9562f1e34e45..4f88327684a4280d29a6b86fbd573c719ab0090b 100644 (file)
 # Try to add IP address
 0 ipset add test 2.0.0.1
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net.t.list0
 # Sleep 5s so that element can time out
 0 sleep 5
 # List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net.t.list1
 # Flush test set
 0 ipset flush test
 # Delete test set
@@ -51,9 +51,9 @@
 # Add networks in range notation
 0 ipset add test 10.2.0.0-10.2.1.12
 # List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net.t.list2
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net.t.list2
 # Delete test set
 0 ipset destroy test
 # Stress test add with range notation
 # Add more than 2^31 elements in a range
 0 ipset a test 0.0.0.0-128.0.0.1
 # List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net.t.list3
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net.t.list3
 # Delete test set
 0 ipset destroy test
 # Counters: create set
index 257d142d83c14c6aacb7765526bcd2c7ba5c4b4e..4dcf90bc07071972d3fe55398812daa5a5516139 100644 (file)
 # Try to add IP address
 0 ipset add test 3:0:0::1,8:0:0::1
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net6,net6.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net6,net6.t.list0
 # Sleep 5s so that element can time out
 0 sleep 5
 # IP: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # IP: Check listing
-0 ./diff.sh .foo hash:net6,net6.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net6,net6.t.list1
 # Flush test set
 0 ipset flush test
 # Add matching IP address entry
index 7ec737ec383392465143a0db911e1a8d0b47cc37..c3164cb438c465d3c1615fbd492b98def614fb40 100644 (file)
@@ -41,9 +41,9 @@
 # Range: Try to add value after second random value
 0 ipset -A test 2:1:0::1,128,2:2:2::2/12
 # Range: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Range: Check listing
-0 ./diff.sh .foo hash:net6,port,net6.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net6,port,net6.t.list0
 # Range: Flush test set
 0 ipset -F test
 # Range: Delete test set
index a9a0f907fefb4d877a9364b2940931e888f745a9..be800452ef357a868bb1f87c58e47c250dce7ffd 100644 (file)
 # Test ICMPv6 by name
 0 ipset test test 192:168:68::95,icmpv6:port-unreachable
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Save set
-0 ipset save test > hash:net6,port.t.restore
+0 ipset save test > "$IPSET_TMP/hash:net6,port.t.restore"
 # Check listing
-0 ./diff.sh .foo hash:net6,port.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net6,port.t.list0
 # Sleep 5s so that element can time out
 0 sleep 5
 # IP: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # IP: Check listing
-0 ./diff.sh .foo hash:net6,port.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net6,port.t.list1
 # Destroy set
 0 ipset x test
 # Restore set
-0 ipset restore < hash:net6,port.t.restore && rm hash:net6,port.t.restore
+0 ipset restore < "$IPSET_TMP/hash:net6,port.t.restore" && rm "$IPSET_TMP/hash:net6,port.t.restore"
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net6,port.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net6,port.t.list0
 # Flush test set
 0 ipset flush test
 # Add multiple elements in one step
index 67ef33e24e0627856f7e476e29d16316e7be79db..e48a85446ec7fcfbb3a9ecb0ac3bf50e38d054ed 100644 (file)
 # Try to add IP address
 0 ipset add test 3:0:0::1
 # List set
-0 ipset list test > .foo0 && ./sort.sh .foo0
+0 ipset list test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo hash:net6.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net6.t.list0
 # Sleep 5s so that element can time out
 0 sleep 5
 # IP: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # IP: Check listing
-0 ./diff.sh .foo hash:net6.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" hash:net6.t.list1
 # Flush test set
 0 ipset flush test
 # Delete test set
index 9d458e302bda4d0f76f6cdd69b3fce8d7c4a6a4a..db617f3c7701779520b779eb56be0cd50b9b5159 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-grep -v Revision: $1 | sed 's/initval 0x[0-9a-fA-F]\{8\}/initval 0x00000000/' > .foo
+grep -v Revision: $1 | sed 's/initval 0x[0-9a-fA-F]\{8\}/initval 0x00000000/' > "$IPSET_TMP/.foo"
 rm $1
index 4d651139eb95309fc19bc38bfedfbef34b7c1f2e..c7c0b081e34a81c69917d2711692ce33519cc477 100644 (file)
@@ -23,9 +23,9 @@
 # IP: Delete element not added to the set, ignoring error
 0 ipset -! -D test 200.100.0.12
 # IP: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # IP: Check listing
-0 ./diff.sh .foo iphash.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" iphash.t.list0
 # IP: Flush test set
 0 ipset -F test
 # IP: Delete test set
 # 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
+0 (grep add iphash.t.restore | sort > "$IPSET_TMP/.foo.1") && (ipset -S test | grep add | sort > "$IPSET_TMP/.foo.2") && cmp "$IPSET_TMP/"{.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
+0 (grep add iphash.t.restore | sort > "$IPSET_TMP/.foo.1") && (ipset -S test | grep add | sort > "$IPSET_TMP/.foo.2") && cmp "$IPSET_TMP/"{.foo.1,.foo.2}
 # IP: Flush test set
 0 ipset -F test
 # IP: Delete test set
@@ -53,9 +53,9 @@
 # IP: Add more entries to the second set
 0 tail -n +2 iphash.t.restore | sed -e 's/test/test2/' -e 's/ 10/ 30/' | ipset r
 # IP: Save sets
-0 ipset -s -f .foo0 save && ./ignore.sh .foo0
+0 ipset -s -f "$IPSET_TMP/.foo0" save && ./ignore.sh "$IPSET_TMP/.foo0"
 # IP: Compare sorted save and restore
-0 cmp .foo iphash.t.restore.sorted
+0 cmp "$IPSET_TMP/.foo" iphash.t.restore.sorted
 # IP: Delete test set
 0 ipset x test
 # IP: Delete test2 set
@@ -63,9 +63,9 @@
 # IP: Restore, which requires multiple messages
 0 ipset restore < iphash.t.large
 # IP: Save the restored set
-0 (ipset save test | sort > .foo.1) && ./ignore.sh .foo.1
+0 (ipset save test | sort > "$IPSET_TMP/.foo.1") && ./ignore.sh "$IPSET_TMP/.foo.1"
 # IP: Compare save and restore
-0 (sort iphash.t.large > .foo.2) && (cmp .foo .foo.2)
+0 (sort iphash.t.large > "$IPSET_TMP/.foo.2") && (cmp "$IPSET_TMP/.foo" "$IPSET_TMP/.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
@@ -95,9 +95,9 @@
 # Network: Delete element not added to the set
 1 ipset -D test 200.100.0.12
 # Network: List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Network: Check listing
-0 ./diff.sh .foo iphash.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" iphash.t.list1
 # Network: Flush test set
 0 ipset -F test
 # Network: Delete test set
index 8e90dc2d1082c6ce6ab40f3ba5176cc09eeb2146..e5b613466ec6b68b85d74dfaa40b3d08e9153640 100644 (file)
 # Range: Add a range of elements
 0 ipset -A test 2.0.0.128-2.0.0.131
 # Range: Save set
-0 ipset -S test > ipmap.t.restore
+0 ipset -S test > "$IPSET_TMP/ipmap.t.restore"
 # Range: Destroy set
 0 ipset -X test
 # Range: Restore set and catch error
-1 sed 's/2.0.0.131/222.0.0.131/' < ipmap.t.restore | ipset -R
+1 sed 's/2.0.0.131/222.0.0.131/' < "$IPSET_TMP/ipmap.t.restore" | ipset -R
 # Range: Check returned error line number
-0 num=`grep 'in line' < .foo.err | sed 's/.* in line //' | cut -d : -f 1` && test $num -eq 6
+0 num=`grep 'in line' < "$IPSET_TMP/.foo.err" | sed 's/.* in line //' | cut -d : -f 1` && test $num -eq 6
 # Range: Destroy set
 0 ipset -X test
 # Range: Restore set
-0 ipset -R < ipmap.t.restore && rm ipmap.t.restore
+0 ipset -R < "$IPSET_TMP/ipmap.t.restore" && rm "$IPSET_TMP/ipmap.t.restore"
 # Range: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Range: Check listing
-0 ./diff.sh .foo ipmap.t.list0
+0 ./diff.sh "$IPSET_TMP/.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
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Range: Check listing
-0 ./diff.sh .foo ipmap.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" ipmap.t.list1
 # Range: Flush test set
 0 ipset -F test
 # Range: Delete test set
@@ -91,9 +91,9 @@
 # Network: Delete the same element
 0 ipset -D test 2.0.0.128
 # Network: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Network: Check listing
-0 ./diff.sh .foo ipmap.t.list2
+0 ./diff.sh "$IPSET_TMP/.foo" ipmap.t.list2
 # Network: Flush test set
 0 ipset -F test
 # Network: Delete test set
 # Subnets: Add a subnet of subnets
 0 ipset -A test 10.8.0.0/16
 # Subnets: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Subnets: Check listing
-0 ./diff.sh .foo ipmap.t.list3
+0 ./diff.sh "$IPSET_TMP/.foo" ipmap.t.list3
 # Subnets: FLush test set
 0 ipset -F test
 # Subnets: Delete test set
 # Full: Delete same element
 0 ipset -D test 0.1.0.0
 # Full: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Full: Check listing
-0 ./diff.sh .foo ipmap.t.list4
+0 ./diff.sh "$IPSET_TMP/.foo" ipmap.t.list4
 # Full: Delete test set
 0 ipset -X test
 # eof
index 1276f725243437a2fabe5a868f457d3e7f2061d2..276178da0bc08c9c201703ab64a8b20450d7a13a 100644 (file)
@@ -31,9 +31,9 @@
 # Try to add value after second random value
 0 ipset -A test 2.1.0.1,0x80
 # List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo ipmarkhash.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" ipmarkhash.t.list0
 # Flush test set
 0 ipset -F test
 # Delete test set
@@ -61,9 +61,9 @@
 # Try to add value after second random value
 0 ipset -A test 2.1.0.0,0x80
 # List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo ipmarkhash.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" ipmarkhash.t.list1
 # Flush test set
 0 ipset -F test
 # Delete test set
index b8f36063ddb58497c0384c5c6732949d5e7c4ca0..21da79235394dd8552176171ae61ea44997eb389 100644 (file)
@@ -31,9 +31,9 @@
 # Try to add value after second random value
 0 ipset -A test 2.1.0.1,128
 # List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo ipporthash.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" ipporthash.t.list0
 # Flush test set
 0 ipset -F test
 # Delete test set
@@ -61,9 +61,9 @@
 # Try to add value after second random value
 0 ipset -A test 2.1.0.0,128
 # List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo ipporthash.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" ipporthash.t.list1
 # Flush test set
 0 ipset -F test
 # Delete test set
index 32f22d116366434d7308d3c372ffb399e8dd4e60..8256f682f8307d18c781b770f28eaedeedd71569 100644 (file)
@@ -39,9 +39,9 @@
 # Try to add value after second random value
 0 ipset -A test 2.1.0.1,128,2.2.2.2
 # List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo ipportiphash.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" ipportiphash.t.list0
 # Flush test set
 0 ipset -F test
 # Delete test set
@@ -71,9 +71,9 @@
 # Try to del value before first random value
 0 ipset -D test 1.255.255.255,5,1.1.1.1
 # List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo ipportiphash.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" ipportiphash.t.list1
 # Flush test set
 0 ipset -F test
 # Delete test set
index b34d46d88ccd7981a0ad5ee0f6fee993973f414b..9b422d08cc625831121e2ac07d2f8335b2499918 100644 (file)
@@ -35,9 +35,9 @@
 # Range: Try to add value after second random value
 0 ipset -A test 2.1.0.1,128,2.2.2.2/12
 # Range: List set
-0 ipset -L test | grep -v Revision: > .foo0 && ./sort.sh .foo0
+0 ipset -L test | grep -v Revision: > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Range: Check listing
-0 diff -u -I 'Size in memory.*' .foo ipportnethash.t.list0
+0 diff -u -I 'Size in memory.*' "$IPSET_TMP/.foo" ipportnethash.t.list0
 # Range: Flush test set
 0 ipset -F test
 # Range: Delete test set
@@ -65,9 +65,9 @@
 # Network: Try to add value after second random value
 0 ipset -A test 2.1.0.0,128,2.2.2.2/12
 # Network: List set
-0 ipset -L test | grep -v Revision: > .foo0 && ./sort.sh .foo0
+0 ipset -L test | grep -v Revision: > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Network: Check listing
-0 diff -u -I 'Size in memory.*' .foo ipportnethash.t.list1
+0 diff -u -I 'Size in memory.*' "$IPSET_TMP/.foo" ipportnethash.t.list1
 # Network: Flush test set
 0 ipset -F test
 # Add a non-matching IP address entry
index f101ab45767c052dd3909028ed4349cbb3accbe6..119241cdd83ac43dc716339395c8d450f9a07835 100755 (executable)
@@ -58,8 +58,8 @@ start)
                      -j LOG --log-prefix "in set ipport: "
        $cmd -A INPUT -m set --match-set list src,src \
                      -j LOG --log-prefix "in set list: "
-       $cmd -A OUTPUT -d $NET -j DROP
-       cat /dev/null > .foo.err
+#      $cmd -A OUTPUT -d $NET -j DROP
+       cat /dev/null > "$IPSET_TMP/.foo.err"
        cat /dev/null > /var/log/kern.log
        ;;
 start_flags)
@@ -73,7 +73,7 @@ start_flags)
        $cmd -A INPUT -m set --match-set test src --return-nomatch \
                      -j LOG --log-prefix "in set test-nomatch: "
        $cmd -A INPUT -s 10.0.0.0/16 -j DROP
-       cat /dev/null > .foo.err
+       cat /dev/null > "$IPSET_TMP/.foo.err"
        cat /dev/null > /var/log/kern.log
        ;;
 start_flags_reversed)
@@ -87,7 +87,7 @@ start_flags_reversed)
        $cmd -A INPUT -m set --match-set test src \
                      -j LOG --log-prefix "in set test: "
        $cmd -A INPUT -s 10.0.0.0/16 -j DROP
-       cat /dev/null > .foo.err
+       cat /dev/null > "$IPSET_TMP/.foo.err"
        cat /dev/null > /var/log/kern.log
        ;;
 del)
index 1e5f7ade78119e7341129e5c5e2f23ae58d6847a..af3ce91aabfeae07549a387a065009967aed44d3 100644 (file)
@@ -13,9 +13,9 @@
 # Static: Test value not added to the set
 1 ipset -T test 192.168.68.70
 # Static: List set
-0 ipset -L test | grep -v Revision: > .foo0 && ./sort.sh .foo0
+0 ipset -L test | grep -v Revision: > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Static: Check listing
-0 diff -u -I 'Size in memory.*' .foo iptree.t.list0
+0 diff -u -I 'Size in memory.*' "$IPSET_TMP/.foo" iptree.t.list0
 # Static: Flush test set
 0 ipset -F test
 # Static: Delete test set
index 8061b4fcd7d538947f272910f3bf1daa7f47c550..65979d72c36c5736f2e45578fc87c8365f901d9e 100644 (file)
@@ -49,9 +49,9 @@
 # Test element after upper bound of deleted network
 0 ipset -T test 192.168.68.72
 # List set
-0 ipset -L test | grep -v Revision: > .foo0 && ./sort.sh .foo0
+0 ipset -L test | grep -v Revision: > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 diff -u -I 'Size in memory.*' .foo iptreemap.t.list0
+0 diff -u -I 'Size in memory.*' "$IPSET_TMP/.foo" iptreemap.t.list0
 # Flush test set
 0 ipset -F test
 # Delete test set
index 074e067443b877e7d25e874eae89905e0910e67d..c2708aef0b25b1fea3fc9652ea2350032d4dd923 100644 (file)
@@ -39,9 +39,9 @@
 # Range: Delete the same element
 0 ipset -D test 2.0.200.214
 # Range: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Range: Check listing
-0 ./diff.sh .foo macipmap.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" macipmap.t.list0
 # Range: Flush test set
 0 ipset -F test
 # Range: Catch invalid (too long) MAC
@@ -87,9 +87,9 @@
 # Network: Add MAC to already added element
 0 ipset -A test 2.0.255.255,00:11:22:33:44:56
 # Network: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Network: Check listing
-0 ./diff.sh .foo macipmap.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" macipmap.t.list1
 # Network: Flush test set
 0 ipset -F test
 # Network: Delete test set
 # Range: Delete the same element
 0 ipset -D test 2.0.200.214
 # Range: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Range: Check listing
-0 ./diff.sh .foo macipmap.t.list3
+0 ./diff.sh "$IPSET_TMP/.foo" macipmap.t.list3
 # Range: sleep 5s so that elements can timeout
 0 sleep 5
 # Range: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Range: Check listing
-0 ./diff.sh .foo macipmap.t.list2
+0 ./diff.sh "$IPSET_TMP/.foo" macipmap.t.list2
 # Range: Flush test set
 0 ipset -F test
 # Range: add element with 1s timeout
index 4141ce6bddde9f984cd57f5851604c615d784697..c3ead171dd00c533376081f6e6eba101db8ec3be 100644 (file)
 # Create set and rules for 0.0.0.0/0 check in hash:net,iface
 0 ./iptables.sh inet netiface
 # Send probe packet
-0 ./sendip.sh -p ipv4 -id 10.255.255.254 -is 10.255.255.64 -p udp -ud 80 -us 1025 10.255.255.254 >/dev/null 2>&1
+0 ./sendip.sh -p ipv4 -id 10.255.255.254 -is 10.255.255.64 -p udp -ud 80 -us 1025 10.255.255.254
 # Check kernel log that the packet matched the set
 0 ./check_klog.sh 10.255.255.64 udp 1025 netiface
 # Destroy sets and rules
index 8f98ffa6888ecc0c9d8cf6ea7b6ae34bdc3dc8fa..c4f47704414eb0dd92f91b3f3c4a03700dc3f966 100644 (file)
@@ -33,9 +33,9 @@
 # Try to add IP address
 0 ipset -A test 2.0.0.1
 # List set
-0 ipset -L test > .foo0 && ./sort.sh .foo0
+0 ipset -L test > "$IPSET_TMP/.foo0" && ./sort.sh "$IPSET_TMP/.foo0"
 # Check listing
-0 ./diff.sh .foo nethash.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" nethash.t.list0
 # Flush test set
 0 ipset -F test
 # Add a non-matching IP address entry
index 819a59bc072eb564dd3950820666e13f5f4c930a..1b4a82fd81b4cfe3ac1308f49c8c3d8fa6aef3f1 100644 (file)
@@ -25,9 +25,9 @@
 # Range: Delete the same element
 0 ipset -D test 567
 # Range: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Range: Check listing
-0 ./diff.sh .foo portmap.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" portmap.t.list0
 # Range: Flush test set
 0 ipset -F test
 # Range: Delete test set
@@ -45,9 +45,9 @@
 # Full: Test value not added to the set
 1 ipset -T test 1
 # Full: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Full: Check listing
-0 ./diff.sh .foo portmap.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" portmap.t.list1
 # Full: Flush test set
 0 ipset -F test
 # Full: Delete test set
 # Full: Delete the same element
 0 ipset -D test 567
 # Full: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Full: Check listing
-0 ./diff.sh .foo portmap.t.list3
+0 ./diff.sh "$IPSET_TMP/.foo" portmap.t.list3
 # Full: sleep 5s so that elements can timeout
 0 sleep 5
 # Full: List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Full: Check listing
-# 0 ./diff.sh .foo portmap.t.list2
+# 0 ./diff.sh "$IPSET_TMP/.foo" portmap.t.list2
 # Full: Flush test set
 0 ipset -F test
 # Full: add element with 1s timeout
index dda143f8412b0c9b3debe11dcb562e46e3f7475b..02da4465af94a4df776f44e31437749b500c4a2f 100644 (file)
@@ -1,7 +1,7 @@
 # Check multi-set restore
 0 ipset restore < restore.t.multi
 # Save sets and compare
-0 ipset save > .foo && diff restore.t.multi.saved .foo
+0 ipset save > "$IPSET_TMP/.foo" && diff restore.t.multi.saved "$IPSET_TMP/.foo"
 # Delete all sets
 0 ipset x
 # Check auto-increasing maximal number of sets
index fc4fd3c13dc6bbb1dca529d7e768a1c2e829a207..d102305fff5f71acd3cbd08ec2ff44a02dfdc411 100755 (executable)
@@ -3,6 +3,7 @@
 # set -x
 
 ipset=${IPSET_BIN:-../src/ipset}
+tmpdir=""
 
 tests="init"
 tests="$tests ipmap bitmap:ip"
@@ -17,10 +18,18 @@ tests="$tests hash:net,port,net hash:net6,port,net6"
 tests="$tests hash:net,iface.t hash:mac.t"
 tests="$tests comment setlist restore"
 # tests="$tests iptree iptreemap"
+cleanup() {
+       rm -f "$tmpdir"/.foo*
+       rm -f "$tmpdir/.loglines"
+       rmdir "$tmpdir"
+}
+trap cleanup EXIT
+tmpdir=$(mktemp -t -d ipset-XXXXXXXX)
 
 # For correct sorting:
 LC_ALL=C
 export LC_ALL
+export IPSET_TMP="$tmpdir"
 
 add_tests() {
        # inet|inet6 network
@@ -105,7 +114,7 @@ for types in $tests; do
                ;;
        esac
        echo -ne "$types: $what: "
-       cmd=`echo $cmd | sed "s|ipset|$ipset 2>.foo.err|"`
+       cmd=`echo $cmd | sed "s|ipset|$ipset 2>"$tmpdir"/.foo.err|"`
        # For the case: ipset list | ... | xargs -n1 ipset
        cmd=`echo $cmd | sed "s|ipset|$ipset|2g"`
        eval $cmd
@@ -116,7 +125,7 @@ for types in $tests; do
        else
                echo "FAILED"
                echo "Failed test: $cmd"
-               cat .foo.err
+               cat "$tmpdir"/.foo.err
                let "failcount++"
                break
        fi
@@ -137,7 +146,6 @@ for x in $tests; do
        esac
 done
 rmmod ip_set >/dev/null 2>&1
-rm -f .foo*
 if [ "$failcount" -eq 0 ]; then
        echo "All tests are passed"
 else
index 3a951f58c7ada9f0d22c54b9b192d4d9a510fd19..f80b24ab49b86183dc2ba7118f93f5314cc29743 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
 # Save lineno for checking
-wc -l /var/log/kern.log | cut -d ' ' -f 1 > .loglines
+wc -l /var/log/kern.log | cut -d ' ' -f 1 > "$IPSET_TMP/.loglines"
 sendip "$@"
 
index a2780d7aa825d1a577aed59f2a2f658e9869d744..c1f1d3b4481642162833f446c1052cf5ee202a6f 100644 (file)
@@ -29,7 +29,7 @@
 # Test foo,after,bar
 1 ipset -T test foo,after,bar
 # Save sets
-0 ipset -S > setlist.t.r
+0 ipset -S > "$IPSET_TMP/setlist.t.r"
 # Delete bar,before,foo
 1 ipset -D test bar,before,foo
 # Delete foo,after,bar
 # Delete all sets
 0 ipset -X
 # Restore saved sets
-0 ipset -R < setlist.t.r
+0 ipset -R < "$IPSET_TMP/setlist.t.r"
 # List set
-0 ipset -L test > .foo
+0 ipset -L test > "$IPSET_TMP/.foo"
 # Check listing
-0 ./diff.sh .foo setlist.t.list0
+0 ./diff.sh "$IPSET_TMP/.foo" setlist.t.list0
 # Flush all sets
 0 ipset -F
 # Delete all sets
-0 ipset -X && rm setlist.t.r
+0 ipset -X && rm "$IPSET_TMP/setlist.t.r"
 # Create sets a, b, c to check before/after in all combinations
 0 ipset restore < setlist.t.before
 # Add set b to test set
@@ -61,9 +61,9 @@
 # Add set a before b
 0 ipset add test a before b
 # List test set
-0 ipset list test > .foo
+0 ipset list test > "$IPSET_TMP/.foo"
 # Check listing
-0 ./diff.sh .foo setlist.t.list1
+0 ./diff.sh "$IPSET_TMP/.foo" setlist.t.list1
 # Test a set before b
 0 ipset test test a before b
 # Test c set after b
 # Delete b set before c
 0 ipset del test b before c
 # List test set
-0 ipset list test > .foo
+0 ipset list test > "$IPSET_TMP/.foo"
 # Check listing
-0 ./diff.sh .foo setlist.t.list2
+0 ./diff.sh "$IPSET_TMP/.foo" setlist.t.list2
 # Delete c set after a
 0 ipset del test c after a
 # List test set
-0 ipset list test > .foo
+0 ipset list test > "$IPSET_TMP/.foo"
 # Check listing
-0 ./diff.sh .foo setlist.t.list3
+0 ./diff.sh "$IPSET_TMP/.foo" setlist.t.list3
 # List all sets
-0 sleep .1s; ipset list > .foo
+0 sleep .1s; ipset list > "$IPSET_TMP/.foo"
 # Check listing
-0 ./diff.sh .foo setlist.t.list4
+0 ./diff.sh "$IPSET_TMP/.foo" setlist.t.list4
 # Flush sets
 0 ipset flush
 # Destroy sets
index 904b216827066937661db7bb5d6bc33a8d703a1d..56893ac36e1f9f3d685815d987f904b53e438d60 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-sed '/Members:/q' $1 > .foo
-awk '/Members:/,EOF' $1 | grep -v 'Members:' | sort >> .foo
-rm -f $1
+sed '/Members:/q' "$1" > "$IPSET_TMP/.foo"
+awk '/Members:/,EOF' "$1" | grep -v 'Members:' | sort >> "$IPSET_TMP/.foo"
+rm -f "$1"