]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/py: Fix differences printing for rules with sets
authorPhil Sutter <phil@nwl.cc>
Fri, 13 Apr 2018 14:52:31 +0000 (16:52 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 14 Apr 2018 11:53:02 +0000 (13:53 +0200)
If a rule contained a set, it would always print the tested rule as
differing from the output instead of any given output (if defined).

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/py/nft-test.py

index d5cb25b389de5de5fac3a4ccd1d1cd10d8df7ae8..d4b22817d766557b01d93bb3d8c7878501646b82 100755 (executable)
@@ -737,8 +737,8 @@ def rule_add(rule, filename, lineno, force_all_family_option, filename_path):
                             if set_check_element(teoric_exit.rstrip(), rule_output.rstrip()) != 0:
                                 warning += 1
                                 print_differences_warning(filename, lineno,
-                                                          rule[0], rule_output,
-                                                          cmd)
+                                                          teoric_exit.rstrip(),
+                                                          rule_output, cmd)
                                 if not force_all_family_option:
                                     return [ret, warning, error, unit_tests]
                         else: