<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/testing/selftests/netfilter, branch v5.8</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-06-24T22:50:31Z</updated>
<entry>
<title>selftests: netfilter: add test case for conntrack helper assignment</title>
<updated>2020-06-24T22:50:31Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2020-06-22T08:28:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=619ae8e0697a6fb85b99b19137590c7c337c579e'/>
<id>urn:sha1:619ae8e0697a6fb85b99b19137590c7c337c579e</id>
<content type='text'>
check that 'nft ... ct helper set &lt;foo&gt;' works:
 1. configure ftp helper via nft and assign it to
    connections on port 2121
 2. check with 'conntrack -L' that the next connection
    has the ftp helper attached to it.

Also add a test for auto-assign (old behaviour).

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>selftests: netfilter: add nfqueue test case</title>
<updated>2020-03-24T19:00:12Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2020-03-23T16:34:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a64d558d8cf98424cc5eb9ae6631782cd8bf789c'/>
<id>urn:sha1:a64d558d8cf98424cc5eb9ae6631782cd8bf789c</id>
<content type='text'>
Add a test case to check nf queue infrastructure.
Could be extended in the future to also cover serialization of
conntrack, uid and secctx attributes in nfqueue.

For now, this checks that 'queue bypass' works, that a queue rule with
no bypass option blocks traffic and that userspace receives the expected
number of packets.
For this we add two queues and hook all of
prerouting/input/forward/output/postrouting.

Packets get queued twice with a dummy base chain in between:
This passes with current nf tree, but reverting
commit 946c0d8e6ed4 ("netfilter: nf_queue: fix reinject verdict handling")
makes this trip (it processes 30 instead of expected 20 packets).

v2: update config file with queue and other options missing/needed for
other tests.
v3: also test with tcp, this reveals problem with commit
28f8bfd1ac94 ("netfilter: Support iif matches in POSTROUTING"), due to
skb-&gt;dev pointing at another skb in the retransmit rbtree (skb-&gt;dev
aliases to rbnode child).

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>selftests: nft_concat_range: Add test for reported add/flush/add issue</title>
<updated>2020-02-26T13:33:09Z</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2020-02-21T02:04:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0954df70fba743d8cdaa09ccf6ba8e4ad09628de'/>
<id>urn:sha1:0954df70fba743d8cdaa09ccf6ba8e4ad09628de</id>
<content type='text'>
Add a specific test for the crash reported by Phil Sutter and addressed
in the previous patch. The test cases that, in my intention, should
have covered these cases, that is, the ones from the 'concurrency'
section, don't run these sequences tightly enough and spectacularly
failed to catch this.

While at it, define a convenient way to add these kind of tests, by
adding a "reported issues" test section.

It's more convenient, for this particular test, to execute the set
setup in its own function. However, future test cases like this one
might need to call setup functions, and will typically need no tools
other than nft, so allow for this in check_tools().

The original form of the reproducer used here was provided by Phil.

Reported-by: Phil Sutter &lt;phil@nwl.cc&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>selftests: nft_concat_range: Move option for 'list ruleset' before command</title>
<updated>2020-02-25T12:01:07Z</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2020-02-21T02:11:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d0820556507bd7aef4f3a615b1b6eb66eb9785fe'/>
<id>urn:sha1:d0820556507bd7aef4f3a615b1b6eb66eb9785fe</id>
<content type='text'>
Before nftables commit fb9cea50e8b3 ("main: enforce options before
commands"), 'nft list ruleset -a' happened to work, but it's wrong
and won't work anymore. Replace it by 'nft -a list ruleset'.

Reported-by: Chen Yi &lt;yiche@redhat.com&gt;
Fixes: 611973c1e06f ("selftests: netfilter: Introduce tests for sets with range concatenation")
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>selftests: netfilter: Introduce tests for sets with range concatenation</title>
<updated>2020-01-27T07:54:30Z</updated>
<author>
<name>Stefano Brivio</name>
<email>sbrivio@redhat.com</email>
</author>
<published>2020-01-21T23:17:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=611973c1e06faef31d034deeb3ae7b7960b1f043'/>
<id>urn:sha1:611973c1e06faef31d034deeb3ae7b7960b1f043</id>
<content type='text'>
This test covers functionality and stability of the newly added
nftables set implementation supporting concatenation of ranged
fields.

For some selected set expression types, test:
- correctness, by checking that packets match or don't
- concurrency, by attempting races between insertion, deletion, lookup
- timeout feature, checking that packets don't match expired entries

and (roughly) estimate matching rates, comparing to baselines for
simple drop on netdev ingress hook and for hash and rbtrees sets.

In order to send packets, this needs one of sendip, netcat or bash.
To flood with traffic, iperf3, iperf and netperf are supported. For
performance measurements, this relies on the sample pktgen script
pktgen_bench_xmit_mode_netif_receive.sh.

If none of the tools suitable for a given test are available, specific
tests will be skipped.

Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>selftests: netfilter: extend flowtable test script with dnat rule</title>
<updated>2019-12-20T01:12:27Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2019-12-13T00:19:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d05d5db815d56a0ce203ed297153d9794dfdcb68'/>
<id>urn:sha1:d05d5db815d56a0ce203ed297153d9794dfdcb68</id>
<content type='text'>
NAT test currently covers snat (masquerade) only.

Also add a dnat rule and then check that a connecting to the
to-be-dnated address will work.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>selftests: netfilter: use randomized netns names</title>
<updated>2019-12-07T18:50:39Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2019-12-02T17:35:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5a2e6af81807d4616f9839ad0ae7d1313b45c64d'/>
<id>urn:sha1:5a2e6af81807d4616f9839ad0ae7d1313b45c64d</id>
<content type='text'>
Using ns0, ns1, etc. isn't a good idea, they might exist already.
Use a random suffix.

Also, older nft versions don't support "-" as alias for stdin, so
use /dev/stdin instead.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Acked-by: Phil Sutter &lt;phil@nwl.cc&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>selftests: netfilter: add ipvs tunnel test case</title>
<updated>2019-10-11T08:05:27Z</updated>
<author>
<name>Haishuang Yan</name>
<email>yanhaishuang@cmss.chinamobile.com</email>
</author>
<published>2019-10-10T14:50:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=176a52043ab853f1db7581ed02e1096aba78b4d1'/>
<id>urn:sha1:176a52043ab853f1db7581ed02e1096aba78b4d1</id>
<content type='text'>
Test virtual server via ipip tunnel.

Tested:
# selftests: netfilter: ipvs.sh
# Testing DR mode...
# Testing NAT mode...
# Testing Tunnel mode...
# ipvs.sh: PASS
ok 6 selftests: netfilter: ipvs.sh

Signed-off-by: Haishuang Yan &lt;yanhaishuang@cmss.chinamobile.com&gt;
Signed-off-by: Simon Horman &lt;horms@verge.net.au&gt;
</content>
</entry>
<entry>
<title>selftests: netfilter: add ipvs nat test case</title>
<updated>2019-10-11T08:05:24Z</updated>
<author>
<name>Haishuang Yan</name>
<email>yanhaishuang@cmss.chinamobile.com</email>
</author>
<published>2019-10-10T14:50:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0ed15462069082f12bf89d0d2d2edfe0374b6059'/>
<id>urn:sha1:0ed15462069082f12bf89d0d2d2edfe0374b6059</id>
<content type='text'>
Test virtual server via NAT.

Tested:
# selftests: netfilter: ipvs.sh
# Testing DR mode...
# Testing NAT mode...
# ipvs.sh: PASS

Signed-off-by: Haishuang Yan &lt;yanhaishuang@cmss.chinamobile.com&gt;
Signed-off-by: Simon Horman &lt;horms@verge.net.au&gt;
</content>
</entry>
<entry>
<title>selftests: netfilter: add ipvs test script</title>
<updated>2019-10-11T08:05:20Z</updated>
<author>
<name>Haishuang Yan</name>
<email>yanhaishuang@cmss.chinamobile.com</email>
</author>
<published>2019-10-10T14:50:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=867d2190799ab088479dfeb19d9fa92568be0a19'/>
<id>urn:sha1:867d2190799ab088479dfeb19d9fa92568be0a19</id>
<content type='text'>
Test virutal server via directing routing for IPv4.

Tested:

# selftests: netfilter: ipvs.sh
# Testing DR mode...
# ipvs.sh: PASS
ok 6 selftests: netfilter: ipvs.sh

Signed-off-by: Haishuang Yan &lt;yanhaishuang@cmss.chinamobile.com&gt;
Signed-off-by: Simon Horman &lt;horms@verge.net.au&gt;
</content>
</entry>
</feed>
