summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-06-07 19:25:24 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-06-08 00:04:24 +0200
commit5edf80a14b8e3eafa3fbcef073f87e04da5264db (patch)
tree1dafa290613d9cb6795d7b447a81f7c858556677
parente5382c0d08e3c6d8246afa95b7380f0d6b8c1826 (diff)
tests/py: Fix JSON equivalents
Recent patch removing single element set use missed to adjust JSON equivalents accordingly. Fixes: 27f6a4c68b4fd ("tests: replace single element sets") Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--tests/py/any/ct.t.json35
-rw-r--r--tests/py/any/ct.t.json.output21
-rw-r--r--tests/py/any/meta.t.json110
3 files changed, 86 insertions, 80 deletions
diff --git a/tests/py/any/ct.t.json b/tests/py/any/ct.t.json
index 45e48f22..7c16f9df 100644
--- a/tests/py/any/ct.t.json
+++ b/tests/py/any/ct.t.json
@@ -883,7 +883,7 @@
}
]
-# ct expiration {33-55}
+# ct expiration {33-55, 66-88}
[
{
"match": {
@@ -895,16 +895,15 @@
"op": "==",
"right": {
"set": [
- {
- "range": [ 33, 55 ]
- }
+ { "range": [ 33, 55 ] },
+ { "range": [ 66, 88 ] }
]
}
}
}
]
-# ct expiration != {33-55}
+# ct expiration != {33-55, 66-88}
[
{
"match": {
@@ -916,9 +915,8 @@
"op": "!=",
"right": {
"set": [
- {
- "range": [ 33, 55 ]
- }
+ { "range": [ 33, 55 ] },
+ { "range": [ 66, 88 ] }
]
}
}
@@ -1003,7 +1001,7 @@
}
]
-# ct direction . ct mark { original . 0x12345678}
+# ct direction . ct mark { original . 0x12345678, reply . 0x87654321}
[
{
"match": {
@@ -1029,6 +1027,12 @@
"original",
"0x12345678"
]
+ },
+ {
+ "concat": [
+ "reply",
+ "0x87654321"
+ ]
}
]
}
@@ -1036,7 +1040,7 @@
}
]
-# ct state . ct mark vmap { new . 0x12345678 : drop}
+# ct state . ct mark vmap { new . 0x12345678 : drop, established . 0x87654321 : accept}
[
{
"vmap": {
@@ -1066,6 +1070,17 @@
{
"drop": null
}
+ ],
+ [
+ {
+ "concat": [
+ "established",
+ "0x87654321"
+ ]
+ },
+ {
+ "accept": null
+ }
]
]
}
diff --git a/tests/py/any/ct.t.json.output b/tests/py/any/ct.t.json.output
index 49d51771..aced3817 100644
--- a/tests/py/any/ct.t.json.output
+++ b/tests/py/any/ct.t.json.output
@@ -549,7 +549,7 @@
}
]
-# ct direction . ct mark { original . 0x12345678}
+# ct direction . ct mark { original . 0x12345678, reply . 0x87654321}
[
{
"match": {
@@ -575,6 +575,12 @@
"original",
305419896
]
+ },
+ {
+ "concat": [
+ "reply",
+ 2271560481
+ ]
}
]
}
@@ -582,7 +588,7 @@
}
]
-# ct state . ct mark vmap { new . 0x12345678 : drop}
+# ct state . ct mark vmap { new . 0x12345678 : drop, established . 0x87654321 : accept}
[
{
"vmap": {
@@ -605,6 +611,17 @@
[
{
"concat": [
+ "established",
+ 2271560481
+ ]
+ },
+ {
+ "accept": null
+ }
+ ],
+ [
+ {
+ "concat": [
"new",
305419896
]
diff --git a/tests/py/any/meta.t.json b/tests/py/any/meta.t.json
index 2cf91cda..447e553f 100644
--- a/tests/py/any/meta.t.json
+++ b/tests/py/any/meta.t.json
@@ -143,7 +143,7 @@
}
]
-# meta length { 33-55}
+# meta length { 33-55, 66-88}
[
{
"match": {
@@ -153,14 +153,15 @@
"op": "==",
"right": {
"set": [
- { "range": [ 33, 55 ] }
+ { "range": [ 33, 55 ] },
+ { "range": [ 66, 88 ] }
]
}
}
}
]
-# meta length != { 33-55}
+# meta length != { 33-55, 66-88}
[
{
"match": {
@@ -170,7 +171,8 @@
"op": "!=",
"right": {
"set": [
- { "range": [ 33, 55 ] }
+ { "range": [ 33, 55 ] },
+ { "range": [ 66, 88 ] }
]
}
}
@@ -339,7 +341,7 @@
}
]
-# meta l4proto { 33-55}
+# meta l4proto { 33-55, 66-88}
[
{
"match": {
@@ -349,14 +351,15 @@
"op": "==",
"right": {
"set": [
- { "range": [ 33, 55 ] }
+ { "range": [ 33, 55 ] },
+ { "range": [ 66, 88 ] }
]
}
}
}
]
-# meta l4proto != { 33-55}
+# meta l4proto != { 33-55, 66-88}
[
{
"match": {
@@ -366,7 +369,8 @@
"op": "!=",
"right": {
"set": [
- { "range": [ 33, 55 ] }
+ { "range": [ 33, 55 ] },
+ { "range": [ 66, 88 ] }
]
}
}
@@ -980,46 +984,6 @@
}
]
-# meta oif {"lo"} accept
-[
- {
- "match": {
- "left": {
- "meta": { "key": "oif" }
- },
- "op": "==",
- "right": {
- "set": [
- "lo"
- ]
- }
- }
- },
- {
- "accept": null
- }
-]
-
-# meta oif != {"lo"} accept
-[
- {
- "match": {
- "left": {
- "meta": { "key": "oif" }
- },
- "op": "!=",
- "right": {
- "set": [
- "lo"
- ]
- }
- }
- },
- {
- "accept": null
- }
-]
-
# meta oifname "dummy0"
[
{
@@ -1316,7 +1280,7 @@
}
]
-# meta skuid { 2001-2005} accept
+# meta skuid { 2001-2005, 3001-3005} accept
[
{
"match": {
@@ -1326,7 +1290,8 @@
"op": "==",
"right": {
"set": [
- { "range": [ 2001, 2005 ] }
+ { "range": [ 2001, 2005 ] },
+ { "range": [ 3001, 3005 ] }
]
}
}
@@ -1336,7 +1301,7 @@
}
]
-# meta skuid != { 2001-2005} accept
+# meta skuid != { 2001-2005, 3001-3005} accept
[
{
"match": {
@@ -1346,7 +1311,8 @@
"op": "!=",
"right": {
"set": [
- { "range": [ 2001, 2005 ] }
+ { "range": [ 2001, 2005 ] },
+ { "range": [ 3001, 3005 ] }
]
}
}
@@ -1988,7 +1954,7 @@
}
]
-# meta iifgroup {"default"}
+# meta iifgroup {"default", 11}
[
{
"match": {
@@ -1998,14 +1964,15 @@
"op": "==",
"right": {
"set": [
- "default"
+ "default",
+ 11
]
}
}
}
]
-# meta iifgroup != {"default"}
+# meta iifgroup != {"default", 11}
[
{
"match": {
@@ -2015,7 +1982,8 @@
"op": "!=",
"right": {
"set": [
- "default"
+ "default",
+ 11
]
}
}
@@ -2040,7 +2008,7 @@
}
]
-# meta iifgroup {11-33}
+# meta iifgroup {11-33, 44-55}
[
{
"match": {
@@ -2050,7 +2018,8 @@
"op": "==",
"right": {
"set": [
- { "range": [ 11, 33 ] }
+ { "range": [ 11, 33 ] },
+ { "range": [ 44, 55 ] }
]
}
}
@@ -2075,7 +2044,7 @@
}
]
-# meta iifgroup != {11-33}
+# meta iifgroup != {11-33, 44-55}
[
{
"match": {
@@ -2085,7 +2054,8 @@
"op": "!=",
"right": {
"set": [
- { "range": [ 11, 33 ] }
+ { "range": [ 11, 33 ] },
+ { "range": [ 44, 55 ] }
]
}
}
@@ -2144,7 +2114,7 @@
}
]
-# meta oifgroup {"default"}
+# meta oifgroup {"default", 11}
[
{
"match": {
@@ -2154,14 +2124,15 @@
"op": "==",
"right": {
"set": [
- "default"
+ "default",
+ 11
]
}
}
}
]
-# meta oifgroup != {"default"}
+# meta oifgroup != {"default", 11}
[
{
"match": {
@@ -2171,7 +2142,8 @@
"op": "!=",
"right": {
"set": [
- "default"
+ "default",
+ 11
]
}
}
@@ -2196,7 +2168,7 @@
}
]
-# meta oifgroup {11-33}
+# meta oifgroup {11-33, 44-55}
[
{
"match": {
@@ -2206,7 +2178,8 @@
"op": "==",
"right": {
"set": [
- { "range": [ 11, 33 ] }
+ { "range": [ 11, 33 ] },
+ { "range": [ 44, 55 ] }
]
}
}
@@ -2231,7 +2204,7 @@
}
]
-# meta oifgroup != {11-33}
+# meta oifgroup != {11-33, 44-55}
[
{
"match": {
@@ -2241,7 +2214,8 @@
"op": "!=",
"right": {
"set": [
- { "range": [ 11, 33 ] }
+ { "range": [ 11, 33 ] },
+ { "range": [ 44, 55 ] }
]
}
}