]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
nft-test: check start of rule with sets too
authorFlorian Westphal <fw@strlen.de>
Sat, 31 Mar 2018 09:08:33 +0000 (11:08 +0200)
committerFlorian Westphal <fw@strlen.de>
Sat, 31 Mar 2018 22:05:53 +0000 (00:05 +0200)
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 <fw@strlen.de>
tests/py/nft-test.py

index 87e3d51ec2ddb53be1f718e57fb04a12d35ae80c..7998914aa4180f8fcdf62e11b2d413f27ce0dd27 100755 (executable)
@@ -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("}")