Message ID | 87f974d9431af3018c35cbd4db147ea807e3c451.1713321357.git.tanggeliang@kylinos.cn (mailing list archive) |
---|---|
State | Accepted, archived |
Commit | d0432b7d2bb05fd5d7401080a2ce2854f95ae169 |
Delegated to: | Matthieu Baerts |
Headers | show |
Series | refactor mptcp bpf tests | expand |
Context | Check | Description |
---|---|---|
matttbe/KVM_Validation__normal | success | Success! ✅ |
matttbe/KVM_Validation__debug | success | Success! ✅ |
matttbe/KVM_Validation__btf__only_bpftest_all_ | success | Success! ✅ |
matttbe/build | success | Build and static analysis OK |
matttbe/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 20 lines checked |
matttbe/shellcheck | success | MPTCP selftests files have not been modified |
On Wed, 17 Apr 2024, Geliang Tang wrote: > From: Geliang Tang <tanggeliang@kylinos.cn> > > Each MPTCP subtest tests test__start_subtest(suffix), then invokes > test_suffix(). It makes sense to add a new macro RUN_MPTCP_TEST to > simpolify the code. > > Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> With https://patchwork.kernel.org/project/mptcp/patch/cc01abb2882608ac5f719e0f7960aa2a2d9fca41.1713404174.git.tanggeliang@kylinos.cn/, v9 of the series looks good to apply. The rest of the series is all "squash-to" patches, but for this first patch: Reviewed-by: Mat Martineau <martineau@kernel.org> > --- > tools/testing/selftests/bpf/prog_tests/mptcp.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c > index cbdb15922949..c29c81239603 100644 > --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c > +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c > @@ -653,12 +653,16 @@ static void test_burst(void) > mptcp_bpf_burst__destroy(burst_skel); > } > > +#define RUN_MPTCP_TEST(suffix) \ > +do { \ > + if (test__start_subtest(#suffix)) \ > + test_##suffix(); \ > +} while (0) > + > void test_mptcp(void) > { > - if (test__start_subtest("base")) > - test_base(); > - if (test__start_subtest("mptcpify")) > - test_mptcpify(); > + RUN_MPTCP_TEST(base); > + RUN_MPTCP_TEST(mptcpify); > if (test__start_subtest("default")) > test_default(); > if (test__start_subtest("first")) > -- > 2.40.1 > > >
diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c index cbdb15922949..c29c81239603 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -653,12 +653,16 @@ static void test_burst(void) mptcp_bpf_burst__destroy(burst_skel); } +#define RUN_MPTCP_TEST(suffix) \ +do { \ + if (test__start_subtest(#suffix)) \ + test_##suffix(); \ +} while (0) + void test_mptcp(void) { - if (test__start_subtest("base")) - test_base(); - if (test__start_subtest("mptcpify")) - test_mptcpify(); + RUN_MPTCP_TEST(base); + RUN_MPTCP_TEST(mptcpify); if (test__start_subtest("default")) test_default(); if (test__start_subtest("first"))