]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: regression: simplify run_test_file() in case `-e' is used
authorPablo Neira Ayuso <pablo@netfilter.org>
Sat, 13 Dec 2014 18:05:38 +0000 (19:05 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 14 Dec 2014 20:14:57 +0000 (21:14 +0100)
Avoid copy&paste coding style pattern by simplifying the code that
handles the `-e' option that allows us to run known broken tests.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/regression/nft-test.py

index dea0f36946e00dee4432d468f7227db97fc23b23..7e5b4756919240b07a5d8a4f04c6140dc2fca7f2 100755 (executable)
@@ -692,23 +692,9 @@ def run_test_file(filename, force_all_family_option, specific_file):
                 continue
             if need_fix_option:
                 rule[0] = rule[0].rstrip()[1:].strip()
-                result = rule_add(rule, table_list, chain_list, filename,
-                                  lineno, force_all_family_option)
-                tests += 1
-                warning = result[1]
-                ret = result[0]
-                total_warning += warning
-                total_error += result[2]
-                total_unit_run += result[3]
-
-                if ret != 0:
-                    total_test_passed = False
-                elif warning == 0:
-                    passed += 1
-                continue
             else:
                 continue
-        if need_fix_option:
+        elif need_fix_option:
             continue
 
         result = rule_add(rule, table_list, chain_list, filename, lineno,