Commit 77a7a822 authored by Daniel Xu's avatar Daniel Xu Committed by Alexei Starovoitov

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: default avatarDaniel Xu <dxu@dxuuu.xyz>
Link: https://lore.kernel.org/r/0fb59fa16fb58cca7def5239df606005a3e8dd0e.1702593901.git.dxu@dxuuu.xyzSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 8f0ec8c6
...@@ -535,23 +535,20 @@ static void test_ipip_tunnel(enum ipip_encap encap) ...@@ -535,23 +535,20 @@ static void test_ipip_tunnel(enum ipip_encap encap)
#define RUN_TEST(name, ...) \ #define RUN_TEST(name, ...) \
({ \ ({ \
if (test__start_subtest(#name)) { \ if (test__start_subtest(#name)) { \
config_device(); \
test_ ## name(__VA_ARGS__); \ test_ ## name(__VA_ARGS__); \
cleanup(); \
} \ } \
}) })
static void *test_tunnel_run_tests(void *arg) static void *test_tunnel_run_tests(void *arg)
{ {
cleanup();
config_device();
RUN_TEST(vxlan_tunnel); RUN_TEST(vxlan_tunnel);
RUN_TEST(ip6vxlan_tunnel); RUN_TEST(ip6vxlan_tunnel);
RUN_TEST(ipip_tunnel, NONE); RUN_TEST(ipip_tunnel, NONE);
RUN_TEST(ipip_tunnel, FOU); RUN_TEST(ipip_tunnel, FOU);
RUN_TEST(ipip_tunnel, GUE); RUN_TEST(ipip_tunnel, GUE);
cleanup();
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment