diff options
author | Daniel Xu <dxu@dxuuu.xyz> | 2023-12-14 15:49:03 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-12-14 17:12:49 -0800 |
commit | 77a7a8220f0d87c44425c0a12e0a72b14962535b (patch) | |
tree | d6d8802fab0be3c12762810ffc6e026f4dbe84b1 | |
parent | 8f0ec8c681755f523cf842bfe350ea40609b83a9 (diff) | |
download | linux-77a7a8220f0d87c44425c0a12e0a72b14962535b.tar.gz linux-77a7a8220f0d87c44425c0a12e0a72b14962535b.tar.bz2 linux-77a7a8220f0d87c44425c0a12e0a72b14962535b.zip |
bpf: selftests: test_tunnel: Setup fresh topology for each subtest
This helps with determinism b/c individual setup/teardown prevents
leaking state between different subtests.
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Link: https://lore.kernel.org/r/0fb59fa16fb58cca7def5239df606005a3e8dd0e.1702593901.git.dxu@dxuuu.xyz
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/test_tunnel.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/test_tunnel.c b/tools/testing/selftests/bpf/prog_tests/test_tunnel.c index d149ab98798d..b57d48219d0b 100644 --- a/tools/testing/selftests/bpf/prog_tests/test_tunnel.c +++ b/tools/testing/selftests/bpf/prog_tests/test_tunnel.c @@ -535,23 +535,20 @@ done: #define RUN_TEST(name, ...) \ ({ \ if (test__start_subtest(#name)) { \ + config_device(); \ test_ ## name(__VA_ARGS__); \ + cleanup(); \ } \ }) static void *test_tunnel_run_tests(void *arg) { - cleanup(); - config_device(); - RUN_TEST(vxlan_tunnel); RUN_TEST(ip6vxlan_tunnel); RUN_TEST(ipip_tunnel, NONE); RUN_TEST(ipip_tunnel, FOU); RUN_TEST(ipip_tunnel, GUE); - cleanup(); - return NULL; } |