Skip to content

Commit e0a8742

Browse files
Steven Rostedtrostedt
authored andcommitted
ktest: Add NO_INSTALL option to not install for a test
There's cases where running the same kernel over and over again is useful, and being able to not install the same kernel can save time between tests. Add a NO_INSTALL option that tells ktest.pl to not install the new kernel. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent eaa1fe2 commit e0a8742

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎tools/testing/ktest/ktest.pl‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
$default{"BISECT_SKIP"} = 1;
4343
$default{"SUCCESS_LINE"} = "login:";
4444
$default{"DETECT_TRIPLE_FAULT"} = 1;
45+
$default{"NO_INSTALL"} = 0;
4546
$default{"BOOTED_TIMEOUT"} = 1;
4647
$default{"DIE_ON_FAILURE"} = 1;
4748
$default{"SSH_EXEC"} = "ssh \$SSH_USER\@\$MACHINE \$SSH_COMMAND";
@@ -84,6 +85,7 @@
8485
my $target;
8586
my $make;
8687
my $post_install;
88+
my $no_install;
8789
my $noclean;
8890
my $minconfig;
8991
my $start_minconfig;
@@ -1094,6 +1096,8 @@ sub do_post_install {
10941096

10951097
sub install {
10961098

1099+
return if ($no_install);
1100+
10971101
run_scp "$outputdir/$build_target", "$target_image" or
10981102
dodie "failed to copy image";
10991103

@@ -2810,6 +2814,7 @@ sub set_test_option {
28102814
$reboot_type = set_test_option("REBOOT_TYPE", $i);
28112815
$grub_menu = set_test_option("GRUB_MENU", $i);
28122816
$post_install = set_test_option("POST_INSTALL", $i);
2817+
$no_install = set_test_option("NO_INSTALL", $i);
28132818
$reboot_script = set_test_option("REBOOT_SCRIPT", $i);
28142819
$reboot_on_error = set_test_option("REBOOT_ON_ERROR", $i);
28152820
$poweroff_on_error = set_test_option("POWEROFF_ON_ERROR", $i);
@@ -2890,8 +2895,11 @@ sub set_test_option {
28902895
$run_type = "ERROR";
28912896
}
28922897

2898+
my $installme = "";
2899+
$installme = " no_install" if ($no_install);
2900+
28932901
doprint "\n\n";
2894-
doprint "RUNNING TEST $i of $opt{NUM_TESTS} with option $test_type $run_type\n\n";
2902+
doprint "RUNNING TEST $i of $opt{NUM_TESTS} with option $test_type $run_type$installme\n\n";
28952903

28962904
unlink $dmesg;
28972905
unlink $buildlog;

‎tools/testing/ktest/sample.conf‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,13 @@
294294
# or on some systems:
295295
#POST_INSTALL = ssh user@target /sbin/dracut -f /boot/initramfs-test.img $KERNEL_VERSION
296296

297+
# If for some reason you just want to boot the kernel and you do not
298+
# want the test to install anything new. For example, you may just want
299+
# to boot test the same kernel over and over and do not want to go through
300+
# the hassle of installing anything, you can set this option to 1
301+
# (default 0)
302+
#NO_INSTALL = 1
303+
297304
# If there is a script that you require to run before the build is done
298305
# you can specify it with PRE_BUILD.
299306
#

0 commit comments

Comments
 (0)