From: Phil Sutter Date: Thu, 9 Oct 2025 00:06:54 +0000 (+0200) Subject: tests: py: inet/osf.t: Fix element ordering in JSON equivalents X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b028f8ce616bb5a219a10844357b9a3822d99a8c;p=thirdparty%2Fnftables.git tests: py: inet/osf.t: Fix element ordering in JSON equivalents The original rules order set elements differently. Stick to that and add entries to inet/osf.t.json.output to cover for nftables reordering entries. Fixes: 92029c1282958 ("src: osf: add json support") Signed-off-by: Phil Sutter --- diff --git a/tests/py/inet/osf.t.json b/tests/py/inet/osf.t.json index cedb7f67..b1bf7472 100644 --- a/tests/py/inet/osf.t.json +++ b/tests/py/inet/osf.t.json @@ -73,8 +73,8 @@ "op": "==", "right": { "set": [ - "MacOs", - "Windows" + "Windows", + "MacOs" ] } } @@ -114,13 +114,13 @@ "map": { "data": { "set": [ - [ - "MacOs", - 2 - ], [ "Windows", 1 + ], + [ + "MacOs", + 2 ] ] }, diff --git a/tests/py/inet/osf.t.json.output b/tests/py/inet/osf.t.json.output new file mode 100644 index 00000000..922e395f --- /dev/null +++ b/tests/py/inet/osf.t.json.output @@ -0,0 +1,53 @@ +# osf name { "Windows", "MacOs" } +[ + { + "match": { + "left": { + "osf": { + "key": "name" + } + }, + "op": "==", + "right": { + "set": [ + "MacOs", + "Windows" + ] + } + } + } +] + +# ct mark set osf name map { "Windows" : 0x00000001, "MacOs" : 0x00000002 } +[ + { + "mangle": { + "key": { + "ct": { + "key": "mark" + } + }, + "value": { + "map": { + "data": { + "set": [ + [ + "MacOs", + 2 + ], + [ + "Windows", + 1 + ] + ] + }, + "key": { + "osf": { + "key": "name" + } + } + } + } + } + } +]