linux-stable/tools/testing
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
..
crypto/chacha20-s390
cxl tools/testing/cxl: Fix command effects for inject/clear poison 2023-07-19 16:36:23 +02:00
fault-injection
ktest ktest: Restore stty setting at first in dodie 2023-02-20 11:52:27 -05:00
kunit kunit: tool: undo type subscripts for subprocess.Popen 2023-07-19 16:35:17 +02:00
memblock mm, treewide: redefine MAX_ORDER sanely 2023-04-05 19:42:46 -07:00
nvdimm Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00
radix-tree radix tree test suite: fix incorrect allocation size for pthreads 2023-08-16 18:32:19 +02:00
scatterlist
selftests selftests/bpf: Fix bpf_nf failure upon test rerun 2023-09-13 09:47:59 +02:00
vsock test/vsock: remove vsock_perf executable on `make clean` 2023-08-11 12:14:18 +02:00