* [PATCH] selftests: runner: Avoid spurious warning about missing failures file
@ 2026-01-28 9:05 Thomas Weißschuh
2026-01-28 11:18 ` Brendan Jackman
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Weißschuh @ 2026-01-28 9:05 UTC (permalink / raw)
To: Shuah Khan, Brendan Jackman
Cc: Shuah Khan, linux-kselftest, linux-kernel, Thomas Weißschuh
When runner.sh is *not* executed via run_kselftest.sh, the variable
$kselftest_failures_file does not exist. This triggers a harmless but
annyoing warning from runner.sh if a test fails:
tools/testing/selftests/kselftest/runner.sh: line 50: : No such file or directory
Silence the spurious warning.
Fixes: d9e6269e3303 ("selftests/run_kselftest.sh: exit with error if tests fail")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
tools/testing/selftests/kselftest/runner.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh
index 3a62039fa621..1eb935b6f790 100644
--- a/tools/testing/selftests/kselftest/runner.sh
+++ b/tools/testing/selftests/kselftest/runner.sh
@@ -47,7 +47,7 @@ tap_timeout()
report_failure()
{
echo "not ok $*"
- echo "$*" >> "$kselftest_failures_file"
+ echo "$*" >> "${kselftest_failures_file:-/dev/null}"
}
run_one()
---
base-commit: 6e39903c73df08b256322d04c4dfe4a82ec63a45
change-id: 20260128-kselftest-fix-failures-file-8b38692c2a3c
Best regards,
--
Thomas Weißschuh <thomas.weissschuh@linutronix.de>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] selftests: runner: Avoid spurious warning about missing failures file
2026-01-28 9:05 [PATCH] selftests: runner: Avoid spurious warning about missing failures file Thomas Weißschuh
@ 2026-01-28 11:18 ` Brendan Jackman
2026-01-28 11:39 ` Thomas Weißschuh
0 siblings, 1 reply; 3+ messages in thread
From: Brendan Jackman @ 2026-01-28 11:18 UTC (permalink / raw)
To: Thomas Weißschuh, Shuah Khan, Brendan Jackman
Cc: Shuah Khan, linux-kselftest, linux-kernel
On Wed Jan 28, 2026 at 9:05 AM UTC, Thomas Weißschuh wrote:
> When runner.sh is *not* executed via run_kselftest.sh,
Hm, what's the usecase for that? runner.sh is a "library", right? So in
my mind there's basically an undocumented contract that you need to set
this variable before you call the relevant functions.
The fix below opens the door to bugs where we fail to report test
failures which would be... a shame!
> the variable
> $kselftest_failures_file does not exist. This triggers a harmless but
> annyoing warning from runner.sh if a test fails:
>
> tools/testing/selftests/kselftest/runner.sh: line 50: : No such file or directory
>
> Silence the spurious warning.
>
> Fixes: d9e6269e3303 ("selftests/run_kselftest.sh: exit with error if tests fail")
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Having said that, it's not a big deal, the risk of those bugs is not
that high and we'd probably notice them before too long. Assuming you
have a usecase where just setting the variable to /dev/null yourself is
a pain, this LGTM.
Reviewed-By: Brendan Jackman <jackmanb@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] selftests: runner: Avoid spurious warning about missing failures file
2026-01-28 11:18 ` Brendan Jackman
@ 2026-01-28 11:39 ` Thomas Weißschuh
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Weißschuh @ 2026-01-28 11:39 UTC (permalink / raw)
To: Brendan Jackman; +Cc: Shuah Khan, Shuah Khan, linux-kselftest, linux-kernel
On Wed, Jan 28, 2026 at 11:18:35AM +0000, Brendan Jackman wrote:
> On Wed Jan 28, 2026 at 9:05 AM UTC, Thomas Weißschuh wrote:
> > When runner.sh is *not* executed via run_kselftest.sh,
>
> Hm, what's the usecase for that? runner.sh is a "library", right? So in
> my mind there's basically an undocumented contract that you need to set
> this variable before you call the relevant functions.
This happens when using 'make run_tests' in a selftest directory.
There the failure currently is also not reported to the caller of make.
Maybe we should make the failures file also work there.
I am not sure what the expected semantics actually are.
In any case, a larger fix should wait for the next cycle,
until then I'd like to get rid of the warning.
> The fix below opens the door to bugs where we fail to report test
> failures which would be... a shame!
>
> > the variable
> > $kselftest_failures_file does not exist. This triggers a harmless but
> > annyoing warning from runner.sh if a test fails:
> >
> > tools/testing/selftests/kselftest/runner.sh: line 50: : No such file or directory
> >
> > Silence the spurious warning.
> >
> > Fixes: d9e6269e3303 ("selftests/run_kselftest.sh: exit with error if tests fail")
> > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
>
> Having said that, it's not a big deal, the risk of those bugs is not
> that high and we'd probably notice them before too long. Assuming you
> have a usecase where just setting the variable to /dev/null yourself is
> a pain, this LGTM.
Passing /dev/null explicitly would also work.
I don't have a strong preference.
> Reviewed-By: Brendan Jackman <jackmanb@google.com>
Thanks
Thomas
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-28 11:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-28 9:05 [PATCH] selftests: runner: Avoid spurious warning about missing failures file Thomas Weißschuh
2026-01-28 11:18 ` Brendan Jackman
2026-01-28 11:39 ` Thomas Weißschuh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®