From: Florian Westphal Date: Sat, 31 Mar 2018 09:08:33 +0000 (+0200) Subject: nft-test: check start of rule with sets too X-Git-Tag: v0.8.4~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c5e24b8d94ead21e8c81315794f779850fd6b135;p=thirdparty%2Fnftables.git nft-test: check start of rule with sets too We special case rules with sets ({}) so set members are sorted properly. But we failed to check start of rule: input: meta mark { 1, 2 } bar expect: meta mark { 1, 2 } bar We made sure 'bar' is equal in both input and expected output, but we did not check start (before {). This causes a gazillion of warnings, will fix in followup commit. Signed-off-by: Florian Westphal --- diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py index 87e3d51e..7998914a 100755 --- a/tests/py/nft-test.py +++ b/tests/py/nft-test.py @@ -471,6 +471,10 @@ def set_check_element(rule1, rule2): ret = -1 pos1 = rule1.find("{") pos2 = rule2.find("{") + + if (cmp(rule1[:pos1], rule2[:pos2]) != 0): + return ret; + end1 = rule1.find("}") end2 = rule2.find("}")