diff mbox series

[nft,v2,4/5] tests: py: Warn if recorded JSON output matches the input

Message ID 20240322160645.18331-5-phil@nwl.cc
State Accepted
Headers show
Series json: Accept more than two operands in binary expressions | expand

Commit Message

Phil Sutter March 22, 2024, 4:06 p.m. UTC
Actively support spring-cleaning by nagging callers.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 tests/py/nft-test.py | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index a7d27c25f9fe0..1bc8955836d0d 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -809,6 +809,8 @@  def set_delete_elements(set_element, set_name, table, filename=None,
                     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":