diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2023-05-15 13:48:33 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-05-16 20:57:16 -0700 |
commit | 24a86d833bc5509ad34343dd6c649ea11ed1cad3 (patch) | |
tree | f4d92564ac4dcefdf592aff26c566ce54028620e /tools/testing/selftests/bpf/prog_tests/netcnt.c | |
parent | e7480a44d7c4ce4691fa6bcdb0318f0d81fe4b12 (diff) |
selftests/bpf: improve netcnt test robustness
Change netcnt to demand at least 10K packets, as we frequently see some
stray packet arriving during the test in BPF CI. It seems more important
to make sure we haven't lost any packet than enforcing exact number of
packets.
Cc: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/20230515204833.2832000-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/netcnt.c')
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/netcnt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/netcnt.c b/tools/testing/selftests/bpf/prog_tests/netcnt.c index d3915c58d0e1..c3333edd029f 100644 --- a/tools/testing/selftests/bpf/prog_tests/netcnt.c +++ b/tools/testing/selftests/bpf/prog_tests/netcnt.c @@ -67,12 +67,12 @@ void serial_test_netcnt(void) } /* No packets should be lost */ - ASSERT_EQ(packets, 10000, "packets"); + ASSERT_GE(packets, 10000, "packets"); /* Let's check that bytes counter matches the number of packets * multiplied by the size of ipv6 ICMP packet. */ - ASSERT_EQ(bytes, packets * 104, "bytes"); + ASSERT_GE(bytes, packets * 104, "bytes"); err: if (cg_fd != -1) |