bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] selftests/bpf: remove filtered subtests from output
@ 2022-05-20  6:13 Mykola Lysenko
  2022-05-20 17:47 ` Yonghong Song
  2022-05-20 23:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Mykola Lysenko @ 2022-05-20  6:13 UTC (permalink / raw)
  To: bpf, ast, andrii, daniel, kernel-team; +Cc: Mykola Lysenko

Currently filtered subtests show up in the output as skipped.

Before:
$ sudo ./test_progs -t log_fixup/missing_map
 #94 /1     log_fixup/bad_core_relo_trunc_none:SKIP
 #94 /2     log_fixup/bad_core_relo_trunc_partial:SKIP
 #94 /3     log_fixup/bad_core_relo_trunc_full:SKIP
 #94 /4     log_fixup/bad_core_relo_subprog:SKIP
 #94 /5     log_fixup/missing_map:OK
 #94        log_fixup:OK
Summary: 1/1 PASSED, 0 SKIPPED, 0 FAILED

After:
$ sudo ./test_progs -t log_fixup/missing_map
 #94 /5     log_fixup/missing_map:OK
 #94        log_fixup:OK
Summary: 1/1 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Mykola Lysenko <mykolal@fb.com>
---
 tools/testing/selftests/bpf/test_progs.c | 8 ++++++--
 tools/testing/selftests/bpf/test_progs.h | 2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
index a07da648af3b..ecf69fce036e 100644
--- a/tools/testing/selftests/bpf/test_progs.c
+++ b/tools/testing/selftests/bpf/test_progs.c
@@ -265,6 +265,7 @@ static void dump_test_log(const struct prog_test_def *test,
 	int i;
 	struct subtest_state *subtest_state;
 	bool subtest_failed;
+	bool subtest_filtered;
 	bool print_subtest;
 
 	/* we do not print anything in the worker thread */
@@ -283,9 +284,10 @@ static void dump_test_log(const struct prog_test_def *test,
 	for (i = 0; i < test_state->subtest_num; i++) {
 		subtest_state = &test_state->subtest_states[i];
 		subtest_failed = subtest_state->error_cnt;
+		subtest_filtered = subtest_state->filtered;
 		print_subtest = verbose() || force_log || subtest_failed;
 
-		if (skip_ok_subtests && !subtest_failed)
+		if ((skip_ok_subtests && !subtest_failed) || subtest_filtered)
 			continue;
 
 		if (subtest_state->log_cnt && print_subtest) {
@@ -417,7 +419,7 @@ bool test__start_subtest(const char *subtest_name)
 				state->subtest_num,
 				test->test_name,
 				subtest_name)) {
-		subtest_state->skipped = true;
+		subtest_state->filtered = true;
 		return false;
 	}
 
@@ -1123,6 +1125,7 @@ static int dispatch_thread_send_subtests(int sock_fd, struct test_state *state)
 		subtest_state->name = strdup(msg.subtest_done.name);
 		subtest_state->error_cnt = msg.subtest_done.error_cnt;
 		subtest_state->skipped = msg.subtest_done.skipped;
+		subtest_state->filtered = msg.subtest_done.filtered;
 
 		/* collect all logs */
 		if (msg.subtest_done.have_log)
@@ -1418,6 +1421,7 @@ static int worker_main_send_subtests(int sock, struct test_state *state)
 
 		msg.subtest_done.error_cnt = subtest_state->error_cnt;
 		msg.subtest_done.skipped = subtest_state->skipped;
+		msg.subtest_done.filtered = subtest_state->filtered;
 		msg.subtest_done.have_log = false;
 
 		if (verbose() || state->force_log || subtest_state->error_cnt) {
diff --git a/tools/testing/selftests/bpf/test_progs.h b/tools/testing/selftests/bpf/test_progs.h
index dd1b91d7985a..5fe1365c2bb1 100644
--- a/tools/testing/selftests/bpf/test_progs.h
+++ b/tools/testing/selftests/bpf/test_progs.h
@@ -70,6 +70,7 @@ struct subtest_state {
 	char *log_buf;
 	int error_cnt;
 	bool skipped;
+	bool filtered;
 
 	FILE *stdout;
 };
@@ -156,6 +157,7 @@ struct msg {
 			char name[MAX_SUBTEST_NAME + 1];
 			int error_cnt;
 			bool skipped;
+			bool filtered;
 			bool have_log;
 		} subtest_done;
 	};
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: remove filtered subtests from output
  2022-05-20  6:13 [PATCH bpf-next] selftests/bpf: remove filtered subtests from output Mykola Lysenko
@ 2022-05-20 17:47 ` Yonghong Song
  2022-05-20 23:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Yonghong Song @ 2022-05-20 17:47 UTC (permalink / raw)
  To: Mykola Lysenko, bpf, ast, andrii, daniel, kernel-team



On 5/19/22 11:13 PM, Mykola Lysenko wrote:
> Currently filtered subtests show up in the output as skipped.
> 
> Before:
> $ sudo ./test_progs -t log_fixup/missing_map
>   #94 /1     log_fixup/bad_core_relo_trunc_none:SKIP
>   #94 /2     log_fixup/bad_core_relo_trunc_partial:SKIP
>   #94 /3     log_fixup/bad_core_relo_trunc_full:SKIP
>   #94 /4     log_fixup/bad_core_relo_subprog:SKIP
>   #94 /5     log_fixup/missing_map:OK
>   #94        log_fixup:OK
> Summary: 1/1 PASSED, 0 SKIPPED, 0 FAILED
> 
> After:
> $ sudo ./test_progs -t log_fixup/missing_map
>   #94 /5     log_fixup/missing_map:OK
>   #94        log_fixup:OK
> Summary: 1/1 PASSED, 0 SKIPPED, 0 FAILED
> 
> Signed-off-by: Mykola Lysenko <mykolal@fb.com>

Acked-by: Yonghong Song <yhs@fb.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: remove filtered subtests from output
  2022-05-20  6:13 [PATCH bpf-next] selftests/bpf: remove filtered subtests from output Mykola Lysenko
  2022-05-20 17:47 ` Yonghong Song
@ 2022-05-20 23:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-20 23:30 UTC (permalink / raw)
  To: Mykola Lysenko; +Cc: bpf, ast, andrii, daniel, kernel-team

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Thu, 19 May 2022 23:13:03 -0700 you wrote:
> Currently filtered subtests show up in the output as skipped.
> 
> Before:
> $ sudo ./test_progs -t log_fixup/missing_map
>  #94 /1     log_fixup/bad_core_relo_trunc_none:SKIP
>  #94 /2     log_fixup/bad_core_relo_trunc_partial:SKIP
>  #94 /3     log_fixup/bad_core_relo_trunc_full:SKIP
>  #94 /4     log_fixup/bad_core_relo_subprog:SKIP
>  #94 /5     log_fixup/missing_map:OK
>  #94        log_fixup:OK
> Summary: 1/1 PASSED, 0 SKIPPED, 0 FAILED
> 
> [...]

Here is the summary with links:
  - [bpf-next] selftests/bpf: remove filtered subtests from output
    https://git.kernel.org/bpf/bpf-next/c/2dc323b1c4cb

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-20 23:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20  6:13 [PATCH bpf-next] selftests/bpf: remove filtered subtests from output Mykola Lysenko
2022-05-20 17:47 ` Yonghong Song
2022-05-20 23:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).