Skip to content

Commit 1ebf1c6

Browse files
rbmarlieregregkh
authored andcommitted
ktest: Avoid undef warning when WARNINGS_FILE is unset
[ Upstream commit 057854f ] check_buildlog() probes $warnings_file with -f even when WARNINGS_FILE is not configured. Perl warns about the uninitialized value and adds noise to the test log, which can hide the output we actually care about. Check that WARNINGS_FILE is defined before testing whether the file exists. Cc: John Hawley <warthog9@eaglescrag.net> Cc: Andrea Righi <arighi@nvidia.com> Cc: Marcos Paulo de Souza <mpdesouza@suse.com> Cc: Matthieu Baerts <matttbe@kernel.org> Cc: Fernando Fernandez Mancera <fmancera@suse.de> Cc: Pedro Falcato <pfalcato@suse.de> Link: https://patch.msgid.link/20260307-ktest-fixes-v1-1-565d412f4925@suse.com Fixes: 4283b16 ("ktest: Add make_warnings_file and process full warnings") Signed-off-by: Ricardo B. Marlière <rbm@suse.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 83a8914 commit 1ebf1c6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/testing/ktest/ktest.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2483,7 +2483,7 @@ sub check_buildlog {
24832483
my $save_no_reboot = $no_reboot;
24842484
$no_reboot = 1;
24852485

2486-
if (-f $warnings_file) {
2486+
if (defined($warnings_file) && -f $warnings_file) {
24872487
open(IN, $warnings_file) or
24882488
dodie "Error opening $warnings_file";
24892489

0 commit comments

Comments
 (0)