summaryrefslogtreecommitdiffstats
path: root/tests/py/any/meta.t
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2018-07-03 16:16:51 +0200
committerFlorian Westphal <fw@strlen.de>2018-07-21 11:30:56 +0200
commit6dd848339444fecf95122579c1a1fe944a819b6d (patch)
tree3e26cbf7eeb3e5023fb0f95f0721680df6aa772f /tests/py/any/meta.t
parent0b97683b33be6f703fa93222d0b35a6abad0b514 (diff)
src: meta: always prefix 'meta' for almost all tokens
got following bug report: nft add ... ct mark set mark and 0x10 ... always sets 0. What reporter meant to write instead was 'ct mark', not 'mark'. We can't just remove support for 'mark' and force 'meta mark', but we can start to discourage it by printing meta prefix too. Later on, we could start to print deprecation warning if needed. Followup patch can also change "iifname" etc. to "meta iifname". Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/py/any/meta.t')
-rw-r--r--tests/py/any/meta.t160
1 files changed, 80 insertions, 80 deletions
diff --git a/tests/py/any/meta.t b/tests/py/any/meta.t
index b3bb0504..d69b8b4e 100644
--- a/tests/py/any/meta.t
+++ b/tests/py/any/meta.t
@@ -49,17 +49,17 @@ meta priority {bcad:dada, bcad:dadc, aaaa:bbbb};ok
meta priority set cafe:beef;ok
meta priority != {bcad:dada, bcad:dadc, aaaa:bbbb};ok
-meta mark 0x4;ok;mark 0x00000004
-meta mark 0x32;ok;mark 0x00000032
-meta mark and 0x03 == 0x01;ok;mark & 0x00000003 == 0x00000001
-meta mark and 0x03 != 0x01;ok;mark & 0x00000003 != 0x00000001
-meta mark 0x10;ok;mark 0x00000010
-meta mark != 0x10;ok;mark != 0x00000010
-
-meta mark or 0x03 == 0x01;ok;mark | 0x00000003 == 0x00000001
-meta mark or 0x03 != 0x01;ok;mark | 0x00000003 != 0x00000001
-meta mark xor 0x03 == 0x01;ok;mark 0x00000002
-meta mark xor 0x03 != 0x01;ok;mark != 0x00000002
+meta mark 0x4;ok;meta mark 0x00000004
+meta mark 0x32;ok;meta mark 0x00000032
+meta mark and 0x03 == 0x01;ok;meta mark & 0x00000003 == 0x00000001
+meta mark and 0x03 != 0x01;ok;meta mark & 0x00000003 != 0x00000001
+meta mark 0x10;ok;meta mark 0x00000010
+meta mark != 0x10;ok;meta mark != 0x00000010
+
+meta mark or 0x03 == 0x01;ok;meta mark | 0x00000003 == 0x00000001
+meta mark or 0x03 != 0x01;ok;meta mark | 0x00000003 != 0x00000001
+meta mark xor 0x03 == 0x01;ok;meta mark 0x00000002
+meta mark xor 0x03 != 0x01;ok;meta mark != 0x00000002
meta iif "lo" accept;ok;iif "lo" accept
meta iif != "lo" accept;ok;iif != "lo" accept
@@ -72,12 +72,12 @@ meta iifname "dummy*";ok;iifname "dummy*"
meta iifname "dummy\*";ok;iifname "dummy\*"
meta iifname "";fail
-meta iiftype {ether, ppp, ipip, ipip6, loopback, sit, ipgre};ok;iiftype {ether, ppp, ipip, ipip6, loopback, sit, ipgre}
-meta iiftype != {ether, ppp, ipip, ipip6, loopback, sit, ipgre};ok;iiftype != {ether, ppp, ipip, ipip6, loopback, sit, ipgre}
-meta iiftype != ether;ok;iiftype != ether
-meta iiftype ether;ok;iiftype ether
-meta iiftype != ppp;ok;iiftype != ppp
-meta iiftype ppp;ok;iiftype ppp
+meta iiftype {ether, ppp, ipip, ipip6, loopback, sit, ipgre};ok
+meta iiftype != {ether, ppp, ipip, ipip6, loopback, sit, ipgre};ok
+meta iiftype != ether;ok
+meta iiftype ether;ok
+meta iiftype != ppp;ok
+meta iiftype ppp;ok
meta oif "lo" accept;ok;oif "lo" accept
meta oif != "lo" accept;ok;oif != "lo" accept
@@ -91,34 +91,34 @@ meta oifname "dummy*";ok;oifname "dummy*"
meta oifname "dummy\*";ok;oifname "dummy\*"
meta oifname "";fail
-meta oiftype {ether, ppp, ipip, ipip6, loopback, sit, ipgre};ok;oiftype {ether, ppp, ipip, ipip6, loopback, sit, ipgre}
-meta oiftype != {ether, ppp, ipip, ipip6, loopback, sit, ipgre};ok;oiftype != {ether, ppp, ipip, ipip6, loopback, sit, ipgre}
-meta oiftype != ether;ok;oiftype != ether
-meta oiftype ether;ok;oiftype ether
-
-meta skuid {"bin", "root", "daemon"} accept;ok;skuid { 0, 1, 2} accept
-meta skuid != {"bin", "root", "daemon"} accept;ok;skuid != { 1, 0, 2} accept
-meta skuid "root";ok;skuid 0
-meta skuid != "root";ok;skuid != 0
-meta skuid lt 3000 accept;ok;skuid < 3000 accept
-meta skuid gt 3000 accept;ok;skuid > 3000 accept
-meta skuid eq 3000 accept;ok;skuid 3000 accept
-meta skuid 3001-3005 accept;ok;skuid 3001-3005 accept
-meta skuid != 2001-2005 accept;ok;skuid != 2001-2005 accept
-meta skuid { 2001-2005} accept;ok;skuid { 2001-2005} accept
-meta skuid != { 2001-2005} accept;ok;skuid != { 2001-2005} accept
-
-meta skgid {"bin", "root", "daemon"} accept;ok;skgid { 0, 1, 2} accept
-meta skgid != {"bin", "root", "daemon"} accept;ok;skgid != { 1, 0, 2} accept
-meta skgid "root";ok;skgid 0
-meta skgid != "root";ok;skgid != 0
-meta skgid lt 3000 accept;ok;skgid < 3000 accept
-meta skgid gt 3000 accept;ok;skgid > 3000 accept
-meta skgid eq 3000 accept;ok;skgid 3000 accept
-meta skgid 2001-2005 accept;ok;skgid 2001-2005 accept
-meta skgid != 2001-2005 accept;ok;skgid != 2001-2005 accept
-meta skgid { 2001-2005} accept;ok;skgid { 2001-2005} accept
-meta skgid != { 2001-2005} accept;ok;skgid != { 2001-2005} accept
+meta oiftype {ether, ppp, ipip, ipip6, loopback, sit, ipgre};ok
+meta oiftype != {ether, ppp, ipip, ipip6, loopback, sit, ipgre};ok
+meta oiftype != ether;ok
+meta oiftype ether;ok
+
+meta skuid {"bin", "root", "daemon"} accept;ok;meta skuid { 0, 1, 2} accept
+meta skuid != {"bin", "root", "daemon"} accept;ok;meta skuid != { 1, 0, 2} accept
+meta skuid "root";ok;meta skuid 0
+meta skuid != "root";ok;meta skuid != 0
+meta skuid lt 3000 accept;ok;meta skuid < 3000 accept
+meta skuid gt 3000 accept;ok;meta skuid > 3000 accept
+meta skuid eq 3000 accept;ok;meta skuid 3000 accept
+meta skuid 3001-3005 accept;ok;meta skuid 3001-3005 accept
+meta skuid != 2001-2005 accept;ok;meta skuid != 2001-2005 accept
+meta skuid { 2001-2005} accept;ok;meta skuid { 2001-2005} accept
+meta skuid != { 2001-2005} accept;ok;meta skuid != { 2001-2005} accept
+
+meta skgid {"bin", "root", "daemon"} accept;ok;meta skgid { 0, 1, 2} accept
+meta skgid != {"bin", "root", "daemon"} accept;ok;meta skgid != { 1, 0, 2} accept
+meta skgid "root";ok;meta skgid 0
+meta skgid != "root";ok;meta skgid != 0
+meta skgid lt 3000 accept;ok;meta skgid < 3000 accept
+meta skgid gt 3000 accept;ok;meta skgid > 3000 accept
+meta skgid eq 3000 accept;ok;meta skgid 3000 accept
+meta skgid 2001-2005 accept;ok;meta skgid 2001-2005 accept
+meta skgid != 2001-2005 accept;ok;meta skgid != 2001-2005 accept
+meta skgid { 2001-2005} accept;ok;meta skgid { 2001-2005} accept
+meta skgid != { 2001-2005} accept;ok;meta skgid != { 2001-2005} accept
# BUG: meta nftrace 2 and meta nftrace 1
# $ sudo nft add rule ip test input meta nftrace 2
@@ -130,14 +130,14 @@ meta skgid != { 2001-2005} accept;ok;skgid != { 2001-2005} accept
# add rule ip test input meta nftrace 1
# -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-meta mark set 0xffffffc8 xor 0x16;ok;mark set 0xffffffde
-meta mark set 0x16 and 0x16;ok;mark set 0x00000016
-meta mark set 0xffffffe9 or 0x16;ok;mark set 0xffffffff
-meta mark set 0xffffffde and 0x16;ok;mark set 0x00000016
-meta mark set 0xf045ffde or 0x10;ok;mark set 0xf045ffde
-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 0xffffffc8 xor 0x16;ok;meta mark set 0xffffffde
+meta mark set 0x16 and 0x16;ok;meta mark set 0x00000016
+meta mark set 0xffffffe9 or 0x16;ok;meta mark set 0xffffffff
+meta mark set 0xffffffde and 0x16;ok;meta mark set 0x00000016
+meta mark set 0xf045ffde or 0x10;ok;meta mark set 0xf045ffde
+meta mark set 0xffffffde or 0x16;ok;meta mark set 0xffffffde
+meta mark set 0x32 or 0xfffff;ok;meta mark set 0x000fffff
+meta mark set 0xfffe xor 0x16;ok;meta mark set 0x0000ffe8
meta mark set {0xffff, 0xcc};fail
meta pkttype set {unicast, multicast, broadcast};fail
@@ -145,29 +145,29 @@ 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
-meta skuid 3000;ok;skuid 3000
-meta skgid 3000;ok;skgid 3000
+meta skuid 3000;ok
+meta skgid 3000;ok
# BUG: meta nftrace 1;ok
# <cmdline>:1:1-37: Error: Could not process rule: Operation not supported
- meta nftrace 1;ok
-meta rtclassid "cosmos";ok;rtclassid "cosmos"
-
-meta pkttype broadcast;ok;pkttype broadcast
-meta pkttype host;ok;pkttype host
-meta pkttype multicast;ok;pkttype multicast
-meta pkttype != broadcast;ok;pkttype != broadcast
-meta pkttype != host;ok;pkttype != host
-meta pkttype != multicast;ok;pkttype != multicast
+meta rtclassid "cosmos";ok
+
+meta pkttype broadcast;ok
+meta pkttype host;ok
+meta pkttype multicast;ok
+meta pkttype != broadcast;ok
+meta pkttype != host;ok
+meta pkttype != multicast;ok
meta pkttype broadcastttt;fail
-pkttype { broadcast, multicast} accept;ok
+pkttype { broadcast, multicast} accept;ok;meta pkttype { broadcast, multicast} accept
-meta cpu 1;ok;cpu 1
-meta cpu != 1;ok;cpu != 1
-meta cpu 1-3;ok;cpu 1-3
-meta cpu != 1-2;ok;cpu != 1-2
-meta cpu { 2,3};ok;cpu { 2,3}
-meta cpu { 2-3, 5-7};ok;cpu { 2-3, 5-7}
-meta cpu != { 2,3};ok;cpu != { 2,3}
+meta cpu 1;ok
+meta cpu != 1;ok
+meta cpu 1-3;ok
+meta cpu != 1-2;ok
+meta cpu { 2,3};ok
+meta cpu { 2-3, 5-7};ok
+meta cpu != { 2,3};ok
meta iifgroup 0;ok;iifgroup "default"
meta iifgroup != 0;ok;iifgroup != "default"
@@ -190,17 +190,17 @@ meta oifgroup {11-33};ok;oifgroup {11-33}
meta oifgroup != { 11,33};ok;oifgroup != { 11,33}
meta oifgroup != {11-33};ok;oifgroup != {11-33}
-meta cgroup 1048577;ok;cgroup 1048577
-meta cgroup != 1048577;ok;cgroup != 1048577
-meta cgroup { 1048577, 1048578 };ok;cgroup { 1048577, 1048578}
-meta cgroup != { 1048577, 1048578};ok;cgroup != { 1048577, 1048578}
-meta cgroup 1048577-1048578;ok;cgroup 1048577-1048578
-meta cgroup != 1048577-1048578;ok;cgroup != 1048577-1048578
-meta cgroup {1048577-1048578};ok;cgroup { 1048577-1048578}
-meta cgroup != { 1048577-1048578};ok;cgroup != { 1048577-1048578}
+meta cgroup 1048577;ok;meta cgroup 1048577
+meta cgroup != 1048577;ok;meta cgroup != 1048577
+meta cgroup { 1048577, 1048578 };ok;meta cgroup { 1048577, 1048578}
+meta cgroup != { 1048577, 1048578};ok;meta cgroup != { 1048577, 1048578}
+meta cgroup 1048577-1048578;ok;meta cgroup 1048577-1048578
+meta cgroup != 1048577-1048578;ok;meta cgroup != 1048577-1048578
+meta cgroup {1048577-1048578};ok;meta cgroup { 1048577-1048578}
+meta cgroup != { 1048577-1048578};ok;meta cgroup != { 1048577-1048578}
meta iif . meta oif { "lo" . "lo" };ok;iif . oif { "lo" . "lo" }
-meta iif . meta oif . meta mark { "lo" . "lo" . 0x0000000a };ok;iif . oif . mark { "lo" . "lo" . 0x0000000a }
+meta iif . meta oif . meta mark { "lo" . "lo" . 0x0000000a };ok;iif . oif . meta mark { "lo" . "lo" . 0x0000000a }
meta iif . meta oif vmap { "lo" . "lo" : drop };ok;iif . oif vmap { "lo" . "lo" : drop }
meta random eq 1;ok;meta random 1