selftests: add xfrm policy test script
authorFlorian Westphal <fw@strlen.de>
Wed, 7 Nov 2018 22:00:31 +0000 (23:00 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 9 Nov 2018 10:57:08 +0000 (11:57 +0100)
commitb69d540da7db84e836cea77fbd56a518aafa1f2f
treefcaa3d4559843f6c7e7773038faa48abc6a4bf81
parent29e12207174a58ac8cab4914d0a7ce5e6c872646
selftests: add xfrm policy test script

add a script that adds a ipsec tunnel between two network
namespaces plus following policies:

.0/24 -> ipsec tunnel
.240/28 -> bypass
.253/32 -> ipsec tunnel

Then check that .254 bypasses tunnel (match /28 exception),
and .2 (match /24) and .253 (match direct policy) pass through the
tunnel.

Abuses iptables to check if ping did resolve an ipsec policy or not.

Also adds a bunch of 'block' rules that are not supposed to match.

Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
tools/testing/selftests/net/Makefile
tools/testing/selftests/net/xfrm_policy.sh [new file with mode: 0755]