From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [nft PATCH 2/4] tests/py: Add missing arp.t JSON equivalents
Date: Fri, 7 Jun 2019 19:25:25 +0200 [thread overview]
Message-ID: <20190607172527.22177-3-phil@nwl.cc> (raw)
In-Reply-To: <20190607172527.22177-1-phil@nwl.cc>
Fixes: 4b0f2a712b579 ("src: support for arp sender and target ethernet and IPv4 addresses")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
tests/py/arp/arp.t.json | 64 ++++++++++++++++++++++++++++++++++
tests/py/arp/arp.t.json.output | 14 ++++----
2 files changed, 70 insertions(+), 8 deletions(-)
diff --git a/tests/py/arp/arp.t.json b/tests/py/arp/arp.t.json
index 4b0439e6edd58..0ea62645bbf6a 100644
--- a/tests/py/arp/arp.t.json
+++ b/tests/py/arp/arp.t.json
@@ -816,6 +816,70 @@
}
]
+# arp saddr ip 1.2.3.4
+[
+ {
+ "match": {
+ "left": {
+ "payload": {
+ "field": "saddr ip",
+ "protocol": "arp"
+ }
+ },
+ "op": "==",
+ "right": "1.2.3.4"
+ }
+ }
+]
+
+# arp daddr ip 4.3.2.1
+[
+ {
+ "match": {
+ "left": {
+ "payload": {
+ "field": "daddr ip",
+ "protocol": "arp"
+ }
+ },
+ "op": "==",
+ "right": "4.3.2.1"
+ }
+ }
+]
+
+# arp saddr ether aa:bb:cc:aa:bb:cc
+[
+ {
+ "match": {
+ "left": {
+ "payload": {
+ "field": "saddr ether",
+ "protocol": "arp"
+ }
+ },
+ "op": "==",
+ "right": "aa:bb:cc:aa:bb:cc"
+ }
+ }
+]
+
+# arp daddr ether aa:bb:cc:aa:bb:cc
+[
+ {
+ "match": {
+ "left": {
+ "payload": {
+ "field": "daddr ether",
+ "protocol": "arp"
+ }
+ },
+ "op": "==",
+ "right": "aa:bb:cc:aa:bb:cc"
+ }
+ }
+]
+
# meta iifname "invalid" arp ptype 0x0800 arp htype 1 arp hlen 6 arp plen 4 @nh,192,32 0xc0a88f10 @nh,144,48 set 0x112233445566
[
{
diff --git a/tests/py/arp/arp.t.json.output b/tests/py/arp/arp.t.json.output
index 4053d94763de5..b8507bffc8cc4 100644
--- a/tests/py/arp/arp.t.json.output
+++ b/tests/py/arp/arp.t.json.output
@@ -129,25 +129,23 @@
"match": {
"left": {
"payload": {
- "base": "nh",
- "len": 32,
- "offset": 192
+ "field": "daddr ip",
+ "protocol": "arp"
}
},
"op": "==",
- "right": 3232272144
+ "right": "192.168.143.16"
}
},
{
"mangle": {
"key": {
"payload": {
- "base": "nh",
- "len": 48,
- "offset": 144
+ "field": "daddr ether",
+ "protocol": "arp"
}
},
- "value": 18838586676582
+ "value": "11:22:33:44:55:66"
}
}
]
--
2.21.0
next prev parent reply other threads:[~2019-06-07 17:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-07 17:25 [nft PATCH 0/4] Some fixes and minor improvements in tests/ Phil Sutter
2019-06-07 17:25 ` [nft PATCH 1/4] tests/py: Fix JSON equivalents Phil Sutter
2019-06-07 17:25 ` Phil Sutter [this message]
2019-06-07 17:25 ` [nft PATCH 3/4] tests/shell: Fix warning from awk call Phil Sutter
2019-06-07 17:25 ` [nft PATCH 4/4] tests/shell: Print unified diffs in dump errors Phil Sutter
2019-06-07 22:06 ` [nft PATCH 0/4] Some fixes and minor improvements in tests/ Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190607172527.22177-3-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).