Skip to content

Commit 96f6a0d

Browse files
Steven Rostedtrostedt
authored andcommitted
ktest: Still do reboot even for REBOOT_TYPE = script
The REBOOT_TYPE may be either grub or script, if it is script it is expected that a REBOOT_SCRIPT is defined. With the SWITCH_TO_TEST which is the complement of SWITCH_TO_GOOD, which does basically the same thing as REBOOT_SCRIPT and but for both grub and script, the REBOOT_SCRIPT does not need to be mandatory anymore. Do not require the REBOOT_SCRIPT and always run the reboot code for both grub and script. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent c2857cb commit 96f6a0d

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

‎tools/testing/ktest/ktest.pl‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,6 @@ sub get_ktest_configs {
485485

486486
if ($rtype eq "grub") {
487487
get_ktest_config("GRUB_MENU");
488-
} else {
489-
get_ktest_config("REBOOT_SCRIPT");
490488
}
491489
}
492490

@@ -1430,11 +1428,10 @@ sub reboot_to {
14301428

14311429
if ($reboot_type eq "grub") {
14321430
run_ssh "'(echo \"savedefault --default=$grub_number --once\" | grub --batch)'";
1433-
reboot;
1434-
return;
1431+
} elsif (defined $reboot_script) {
1432+
run_command "$reboot_script";
14351433
}
1436-
1437-
run_command "$reboot_script";
1434+
reboot;
14381435
}
14391436

14401437
sub get_sha1 {
@@ -3479,8 +3476,6 @@ sub set_test_option {
34793476
$target = "$ssh_user\@$machine";
34803477
if ($reboot_type eq "grub") {
34813478
dodie "GRUB_MENU not defined" if (!defined($grub_menu));
3482-
} elsif (!defined($reboot_script)) {
3483-
dodie "REBOOT_SCRIPT not defined"
34843479
}
34853480
}
34863481

‎tools/testing/ktest/sample.conf‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,10 @@
346346
#GRUB_MENU = Test Kernel
347347

348348
# A script to reboot the target into the test kernel
349-
# (Only mandatory if REBOOT_TYPE = script)
349+
# This and SWITCH_TO_TEST are about the same, except
350+
# SWITCH_TO_TEST is run even for REBOOT_TYPE = grub.
351+
# This may be left undefined.
352+
# (default undefined)
350353
#REBOOT_SCRIPT =
351354

352355
#### Optional Config Options (all have defaults) ####

0 commit comments

Comments
 (0)