tests/py: don't test log statement from protocol match
Pablo Neira Ayuso
maintainerPATCH 1/3 tests/py: don't test log statement from protocol match
--- tests/py/inet/tcp.t | 1 - tests/py/inet/tcp.t.payload.inet | 9 --------- tests/py/inet/tcp.t.payload.ip | 9 --------- tests/py/inet/tcp.t.payload.ip6 | 9 --------- tests/py/ip/ip.t | 12 ++++++------ tests/py/ip/ip.t.payload | 18 ++++++------------ tests/py/ip/ip.t.payload.inet | 18 ++++++------------ tests/py/ip6/ip6.t | 4 ++-- tests/py/ip6/ip6.t.payload.inet | 6 ++---- tests/py/ip6/ip6.t.payload.ip6 | 6 ++---- 10 files changed, 24 insertions(+), 68 deletions(-)
tests/py/inet/tcp.t +0 -1
@@ -83,7 +83,6 @@ tcp window { 33, 55, 67, 88};ok tcp window { 33-55};ok - tcp window != { 33-55};ok -tcp checksum 23456 log drop;ok tcp checksum 22;ok tcp checksum != 233;ok tcp checksum 33-45;ok
tests/py/inet/tcp.t.payload.inet +0 -9
@@ -381,15 +381,6 @@ inet test-inet input [ payload load 2b @ transport header + 14 => reg 1 ] [ lookup reg 1 set set%d ] -# tcp checksum 23456 log drop -inet test-inet input - [ meta load l4proto => reg 1 ] - [ cmp eq reg 1 0x00000006 ] - [ payload load 2b @ transport header + 16 => reg 1 ] - [ cmp eq reg 1 0x0000a05b ] - [ log prefix (null) ] - [ immediate reg 0 drop ] - # tcp checksum 22 inet test-inet input [ meta load l4proto => reg 1 ]
tests/py/inet/tcp.t.payload.ip +0 -9
@@ -381,15 +381,6 @@ ip test-ip4 input [ payload load 2b @ transport header + 14 => reg 1 ] [ lookup reg 1 set set%d ] -# tcp checksum 23456 log drop -ip test-ip4 input - [ payload load 1b @ network header + 9 => reg 1 ] - [ cmp eq reg 1 0x00000006 ] - [ payload load 2b @ transport header + 16 => reg 1 ] - [ cmp eq reg 1 0x0000a05b ] - [ log prefix (null) ] - [ immediate reg 0 drop ] - # tcp checksum 22 ip test-ip4 input [ payload load 1b @ network header + 9 => reg 1 ]
tests/py/inet/tcp.t.payload.ip6 +0 -9
@@ -381,15 +381,6 @@ ip6 test-ip6 input [ payload load 2b @ transport header + 14 => reg 1 ] [ lookup reg 1 set set%d ] -# tcp checksum 23456 log drop -ip6 test-ip6 input - [ payload load 1b @ network header + 6 => reg 1 ] - [ cmp eq reg 1 0x00000006 ] - [ payload load 2b @ transport header + 16 => reg 1 ] - [ cmp eq reg 1 0x0000a05b ] - [ log prefix (null) ] - [ immediate reg 0 drop ] - # tcp checksum 22 ip6 test-ip6 input [ payload load 1b @ network header + 6 => reg 1 ]
tests/py/ip/ip.t +6 -6
@@ -57,7 +57,7 @@ ip frag-off { 33-55};ok - ip frag-off != { 33-55};ok ip ttl 0 drop;ok -ip ttl 233 log;ok +ip ttl 233;ok ip ttl 33-55;ok ip ttl != 45-50;ok ip ttl {43, 53, 45 };ok
@@ -68,8 +68,8 @@ ip ttl {43, 53, 45 };ok ip ttl { 33-55};ok - ip ttl != { 33-55};ok -ip protocol tcp log;ok;ip protocol 6 log -ip protocol != tcp log;ok;ip protocol != 6 log +ip protocol tcp;ok;ip protocol 6 +ip protocol != tcp;ok;ip protocol != 6 ip protocol { icmp, esp, ah, comp, udp, udplite, tcp, dccp, sctp} accept;ok;ip protocol { 33, 136, 17, 51, 50, 6, 132, 1, 108} accept - ip protocol != { icmp, esp, ah, comp, udp, udplite, tcp, dccp, sctp} accept;ok
@@ -86,8 +86,8 @@ ip checksum { 33-55};ok ip saddr 192.168.2.0/24;ok ip saddr != 192.168.2.0/24;ok ip saddr 192.168.3.1 ip daddr 192.168.3.100;ok -ip saddr != 1.1.1.1 log prefix giuseppe;ok;ip saddr != 1.1.1.1 log prefix "giuseppe" -ip saddr 1.1.1.1 log prefix example group 1;ok;ip saddr 1.1.1.1 log prefix "example" group 1 +ip saddr != 1.1.1.1;ok;ip saddr != 1.1.1.1 +ip saddr 1.1.1.1;ok;ip saddr 1.1.1.1 ip daddr 192.168.0.1-192.168.0.250;ok ip daddr 10.0.0.0-10.255.255.255;ok ip daddr 172.16.0.0-172.31.255.255;ok
@@ -105,7 +105,7 @@ ip saddr != 192.168.1.3-192.168.33.55;ok ip daddr 192.168.0.1;ok ip daddr 192.168.0.1 drop;ok -ip daddr 192.168.0.2 log;ok +ip daddr 192.168.0.2;ok ip saddr \& 0xff == 1;ok;ip saddr & 0.0.0.255 == 0.0.0.1 ip saddr \& 0.0.0.255 \< 0.0.0.127;ok;ip saddr & 0.0.0.255 < 0.0.0.127
tests/py/ip/ip.t.payload +6 -12
@@ -119,11 +119,10 @@ ip test-ip4 input [ cmp eq reg 1 0x00000000 ] [ immediate reg 0 drop ] -# ip ttl 233 log +# ip ttl 233 ip test-ip4 input [ payload load 1b @ network header + 8 => reg 1 ] [ cmp eq reg 1 0x000000e9 ] - [ log prefix (null) ] # ip ttl 33-55 ip test-ip4 input
@@ -153,17 +152,15 @@ ip test-ip4 input [ payload load 1b @ network header + 8 => reg 1 ] [ lookup reg 1 set set%d ] -# ip protocol tcp log +# ip protocol tcp ip test-ip4 input [ payload load 1b @ network header + 9 => reg 1 ] [ cmp eq reg 1 0x00000006 ] - [ log prefix (null) ] -# ip protocol != tcp log +# ip protocol != tcp ip test-ip4 input [ payload load 1b @ network header + 9 => reg 1 ] [ cmp neq reg 1 0x00000006 ] - [ log prefix (null) ] # ip protocol { icmp, esp, ah, comp, udp, udplite, tcp, dccp, sctp} accept set%d test-ip4 3
@@ -235,17 +232,15 @@ ip test-ip4 input [ payload load 8b @ network header + 12 => reg 1 ] [ cmp eq reg 1 0x0103a8c0 0x6403a8c0 ] -# ip saddr != 1.1.1.1 log prefix giuseppe +# ip saddr != 1.1.1.1 ip test-ip4 input [ payload load 4b @ network header + 12 => reg 1 ] [ cmp neq reg 1 0x01010101 ] - [ log prefix giuseppe ] -# ip saddr 1.1.1.1 log prefix example group 1 +# ip saddr 1.1.1.1 ip test-ip4 input [ payload load 4b @ network header + 12 => reg 1 ] [ cmp eq reg 1 0x01010101 ] - [ log prefix example group 1 snaplen 0 qthreshold 0] # ip daddr 192.168.0.1-192.168.0.250 ip test-ip4 input
@@ -329,11 +324,10 @@ ip test-ip4 input [ cmp eq reg 1 0x0100a8c0 ] [ immediate reg 0 drop ] -# ip daddr 192.168.0.2 log +# ip daddr 192.168.0.2 ip test-ip4 input [ payload load 4b @ network header + 16 => reg 1 ] [ cmp eq reg 1 0x0200a8c0 ] - [ log prefix (null) ] # ip saddr \& 0xff == 1 ip test-ip4 input
tests/py/ip/ip.t.payload.inet +6 -12
@@ -157,13 +157,12 @@ inet test-inet input [ cmp eq reg 1 0x00000000 ] [ immediate reg 0 drop ] -# ip ttl 233 log +# ip ttl 233 inet test-inet input [ meta load nfproto => reg 1 ] [ cmp eq reg 1 0x00000002 ] [ payload load 1b @ network header + 8 => reg 1 ] [ cmp eq reg 1 0x000000e9 ] - [ log prefix (null) ] # ip ttl 33-55 inet test-inet input
@@ -201,21 +200,19 @@ inet test-inet input [ payload load 1b @ network header + 8 => reg 1 ] [ lookup reg 1 set set%d ] -# ip protocol tcp log +# ip protocol tcp inet test-inet input [ meta load nfproto => reg 1 ] [ cmp eq reg 1 0x00000002 ] [ payload load 1b @ network header + 9 => reg 1 ] [ cmp eq reg 1 0x00000006 ] - [ log prefix (null) ] -# ip protocol != tcp log +# ip protocol != tcp inet test-inet input [ meta load nfproto => reg 1 ] [ cmp eq reg 1 0x00000002 ] [ payload load 1b @ network header + 9 => reg 1 ] [ cmp neq reg 1 0x00000006 ] - [ log prefix (null) ] # ip protocol { icmp, esp, ah, comp, udp, udplite, tcp, dccp, sctp} accept set%d test-inet 3
@@ -309,21 +306,19 @@ inet test-inet input [ payload load 8b @ network header + 12 => reg 1 ] [ cmp eq reg 1 0x0103a8c0 0x6403a8c0 ] -# ip saddr != 1.1.1.1 log prefix giuseppe +# ip saddr != 1.1.1.1 inet test-inet input [ meta load nfproto => reg 1 ] [ cmp eq reg 1 0x00000002 ] [ payload load 4b @ network header + 12 => reg 1 ] [ cmp neq reg 1 0x01010101 ] - [ log prefix giuseppe ] -# ip saddr 1.1.1.1 log prefix example group 1 +# ip saddr 1.1.1.1 inet test-inet input [ meta load nfproto => reg 1 ] [ cmp eq reg 1 0x00000002 ] [ payload load 4b @ network header + 12 => reg 1 ] [ cmp eq reg 1 0x01010101 ] - [ log prefix example group 1 snaplen 0 qthreshold 0] # ip daddr 192.168.0.1-192.168.0.250 inet test-inet input
@@ -433,13 +428,12 @@ inet test-inet input [ cmp eq reg 1 0x0100a8c0 ] [ immediate reg 0 drop ] -# ip daddr 192.168.0.2 log +# ip daddr 192.168.0.2 inet test-inet input [ meta load nfproto => reg 1 ] [ cmp eq reg 1 0x00000002 ] [ payload load 4b @ network header + 16 => reg 1 ] [ cmp eq reg 1 0x0200a8c0 ] - [ log prefix (null) ] # ip saddr \& 0xff == 1 inet test-inet input
tests/py/ip6/ip6.t +2 -2
@@ -37,7 +37,7 @@ ip6 length != 33-45;ok ip6 length { 33-55};ok - ip6 length != { 33-55};ok -ip6 nexthdr {udp, ah, comp, udplite, tcp, dccp, sctp} log;ok;ip6 nexthdr { 132, 51, 108, 136, 17, 33, 6} log +ip6 nexthdr {udp, ah, comp, udplite, tcp, dccp, sctp};ok;ip6 nexthdr { 132, 51, 108, 136, 17, 33, 6} ip6 nexthdr {esp, ah, comp, udp, udplite, tcp, dccp, sctp, icmpv6};ok;ip6 nexthdr { 6, 136, 108, 33, 50, 17, 132, 58, 51} - ip6 nexthdr != {esp, ah, comp, udp, udplite, tcp, dccp, sctp, icmpv6};ok ip6 nexthdr esp;ok;ip6 nexthdr 50
@@ -47,7 +47,7 @@ ip6 nexthdr { 33-44};ok ip6 nexthdr 33-44;ok ip6 nexthdr != 33-44;ok -ip6 hoplimit 1 log;ok +ip6 hoplimit 1;ok ip6 hoplimit != 233;ok ip6 hoplimit 33-45;ok ip6 hoplimit != 33-45;ok
tests/py/ip6/ip6.t.payload.inet +2 -4
@@ -72,7 +72,7 @@ inet test-inet input [ payload load 2b @ network header + 4 => reg 1 ] [ lookup reg 1 set set%d ] -# ip6 nexthdr {udp, ah, comp, udplite, tcp, dccp, sctp} log +# ip6 nexthdr {udp, ah, comp, udplite, tcp, dccp, sctp} set%d test-inet 3 set%d test-inet 0 element 00000011 : 0 [end] element 00000033 : 0 [end] element 0000006c : 0 [end] element 00000088 : 0 [end] element 00000006 : 0 [end] element 00000021 : 0 [end] element 00000084 : 0 [end]
@@ -81,7 +81,6 @@ inet test-inet input [ cmp eq reg 1 0x0000000a ] [ payload load 1b @ network header + 6 => reg 1 ] [ lookup reg 1 set set%d ] - [ log prefix (null) ] # ip6 nexthdr {esp, ah, comp, udp, udplite, tcp, dccp, sctp, icmpv6} set%d test-inet 3
@@ -133,13 +132,12 @@ inet test-inet input [ cmp lt reg 1 0x00000021 ] [ cmp gt reg 1 0x0000002c ] -# ip6 hoplimit 1 log +# ip6 hoplimit 1 inet test-inet input [ meta load nfproto => reg 1 ] [ cmp eq reg 1 0x0000000a ] [ payload load 1b @ network header + 7 => reg 1 ] [ cmp eq reg 1 0x00000001 ] - [ log prefix (null) ] # ip6 hoplimit != 233 inet test-inet input
tests/py/ip6/ip6.t.payload.ip6 +2 -4
@@ -54,14 +54,13 @@ ip6 test-ip6 input [ payload load 2b @ network header + 4 => reg 1 ] [ lookup reg 1 set set%d ] -# ip6 nexthdr {udp, ah, comp, udplite, tcp, dccp, sctp} log +# ip6 nexthdr {udp, ah, comp, udplite, tcp, dccp, sctp} set%d test-ip6 3 set%d test-ip6 0 element 00000011 : 0 [end] element 00000033 : 0 [end] element 0000006c : 0 [end] element 00000088 : 0 [end] element 00000006 : 0 [end] element 00000021 : 0 [end] element 00000084 : 0 [end] ip6 test-ip6 input [ payload load 1b @ network header + 6 => reg 1 ] [ lookup reg 1 set set%d ] - [ log prefix (null) ] # ip6 nexthdr {esp, ah, comp, udp, udplite, tcp, dccp, sctp, icmpv6} set%d test-ip6 3
@@ -101,11 +100,10 @@ ip6 test-ip6 input [ cmp lt reg 1 0x00000021 ] [ cmp gt reg 1 0x0000002c ] -# ip6 hoplimit 1 log +# ip6 hoplimit 1 ip6 test-ip6 input [ payload load 1b @ network header + 7 => reg 1 ] [ cmp eq reg 1 0x00000001 ] - [ log prefix (null) ] # ip6 hoplimit != 233 ip6 test-ip6 input
Signature · 1 line
2.1.4
Pablo Neira Ayuso
maintainerPATCH 2/3 tests/py: test udp from ip and ip6 families
The existing test was checking for the ip family three times, fix it.
--- tests/py/inet/udp.t | 4 +- tests/py/inet/udp.t.payload.inet | 222 +++++++++++++++++++++++++++++++++++++++ tests/py/inet/udp.t.payload.ip6 | 222 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 446 insertions(+), 2 deletions(-) create mode 100644 tests/py/inet/udp.t.payload.inet create mode 100644 tests/py/inet/udp.t.payload.ip6
tests/py/inet/udp.t +2 -2
@@ -1,8 +1,8 @@ :input;type filter hook input priority 0 *ip;test-ip4;input -*ip;test-ip6;input -*ip;test-inet;input +*ip6;test-ip6;input +*inet;test-inet;input udp sport 80 accept;ok udp sport != 60 accept;ok
tests/py/inet/udp.t.payload.inet new file +222 -0
222 lines not on this page · raw message
tests/py/inet/udp.t.payload.ip6 new file +222 -0
222 lines not on this page · raw message
Signature · 1 line
2.1.4
Pablo Neira Ayuso
maintainerPATCH 3/3 tests/py: netdev family with ingress chain
In reply to Pablo Neira Ayuso--- tests/py/any/frag.t | 2 + tests/py/any/limit.t | 2 + tests/py/any/meta.t | 2 + tests/py/arp/arp.t | 2 + tests/py/arp/arp.t.payload.netdev | 293 ++++++++++++++++ tests/py/inet/ah.t | 2 + tests/py/inet/ah.t.payload.netdev | 186 ++++++++++ tests/py/inet/comp.t | 2 + tests/py/inet/comp.t.payload.netdev | 107 ++++++ tests/py/inet/dccp.t | 2 + tests/py/inet/dccp.t.payload.netdev | 82 +++++ tests/py/inet/esp.t | 2 + tests/py/inet/esp.t.payload.netdev | 93 +++++ tests/py/inet/ether-ip.t | 2 + tests/py/inet/ether-ip.t.payload.netdev | 44 +++ tests/py/inet/ether.t | 2 + tests/py/inet/ip.t | 2 + tests/py/inet/ip.t.payload.netdev | 14 + tests/py/inet/sctp.t | 2 + tests/py/inet/sctp.t.payload.netdev | 200 +++++++++++ tests/py/inet/tcp.t | 2 + tests/py/inet/tcp.t.payload.netdev | 507 +++++++++++++++++++++++++++ tests/py/inet/udp.t | 2 + tests/py/inet/udp.t.payload.netdev | 222 ++++++++++++ tests/py/inet/udplite.t | 2 + tests/py/inet/udplite.t.payload.netdev | 169 +++++++++ tests/py/ip/ip.t | 2 + tests/py/ip/ip.t.payload.netdev | 600 ++++++++++++++++++++++++++++++++ tests/py/ip/sets.t | 2 + tests/py/ip/sets.t.payload.netdev | 16 + tests/py/ip6/sets.t | 2 + tests/py/ip6/sets.t.payload.netdev | 8 + tests/py/ip6/vmap.t | 2 + tests/py/ip6/vmap.t.payload.netdev | 420 ++++++++++++++++++++++ 34 files changed, 2999 insertions(+) create mode 100644 tests/py/arp/arp.t.payload.netdev create mode 100644 tests/py/inet/ah.t.payload.netdev create mode 100644 tests/py/inet/comp.t.payload.netdev create mode 100644 tests/py/inet/dccp.t.payload.netdev create mode 100644 tests/py/inet/esp.t.payload.netdev create mode 100644 tests/py/inet/ether-ip.t.payload.netdev create mode 100644 tests/py/inet/ip.t.payload.netdev create mode 100644 tests/py/inet/sctp.t.payload.netdev create mode 100644 tests/py/inet/tcp.t.payload.netdev create mode 100644 tests/py/inet/udp.t.payload.netdev create mode 100644 tests/py/inet/udplite.t.payload.netdev create mode 100644 tests/py/ip/ip.t.payload.netdev create mode 100644 tests/py/ip/sets.t.payload.netdev create mode 100644 tests/py/ip6/sets.t.payload.netdev create mode 100644 tests/py/ip6/vmap.t.payload.netdev
tests/py/any/frag.t +2 -0
@@ -1,10 +1,12 @@ :output;type filter hook output priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;output *ip6;test-ip6;output *inet;test-inet;output *arp;test-arp;output *bridge;test-bridge;output +*netdev;test-netdev;ingress frag nexthdr tcp;ok;frag nexthdr 6 frag nexthdr != icmp;ok;frag nexthdr != 1
tests/py/any/limit.t +2 -0
@@ -1,10 +1,12 @@ :output;type filter hook output priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;output *ip6;test-ip6;output *inet;test-inet;output *arp;test-arp;output *bridge;test-bridge;output +*netdev;test-netdev;ingress limit rate 400/minute;ok limit rate 20/second;ok
tests/py/any/meta.t +2 -0
@@ -1,10 +1,12 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;input *ip6;test-ip6;input *inet;test-inet;input *arp;test-arp;input *bridge;test-bridge;input +*netdev;test-netdev;ingress meta length 1000;ok meta length 22;ok
tests/py/arp/arp.t +2 -0
@@ -1,7 +1,9 @@ # filter chains available are: input, output, forward :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *arp;test-arp;input +*netdev;test-netdev;ingress arp htype 1;ok arp htype != 1;ok
tests/py/arp/arp.t.payload.netdev new file +293 -0
293 lines not on this page · raw message
tests/py/inet/ah.t +2 -0
@@ -1,8 +1,10 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;input *ip6;test-ip6;input *inet;test-inet;input +*netdev;test-netdev;ingress # nexthdr Bug to list table.
tests/py/inet/ah.t.payload.netdev new file +186 -0
186 lines not on this page · raw message
tests/py/inet/comp.t +2 -0
@@ -1,8 +1,10 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;input *ip6;test-ip6;input *inet;test-inet;input +*netdev;test-netdev;ingress # BUG: nft: payload.c:88: payload_expr_pctx_update: Assertion `left->payload.base + 1 <= (__PROTO_BASE_MAX - 1)' failed. - comp nexthdr esp;ok;comp nexthdr 50
tests/py/inet/comp.t.payload.netdev new file +107 -0
107 lines not on this page · raw message
tests/py/inet/dccp.t +2 -0
@@ -1,8 +1,10 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;input *ip6;test-ip6;input *inet;test-inet;input +*netdev;test-netdev;ingress dccp sport 21-35;ok dccp sport != 21-35;ok
tests/py/inet/dccp.t.payload.netdev new file +82 -0
82 lines not on this page · raw message
tests/py/inet/esp.t +2 -0
@@ -1,8 +1,10 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;input *ip6;test-ip6;input *inet;test-inet;input +*netdev;test-netdev;ingress esp spi 100;ok esp spi != 100;ok
tests/py/inet/esp.t.payload.netdev new file +93 -0
93 lines not on this page · raw message
tests/py/inet/ether-ip.t +2 -0
@@ -1,6 +1,8 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *inet;test-inet;input +*netdev;test-netdev;ingress tcp dport 22 iiftype ether ip daddr 1.2.3.4 ether saddr 00:0f:54:0c:11:4 accept;ok;tcp dport 22 ether saddr 00:0f:54:0c:11:04 ip daddr 1.2.3.4 accept tcp dport 22 ip daddr 1.2.3.4 ether saddr 00:0f:54:0c:11:04;ok
tests/py/inet/ether-ip.t.payload.netdev new file +44 -0
44 lines not on this page · raw message
tests/py/inet/ether.t +2 -0
@@ -1,9 +1,11 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;input *ip6;test-ip6;input *inet;test-inet;input *bridge;test-bridge;input +*netdev;test-netdev;ingress tcp dport 22 iiftype ether ether saddr 00:0f:54:0c:11:4 meta nfproto ipv4 accept;ok;tcp dport 22 ether saddr 00:0f:54:0c:11:04 meta nfproto ipv4 accept tcp dport 22 iiftype ether ether saddr 00:0f:54:0c:11:4 accept;ok;tcp dport 22 ether saddr 00:0f:54:0c:11:04 accept
tests/py/inet/ip.t +2 -0
@@ -1,7 +1,9 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;input *inet;test-inet;input *bridge;test-bridge;input +*netdev;test-netdev;ingress ip saddr . ip daddr . ether saddr { 1.1.1.1 . 2.2.2.2 . ca:fe:ca:fe:ca:fe };ok
tests/py/inet/ip.t.payload.netdev new file +14 -0
@@ -0,0 +1,14 @@ +# ip saddr . ip daddr . ether saddr { 1.1.1.1 . 2.2.2.2 . ca:fe:ca:fe:ca:fe } +set%d test-netdev 3 +set%d test-netdev 0 + element 01010101 02020202 fecafeca 0000feca : 0 [end] +netdev test-netdev ingress + [ meta load protocol => reg 1 ] + [ cmp eq reg 1 0x00000008 ] + [ meta load iiftype => reg 1 ] + [ cmp eq reg 1 0x00000001 ] + [ payload load 4b @ network header + 12 => reg 1 ] + [ payload load 4b @ network header + 16 => reg 9 ] + [ payload load 6b @ link header + 6 => reg 10 ] + [ lookup reg 1 set set%d ] +
tests/py/inet/sctp.t +2 -0
@@ -1,8 +1,10 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;input *ip6;test-ip6;input *inet;test-inet;input +*netdev;test-netdev;ingress sctp sport 23;ok sctp sport != 23;ok
tests/py/inet/sctp.t.payload.netdev new file +200 -0
200 lines not on this page · raw message
tests/py/inet/tcp.t +2 -0
@@ -1,8 +1,10 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;input *ip6;test-ip6;input *inet;test-inet;input +*netdev;test-netdev;ingress tcp dport 22;ok tcp dport != 233;ok
tests/py/inet/tcp.t.payload.netdev new file +507 -0
507 lines not on this page · raw message
tests/py/inet/udp.t +2 -0
@@ -1,8 +1,10 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;input *ip6;test-ip6;input *inet;test-inet;input +*netdev;test-netdev;ingress udp sport 80 accept;ok udp sport != 60 accept;ok
tests/py/inet/udp.t.payload.netdev new file +222 -0
222 lines not on this page · raw message
tests/py/inet/udplite.t +2 -0
@@ -1,8 +1,10 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;input *ip6;test-ip6;input *inet;test-inet;input +*netdev;test-netdev;ingress udplite sport 80 accept;ok udplite sport != 60 accept;ok
tests/py/inet/udplite.t.payload.netdev new file +169 -0
169 lines not on this page · raw message
tests/py/ip/ip.t +2 -0
@@ -1,7 +1,9 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;input *inet;test-inet;input +*netdev;test-netdev;ingress - ip version 2;ok
tests/py/ip/ip.t.payload.netdev new file +600 -0
600 lines not on this page · raw message
tests/py/ip/sets.t +2 -0
@@ -1,7 +1,9 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip;test-ip4;input *inet;test-inet;input +*netdev;test-netdev;ingress !set_ipv4_add ipv4_addr;ok !set_inet inet_proto;ok
tests/py/ip/sets.t.payload.netdev new file +16 -0
@@ -0,0 +1,16 @@ +# ip saddr @set1 drop +netdev test-netdev ingress + [ meta load protocol => reg 1 ] + [ cmp eq reg 1 0x00000008 ] + [ payload load 4b @ network header + 12 => reg 1 ] + [ lookup reg 1 set set1 ] + [ immediate reg 0 drop ] + +# ip saddr @set2 drop +netdev test-netdev ingress + [ meta load protocol => reg 1 ] + [ cmp eq reg 1 0x00000008 ] + [ payload load 4b @ network header + 12 => reg 1 ] + [ lookup reg 1 set set2 ] + [ immediate reg 0 drop ] +
tests/py/ip6/sets.t +2 -0
@@ -1,7 +1,9 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip6;test-ip6;input *inet;test-inet;input +*netdev;test-netdev;ingress !set_ipv6_add1 ipv6_addr;ok !set_inet1 inet_proto;ok
tests/py/ip6/sets.t.payload.netdev new file +8 -0
@@ -0,0 +1,8 @@ +# ip6 saddr @set2 drop +netdev test-netdev ingress + [ meta load protocol => reg 1 ] + [ cmp eq reg 1 0x0000dd86 ] + [ payload load 16b @ network header + 8 => reg 1 ] + [ lookup reg 1 set set2 ] + [ immediate reg 0 drop ] +
tests/py/ip6/vmap.t +2 -0
@@ -1,7 +1,9 @@ :input;type filter hook input priority 0 +:ingress;type filter hook ingress device lo priority 0 *ip6;test-ip6;input *inet;test-inet;input +*netdev;test-netdev;ingress ip6 saddr vmap { abcd::3 : accept };ok ip6 saddr 1234:1234:1234:1234:1234:1234:1234:1234:1234;fail
tests/py/ip6/vmap.t.payload.netdev new file +420 -0
270 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.1.4
Part of the diff is not shown here. View the raw message.
Florian Westphal
maintainerQuoted 1 line · Pablo Neira Ayuso
Signed-off-by Pablo Neira Ayuso <[email protected]>
[ zap log rules from family matches ]
I assume thats because you deem tests/py/any/log.t sufficient?
When you push it can you add one-liner summary in this direction?
Thanks!
Pablo Neira Ayuso
maintainerQuoted 7 lines · Florian Westphal
Quoted 1 line · Pablo Neira Ayuso
Signed-off-by Pablo Neira Ayuso <[email protected]>[ zap log rules from family matches ]
I assume thats because you deem tests/py/any/log.t sufficient?
I think this unit tests should be self-contained at some level. The shell/ directory should be used to catch regressions at ruleset level, ie. these kind of combinations.
Another motivation is that I want that netdev/ingress gets tested, and we don't support log there yet, so I would need to skip this test for that case.
Quoted 1 line
When you push it can you add one-liner summary in this direction?
I'm going to include this information above. Let me know if you have any other concern, thanks Florian.
Florian Westphal
maintainerQuoted 5 lines · Pablo Neira Ayuso
Quoted 1 line · Florian Westphal
When you push it can you add one-liner summary in this direction?
I'm going to include this information above. Let me know if you have any other concern, thanks Florian.
No, all good.