From: Phil Sutter Date: Fri, 22 Mar 2024 13:00:26 +0000 (+0100) Subject: tests: py: Fix some JSON equivalents X-Git-Tag: v1.1.0~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0c17b910b3e19c4eacf5567f90b6545ed1fd8aac;p=thirdparty%2Fnftables.git tests: py: Fix some JSON equivalents Make sure they match the standard syntax input as much as possible. For some reason inet/tcp.t.json was using plain arrays in place of binary OR expressions in many cases. These arrays are interpreted as list expressions, which seems to be semantically identical but the goal here is to present an accurate equivalent to the rule in standard syntax. Signed-off-by: Phil Sutter --- diff --git a/tests/py/any/meta.t.json b/tests/py/any/meta.t.json index 2af3f623..676affea 100644 --- a/tests/py/any/meta.t.json +++ b/tests/py/any/meta.t.json @@ -2661,7 +2661,7 @@ } }, "op": "==", - "right": "17:00" + "right": "17:00:00" } }, { diff --git a/tests/py/any/tcpopt.t.json b/tests/py/any/tcpopt.t.json index 4466f14f..87074b9d 100644 --- a/tests/py/any/tcpopt.t.json +++ b/tests/py/any/tcpopt.t.json @@ -192,7 +192,7 @@ "left": { "tcp option": { "field": "left", - "name": "sack" + "name": "sack0" } }, "op": "==", @@ -272,7 +272,7 @@ "left": { "tcp option": { "field": "right", - "name": "sack" + "name": "sack0" } }, "op": "==", diff --git a/tests/py/inet/tcp.t.json b/tests/py/inet/tcp.t.json index bd589cf0..28dd4341 100644 --- a/tests/py/inet/tcp.t.json +++ b/tests/py/inet/tcp.t.json @@ -1370,13 +1370,13 @@ "op": "==", "right": { "set": [ + "syn", { "|": [ "syn", "ack" ] - }, - "syn" + } ] } } @@ -1401,10 +1401,10 @@ "op": "==", "right": { "set": [ - { "|": [ "fin", "psh", "ack" ] }, "fin", + "ack", { "|": [ "psh", "ack" ] }, - "ack" + { "|": [ "fin", "psh", "ack" ] } ] } } @@ -1442,17 +1442,21 @@ "protocol": "tcp" } }, - [ - "fin", - "syn" - ] + { + "|": [ + "fin", + "syn" + ] + } ] }, "op": "==", - "right": [ - "fin", - "syn" - ] + "right": { + "|": [ + "fin", + "syn" + ] + } } } ] @@ -1469,10 +1473,12 @@ "protocol": "tcp" } }, - [ - "fin", - "syn" - ] + { + "|": [ + "fin", + "syn" + ] + } ] }, "op": "!=", @@ -1605,12 +1611,14 @@ "protocol": "tcp" } }, - [ - "fin", - "syn", - "rst", - "ack" - ] + { + "|": [ + "fin", + "syn", + "rst", + "ack" + ] + } ] }, "op": "==", @@ -1631,12 +1639,14 @@ "protocol": "tcp" } }, - [ - "fin", - "syn", - "rst", - "ack" - ] + { + "|": [ + "fin", + "syn", + "rst", + "ack" + ] + } ] }, "op": "==", @@ -1658,12 +1668,14 @@ "protocol": "tcp" } }, - [ - "fin", - "syn", - "rst", - "ack" - ] + { + "|": [ + "fin", + "syn", + "rst", + "ack" + ] + } ] }, "op": "!=", @@ -1684,19 +1696,23 @@ "protocol": "tcp" } }, - [ - "fin", - "syn", - "rst", - "ack" - ] + { + "|": [ + "fin", + "syn", + "rst", + "ack" + ] + } ] }, "op": "==", - "right": [ - "syn", - "ack" - ] + "right": { + "|": [ + "syn", + "ack" + ] + } } } ] @@ -1713,17 +1729,21 @@ "protocol": "tcp" } }, - [ - "syn", - "ack" - ] + { + "|": [ + "syn", + "ack" + ] + } ] }, "op": "==", - "right": [ - "syn", - "ack" - ] + "right": { + "|": [ + "syn", + "ack" + ] + } } } ]