From 1441728b56f3ed8288b7b3bab0422adf1f90cecc Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Sun, 24 Jan 2016 13:29:55 +0100 Subject: tests: add two map test cases One normal map lookup, one with an explicit binop. The latter is supposed to also work with the followup patch applied. Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso --- tests/py/ip6/map.t | 5 +++++ tests/py/ip6/map.t.payload | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 tests/py/ip6/map.t create mode 100644 tests/py/ip6/map.t.payload (limited to 'tests/py/ip6') diff --git a/tests/py/ip6/map.t b/tests/py/ip6/map.t new file mode 100644 index 00000000..3377f8d3 --- /dev/null +++ b/tests/py/ip6/map.t @@ -0,0 +1,5 @@ +:input;type filter hook input priority 0 +*ip6;test-ip6;input + +mark set ip6 saddr and ::ffff map { ::2 : 0x0000002a, ::ffff : 0x00000017};ok;mark set ip6 saddr & ::ffff map { ::2 : 0x0000002a, ::ffff : 0x00000017} + diff --git a/tests/py/ip6/map.t.payload b/tests/py/ip6/map.t.payload new file mode 100644 index 00000000..db7df27d --- /dev/null +++ b/tests/py/ip6/map.t.payload @@ -0,0 +1,10 @@ +# mark set ip6 saddr and ::ffff map { ::2 : 0x0000002a, ::ffff : 0x00000017} +map%d test-ip6 b +map%d test-ip6 0 + element 00000000 00000000 00000000 02000000 : 0000002a 0 [end] element 00000000 00000000 00000000 ffff0000 : 00000017 0 [end] +ip6 test-ip6 input + [ payload load 16b @ network header + 8 => reg 1 ] + [ bitwise reg 1 = (reg=1 & 0x00000000 0x00000000 0x00000000 0xffff0000 ) ^ 0x00000000 0x00000000 0x00000000 0x00000000 ] + [ lookup reg 1 set map%d dreg 1 ] + [ meta set mark with reg 1 ] + -- cgit v1.2.3