linux/tools/testing/selftests
Yonghong Song 7b4eb53d95 tools/bpf: fix batch-mode test failure of test_xdp_redirect.sh
The tests at tools/testing/selftests/bpf can run in patch mode, e.g.,
    make -C tools/testing/selftests/bpf run_tests

With the batch mode, I experimented intermittent test failure of
test_xdp_redirect.sh.
    ....
    selftests: test_xdp_redirect [PASS]
    selftests: test_xdp_redirect.sh [PASS]
    RTNETLINK answers: File exists
    selftests: test_xdp_meta [FAILED]
    selftests: test_xdp_meta.sh [FAIL]
    ....

The following illustrates what caused the failure:
     (1). test_xdp_redirect creates veth pairs (veth1,veth11) and
          (veth2,veth22), and assign veth11 and veth22 to namespace
          ns1 and ns2 respectively.
     (2). at the end of test_xdp_redirect test, ns1 and ns2 are
          deleted. During this process, the deletion of actual
          namespace resources, including deletion of veth1{1} and veth2{2},
          is put into a workqueue to be processed asynchronously.
     (3). test_xdp_meta tries to create veth pair (veth1, veth2).
          The previous veth deletions in step (2) have not finished yet,
          and veth1 or veth2 may be still valid in the kernel, thus
          causing the failure.

The fix is to explicitly delete the veth pair before test_xdp_redirect
exits. Only one end of veth needs deletion as the kernel will delete
the other end automatically. Also test_xdp_meta is also fixed in
similar manner to avoid future potential issues.

Fixes: 996139e801 ("selftests: bpf: add a test for XDP redirect")
Fixes: 22c8852624 ("bpf: improve selftests and add tests for meta pointer")
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-02-06 11:34:42 +01:00
..
android android/ion: userspace test utility for ion buffer sharing 2017-11-15 08:07:53 -07:00
bpf tools/bpf: fix batch-mode test failure of test_xdp_redirect.sh 2018-02-06 11:34:42 +01:00
breakpoints selftests: breakpoints: fix compile error on breakpoint_test_arm64 2017-11-15 08:01:43 -07:00
capabilities License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cpu-hotplug selftests: remove obsolete kconfig fragment for cpu-hotplug 2017-11-15 08:01:43 -07:00
cpufreq License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
drivers/gpu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
efivarfs License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
exec selftests/exec: include cwd in long path calculation 2017-11-15 08:01:42 -07:00
filesystems License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
firmware test_firmware: wrap custom sysfs load tests into helper 2017-11-29 11:22:49 +01:00
ftrace selftest: ftrace: Fix to add 256 kprobe events correctly 2018-01-16 09:29:33 -07:00
futex License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gpio License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ia64 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
intel_pstate License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ipc License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kcmp License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kmod test_kmod: fix description for -s -and -c parameters 2017-08-18 15:32:01 -07:00
lib License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
locking License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
media_tests selftests: media_tests: Add SPDX license identifier 2018-01-12 11:46:56 -07:00
membarrier License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
memfd memfd-test: run fuse test on hugetlb backend memory 2018-01-31 17:18:39 -08:00
memory-hotplug selftests: add missing test result status in memory-hotplug test 2017-11-15 08:01:43 -07:00
mount License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mqueue License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
net selftests: fib_tests: Add test cases for netdev carrier change 2018-01-07 21:29:41 -05:00
networking/timestamping License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nsfs tools/testing: Fix trailing semicolon 2018-01-12 11:41:33 -07:00
ntb NTB: ntb_test: Update ntb_perf tests 2018-01-28 22:17:24 -05:00
powerpc powerpc/selftests: Check endianness on trap in TM 2018-01-22 05:48:37 +11:00
prctl License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pstore License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ptp posix-timers: Prevent UB from shifting negative signed value 2018-01-04 14:57:10 +01:00
ptrace License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rcutorture torture: Eliminate torture_runnable and perf_runnable 2017-12-11 09:18:29 -08:00
seccomp selftests: seccomp: fix compile error seccomp_bpf 2018-01-10 08:22:39 -07:00
sigaltstack License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
size kselftest: convert get_size to use stricter TAP13 format 2017-06-14 18:23:27 -06:00
splice License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
static_keys License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sync License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sysctl test_sysctl: fix sysctl.sh by making it executable 2017-08-07 15:13:36 -06:00
tc-testing Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
timers selftests: timers: Update .gitignore with newly added tests 2017-11-15 08:01:42 -07:00
user License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vDSO selftests: vdso_test: support ARM64 targets 2017-11-15 08:01:43 -07:00
vm linux-kselftest-4.16-rc1 2018-02-03 13:01:19 -08:00
watchdog License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
x86 linux-kselftest-4.16-rc1 2018-02-03 13:01:19 -08:00
zram License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
.gitignore selftests: add gpio generated files to .gitignore 2017-04-25 09:49:38 -06:00
gen_kselftest_tar.sh selftests: gen_kselftest_tar.h: Add SPDX license identifier 2018-01-12 11:44:31 -07:00
kselftest_harness.h selftests: Enhance kselftest_harness.h to print which assert failed 2017-09-05 19:21:33 -06:00
kselftest_install.sh selftests: kselftest_install.sh: Add SPDX license identifier 2018-01-12 11:45:05 -07:00
kselftest.h selftests: kselftest.h: Add SPDX license identifier 2018-01-12 11:46:21 -07:00
lib.mk selftests: Fix loss of test output in run_kselftests.sh 2018-01-16 09:31:31 -07:00
Makefile selftests: Fix loss of test output in run_kselftests.sh 2018-01-16 09:31:31 -07:00