summaryrefslogtreecommitdiffstats
path: root/tests/setlist.t
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-03-25 11:10:29 +0100
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-03-25 11:10:29 +0100
commitd90a2f5b8998f9063ff8aa7ae0fb301e3933f709 (patch)
tree5788a1833816977c3f6004136d591e6737c9102e /tests/setlist.t
parent48509af4bc2a60c368c46f1351ddf5370e012bc0 (diff)
References are protected by rwlock instead of mutex
The timeout variant of the list:set type must reference the member sets. However, its garbage collector runs at timer interrupt so the mutex protection of the references is a no go. Therefore the reference protection is converted to rwlock.
Diffstat (limited to 'tests/setlist.t')
-rw-r--r--tests/setlist.t10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/setlist.t b/tests/setlist.t
index 6d9371d..a322cd4 100644
--- a/tests/setlist.t
+++ b/tests/setlist.t
@@ -70,6 +70,16 @@
0 ipset del test a
# Check reference number of deleted set
0 ref=`ipset list a | grep References | sed 's/References: //'` && test $ref -eq 0
+# Add element to set a
+0 ipset add a 1.1.1.1
+# Swap sets
+0 ipset swap a b
+# Check reference number of deleted set
+0 ref=`ipset list a | grep References | sed 's/References: //'` && test $ref -eq 0
+# Check reference number of member set
+0 ref=`ipset list b | grep References | sed 's/References: //'` && test $ref -eq 1
+# Check element in member set
+0 ipset test b 1.1.1.1
# Sleep 10s so that entries can time out
0 sleep 10
# Check reference numbers of the sets