Netfilter-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH nft 0/3] tests: py: fixes for failing JSON tests
@ 2020-10-11 19:23 Jeremy Sowden
  2020-10-11 19:23 ` [PATCH nft 1/3] tests: py: add missing JSON output for ct test Jeremy Sowden
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jeremy Sowden @ 2020-10-11 19:23 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

Fixes for a few Python tests with missing or incorrect JSON output.

Jeremy Sowden (3):
  tests: py: add missing JSON output for ct test.
  tests: py: correct order of set elements in test JSON output.
  tests: py: add missing test JSON output for TCP flag tests.

 tests/py/any/ct.t.json          | 15 ++++++
 tests/py/any/ct.t.json.output   | 20 +++----
 tests/py/inet/tcp.t.json        | 93 +++++++++++++++++++++++++++++++++
 tests/py/inet/tcp.t.json.output | 93 +++++++++++++++++++++++++++++++++
 4 files changed, 211 insertions(+), 10 deletions(-)

-- 
2.28.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH nft 1/3] tests: py: add missing JSON output for ct test.
  2020-10-11 19:23 [PATCH nft 0/3] tests: py: fixes for failing JSON tests Jeremy Sowden
@ 2020-10-11 19:23 ` Jeremy Sowden
  2020-10-11 19:23 ` [PATCH nft 2/3] tests: py: correct order of set elements in test JSON output Jeremy Sowden
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jeremy Sowden @ 2020-10-11 19:23 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

Fixes: dcec7d57559a ("ct: Add support for the 'id' key")
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 tests/py/any/ct.t.json | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tests/py/any/ct.t.json b/tests/py/any/ct.t.json
index 59ac27c3055c..c5c15b9c8b94 100644
--- a/tests/py/any/ct.t.json
+++ b/tests/py/any/ct.t.json
@@ -1449,6 +1449,21 @@
     }
 ]
 
+# ct id 12345
+[
+    {
+        "match": {
+            "left": {
+                "ct": {
+                    "key": "id"
+                }
+            },
+            "op": "==",
+            "right": 12345
+        }
+    }
+]
+
 # ct zone set mark map { 1 : 1,  2 : 2 }
 [
     {
-- 
2.28.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH nft 2/3] tests: py: correct order of set elements in test JSON output.
  2020-10-11 19:23 [PATCH nft 0/3] tests: py: fixes for failing JSON tests Jeremy Sowden
  2020-10-11 19:23 ` [PATCH nft 1/3] tests: py: add missing JSON output for ct test Jeremy Sowden
@ 2020-10-11 19:23 ` Jeremy Sowden
  2020-10-11 19:23 ` [PATCH nft 3/3] tests: py: add missing test JSON output for TCP flag tests Jeremy Sowden
  2020-10-12  0:16 ` [PATCH nft 0/3] tests: py: fixes for failing JSON tests Pablo Neira Ayuso
  3 siblings, 0 replies; 5+ messages in thread
From: Jeremy Sowden @ 2020-10-11 19:23 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

Fixes: 741a06ac15d2 ("mergesort: find base value expression type via recursion")
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 tests/py/any/ct.t.json.output | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/py/any/ct.t.json.output b/tests/py/any/ct.t.json.output
index aced3817cf49..70ade7e38987 100644
--- a/tests/py/any/ct.t.json.output
+++ b/tests/py/any/ct.t.json.output
@@ -527,14 +527,14 @@
                 "set": [
                     {
                         "concat": [
-                            "established",
-                            309876276
+                            "new",
+                            305419896
                         ]
                     },
                     {
                         "concat": [
-                            "new",
-                            305419896
+                            "established",
+                            309876276
                         ]
                     },
                     {
@@ -611,23 +611,23 @@
                     [
                         {
                             "concat": [
-                                "established",
-                                2271560481
+                                "new",
+                                305419896
                             ]
                         },
                         {
-                            "accept": null
+                            "drop": null
                         }
                     ],
                     [
                         {
                             "concat": [
-                                "new",
-                                305419896
+                                "established",
+                                2271560481
                             ]
                         },
                         {
-                            "drop": null
+                            "accept": null
                         }
                     ]
                 ]
-- 
2.28.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH nft 3/3] tests: py: add missing test JSON output for TCP flag tests.
  2020-10-11 19:23 [PATCH nft 0/3] tests: py: fixes for failing JSON tests Jeremy Sowden
  2020-10-11 19:23 ` [PATCH nft 1/3] tests: py: add missing JSON output for ct test Jeremy Sowden
  2020-10-11 19:23 ` [PATCH nft 2/3] tests: py: correct order of set elements in test JSON output Jeremy Sowden
@ 2020-10-11 19:23 ` Jeremy Sowden
  2020-10-12  0:16 ` [PATCH nft 0/3] tests: py: fixes for failing JSON tests Pablo Neira Ayuso
  3 siblings, 0 replies; 5+ messages in thread
From: Jeremy Sowden @ 2020-10-11 19:23 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

Fixes: 3926a3369bb5 ("mergesort: unbreak listing with binops")
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 tests/py/inet/tcp.t.json        | 93 +++++++++++++++++++++++++++++++++
 tests/py/inet/tcp.t.json.output | 93 +++++++++++++++++++++++++++++++++
 2 files changed, 186 insertions(+)

diff --git a/tests/py/inet/tcp.t.json b/tests/py/inet/tcp.t.json
index babe59208925..702251828360 100644
--- a/tests/py/inet/tcp.t.json
+++ b/tests/py/inet/tcp.t.json
@@ -1637,3 +1637,96 @@
     }
 ]
 
+# tcp flags { syn, syn | ack }
+[
+    {
+        "match": {
+            "left": {
+                "payload": {
+                    "field": "flags",
+                    "protocol": "tcp"
+                }
+            },
+            "op": "==",
+            "right": {
+                "set": [
+                    {
+                        "|": [
+                            "syn",
+                            "ack"
+                        ]
+                    },
+                    "syn"
+                ]
+            }
+        }
+    }
+]
+
+# tcp flags & (fin | syn | rst | psh | ack | urg) == { fin, ack, psh | ack, fin | psh | ack }
+[
+    {
+        "match": {
+            "left": {
+                "&": [
+                    {
+                        "payload": {
+                            "field": "flags",
+                            "protocol": "tcp"
+                        }
+                    },
+                    {
+                        "|": [
+                            {
+                                "|": [
+                                    {
+                                        "|": [
+                                            {
+                                                "|": [
+                                                    {
+                                                        "|": [
+                                                            "fin",
+                                                            "syn"
+                                                        ]
+                                                    },
+                                                    "rst"
+                                                ]
+                                            },
+                                            "psh"
+                                        ]
+                                    },
+                                    "ack"
+                                ]
+                            },
+                            "urg"
+                        ]
+                    }
+                ]
+            },
+            "op": "==",
+            "right": {
+                "set": [
+                    {
+                        "|": [
+                            {
+                                "|": [
+                                    "fin",
+                                    "psh"
+                                ]
+                            },
+                            "ack"
+                        ]
+                    },
+                    "fin",
+                    {
+                        "|": [
+                            "psh",
+                            "ack"
+                        ]
+                    },
+                    "ack"
+                ]
+            }
+        }
+    }
+]
diff --git a/tests/py/inet/tcp.t.json.output b/tests/py/inet/tcp.t.json.output
index 0f7a593b788c..c471e8d8dcef 100644
--- a/tests/py/inet/tcp.t.json.output
+++ b/tests/py/inet/tcp.t.json.output
@@ -115,3 +115,96 @@
     }
 ]
 
+# tcp flags { syn, syn | ack }
+[
+    {
+        "match": {
+            "left": {
+                "payload": {
+                    "field": "flags",
+                    "protocol": "tcp"
+                }
+            },
+            "op": "==",
+            "right": {
+                "set": [
+                    "syn",
+                    {
+                        "|": [
+                            "syn",
+                            "ack"
+                        ]
+                    }
+                ]
+            }
+        }
+    }
+]
+
+# tcp flags & (fin | syn | rst | psh | ack | urg) == { fin, ack, psh | ack, fin | psh | ack }
+[
+    {
+        "match": {
+            "left": {
+                "&": [
+                    {
+                        "payload": {
+                            "field": "flags",
+                            "protocol": "tcp"
+                        }
+                    },
+                    {
+                        "|": [
+                            {
+                                "|": [
+                                    {
+                                        "|": [
+                                            {
+                                                "|": [
+                                                    {
+                                                        "|": [
+                                                            "fin",
+                                                            "syn"
+                                                        ]
+                                                    },
+                                                    "rst"
+                                                ]
+                                            },
+                                            "psh"
+                                        ]
+                                    },
+                                    "ack"
+                                ]
+                            },
+                            "urg"
+                        ]
+                    }
+                ]
+            },
+            "op": "==",
+            "right": {
+                "set": [
+                    "fin",
+                    {
+                        "|": [
+                            {
+                                "|": [
+                                    "fin",
+                                    "psh"
+                                ]
+                            },
+                            "ack"
+                        ]
+                    },
+                    {
+                        "|": [
+                            "psh",
+                            "ack"
+                        ]
+                    },
+                    "ack"
+                ]
+            }
+        }
+    }
+]
-- 
2.28.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH nft 0/3] tests: py: fixes for failing JSON tests
  2020-10-11 19:23 [PATCH nft 0/3] tests: py: fixes for failing JSON tests Jeremy Sowden
                   ` (2 preceding siblings ...)
  2020-10-11 19:23 ` [PATCH nft 3/3] tests: py: add missing test JSON output for TCP flag tests Jeremy Sowden
@ 2020-10-12  0:16 ` Pablo Neira Ayuso
  3 siblings, 0 replies; 5+ messages in thread
From: Pablo Neira Ayuso @ 2020-10-12  0:16 UTC (permalink / raw)
  To: Jeremy Sowden; +Cc: Netfilter Devel

On Sun, Oct 11, 2020 at 08:23:21PM +0100, Jeremy Sowden wrote:
> Fixes for a few Python tests with missing or incorrect JSON output.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-11 19:23 [PATCH nft 0/3] tests: py: fixes for failing JSON tests Jeremy Sowden
2020-10-11 19:23 ` [PATCH nft 1/3] tests: py: add missing JSON output for ct test Jeremy Sowden
2020-10-11 19:23 ` [PATCH nft 2/3] tests: py: correct order of set elements in test JSON output Jeremy Sowden
2020-10-11 19:23 ` [PATCH nft 3/3] tests: py: add missing test JSON output for TCP flag tests Jeremy Sowden
2020-10-12  0:16 ` [PATCH nft 0/3] tests: py: fixes for failing JSON tests Pablo Neira Ayuso

Netfilter-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netfilter-devel/0 netfilter-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netfilter-devel netfilter-devel/ https://lore.kernel.org/netfilter-devel \
		netfilter-devel@vger.kernel.org
	public-inbox-index netfilter-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netfilter-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git