]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: py: Warn if recorded JSON output matches the input
authorPhil Sutter <phil@nwl.cc>
Fri, 22 Mar 2024 14:04:40 +0000 (15:04 +0100)
committerPhil Sutter <phil@nwl.cc>
Fri, 12 Apr 2024 12:33:14 +0000 (14:33 +0200)
Actively support spring-cleaning by nagging callers.

Signed-off-by: Phil Sutter <phil@nwl.cc>
tests/py/nft-test.py

index a7d27c25f9fe06c53f522243d3f93dbbf91613be..1bc8955836d0d397b2e69287671c2996b6502139 100755 (executable)
@@ -809,6 +809,8 @@ def rule_add(rule, filename, lineno, force_all_family_option, filename_path):
                     reason = "Invalid JSON syntax in expected output: %s" % json_expected
                     print_error(reason)
                     return [-1, warning, error, unit_tests]
+                if json_expected == json_input:
+                    print_warning("Recorded JSON output matches input for: %s" % rule[0])
 
     for table in table_list:
         if rule[1].strip() == "ok":