]> git.ipfire.org Git - thirdparty/ipset.git/commitdiff
tests: Verify module unload when sets with timeout were just destroyed
authorJozsef Kadlecsik <kadlec@netfilter.org>
Mon, 5 Feb 2024 11:41:10 +0000 (12:41 +0100)
committerJozsef Kadlecsik <kadlec@netfilter.org>
Mon, 5 Feb 2024 11:41:10 +0000 (12:41 +0100)
tests/restore.t
tests/setlist_resize.sh

index ffde2d124ab48f617911dd1844d024b168bd8525..dda143f8412b0c9b3debe11dcb562e46e3f7475b 100644 (file)
@@ -6,4 +6,28 @@
 0 ipset x
 # Check auto-increasing maximal number of sets
 0 ./setlist_resize.sh
+# Create bitmap set with timeout
+0 ipset create test1 bitmap:ip range 2.0.0.1-2.1.0.0 timeout 5
+# Add element to bitmap set
+0 ipset add test1 2.0.0.2 timeout 30
+# Create hash set with timeout
+0 ipset -N test2 iphash --hashsize 128 timeout 4
+# Add element to hash set
+0 ipset add test2 2.0.0.3 timeout 30
+# Create list set with timeout
+0 ipset -N test3 list:set timeout 3
+# Add bitmap set to list set
+0 ipset a test3 test1 timeout 30
+# Add hash set to list set
+0 ipset a test3 test2 timeout 30
+# Flush list set
+0 ipset f test3
+# Destroy all sets
+0 ipset x
+# Remove the ip_set_list_set kernel module
+0 rmmod ip_set_list_set
+# Remove the ip_set_bitmap_ip kernel module
+0 rmmod ip_set_bitmap_ip
+# Remove the ip_set_hash_ip kernel module
+0 rmmod ip_set_hash_ip
 # eof
index 3255656eadc78728f9416595602db9afea72e579..848f1d123b2a00aa426e19a07172f8b8378d8e26 100755 (executable)
@@ -12,7 +12,7 @@ for x in ip_set_list_set ip_set_hash_netiface ip_set_hash_ipportnet \
         ip_set_hash_netportnet ip_set_hash_ipmark ip_set_hash_mac \
         ip_set_bitmap_port ip_set_bitmap_ipmac \
         ip_set_bitmap_ip xt_set ip_set; do
-    rmmod $x
+    rmmod $x >/dev/null 2>&1
 done
 
 create() {
@@ -31,6 +31,6 @@ for x in `seq 1 $loop`; do
     test `$ipset l -n | wc -l` -eq 1024 || exit 1
     $ipset x
     test `lsmod|grep -w ^ip_set_hash_ip | awk '{print $3}'` -eq 0 || exit 1
-    rmmod ip_set_hash_ip
-    rmmod ip_set
+    rmmod ip_set_hash_ip >/dev/null 2>&1
+    rmmod ip_set >/dev/null 2>&1
 done