selftests/bpf: Test table ID fib lookup BPF helper
authorLouis DeLosSantos <louis.delos.devel@gmail.com>
Wed, 31 May 2023 19:38:49 +0000 (15:38 -0400)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 1 Jun 2023 17:59:01 +0000 (19:59 +0200)
commitd4ae3e587eced73c9b6f82fd8f88606a09ff710c
treea6f0de6525370979c12e88cca72ef557b9ade3a1
parent8ad77e72caae22a1ddcfd0c03f2884929e93b7a4
selftests/bpf: Test table ID fib lookup BPF helper

Add additional test cases to `fib_lookup.c` prog_test.

These test cases add a new /24 network to the previously unused veth2
device, removes the directly connected route from the main routing table
and moves it to table 100.

The first test case then confirms a fib lookup for a remote address in
this directly connected network, using the main routing table fails.

The second test case ensures the same fib lookup using table 100 succeeds.

An additional pair of tests which function in the same manner are added
for IPv6.

Signed-off-by: Louis DeLosSantos <louis.delos.devel@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230505-bpf-add-tbid-fib-lookup-v2-2-0a31c22c748c@gmail.com
tools/testing/selftests/bpf/prog_tests/fib_lookup.c