linux/tools/testing
Ferenc Fejes 9c441fe4c0 selftests/bpf: Add test for SO_BINDTODEVICE opt of bpf_setsockopt
This test intended to verify if SO_BINDTODEVICE option works in
bpf_setsockopt. Because we already in the SOL_SOCKET level in this
connect bpf prog its safe to verify the sanity in the beginning of
the connect_v4_prog by calling the bind_to_device test helper.

The testing environment already created by the test_sock_addr.sh
script so this test assume that two netdevices already existing in
the system: veth pair with names test_sock_addr1 and test_sock_addr2.
The test will try to bind the socket to those devices first.
Then the test assume there are no netdevice with "nonexistent_dev"
name so the bpf_setsockopt will give use ENODEV error.
At the end the test remove the device binding from the socket
by binding it to an empty name.

Signed-off-by: Ferenc Fejes <fejes@inf.elte.hu>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/3f055b8e45c65639c5c73d0b4b6c589e60b86f15.1590871065.git.fejes@inf.elte.hu
2020-06-01 14:57:14 -07:00
..
fault-injection
ktest ktest: Fix typos in ktest.pl 2020-03-09 16:15:27 -04:00
kunit SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
nvdimm tools/test/nvdimm: Fix out of tree build 2020-03-31 14:12:32 -07:00
radix-tree SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
scatterlist
selftests selftests/bpf: Add test for SO_BINDTODEVICE opt of bpf_setsockopt 2020-06-01 14:57:14 -07:00
vsock SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00