diff options
author | Anders K. Pedersen <akp@cohaesio.com> | 2016-10-29 03:12:41 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2016-10-29 03:12:41 +0200 |
commit | 6bc84e04c40a2497c4c416556df09e2782059e1c (patch) | |
tree | 459c92b5ec75e84951e9facb42d3361a38ec6784 /tests/py/inet | |
parent | 4a75ed32132d8e2292dd276f3ea7f4edec4f3d06 (diff) |
Replace tests/files/expr-rt with Python based tests, and replace ether type
with meta nfproto, which generates a bit fewer instructions.
Signed-off-by: Anders K. Pedersen <akp@cohaesio.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/py/inet')
-rw-r--r-- | tests/py/inet/rt.t | 8 | ||||
-rw-r--r-- | tests/py/inet/rt.t.payload | 14 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/py/inet/rt.t b/tests/py/inet/rt.t new file mode 100644 index 00000000..f2dcbdc4 --- /dev/null +++ b/tests/py/inet/rt.t @@ -0,0 +1,8 @@ +:output;type filter hook input priority 0 + +*inet;test-inet;output + +rt nexthop 192.168.0.1;fail +rt nexthop fd00::1;fail +meta nfproto ipv4 rt nexthop 192.168.0.1;ok +meta nfproto ipv6 rt nexthop fd00::1;ok diff --git a/tests/py/inet/rt.t.payload b/tests/py/inet/rt.t.payload new file mode 100644 index 00000000..d94973e0 --- /dev/null +++ b/tests/py/inet/rt.t.payload @@ -0,0 +1,14 @@ +# meta nfproto ipv4 rt nexthop 192.168.0.1 +inet test-inet output + [ meta load nfproto => reg 1 ] + [ cmp eq reg 1 0x00000002 ] + [ rt load nexthop4 => reg 1 ] + [ cmp eq reg 1 0x0100a8c0 ] + +# meta nfproto ipv6 rt nexthop fd00::1 +inet test-inet output + [ meta load nfproto => reg 1 ] + [ cmp eq reg 1 0x0000000a ] + [ rt load nexthop6 => reg 1 ] + [ cmp eq reg 1 0x000000fd 0x00000000 0x00000000 0x01000000 ] + |