Skip to content

Commit

Permalink
ktest: Add NO_INSTALL option to not install for a test
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Oct 17, 2011
1 parent eaa1fe2 commit e0a8742
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tools/testing/ktest/ktest.pl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
$default{"BISECT_SKIP"} = 1;
$default{"SUCCESS_LINE"} = "login:";
$default{"DETECT_TRIPLE_FAULT"} = 1;
$default{"NO_INSTALL"} = 0;
$default{"BOOTED_TIMEOUT"} = 1;
$default{"DIE_ON_FAILURE"} = 1;
$default{"SSH_EXEC"} = "ssh \$SSH_USER\@\$MACHINE \$SSH_COMMAND";
Expand Down Expand Up @@ -84,6 +85,7 @@
my $target;
my $make;
my $post_install;
my $no_install;
my $noclean;
my $minconfig;
my $start_minconfig;
Expand Down Expand Up @@ -1094,6 +1096,8 @@ sub do_post_install {

sub install {

return if ($no_install);

run_scp "$outputdir/$build_target", "$target_image" or
dodie "failed to copy image";

Expand Down Expand Up @@ -2810,6 +2814,7 @@ sub set_test_option {
$reboot_type = set_test_option("REBOOT_TYPE", $i);
$grub_menu = set_test_option("GRUB_MENU", $i);
$post_install = set_test_option("POST_INSTALL", $i);
$no_install = set_test_option("NO_INSTALL", $i);
$reboot_script = set_test_option("REBOOT_SCRIPT", $i);
$reboot_on_error = set_test_option("REBOOT_ON_ERROR", $i);
$poweroff_on_error = set_test_option("POWEROFF_ON_ERROR", $i);
Expand Down Expand Up @@ -2890,8 +2895,11 @@ sub set_test_option {
$run_type = "ERROR";
}

my $installme = "";
$installme = " no_install" if ($no_install);

doprint "\n\n";
doprint "RUNNING TEST $i of $opt{NUM_TESTS} with option $test_type $run_type\n\n";
doprint "RUNNING TEST $i of $opt{NUM_TESTS} with option $test_type $run_type$installme\n\n";

unlink $dmesg;
unlink $buildlog;
Expand Down
7 changes: 7 additions & 0 deletions tools/testing/ktest/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,13 @@
# or on some systems:
#POST_INSTALL = ssh user@target /sbin/dracut -f /boot/initramfs-test.img $KERNEL_VERSION

# If for some reason you just want to boot the kernel and you do not
# want the test to install anything new. For example, you may just want
# to boot test the same kernel over and over and do not want to go through
# the hassle of installing anything, you can set this option to 1
# (default 0)
#NO_INSTALL = 1

# If there is a script that you require to run before the build is done
# you can specify it with PRE_BUILD.
#
Expand Down

0 comments on commit e0a8742

Please sign in to comment.