diff options
author | Florian Westphal <fw@strlen.de> | 2017-03-14 16:55:17 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2017-03-16 10:10:04 +0100 |
commit | 8675f943e7eff24f29aaa492cb58267f9291de31 (patch) | |
tree | dc1907fc65879c7ba7543f198460365be2d7488e /tests/py/nft-test.py | |
parent | 1ed84c4626973cee92e4a238ad55f7ba1f5af249 (diff) |
tests: py: add ct helper tests
needs minor tweak to nft-test.py so we don't zap the ';' withhin the {}.
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/py/nft-test.py')
-rwxr-xr-x | tests/py/nft-test.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py index 25009217..b2240407 100755 --- a/tests/py/nft-test.py +++ b/tests/py/nft-test.py @@ -885,6 +885,10 @@ def obj_process(obj_line, filename, lineno): obj_type = tokens[2] obj_spcf = "" + if obj_type == "ct" and tokens[3] == "helper": + obj_type = "ct helper" + tokens[3] = "" + if len(tokens) > 3: obj_spcf = " ".join(tokens[3:]) @@ -985,7 +989,12 @@ def run_test_file(filename, force_all_family_option, specific_file): continue if line[0] == "%": # Adds this object - obj_line = line.rstrip()[1:].split(";") + brace = line.rfind("}") + if brace < 0: + obj_line = line.rstrip()[1:].split(";") + else: + obj_line = (line[1:brace+1], line[brace+2:].rstrip()) + ret = obj_process(obj_line, filename, lineno) tests += 1 if ret == -1: |