summaryrefslogtreecommitdiffstats
path: root/tests/py/arp
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2018-02-24 10:45:32 +0100
committerFlorian Westphal <fw@strlen.de>2018-02-26 18:32:47 +0100
commitd3d2c4bd782368e9024d88795659325372b99ed8 (patch)
treed0beb2e966257e981954052b080fef06ab7a7125 /tests/py/arp
parent594968b4fd4a68e57868b316c904ec676c6618c3 (diff)
tests: add raw payload test cases.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/py/arp')
-rw-r--r--tests/py/arp/arp.t2
-rw-r--r--tests/py/arp/arp.t.payload10
-rw-r--r--tests/py/arp/arp.t.payload.netdev13
3 files changed, 25 insertions, 0 deletions
diff --git a/tests/py/arp/arp.t b/tests/py/arp/arp.t
index 94ab4a50..36c7f196 100644
--- a/tests/py/arp/arp.t
+++ b/tests/py/arp/arp.t
@@ -54,3 +54,5 @@ arp operation != inrequest;ok
arp operation != inreply;ok
arp operation != nak;ok
arp operation != reply;ok
+
+meta iifname \"invalid\" arp ptype 0x0800 arp htype 1 arp hlen 6 arp plen 4 @nh,192,32 0xc0a88f10 @nh,144,48 set 0x112233445566;ok;iifname "invalid" arp htype 1 arp ptype ip arp hlen 6 arp plen 4 @nh,192,32 3232272144 @nh,144,48 set 18838586676582
diff --git a/tests/py/arp/arp.t.payload b/tests/py/arp/arp.t.payload
index ea778b2d..34ae2414 100644
--- a/tests/py/arp/arp.t.payload
+++ b/tests/py/arp/arp.t.payload
@@ -268,3 +268,13 @@ arp test-arp input
[ payload load 2b @ network header + 6 => reg 1 ]
[ cmp neq reg 1 0x00000200 ]
+# meta iifname \"invalid\" arp ptype 0x0800 arp htype 1 arp hlen 6 arp plen 4 @nh,192,32 0xc0a88f10 @nh,144,48 set 0x112233445566
+arp test-arp input
+ [ meta load iifname => reg 1 ]
+ [ cmp eq reg 1 0x61766e69 0x0064696c 0x00000000 0x00000000 ]
+ [ payload load 6b @ network header + 0 => reg 1 ]
+ [ cmp eq reg 1 0x00080100 0x00000406 ]
+ [ payload load 4b @ network header + 24 => reg 1 ]
+ [ cmp eq reg 1 0x108fa8c0 ]
+ [ immediate reg 1 0x44332211 0x00006655 ]
+ [ payload write reg 1 => 6b @ network header + 18 csum_type 0 csum_off 0 csum_flags 0x0 ]
diff --git a/tests/py/arp/arp.t.payload.netdev b/tests/py/arp/arp.t.payload.netdev
index acf9eb1c..21818ba2 100644
--- a/tests/py/arp/arp.t.payload.netdev
+++ b/tests/py/arp/arp.t.payload.netdev
@@ -358,3 +358,16 @@ netdev test-netdev ingress
[ payload load 2b @ network header + 6 => reg 1 ]
[ cmp neq reg 1 0x00000200 ]
+# meta iifname \"invalid\" arp ptype 0x0800 arp htype 1 arp hlen 6 arp plen 4 @nh,192,32 0xc0a88f10 @nh,144,48 set 0x112233445566
+netdev test-netdev ingress
+ [ meta load iifname => reg 1 ]
+ [ cmp eq reg 1 0x61766e69 0x0064696c 0x00000000 0x00000000 ]
+ [ meta load protocol => reg 1 ]
+ [ cmp eq reg 1 0x00000608 ]
+ [ payload load 6b @ network header + 0 => reg 1 ]
+ [ cmp eq reg 1 0x00080100 0x00000406 ]
+ [ payload load 4b @ network header + 24 => reg 1 ]
+ [ cmp eq reg 1 0x108fa8c0 ]
+ [ immediate reg 1 0x44332211 0x00006655 ]
+ [ payload write reg 1 => 6b @ network header + 18 csum_type 0 csum_off 0 csum_flags 0x0 ]
+