linux-stable/tools/testing/selftests
Daniel Borkmann a3e6c8c383 selftests/bpf: Fix bpf_nf failure upon test rerun
[ Upstream commit 17e8e5d6e0 ]

Alexei reported:

  After fast forwarding bpf-next today bpf_nf test started to fail when
  run twice:

  $ ./test_progs -t bpf_nf
  #17      bpf_nf:OK
  Summary: 1/10 PASSED, 0 SKIPPED, 0 FAILED

  $ ./test_progs -t bpf_nf
  All error logs:
  test_bpf_nf_ct:PASS:test_bpf_nf__open_and_load 0 nsec
  test_bpf_nf_ct:PASS:iptables-legacy -t raw -A PREROUTING -j CONNMARK
  --set-mark 42/0 0 nsec
  (network_helpers.c:102: errno: Address already in use) Failed to bind socket
  test_bpf_nf_ct:FAIL:start_server unexpected start_server: actual -1 < expected 0
  #17/1    bpf_nf/xdp-ct:FAIL
  test_bpf_nf_ct:PASS:test_bpf_nf__open_and_load 0 nsec
  test_bpf_nf_ct:PASS:iptables-legacy -t raw -A PREROUTING -j CONNMARK
  --set-mark 42/0 0 nsec
  (network_helpers.c:102: errno: Address already in use) Failed to bind socket
  test_bpf_nf_ct:FAIL:start_server unexpected start_server: actual -1 < expected 0
  #17/2    bpf_nf/tc-bpf-ct:FAIL
  #17      bpf_nf:FAIL
  Summary: 0/8 PASSED, 0 SKIPPED, 1 FAILED

I was able to locally reproduce as well. Rearrange the connection teardown
so that the client closes its connection first so that we don't need to
linger in TCP time-wait.

Fixes: e81fbd4c1b ("selftests/bpf: Add existing connection bpf_*_ct_lookup() test")
Reported-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/CAADnVQ+0dnDq_v_vH1EfkacbfGnHANaon7zsw10pMb-D9FS0Pw@mail.gmail.com
Link: https://lore.kernel.org/bpf/20230626131942.5100-1-daniel@iogearbox.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-13 09:47:59 +02:00
..
alsa selftests: alsa: pcm-test: Fix compiler warnings about the format 2023-06-05 09:15:42 +02:00
amd-pstate linux-kselftest-next-6.4-rc1 2023-04-24 12:28:34 -07:00
arm64 kselftest/arm64: Convert za-fork to use kselftest.h 2023-04-11 14:10:51 -06:00
bpf selftests/bpf: Fix bpf_nf failure upon test rerun 2023-09-13 09:47:59 +02:00
breakpoints
capabilities
cgroup selftests: cgroup: fix unexpected failure on test_memcg_low 2023-07-19 16:35:27 +02:00
clone3 selftests/clone3: fix number of tests in ksft_set_plan 2023-04-06 11:57:28 +02:00
core
cpu-hotplug
cpufreq
damon
dma
dmabuf-heaps
drivers selftests: bonding: do not set port down before adding to bond 2023-08-30 14:52:32 +02:00
efivarfs
exec
filesystems
firmware
fpu
ftrace selftests/ftace: Fix KTAP output ordering 2023-07-19 16:35:19 +02:00
futex selftests/futex: Order calls to futex_lock_pi 2023-09-13 09:47:58 +02:00
gpio selftests: gpio: gpio-sim: Fix BUG: test FAILED due to recent change 2023-05-11 14:41:45 +02:00
hid selftests: hid: import hid-tools usb-crash tests 2023-04-12 17:13:38 +02:00
ia64
intel_pstate
iommu iommufd/selftest: Cover domain unmap with huge pages and access 2023-04-04 13:11:24 -03:00
ipc
ir
kcmp
kexec
kmod
kselftest
kvm KVM: selftests: Add test for race in kvm_recalculate_apic_map() 2023-06-02 17:21:06 -07:00
landlock
lib
livepatch
lkdtm
locking
media_tests
membarrier
memfd selftests/memfd: fix test_sysctl 2023-04-18 16:53:52 -07:00
memory-hotplug
mincore
mm selftests/mm: FOLL_LONGTERM need to be updated to 0x100 2023-08-30 14:52:36 +02:00
mount
mount_setattr selftests mount: Fix mount_setattr_test builds failed 2023-03-31 09:18:45 -06:00
move_mount_set_group
mqueue
nci
net selftests: mirror_gre_changes: Tighten up the TTL test match 2023-08-23 17:32:44 +02:00
netfilter selftests: nft_flowtable.sh: check ingress/egress chain too 2023-05-10 09:31:07 +02:00
nolibc tools/nolibc: ensure fast64 integer types have 64 bits 2023-07-19 16:35:18 +02:00
nsfs
ntb
openat2
perf_events
pid_namespace
pidfd
powerpc selftests/powerpc/dscr: Restore timeout to DSCR selftests 2023-04-20 13:21:46 +10:00
prctl selftests: prctl: Add new prctl test for PR_SET_VMA action 2023-03-28 10:28:33 -06:00
proc selftests/proc: Assert clock_gettime(CLOCK_BOOTTIME) VS /proc/uptime monotonicity 2023-04-18 16:35:13 +02:00
pstore
ptp selftests/ptp: Fix timestamp printf format for PTP_SYS_OFFSET 2023-06-15 15:07:23 -07:00
ptrace Update for entry and ptrace: 2023-04-25 11:05:04 -07:00
rcutorture rcutorture: Correct name of use_softirq module parameter 2023-07-19 16:35:17 +02:00
resctrl selftests/resctrl: Close perf value read fd on errors 2023-09-13 09:47:58 +02:00
riscv selftests: Test the new RISC-V hwprobe interface 2023-04-18 15:48:17 -07:00
rlimits
rseq selftests/rseq: Fix build with undefined __weak 2023-08-16 18:32:24 +02:00
rtc
safesetid
sched selftests: sched: Add more core schedule prctl calls 2023-03-28 10:27:07 -06:00
seccomp LoongArch changes for v6.3 2023-03-01 09:27:00 -08:00
sgx selftests/sgx: Add "test_encl.elf" to TEST_FILES 2023-05-08 11:01:03 -06:00
sigaltstack selftests: sigaltstack: fix -Wuninitialized 2023-03-20 17:28:31 -06:00
size
sparc64
splice
static_keys
sync
syscall_user_dispatch
sysctl
tc-testing net/sched: taprio: Limit TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME to INT_MAX. 2023-08-11 12:14:14 +02:00
tdx
timens
timers selftests/timers/posix_timers: Test delivery of signals across threads 2023-04-16 09:00:18 +02:00
tmpfs
tpm2
uevent
user
user_events selftests/user_events: Adapt dyn_test to non-persist events 2023-06-14 13:43:27 -04:00
vDSO kselftest: vDSO: Fix accumulation of uninitialized ret when CLOCK_REALTIME is undefined 2023-07-19 16:35:18 +02:00
watchdog
wireguard wireguard: netlink: send staged packets when setting initial private key 2023-07-19 16:37:02 +02:00
x86 Add support for new Linear Address Masking CPU feature. This is similar 2023-04-28 09:43:49 -07:00
zram
.gitignore
gen_kselftest_tar.sh
kselftest.h kselftest: Support nolibc 2023-04-11 14:10:47 -06:00
kselftest_deps.sh
kselftest_harness.h selftests/harness: Actually report SKIP for signal tests 2023-09-13 09:47:57 +02:00
kselftest_install.sh
kselftest_module.h
lib.mk selftests: fix LLVM build for i386 and x86_64 2023-03-10 13:41:10 -07:00
Makefile RISC-V Patches for the 6.4 Merge Window, Part 1 2023-04-28 16:55:39 -07:00
run_kselftest.sh