From: Phil Sutter Date: Wed, 13 Aug 2025 14:14:08 +0000 (+0200) Subject: tests: py: Fix tests added for 'icmpv6 taddr' support X-Git-Tag: v1.1.5~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef8b8ef36f80a2bfcc9df35cccb61ab490a8d6e7;p=thirdparty%2Fnftables.git tests: py: Fix tests added for 'icmpv6 taddr' support There was a duplicate test, also stored JSON equivalents should match input as much as possible. The expected deviation in output (just like with standard syntax) is stored in the .json.output file instead. Fixes: 2e86f45d0260a ("icmpv6: Allow matching target address in NS/NA, redirect and MLD") Signed-off-by: Phil Sutter Reviewed-by: Pablo Neira Ayuso --- diff --git a/tests/py/ip6/icmpv6.t b/tests/py/ip6/icmpv6.t index 7632bfd8..5108b427 100644 --- a/tests/py/ip6/icmpv6.t +++ b/tests/py/ip6/icmpv6.t @@ -91,8 +91,6 @@ icmpv6 type nd-neighbor-solicit icmpv6 taddr 2001:db8::133;ok icmpv6 type nd-neighbor-advert icmpv6 taddr 2001:db8::133;ok icmpv6 taddr 2001:db8::133;ok;icmpv6 type { mld-listener-query, mld-listener-report, mld-listener-done, nd-neighbor-solicit, nd-neighbor-advert, nd-redirect} icmpv6 taddr 2001:db8::133 -icmpv6 taddr 2001:db8::133;ok;icmpv6 type { mld-listener-query, mld-listener-report, mld-listener-done, nd-neighbor-solicit, nd-neighbor-advert, nd-redirect} icmpv6 taddr 2001:db8::133 - icmpv6 type { mld-listener-query, mld-listener-report, mld-listener-done, nd-neighbor-solicit, nd-neighbor-advert, nd-redirect} icmpv6 taddr 2001:db8::133;ok icmpv6 type { nd-neighbor-solicit, nd-neighbor-advert } icmpv6 taddr 2001:db8::133;ok icmpv6 daddr 2001:db8::133;ok diff --git a/tests/py/ip6/icmpv6.t.json b/tests/py/ip6/icmpv6.t.json index 9df886dd..5c36aaba 100644 --- a/tests/py/ip6/icmpv6.t.json +++ b/tests/py/ip6/icmpv6.t.json @@ -1250,64 +1250,6 @@ # icmpv6 taddr 2001:db8::133 [ - { - "match": { - "left": { - "payload": { - "field": "type", - "protocol": "icmpv6" - } - }, - "op": "==", - "right": { - "set": [ - "mld-listener-query", - "mld-listener-report", - "mld-listener-done", - "nd-neighbor-solicit", - "nd-neighbor-advert", - "nd-redirect" - ] - } - } - }, - { - "match": { - "left": { - "payload": { - "field": "taddr", - "protocol": "icmpv6" - } - }, - "op": "==", - "right": "2001:db8::133" - } - } -] - -# icmpv6 taddr 2001:db8::133 -[ - { - "match": { - "left": { - "payload": { - "field": "type", - "protocol": "icmpv6" - } - }, - "op": "==", - "right": { - "set": [ - "mld-listener-query", - "mld-listener-report", - "mld-listener-done", - "nd-neighbor-solicit", - "nd-neighbor-advert", - "nd-redirect" - ] - } - } - }, { "match": { "left": { diff --git a/tests/py/ip6/icmpv6.t.json.output b/tests/py/ip6/icmpv6.t.json.output index 5d33780e..568bdb53 100644 --- a/tests/py/ip6/icmpv6.t.json.output +++ b/tests/py/ip6/icmpv6.t.json.output @@ -696,3 +696,39 @@ } ] +# icmpv6 taddr 2001:db8::133 +[ + { + "match": { + "left": { + "payload": { + "field": "type", + "protocol": "icmpv6" + } + }, + "op": "==", + "right": { + "set": [ + "mld-listener-query", + "mld-listener-report", + "mld-listener-done", + "nd-neighbor-solicit", + "nd-neighbor-advert", + "nd-redirect" + ] + } + } + }, + { + "match": { + "left": { + "payload": { + "field": "taddr", + "protocol": "icmpv6" + } + }, + "op": "==", + "right": "2001:db8::133" + } + } +]