summaryrefslogtreecommitdiffstats
path: root/tests/iphash.t
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2018-11-26 10:54:36 +0100
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2018-11-26 10:54:36 +0100
commit3713072d3bcb5dc1cfbb7c5fa3e24b8a73fd4104 (patch)
tree0d43a750fb5ebc63aefc1d7ba6af327c58062ef6 /tests/iphash.t
parenta680d3fdbb637fae53c60e4a30f028bd5ed1fe4b (diff)
Implement sorting for hash types in the ipset tool
Support listing/saving with sorted entries for the hash types. (bitmap and list types are automatically sorted.)
Diffstat (limited to 'tests/iphash.t')
-rw-r--r--tests/iphash.t16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/iphash.t b/tests/iphash.t
index 2f7efa5..0393295 100644
--- a/tests/iphash.t
+++ b/tests/iphash.t
@@ -44,6 +44,22 @@
0 ipset -F test
# IP: Delete test set
0 ipset -X test
+# IP: Restore values in order to check sorting
+0 ipset r -f iphash.t.restore
+# IP: Delete test2 set
+0 (ipset -X test2; true)
+# IP: Restore another set for sorting
+0 sed -e 's/test/test2/' -e 's/ 10/ 20/' < iphash.t.restore | ipset r
+# 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 .foo.1 save
+# IP: Compare sorted save and restore
+0 cmp .foo.1 iphash.t.restore.sorted
+# IP: Delete test set
+0 ipset x test
+# IP: Delete test2 set
+0 ipset x test2
# IP: Restore, which requires multiple messages
0 ipset restore < iphash.t.large
# IP: Save the restored set