netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [nft PATCH v4 2/8] tests: py: Enable JSON and JSON schema by default
Date: Thu,  4 Sep 2025 17:24:48 +0200	[thread overview]
Message-ID: <20250904152454.13054-3-phil@nwl.cc> (raw)
In-Reply-To: <20250904152454.13054-1-phil@nwl.cc>

Introduce -J/--disable-json and -S/--no-schema to explicitly disable
them if desired.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 tests/py/nft-test.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index 984f2b937a077..12c6174b01257 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -1488,7 +1488,11 @@ def set_delete_elements(set_element, set_name, table, filename=None,
 
     parser.add_argument('-j', '--enable-json', action='store_true',
                         dest='enable_json',
-                        help='test JSON functionality as well')
+                        help='test JSON functionality as well (default)')
+
+    parser.add_argument('-J', '--disable-json', action='store_true',
+                        dest='disable_json',
+                        help='Do not test JSON functionality as well')
 
     parser.add_argument('-l', '--library', default=None,
                         help='path to libntables.so.1, overrides --host')
@@ -1499,7 +1503,11 @@ def set_delete_elements(set_element, set_name, table, filename=None,
 
     parser.add_argument('-s', '--schema', action='store_true',
                         dest='enable_schema',
-                        help='verify json input/output against schema')
+                        help='verify json input/output against schema (default)')
+
+    parser.add_argument('-S', '--no-schema', action='store_true',
+                        dest='disable_schema',
+                        help='Do not verify json input/output against schema')
 
     parser.add_argument('-v', '--version', action='version',
                         version='1.0',
@@ -1510,8 +1518,8 @@ def set_delete_elements(set_element, set_name, table, filename=None,
     debug_option = args.debug
     need_fix_option = args.need_fix_line
     force_all_family_option = args.force_all_family
-    enable_json_option = args.enable_json
-    enable_json_schema = args.enable_schema
+    enable_json_option = not args.disable_json
+    enable_json_schema = not args.disable_json and not args.disable_schema
     specific_file = False
 
     signal.signal(signal.SIGINT, signal_handler)
-- 
2.51.0


  parent reply	other threads:[~2025-09-04 15:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04 15:24 [nft PATCH v4 0/8] Run all test suites via 'make check' Phil Sutter
2025-09-04 15:24 ` [nft PATCH v4 1/8] tests: monitor: Excercise all syntaxes and variants by default Phil Sutter
2025-09-04 15:24 ` Phil Sutter [this message]
2025-09-04 15:29   ` [nft PATCH v4 2/8] tests: py: Enable JSON and JSON schema " Pablo Neira Ayuso
2025-09-04 16:13     ` Phil Sutter
2025-09-04 16:56       ` Pablo Neira Ayuso
2025-09-04 18:33         ` Phil Sutter
2025-09-04 15:24 ` [nft PATCH v4 3/8] tests: Prepare exit codes for automake Phil Sutter
2025-09-04 15:24 ` [nft PATCH v4 4/8] tests: json_echo: Skip if run as non-root Phil Sutter
2025-09-04 15:24 ` [nft PATCH v4 5/8] tests: shell: Skip packetpath/nat_ftp in fake root env Phil Sutter
2025-09-04 15:24 ` [nft PATCH v4 6/8] tests: build: Do not assume caller's CWD Phil Sutter
2025-09-04 15:24 ` [nft PATCH v4 7/8] tests: build: Avoid a recursive 'make check' run Phil Sutter
2025-09-04 15:24 ` [nft PATCH v4 8/8] Makefile: Enable support for 'make check' Phil Sutter
2025-09-11 16:14 ` [nft PATCH v4 0/8] Run all test suites via " Phil Sutter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250904152454.13054-3-phil@nwl.cc \
    --to=phil@nwl.cc \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).