summaryrefslogtreecommitdiffstats
path: root/tests/py/bridge
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-08-29 16:23:27 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-08-30 12:19:36 +0200
commit90d4ee087171e75d5313359ad6b6f1341e51ddc5 (patch)
tree59572c39aa334813b9b090fa46a57fedf9ff5aac /tests/py/bridge
parent8f6e1c37e3e74e1fd490a0de5360ff1467c521cd (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/bridge')
-rw-r--r--tests/py/bridge/ether.t.json13
-rw-r--r--tests/py/bridge/ether.t.json.output6
-rw-r--r--tests/py/bridge/icmpX.t.json6
-rw-r--r--tests/py/bridge/icmpX.t.json.output4
-rw-r--r--tests/py/bridge/meta.t.json2
-rw-r--r--tests/py/bridge/reject.t.json4
-rw-r--r--tests/py/bridge/reject.t.json.output13
-rw-r--r--tests/py/bridge/vlan.t.json33
8 files changed, 81 insertions, 0 deletions
diff --git a/tests/py/bridge/ether.t.json b/tests/py/bridge/ether.t.json
index d9a0066b..485ceee4 100644
--- a/tests/py/bridge/ether.t.json
+++ b/tests/py/bridge/ether.t.json
@@ -8,6 +8,7 @@
"protocol": "tcp"
}
},
+ "op": "==",
"right": 22
}
},
@@ -16,6 +17,7 @@
"left": {
"meta": { "key": "iiftype" }
},
+ "op": "==",
"right": "ether"
}
},
@@ -27,6 +29,7 @@
"protocol": "ip"
}
},
+ "op": "==",
"right": "1.2.3.4"
}
},
@@ -38,6 +41,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "00:0f:54:0c:11:04"
}
},
@@ -56,6 +60,7 @@
"protocol": "tcp"
}
},
+ "op": "==",
"right": 22
}
},
@@ -67,6 +72,7 @@
"protocol": "ip"
}
},
+ "op": "==",
"right": "1.2.3.4"
}
},
@@ -78,6 +84,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "00:0f:54:0c:11:04"
}
}
@@ -93,6 +100,7 @@
"protocol": "tcp"
}
},
+ "op": "==",
"right": 22
}
},
@@ -104,6 +112,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "00:0f:54:0c:11:04"
}
},
@@ -115,6 +124,7 @@
"protocol": "ip"
}
},
+ "op": "==",
"right": "1.2.3.4"
}
}
@@ -130,6 +140,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "00:0f:54:0c:11:04"
}
},
@@ -141,6 +152,7 @@
"protocol": "ip"
}
},
+ "op": "==",
"right": "1.2.3.4"
}
},
@@ -159,6 +171,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "00:01:02:03:04:05"
}
},
diff --git a/tests/py/bridge/ether.t.json.output b/tests/py/bridge/ether.t.json.output
index 1c3cb8dc..05e568f6 100644
--- a/tests/py/bridge/ether.t.json.output
+++ b/tests/py/bridge/ether.t.json.output
@@ -8,6 +8,7 @@
"protocol": "tcp"
}
},
+ "op": "==",
"right": 22
}
},
@@ -19,6 +20,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "00:0f:54:0c:11:04"
}
},
@@ -30,6 +32,7 @@
"protocol": "ip"
}
},
+ "op": "==",
"right": "1.2.3.4"
}
},
@@ -48,6 +51,7 @@
"protocol": "tcp"
}
},
+ "op": "==",
"right": 22
}
},
@@ -59,6 +63,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "00:0f:54:0c:11:04"
}
},
@@ -70,6 +75,7 @@
"protocol": "ip"
}
},
+ "op": "==",
"right": "1.2.3.4"
}
}
diff --git a/tests/py/bridge/icmpX.t.json b/tests/py/bridge/icmpX.t.json
index 830bb799..2dd341ec 100644
--- a/tests/py/bridge/icmpX.t.json
+++ b/tests/py/bridge/icmpX.t.json
@@ -8,6 +8,7 @@
"protocol": "ip"
}
},
+ "op": "==",
"right": "icmp"
}
},
@@ -19,6 +20,7 @@
"protocol": "icmp"
}
},
+ "op": "==",
"right": "echo-request"
}
}
@@ -34,6 +36,7 @@
"protocol": "icmp"
}
},
+ "op": "==",
"right": "echo-request"
}
}
@@ -49,6 +52,7 @@
"protocol": "ip6"
}
},
+ "op": "==",
"right": "icmpv6"
}
},
@@ -60,6 +64,7 @@
"protocol": "icmpv6"
}
},
+ "op": "==",
"right": "echo-request"
}
}
@@ -75,6 +80,7 @@
"protocol": "icmpv6"
}
},
+ "op": "==",
"right": "echo-request"
}
}
diff --git a/tests/py/bridge/icmpX.t.json.output b/tests/py/bridge/icmpX.t.json.output
index ecfaa62f..8cf46791 100644
--- a/tests/py/bridge/icmpX.t.json.output
+++ b/tests/py/bridge/icmpX.t.json.output
@@ -8,6 +8,7 @@
"protocol": "ip"
}
},
+ "op": "==",
"right": 1
}
},
@@ -19,6 +20,7 @@
"protocol": "icmp"
}
},
+ "op": "==",
"right": "echo-request"
}
}
@@ -34,6 +36,7 @@
"protocol": "ip6"
}
},
+ "op": "==",
"right": 58
}
},
@@ -45,6 +48,7 @@
"protocol": "icmpv6"
}
},
+ "op": "==",
"right": "echo-request"
}
}
diff --git a/tests/py/bridge/meta.t.json b/tests/py/bridge/meta.t.json
index 0c63e26e..5df4773a 100644
--- a/tests/py/bridge/meta.t.json
+++ b/tests/py/bridge/meta.t.json
@@ -5,6 +5,7 @@
"left": {
"meta": { "key": "obrname" }
},
+ "op": "==",
"right": "br0"
}
}
@@ -17,6 +18,7 @@
"left": {
"meta": { "key": "ibrname" }
},
+ "op": "==",
"right": "br0"
}
}
diff --git a/tests/py/bridge/reject.t.json b/tests/py/bridge/reject.t.json
index 0ced129c..d20a1d8b 100644
--- a/tests/py/bridge/reject.t.json
+++ b/tests/py/bridge/reject.t.json
@@ -115,6 +115,7 @@
"left": {
"meta": { "key": "mark" }
},
+ "op": "==",
"right": 12345
}
},
@@ -126,6 +127,7 @@
"protocol": "ip"
}
},
+ "op": "==",
"right": "tcp"
}
},
@@ -153,6 +155,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "ip"
}
},
@@ -171,6 +174,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "ip6"
}
},
diff --git a/tests/py/bridge/reject.t.json.output b/tests/py/bridge/reject.t.json.output
index a83feabc..08dfaf6a 100644
--- a/tests/py/bridge/reject.t.json.output
+++ b/tests/py/bridge/reject.t.json.output
@@ -8,6 +8,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "ip"
}
},
@@ -29,6 +30,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "ip"
}
},
@@ -50,6 +52,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "ip"
}
},
@@ -71,6 +74,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "ip"
}
},
@@ -89,6 +93,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "ip"
}
},
@@ -110,6 +115,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "ip"
}
},
@@ -131,6 +137,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "ip"
}
},
@@ -152,6 +159,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "ip6"
}
},
@@ -173,6 +181,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "ip6"
}
},
@@ -194,6 +203,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "ip6"
}
},
@@ -215,6 +225,7 @@
"protocol": "ether"
}
},
+ "op": "==",
"right": "ip6"
}
},
@@ -230,6 +241,7 @@
"left": {
"meta": { "key": "mark" }
},
+ "op": "==",
"right": 12345
}
},
@@ -241,6 +253,7 @@
"protocol": "ip"
}
},
+ "op": "==",
"right": 6
}
},
diff --git a/tests/py/bridge/vlan.t.json b/tests/py/bridge/vlan.t.json
index 7facb61b..1a654640 100644
--- a/tests/py/bridge/vlan.t.json
+++ b/tests/py/bridge/vlan.t.json
@@ -8,6 +8,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 4094
}
}
@@ -23,6 +24,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 0
}
}
@@ -38,6 +40,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 4094
}
},
@@ -49,6 +52,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 0
}
}
@@ -64,6 +68,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 4094
}
},
@@ -91,6 +96,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 4094
}
},
@@ -102,6 +108,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 1
}
}
@@ -117,6 +124,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 4094
}
},
@@ -128,6 +136,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 1
}
},
@@ -139,6 +148,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 7
}
}
@@ -154,6 +164,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 4094
}
},
@@ -165,6 +176,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 1
}
},
@@ -176,6 +188,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 3
}
}
@@ -191,6 +204,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 4094
}
}
@@ -206,6 +220,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 0
}
}
@@ -221,6 +236,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 4094
}
},
@@ -232,6 +248,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 0
}
}
@@ -247,6 +264,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 4094
}
},
@@ -258,6 +276,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 1
}
}
@@ -273,6 +292,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 4094
}
},
@@ -284,6 +304,7 @@
"protocol": "tcp"
}
},
+ "op": "==",
"right": 22
}
}
@@ -299,6 +320,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 1
}
},
@@ -310,6 +332,7 @@
"protocol": "ip"
}
},
+ "op": "==",
"right": "10.0.0.1"
}
}
@@ -325,6 +348,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 1
}
},
@@ -336,6 +360,7 @@
"protocol": "ip"
}
},
+ "op": "==",
"right": {
"prefix": {
"addr": "10.0.0.0",
@@ -356,6 +381,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 1
}
},
@@ -367,6 +393,7 @@
"protocol": "ip"
}
},
+ "op": "==",
"right": {
"prefix": {
"addr": "10.0.0.0",
@@ -383,6 +410,7 @@
"protocol": "udp"
}
},
+ "op": "==",
"right": 53
}
}
@@ -398,6 +426,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": 1
}
},
@@ -409,6 +438,7 @@
"protocol": "ip"
}
},
+ "op": "==",
"right": {
"prefix": {
"addr": "10.0.0.0",
@@ -425,6 +455,7 @@
"protocol": "udp"
}
},
+ "op": "==",
"right": 53
}
}
@@ -440,6 +471,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": {
"set": [
1,
@@ -459,6 +491,7 @@
"protocol": "vlan"
}
},
+ "op": "==",
"right": {
"range": [ 1, 3 ]
}