From c20142bba09b72f398ccf8260715cd6ed9a0e865 Mon Sep 17 00:00:00 2001 From: Shyam Saini Date: Sat, 17 Jun 2017 01:05:42 +0530 Subject: tests: py: Add test for ambiguity while setting the value This test checks bug identified and fixed in the commit mentioned below In a statement if there are multiple src data then it would be totally ambiguous to decide which value to set. Before the commit was made it returned 134(BUG), but now it returns 1 i.e, an error message. Following rules tests ambiguity while setting the value: $ sudo nft add rule ip test-ip4 output ct mark set {0x11333, 0x11} :1:41-55: Error: you cannot use a set here, unknown value to use add rule ip test-ip4 output ct mark set {0x11333, 0x11} ~~~~~~~~~~~~^^^^^^^^^^^^^^^ Test: 986dea8 ("evaluate: avoid reference to multiple src data in statements which set values") Signed-off-by: Shyam Saini Signed-off-by: Pablo Neira Ayuso --- tests/py/any/meta.t | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/py/any/meta.t') diff --git a/tests/py/any/meta.t b/tests/py/any/meta.t index 2ff942ff..fc041bf5 100644 --- a/tests/py/any/meta.t +++ b/tests/py/any/meta.t @@ -143,6 +143,9 @@ meta mark set 0xffffffde or 0x16;ok;mark set 0xffffffde meta mark set 0x32 or 0xfffff;ok;mark set 0x000fffff meta mark set 0xfffe xor 0x16;ok;mark set 0x0000ffe8 +meta mark set {0xffff, 0xcc};fail +meta pkttype set {unicast, multicast, broadcast};fail + meta iif "lo";ok;iif "lo" meta oif "lo";ok;oif "lo" meta oifname "dummy2" accept;ok;oifname "dummy2" accept -- cgit v1.2.3