diff options
author | Phil Sutter <phil@nwl.cc> | 2018-08-29 16:23:27 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-08-30 12:19:36 +0200 |
commit | 90d4ee087171e75d5313359ad6b6f1341e51ddc5 (patch) | |
tree | 59572c39aa334813b9b090fa46a57fedf9ff5aac /tests/py/arp | |
parent | 8f6e1c37e3e74e1fd490a0de5360ff1467c521cd (diff) |
JSON: Make match op mandatory, introduce 'in' operator
This special operator is required for cases where missing operator does
not lead to same results as equal operator, i.e. with bitmasks on RHS.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/py/arp')
-rw-r--r-- | tests/py/arp/arp.t.json | 29 | ||||
-rw-r--r-- | tests/py/arp/arp.t.json.output | 8 |
2 files changed, 37 insertions, 0 deletions
diff --git a/tests/py/arp/arp.t.json b/tests/py/arp/arp.t.json index 7f5c3ca2..4b0439e6 100644 --- a/tests/py/arp/arp.t.json +++ b/tests/py/arp/arp.t.json @@ -8,6 +8,7 @@ "protocol": "arp" } }, + "op": "==", "right": 1 } } @@ -39,6 +40,7 @@ "protocol": "arp" } }, + "op": "==", "right": 22 } } @@ -70,6 +72,7 @@ "protocol": "arp" } }, + "op": "==", "right": { "range": [ 33, 45 ] } @@ -105,6 +108,7 @@ "protocol": "arp" } }, + "op": "==", "right": { "set": [ 33, @@ -150,6 +154,7 @@ "protocol": "arp" } }, + "op": "==", "right": { "set": [ { "range": [ 33, 55 ] } @@ -189,6 +194,7 @@ "protocol": "arp" } }, + "op": "==", "right": "0x0800" } } @@ -204,6 +210,7 @@ "protocol": "arp" } }, + "op": "==", "right": 22 } } @@ -235,6 +242,7 @@ "protocol": "arp" } }, + "op": "==", "right": { "range": [ 33, 45 ] } @@ -270,6 +278,7 @@ "protocol": "arp" } }, + "op": "==", "right": { "set": [ 33, @@ -315,6 +324,7 @@ "protocol": "arp" } }, + "op": "==", "right": { "set": [ { "range": [ 33, 55 ] } @@ -354,6 +364,7 @@ "protocol": "arp" } }, + "op": "==", "right": 22 } } @@ -385,6 +396,7 @@ "protocol": "arp" } }, + "op": "==", "right": { "range": [ 33, 45 ] } @@ -420,6 +432,7 @@ "protocol": "arp" } }, + "op": "==", "right": { "set": [ 33, @@ -465,6 +478,7 @@ "protocol": "arp" } }, + "op": "==", "right": { "set": [ { "range": [ 33, 55 ] } @@ -504,6 +518,7 @@ "protocol": "arp" } }, + "op": "==", "right": { "set": [ "nak", @@ -555,6 +570,7 @@ "protocol": "arp" } }, + "op": "==", "right": "request" } } @@ -570,6 +586,7 @@ "protocol": "arp" } }, + "op": "==", "right": "reply" } } @@ -585,6 +602,7 @@ "protocol": "arp" } }, + "op": "==", "right": "rrequest" } } @@ -600,6 +618,7 @@ "protocol": "arp" } }, + "op": "==", "right": "rreply" } } @@ -615,6 +634,7 @@ "protocol": "arp" } }, + "op": "==", "right": "inrequest" } } @@ -630,6 +650,7 @@ "protocol": "arp" } }, + "op": "==", "right": "inreply" } } @@ -645,6 +666,7 @@ "protocol": "arp" } }, + "op": "==", "right": "nak" } } @@ -660,6 +682,7 @@ "protocol": "arp" } }, + "op": "==", "right": "reply" } } @@ -800,6 +823,7 @@ "left": { "meta": { "key": "iifname" } }, + "op": "==", "right": "invalid" } }, @@ -811,6 +835,7 @@ "protocol": "arp" } }, + "op": "==", "right": "0x0800" } }, @@ -822,6 +847,7 @@ "protocol": "arp" } }, + "op": "==", "right": 1 } }, @@ -833,6 +859,7 @@ "protocol": "arp" } }, + "op": "==", "right": 6 } }, @@ -844,6 +871,7 @@ "protocol": "arp" } }, + "op": "==", "right": 4 } }, @@ -856,6 +884,7 @@ "offset": 192 } }, + "op": "==", "right": "0xc0a88f10" } }, diff --git a/tests/py/arp/arp.t.json.output b/tests/py/arp/arp.t.json.output index 7ee4dbfa..4053d947 100644 --- a/tests/py/arp/arp.t.json.output +++ b/tests/py/arp/arp.t.json.output @@ -8,6 +8,7 @@ "protocol": "arp" } }, + "op": "==", "right": "ip" } } @@ -23,6 +24,7 @@ "protocol": "arp" } }, + "op": "==", "right": { "set": [ "request", @@ -71,6 +73,7 @@ "left": { "meta": { "key": "iifname" } }, + "op": "==", "right": "invalid" } }, @@ -82,6 +85,7 @@ "protocol": "arp" } }, + "op": "==", "right": 1 } }, @@ -93,6 +97,7 @@ "protocol": "arp" } }, + "op": "==", "right": "ip" } }, @@ -104,6 +109,7 @@ "protocol": "arp" } }, + "op": "==", "right": 6 } }, @@ -115,6 +121,7 @@ "protocol": "arp" } }, + "op": "==", "right": 4 } }, @@ -127,6 +134,7 @@ "offset": 192 } }, + "op": "==", "right": 3232272144 } }, |