* [for-next][PATCH 0/2] ktest.pl: Updates for 6.12
@ 2024-09-04 19:15 Steven Rostedt
2024-09-04 19:15 ` [for-next][PATCH 1/2] ktest.pl: Always warn on build warnings Steven Rostedt
2024-09-04 19:15 ` [for-next][PATCH 2/2] ktest.pl: Avoid false positives with grub2 skip regex Steven Rostedt
0 siblings, 2 replies; 3+ messages in thread
From: Steven Rostedt @ 2024-09-04 19:15 UTC (permalink / raw)
To: linux-kernel; +Cc: John Warthog9 Hawley
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git
for-next
Head SHA1: 2351e8c65404aabc433300b6bf90c7a37e8bbc4d
Daniel Jordan (1):
ktest.pl: Avoid false positives with grub2 skip regex
Steven Rostedt (1):
ktest.pl: Always warn on build warnings
----
tools/testing/ktest/ktest.pl | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread* [for-next][PATCH 1/2] ktest.pl: Always warn on build warnings 2024-09-04 19:15 [for-next][PATCH 0/2] ktest.pl: Updates for 6.12 Steven Rostedt @ 2024-09-04 19:15 ` Steven Rostedt 2024-09-04 19:15 ` [for-next][PATCH 2/2] ktest.pl: Avoid false positives with grub2 skip regex Steven Rostedt 1 sibling, 0 replies; 3+ messages in thread From: Steven Rostedt @ 2024-09-04 19:15 UTC (permalink / raw) To: linux-kernel; +Cc: John Warthog9 Hawley, John Warthog9 Hawley (Tenstorrent) From: Steven Rostedt <rostedt@goodmis.org> If a warning happens at build, give a warning at the end: Build time: 1 minute 40 seconds Install time: 17 seconds Reboot time: 25 seconds *** WARNING found in build: 1 *** ******************************************* ******************************************* KTEST RESULT: TEST 1 SUCCESS!!!! ** ******************************************* ******************************************* This way, even if the test isn't made to fail on warnings during the build, a message is still displayed that warnings were found. Link: https://lore.kernel.org/<20240819172028.3a7fae09@gandalf.local.home> Acked-by: John 'Warthog9' Hawley (Tenstorrent) <warthog9@eaglescrag.net> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> --- tools/testing/ktest/ktest.pl | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index eb31cd9c977b..c82b8d55dddb 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -222,6 +222,8 @@ my $install_time; my $reboot_time; my $test_time; +my $warning_found = 0; + my $pwd; my $dirname = $FindBin::Bin; @@ -729,11 +731,18 @@ sub print_times { show_time($test_time); doprint "\n"; } + if ($warning_found) { + doprint "\n*** WARNING"; + doprint "S" if ($warning_found > 1); + doprint " found in build: $warning_found ***\n\n"; + } + # reset for iterations like bisect $build_time = 0; $install_time = 0; $reboot_time = 0; $test_time = 0; + $warning_found = 0; } sub get_mandatory_configs { @@ -2460,8 +2469,6 @@ sub process_warning_line { # Returns 1 if OK # 0 otherwise sub check_buildlog { - return 1 if (!defined $warnings_file); - my %warnings_list; # Failed builds should not reboot the target @@ -2482,18 +2489,21 @@ sub check_buildlog { close(IN); } - # If warnings file didn't exist, and WARNINGS_FILE exist, - # then we fail on any warning! - open(IN, $buildlog) or dodie "Can't open $buildlog"; while (<IN>) { if (/$check_build_re/) { my $warning = process_warning_line $_; if (!defined $warnings_list{$warning}) { - fail "New warning found (not in $warnings_file)\n$_\n"; - $no_reboot = $save_no_reboot; - return 0; + $warning_found++; + + # If warnings file didn't exist, and WARNINGS_FILE exist, + # then we fail on any warning! + if (defined $warnings_file) { + fail "New warning found (not in $warnings_file)\n$_\n"; + $no_reboot = $save_no_reboot; + return 0; + } } } } -- 2.43.0 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [for-next][PATCH 2/2] ktest.pl: Avoid false positives with grub2 skip regex 2024-09-04 19:15 [for-next][PATCH 0/2] ktest.pl: Updates for 6.12 Steven Rostedt 2024-09-04 19:15 ` [for-next][PATCH 1/2] ktest.pl: Always warn on build warnings Steven Rostedt @ 2024-09-04 19:15 ` Steven Rostedt 1 sibling, 0 replies; 3+ messages in thread From: Steven Rostedt @ 2024-09-04 19:15 UTC (permalink / raw) To: linux-kernel Cc: John Warthog9 Hawley, Daniel Jordan, John Warthog9 Hawley (Tenstorrent) From: Daniel Jordan <daniel.m.jordan@oracle.com> Some distros have grub2 config files with the lines if [ x"${feature_menuentry_id}" = xy ]; then menuentry_id_option="--id" else menuentry_id_option="" fi which match the skip regex defined for grub2 in get_grub_index(): $skip = '^\s*menuentry'; These false positives cause the grub number to be higher than it should be, and the wrong kernel can end up booting. Grub documents the menuentry command with whitespace between it and the title, so make the skip regex reflect this. Link: https://lore.kernel.org/20240904175530.84175-1-daniel.m.jordan@oracle.com Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com> Acked-by: John 'Warthog9' Hawley (Tenstorrent) <warthog9@eaglescrag.net> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> --- tools/testing/ktest/ktest.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index c82b8d55dddb..dacad94e2be4 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -2056,7 +2056,7 @@ sub get_grub_index { } elsif ($reboot_type eq "grub2") { $command = "cat $grub_file"; $target = '^\s*menuentry.*' . $grub_menu_qt; - $skip = '^\s*menuentry'; + $skip = '^\s*menuentry\s'; $submenu = '^\s*submenu\s'; } elsif ($reboot_type eq "grub2bls") { $command = $grub_bls_get; -- 2.43.0 ^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-04 19:14 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-09-04 19:15 [for-next][PATCH 0/2] ktest.pl: Updates for 6.12 Steven Rostedt 2024-09-04 19:15 ` [for-next][PATCH 1/2] ktest.pl: Always warn on build warnings Steven Rostedt 2024-09-04 19:15 ` [for-next][PATCH 2/2] ktest.pl: Avoid false positives with grub2 skip regex Steven Rostedt
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox