From b3e8f7feacf438e601aa2c7e96de92f3ca061b34 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Thu, 24 Nov 2011 16:49:54 +0100 Subject: [PATCH] Tests added to check ICMP/ICMPv6 type/code parsing --- tests/hash:net,port.t | 6 ++++++ tests/hash:net,port.t.list0 | 1 + tests/hash:net6,port.t | 6 ++++++ tests/hash:net6,port.t.list0 | 1 + 4 files changed, 14 insertions(+) diff --git a/tests/hash:net,port.t b/tests/hash:net,port.t index b7bc8a3..993893d 100644 --- a/tests/hash:net,port.t +++ b/tests/hash:net,port.t @@ -34,6 +34,12 @@ 1 ipset test test 2.0.1.0,icmp:ping # Try to add IP address 0 ipset add test 2.0.0.1,icmp:ping timeout 3 +# Add ICMP by type/code +0 ipset add test 2.0.0.255,icmp:3/10 +# Test ICMP by type/code +0 ipset test test 2.0.0.255,icmp:3/10 +# Test ICMP by name +0 ipset test test 2.0.0.255,icmp:host-prohibited # List set 0 ipset list test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # Check listing diff --git a/tests/hash:net,port.t.list0 b/tests/hash:net,port.t.list0 index 4988d96..60244a0 100644 --- a/tests/hash:net,port.t.list0 +++ b/tests/hash:net,port.t.list0 @@ -8,3 +8,4 @@ Members: 192.168.68.64/27,tcp:8 timeout x 2.0.0.0/24,icmp:echo-request timeout x 2.0.0.1,icmp:echo-request timeout x +2.0.0.255,icmp:host-prohibited timeout x diff --git a/tests/hash:net6,port.t b/tests/hash:net6,port.t index 1638157..3b58523 100644 --- a/tests/hash:net6,port.t +++ b/tests/hash:net6,port.t @@ -34,6 +34,12 @@ 1 ipset test test 3:0:0::1,tcp:8 # Try to add IP address 0 ipset add test 3:0:0::1,tcp:8 +# Add ICMPv6 by type/code +0 ipset add test 192:168:68::95,icmpv6:1/4 +# Test ICMPv6 by type/code +0 ipset test test 192:168:68::95,icmpv6:1/4 +# Test ICMPv6 by name +0 ipset test test 192:168:68::95,icmpv6:port-unreachable # List set 0 ipset list test | sed 's/timeout ./timeout x/' > .foo0 && ./sort.sh .foo0 # Save set diff --git a/tests/hash:net6,port.t.list0 b/tests/hash:net6,port.t.list0 index e66d2df..f574d2c 100644 --- a/tests/hash:net6,port.t.list0 +++ b/tests/hash:net6,port.t.list0 @@ -5,6 +5,7 @@ Size in memory: 2328 References: 0 Members: 192:160::/27,ipv6-icmp:echo-request timeout x +192:168:68::95,ipv6-icmp:port-unreachable timeout x 1:1:1::1,tcp:8 timeout x 2::/24,tcp:8 timeout x 3::1,tcp:8 timeout x -- 2.40.0