提交 d0a0e495 编写于 作者: J Joe Stringer 提交者: Daniel Borkmann

selftests/bpf: Count tests skipped by unpriv

When priviliged tests are skipped due to user rights, count the number of
skipped tests so it's more obvious that the test did not check everything.
Signed-off-by: NJoe Stringer <joe@wand.net.nz>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
上级 95f87a97
...@@ -11378,7 +11378,7 @@ static int set_admin(bool admin) ...@@ -11378,7 +11378,7 @@ static int set_admin(bool admin)
static int do_test(bool unpriv, unsigned int from, unsigned int to) static int do_test(bool unpriv, unsigned int from, unsigned int to)
{ {
int i, passes = 0, errors = 0; int i, passes = 0, errors = 0, skips = 0;
for (i = from; i < to; i++) { for (i = from; i < to; i++) {
struct bpf_test *test = &tests[i]; struct bpf_test *test = &tests[i];
...@@ -11395,13 +11395,17 @@ static int do_test(bool unpriv, unsigned int from, unsigned int to) ...@@ -11395,13 +11395,17 @@ static int do_test(bool unpriv, unsigned int from, unsigned int to)
set_admin(true); set_admin(true);
} }
if (!unpriv) { if (unpriv) {
printf("#%d/p %s SKIP\n", i, test->descr);
skips++;
} else {
printf("#%d/p %s ", i, test->descr); printf("#%d/p %s ", i, test->descr);
do_test_single(test, false, &passes, &errors); do_test_single(test, false, &passes, &errors);
} }
} }
printf("Summary: %d PASSED, %d FAILED\n", passes, errors); printf("Summary: %d PASSED, %d SKIPPED, %d FAILED\n", passes,
skips, errors);
return errors ? EXIT_FAILURE : EXIT_SUCCESS; return errors ? EXIT_FAILURE : EXIT_SUCCESS;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册