From b858365bc5e0a4a0ef2ede2fedee48f16923cf04 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 29 Sep 2017 13:54:21 +0200 Subject: tests: update inet/bridge icmp test case after previous change nft now culls the dependency chain: 'icmpv6 type echo-request' is shown as-is, and not 'meta nfproto ipv6 meta l4proto 58 icmpv6 type echo-request' anymore. Signed-off-by: Florian Westphal --- tests/py/bridge/icmpX.t | 4 ++-- tests/py/inet/icmpX.t | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/py/bridge/icmpX.t b/tests/py/bridge/icmpX.t index 0a1019c3..8c0a5979 100644 --- a/tests/py/bridge/icmpX.t +++ b/tests/py/bridge/icmpX.t @@ -3,6 +3,6 @@ *bridge;test-bridge;input ip protocol icmp icmp type echo-request;ok;icmp type echo-request -icmp type echo-request;ok;ether type ip meta l4proto 1 icmp type echo-request +icmp type echo-request;ok ip6 nexthdr icmpv6 icmpv6 type echo-request;ok;icmpv6 type echo-request -icmpv6 type echo-request;ok;ether type ip6 meta l4proto 58 icmpv6 type echo-request +icmpv6 type echo-request;ok diff --git a/tests/py/inet/icmpX.t b/tests/py/inet/icmpX.t index 7617e701..1b467a18 100644 --- a/tests/py/inet/icmpX.t +++ b/tests/py/inet/icmpX.t @@ -3,6 +3,6 @@ *inet;test-inet;input ip protocol icmp icmp type echo-request;ok;icmp type echo-request -icmp type echo-request;ok;meta nfproto ipv4 meta l4proto 1 icmp type echo-request +icmp type echo-request;ok ip6 nexthdr icmpv6 icmpv6 type echo-request;ok;icmpv6 type echo-request -icmpv6 type echo-request;ok;meta nfproto ipv6 meta l4proto 58 icmpv6 type echo-request +icmpv6 type echo-request;ok -- cgit v1.2.3 From 2440711cf07ee582db4f0fff3b274acd158dd98f Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 29 Sep 2017 13:54:21 +0200 Subject: tests: ct: adjust test case commands use 'ip saddr', 'ip6 saddr', etc. Signed-off-by: Florian Westphal --- tests/py/inet/ct.t | 7 +++++-- tests/py/inet/ct.t.payload | 4 ++-- tests/py/ip/ct.t | 18 +++++++++--------- tests/py/ip/ct.t.payload | 16 ++++++++-------- 4 files changed, 24 insertions(+), 21 deletions(-) (limited to 'tests') diff --git a/tests/py/inet/ct.t b/tests/py/inet/ct.t index c56c3bc8..1a656aa4 100644 --- a/tests/py/inet/ct.t +++ b/tests/py/inet/ct.t @@ -3,8 +3,11 @@ *inet;test-inet;input -meta nfproto ipv4 ct original saddr 1.2.3.4;ok -meta nfproto ipv6 ct original saddr ::1;ok +meta nfproto ipv4 ct original saddr 1.2.3.4;ok;ct original ip saddr 1.2.3.4 +ct original ip6 saddr ::1;ok # missing protocol context ct original saddr ::1;fail + +# wrong protocol context +ct original ip saddr ::1;fail diff --git a/tests/py/inet/ct.t.payload b/tests/py/inet/ct.t.payload index 21c74581..97128ecc 100644 --- a/tests/py/inet/ct.t.payload +++ b/tests/py/inet/ct.t.payload @@ -5,9 +5,9 @@ ip test-ip4 output [ ct load src => reg 1 , dir original ] [ cmp eq reg 1 0x04030201 ] -# meta nfproto ipv6 ct original saddr ::1 +# ct original ip6 saddr ::1 inet test-inet input - [ meta load nfproto => reg 1 ] + [ ct load l3protocol => reg 1 , dir original ] [ cmp eq reg 1 0x0000000a ] [ ct load src => reg 1 , dir original ] [ cmp eq reg 1 0x00000000 0x00000000 0x00000000 0x01000000 ] diff --git a/tests/py/ip/ct.t b/tests/py/ip/ct.t index d0f16c51..d3247f79 100644 --- a/tests/py/ip/ct.t +++ b/tests/py/ip/ct.t @@ -2,16 +2,16 @@ *ip;test-ip4;output -ct original saddr 192.168.0.1;ok -ct reply saddr 192.168.0.1;ok -ct original daddr 192.168.0.1;ok -ct reply daddr 192.168.0.1;ok +ct original ip saddr 192.168.0.1;ok +ct reply ip saddr 192.168.0.1;ok +ct original ip daddr 192.168.0.1;ok +ct reply ip daddr 192.168.0.1;ok # same, but with a netmask -ct original saddr 192.168.1.0/24;ok -ct reply saddr 192.168.1.0/24;ok -ct original daddr 192.168.1.0/24;ok -ct reply daddr 192.168.1.0/24;ok +ct original ip saddr 192.168.1.0/24;ok +ct reply ip saddr 192.168.1.0/24;ok +ct original ip daddr 192.168.1.0/24;ok +ct reply ip daddr 192.168.1.0/24;ok ct l3proto ipv4;ok ct l3proto foobar;fail @@ -20,4 +20,4 @@ ct protocol 6 ct original proto-dst 22;ok ct original protocol 17 ct reply proto-src 53;ok;ct protocol 17 ct reply proto-src 53 # wrong address family -ct reply daddr dead::beef;fail +ct reply ip daddr dead::beef;fail diff --git a/tests/py/ip/ct.t.payload b/tests/py/ip/ct.t.payload index 56633a24..b7cd130d 100644 --- a/tests/py/ip/ct.t.payload +++ b/tests/py/ip/ct.t.payload @@ -1,42 +1,42 @@ -# ct original saddr 192.168.0.1 +# ct original ip saddr 192.168.0.1 ip test-ip4 output [ ct load src => reg 1 , dir original ] [ cmp eq reg 1 0x0100a8c0 ] -# ct reply saddr 192.168.0.1 +# ct reply ip saddr 192.168.0.1 ip test-ip4 output [ ct load src => reg 1 , dir reply ] [ cmp eq reg 1 0x0100a8c0 ] -# ct original daddr 192.168.0.1 +# ct original ip daddr 192.168.0.1 ip test-ip4 output [ ct load dst => reg 1 , dir original ] [ cmp eq reg 1 0x0100a8c0 ] -# ct reply daddr 192.168.0.1 +# ct reply ip daddr 192.168.0.1 ip test-ip4 output [ ct load dst => reg 1 , dir reply ] [ cmp eq reg 1 0x0100a8c0 ] -# ct original saddr 192.168.1.0/24 +# ct original ip saddr 192.168.1.0/24 ip test-ip4 output [ ct load src => reg 1 , dir original ] [ bitwise reg 1 = (reg=1 & 0x00ffffff ) ^ 0x00000000 ] [ cmp eq reg 1 0x0001a8c0 ] -# ct reply saddr 192.168.1.0/24 +# ct reply ip saddr 192.168.1.0/24 ip test-ip4 output [ ct load src => reg 1 , dir reply ] [ bitwise reg 1 = (reg=1 & 0x00ffffff ) ^ 0x00000000 ] [ cmp eq reg 1 0x0001a8c0 ] -# ct original daddr 192.168.1.0/24 +# ct original ip daddr 192.168.1.0/24 ip test-ip4 output [ ct load dst => reg 1 , dir original ] [ bitwise reg 1 = (reg=1 & 0x00ffffff ) ^ 0x00000000 ] [ cmp eq reg 1 0x0001a8c0 ] -# ct reply daddr 192.168.1.0/24 +# ct reply ip daddr 192.168.1.0/24 ip test-ip4 output [ ct load dst => reg 1 , dir reply ] [ bitwise reg 1 = (reg=1 & 0x00ffffff ) ^ 0x00000000 ] -- cgit v1.2.3 From 67d4030ddf8ceb62da05b78502c6de1b6b367e42 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 29 Sep 2017 13:54:21 +0200 Subject: tests: rt: fix test cases nfproto meta dependency is no longer needed, keep one test since we still support this syntax. When meta is not provided, no need to add a dependency because nft_rt already checks pf number before checking skb->dst. Signed-off-by: Florian Westphal --- tests/py/inet/rt.t | 10 ++++++++-- tests/py/inet/rt.t.payload | 4 +--- tests/py/ip/rt.t | 3 ++- tests/py/ip6/rt0.t | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/py/inet/rt.t b/tests/py/inet/rt.t index 9543738b..23608ab2 100644 --- a/tests/py/inet/rt.t +++ b/tests/py/inet/rt.t @@ -4,7 +4,13 @@ rt nexthop 192.168.0.1;fail rt nexthop fd00::1;fail -meta nfproto ipv4 rt nexthop 192.168.0.1;ok -meta nfproto ipv6 rt nexthop fd00::1;ok + +meta nfproto ipv4 rt nexthop 192.168.0.1;ok;meta nfproto ipv4 rt ip nexthop 192.168.0.1 +rt ip6 nexthop fd00::1;ok + +# missing context +rt nexthop fd00::1;fail +# wrong context +rt ip nexthop fd00::1;fail tcp option maxseg size set rt mtu;ok diff --git a/tests/py/inet/rt.t.payload b/tests/py/inet/rt.t.payload index 928e0095..84dea12c 100644 --- a/tests/py/inet/rt.t.payload +++ b/tests/py/inet/rt.t.payload @@ -5,10 +5,8 @@ inet test-inet output [ rt load nexthop4 => reg 1 ] [ cmp eq reg 1 0x0100a8c0 ] -# meta nfproto ipv6 rt nexthop fd00::1 +# rt ip6 nexthop fd00::1 inet test-inet output - [ meta load nfproto => reg 1 ] - [ cmp eq reg 1 0x0000000a ] [ rt load nexthop6 => reg 1 ] [ cmp eq reg 1 0x000000fd 0x00000000 0x00000000 0x01000000 ] diff --git a/tests/py/ip/rt.t b/tests/py/ip/rt.t index 99750c5d..986bf341 100644 --- a/tests/py/ip/rt.t +++ b/tests/py/ip/rt.t @@ -2,5 +2,6 @@ *ip;test-ip4;output -rt nexthop 192.168.0.1;ok +rt nexthop 192.168.0.1;ok;rt ip nexthop 192.168.0.1 rt nexthop fd00::1;fail +rt ip6 nexthop fd00::1;fail diff --git a/tests/py/ip6/rt0.t b/tests/py/ip6/rt0.t index 92614de3..1d50a89c 100644 --- a/tests/py/ip6/rt0.t +++ b/tests/py/ip6/rt0.t @@ -3,4 +3,4 @@ *ip6;test-ip6;output rt nexthop 192.168.0.1;fail -rt nexthop fd00::1;ok +rt nexthop fd00::1;ok;rt ip6 nexthop fd00::1 -- cgit v1.2.3