Skip to content

Commit dd609b8

Browse files
committed
Merge tag 'ktest-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest
Pull ktest updates from Steven Rostedt: - Add notification of build warnings for all tests Currently, the build will only fail on warnings if the ktest config file states that it should fail or if the compile is done with '-Werror'. This has allowed warnings to sneak in if it doesn't fail. Add a notification at the end of the test that will state that warnings were found in the build so that the developer will be aware of it. - Fix the grub2 parser to not return the wrong kernel index ktest.pl can read the grub.cfg file to know what kernel to boot to via grub-reboot. This requires knowing the index that the kernel is referenced by in the grub.cfg file. Some distros have logic to determine the menuentry that can cause the ktest.pl to come up with the wrong index and boot the wrong kernel. * tag 'ktest-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest: ktest.pl: Avoid false positives with grub2 skip regex ktest.pl: Always warn on build warnings
2 parents 891e8ab + 2351e8c commit dd609b8

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

tools/testing/ktest/ktest.pl

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@
222222
my $reboot_time;
223223
my $test_time;
224224

225+
my $warning_found = 0;
226+
225227
my $pwd;
226228
my $dirname = $FindBin::Bin;
227229

@@ -729,11 +731,18 @@ sub print_times {
729731
show_time($test_time);
730732
doprint "\n";
731733
}
734+
if ($warning_found) {
735+
doprint "\n*** WARNING";
736+
doprint "S" if ($warning_found > 1);
737+
doprint " found in build: $warning_found ***\n\n";
738+
}
739+
732740
# reset for iterations like bisect
733741
$build_time = 0;
734742
$install_time = 0;
735743
$reboot_time = 0;
736744
$test_time = 0;
745+
$warning_found = 0;
737746
}
738747

739748
sub get_mandatory_configs {
@@ -2047,7 +2056,7 @@ sub get_grub_index {
20472056
} elsif ($reboot_type eq "grub2") {
20482057
$command = "cat $grub_file";
20492058
$target = '^\s*menuentry.*' . $grub_menu_qt;
2050-
$skip = '^\s*menuentry';
2059+
$skip = '^\s*menuentry\s';
20512060
$submenu = '^\s*submenu\s';
20522061
} elsif ($reboot_type eq "grub2bls") {
20532062
$command = $grub_bls_get;
@@ -2460,8 +2469,6 @@ sub process_warning_line {
24602469
# Returns 1 if OK
24612470
# 0 otherwise
24622471
sub check_buildlog {
2463-
return 1 if (!defined $warnings_file);
2464-
24652472
my %warnings_list;
24662473

24672474
# Failed builds should not reboot the target
@@ -2482,18 +2489,21 @@ sub check_buildlog {
24822489
close(IN);
24832490
}
24842491

2485-
# If warnings file didn't exist, and WARNINGS_FILE exist,
2486-
# then we fail on any warning!
2487-
24882492
open(IN, $buildlog) or dodie "Can't open $buildlog";
24892493
while (<IN>) {
24902494
if (/$check_build_re/) {
24912495
my $warning = process_warning_line $_;
24922496

24932497
if (!defined $warnings_list{$warning}) {
2494-
fail "New warning found (not in $warnings_file)\n$_\n";
2495-
$no_reboot = $save_no_reboot;
2496-
return 0;
2498+
$warning_found++;
2499+
2500+
# If warnings file didn't exist, and WARNINGS_FILE exist,
2501+
# then we fail on any warning!
2502+
if (defined $warnings_file) {
2503+
fail "New warning found (not in $warnings_file)\n$_\n";
2504+
$no_reboot = $save_no_reboot;
2505+
return 0;
2506+
}
24972507
}
24982508
}
24992509
}

0 commit comments

Comments
 (0)