summaryrefslogtreecommitdiffstats
path: root/tests/py/ip6
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2016-03-07 17:27:53 +0100
committerFlorian Westphal <fw@strlen.de>2016-03-10 14:08:20 +0100
commit2294f6828cd73c12ed76b93f65ffe7315c947c96 (patch)
tree82751d6ec2a3c63d4cb7ec558f039340ee0f8e2a /tests/py/ip6
parent3d3aa45033167b300ec81ab4ae7c2819ecac6ab5 (diff)
tests: frag: enable more tests
Signed-off-by: Florian Westphal <fw@strlen.de> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/py/ip6')
-rw-r--r--tests/py/ip6/frag.t8
-rw-r--r--tests/py/ip6/frag.t.payload.inet38
-rw-r--r--tests/py/ip6/frag.t.payload.ip630
3 files changed, 72 insertions, 4 deletions
diff --git a/tests/py/ip6/frag.t b/tests/py/ip6/frag.t
index 56801ed8..1551044d 100644
--- a/tests/py/ip6/frag.t
+++ b/tests/py/ip6/frag.t
@@ -23,13 +23,13 @@ frag reserved { 33-55};ok
# BUG: frag frag-off 22 and frag frag-off { 33-55}
# This breaks table listing: "netlink: Error: Relational expression size mismatch"
-- frag frag-off 22;ok
-- frag frag-off != 233;ok
+frag frag-off 22;ok
+frag frag-off != 233;ok
- frag frag-off 33-45;ok
- frag frag-off != 33-45;ok
-- frag frag-off { 33, 55, 67, 88};ok
+frag frag-off { 33, 55, 67, 88};ok
- frag frag-off != { 33, 55, 67, 88};ok
-- frag frag-off { 33-55};ok
+frag frag-off { 33-55};ok
- frag frag-off != { 33-55};ok
# BUG frag reserved2 33 and frag reserved2 1
diff --git a/tests/py/ip6/frag.t.payload.inet b/tests/py/ip6/frag.t.payload.inet
index 7cedaf3e..e04d128e 100644
--- a/tests/py/ip6/frag.t.payload.inet
+++ b/tests/py/ip6/frag.t.payload.inet
@@ -86,6 +86,44 @@ inet test-inet output
[ exthdr load 1b @ 44 + 1 => reg 1 ]
[ lookup reg 1 set set%d ]
+# frag frag-off 22
+inet test-inet output
+ [ meta load nfproto => reg 1 ]
+ [ cmp eq reg 1 0x0000000a ]
+ [ exthdr load 2b @ 44 + 2 => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x0000f8ff ) ^ 0x00000000 ]
+ [ cmp eq reg 1 0x0000b000 ]
+
+# frag frag-off != 233
+inet test-inet output
+ [ meta load nfproto => reg 1 ]
+ [ cmp eq reg 1 0x0000000a ]
+ [ exthdr load 2b @ 44 + 2 => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x0000f8ff ) ^ 0x00000000 ]
+ [ cmp neq reg 1 0x00004807 ]
+
+# frag frag-off { 33, 55, 67, 88}
+set%d test-inet 3
+set%d test-inet 0
+ element 00002100 : 0 [end] element 00003700 : 0 [end] element 00004300 : 0 [end] element 00005800 : 0 [end]
+inet test-inet output
+ [ meta load nfproto => reg 1 ]
+ [ cmp eq reg 1 0x0000000a ]
+ [ exthdr load 2b @ 44 + 2 => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x0000f8ff ) ^ 0x00000000 ]
+ [ lookup reg 1 set set%d ]
+
+# frag frag-off { 33-55}
+set%d test-inet 7
+set%d test-inet 0
+ element 00000000 : 1 [end] element 00002100 : 0 [end] element 00003800 : 1 [end]
+inet test-inet output
+ [ meta load nfproto => reg 1 ]
+ [ cmp eq reg 1 0x0000000a ]
+ [ exthdr load 2b @ 44 + 2 => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x0000f8ff ) ^ 0x00000000 ]
+ [ lookup reg 1 set set%d ]
+
# frag id 1
inet test-inet output
[ meta load nfproto => reg 1 ]
diff --git a/tests/py/ip6/frag.t.payload.ip6 b/tests/py/ip6/frag.t.payload.ip6
index f2d04b6b..b3da6fef 100644
--- a/tests/py/ip6/frag.t.payload.ip6
+++ b/tests/py/ip6/frag.t.payload.ip6
@@ -64,6 +64,36 @@ ip6 test-ip6 output
[ exthdr load 1b @ 44 + 1 => reg 1 ]
[ lookup reg 1 set set%d ]
+# frag frag-off 22
+ip6 test-ip6 output
+ [ exthdr load 2b @ 44 + 2 => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x0000f8ff ) ^ 0x00000000 ]
+ [ cmp eq reg 1 0x0000b000 ]
+
+# frag frag-off != 233
+ip6 test-ip6 output
+ [ exthdr load 2b @ 44 + 2 => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x0000f8ff ) ^ 0x00000000 ]
+ [ cmp neq reg 1 0x00004807 ]
+
+# frag frag-off { 33, 55, 67, 88}
+set%d test-ip6 3
+set%d test-ip6 0
+ element 00002100 : 0 [end] element 00003700 : 0 [end] element 00004300 : 0 [end] element 00005800 : 0 [end]
+ip6 test-ip6 output
+ [ exthdr load 2b @ 44 + 2 => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x0000f8ff ) ^ 0x00000000 ]
+ [ lookup reg 1 set set%d ]
+
+# frag frag-off { 33-55}
+set%d test-ip6 7
+set%d test-ip6 0
+ element 00000000 : 1 [end] element 00002100 : 0 [end] element 00003800 : 1 [end]
+ip6 test-ip6 output
+ [ exthdr load 2b @ 44 + 2 => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x0000f8ff ) ^ 0x00000000 ]
+ [ lookup reg 1 set set%d ]
+
# frag id 1
ip6 test-ip6 output
[ exthdr load 4b @ 44 + 4 => reg 1 ]