aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-07-19 15:22:05 -0400
committerSteven Rostedt <rostedt@goodmis.org>2012-07-19 15:22:05 -0400
commite5c2ec11a07b9e1e7eb714aad13583e2bbae49bd (patch)
treefd95397b6cc081de8f6114a1042c710b2a289a44 /tools
parent921ed4c7208e5c466a87db0a11c6fdd26bcc2fe7 (diff)
ktest: Add PRE_INSTALL option
Add the PRE_INSTALL option that will allow a user to specify a shell command to be executed before the install operation executes. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/ktest/ktest.pl8
-rw-r--r--tools/testing/ktest/sample.conf8
2 files changed, 16 insertions, 0 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 31b941613f98..e91702eee580 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -106,6 +106,7 @@ my $grub_menu;
106my $grub_number; 106my $grub_number;
107my $target; 107my $target;
108my $make; 108my $make;
109my $pre_install;
109my $post_install; 110my $post_install;
110my $no_install; 111my $no_install;
111my $noclean; 112my $noclean;
@@ -225,6 +226,7 @@ my %option_map = (
225 "ADD_CONFIG" => \$addconfig, 226 "ADD_CONFIG" => \$addconfig,
226 "REBOOT_TYPE" => \$reboot_type, 227 "REBOOT_TYPE" => \$reboot_type,
227 "GRUB_MENU" => \$grub_menu, 228 "GRUB_MENU" => \$grub_menu,
229 "PRE_INSTALL" => \$pre_install,
228 "POST_INSTALL" => \$post_install, 230 "POST_INSTALL" => \$post_install,
229 "NO_INSTALL" => \$no_install, 231 "NO_INSTALL" => \$no_install,
230 "REBOOT_SCRIPT" => \$reboot_script, 232 "REBOOT_SCRIPT" => \$reboot_script,
@@ -1669,6 +1671,12 @@ sub install {
1669 1671
1670 return if ($no_install); 1672 return if ($no_install);
1671 1673
1674 if (defined($pre_install)) {
1675 my $cp_pre_install = eval_kernel_version $pre_install;
1676 run_command "$cp_pre_install" or
1677 dodie "Failed to run pre install";
1678 }
1679
1672 my $cp_target = eval_kernel_version $target_image; 1680 my $cp_target = eval_kernel_version $target_image;
1673 1681
1674 run_scp_install "$outputdir/$build_target", "$cp_target" or 1682 run_scp_install "$outputdir/$build_target", "$cp_target" or
diff --git a/tools/testing/ktest/sample.conf b/tools/testing/ktest/sample.conf
index 4472452f5be1..19754e0c8c64 100644
--- a/tools/testing/ktest/sample.conf
+++ b/tools/testing/ktest/sample.conf
@@ -426,6 +426,14 @@
426# (default "") 426# (default "")
427#BUILD_OPTIONS = -j20 427#BUILD_OPTIONS = -j20
428 428
429# If you need to do some special handling before installing
430# you can add a script with this option.
431# The environment variable KERNEL_VERSION will be set to the
432# kernel version that is used.
433#
434# default (undefined)
435#PRE_INSTALL = ssh user@target rm -rf '/lib/modules/*-test*'
436
429# If you need an initrd, you can add a script or code here to install 437# If you need an initrd, you can add a script or code here to install
430# it. The environment variable KERNEL_VERSION will be set to the 438# it. The environment variable KERNEL_VERSION will be set to the
431# kernel version that is used. Remember to add the initrd line 439# kernel version that is used. Remember to add the initrd line