]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: py: inet/osf.t: Fix element ordering in JSON equivalents
authorPhil Sutter <phil@nwl.cc>
Thu, 9 Oct 2025 00:06:54 +0000 (02:06 +0200)
committerPhil Sutter <phil@nwl.cc>
Thu, 23 Oct 2025 20:48:51 +0000 (22:48 +0200)
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 <phil@nwl.cc>
tests/py/inet/osf.t.json
tests/py/inet/osf.t.json.output [new file with mode: 0644]

index cedb7f67bd52f8cc71220acd9f26aa22ed437dbd..b1bf747265f8165370ae1196cf3e6f0b7877dbd9 100644 (file)
@@ -73,8 +73,8 @@
             "op": "==",
             "right": {
                 "set": [
-                    "MacOs",
-                    "Windows"
+                    "Windows",
+                    "MacOs"
                 ]
             }
         }
                 "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 (file)
index 0000000..922e395
--- /dev/null
@@ -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"
+                        }
+                    }
+                }
+            }
+        }
+    }
+]