aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-11-02 14:58:33 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-11-18 11:23:08 -0500
commit8b37ca8cac46b2c108386e3901cc8611dc81c7aa (patch)
treedb2afe35d5579f8ec7631dac6eaef0ecccafbe00 /tools
parenta75fececff3cc1e86d74e98de634ea2ed1b47697 (diff)
ktest: Add POST_INSTALL to allow initrds to be created
Add a POST_INSTALL option that runs after the build and install but before rebooting to the test kernel. This alls the user to run a script that will install an initrd (or anything else that may be special) before booting. An environment variable KERNEL_VERSION is set. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/ktest/ktest.pl11
-rw-r--r--tools/testing/ktest/sample.conf5
2 files changed, 16 insertions, 0 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 1f28c45f15b8..687a85475af5 100644
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -58,6 +58,7 @@ my $grub_menu;
58my $grub_number; 58my $grub_number;
59my $target; 59my $target;
60my $make; 60my $make;
61my $post_install;
61my $noclean; 62my $noclean;
62my $minconfig; 63my $minconfig;
63my $addconfig; 64my $addconfig;
@@ -489,6 +490,15 @@ sub install {
489 dodie "failed to tar modules"; 490 dodie "failed to tar modules";
490 491
491 run_command "ssh $target rm -f /tmp/$modtar"; 492 run_command "ssh $target rm -f /tmp/$modtar";
493
494 return if (!defined($post_install));
495
496 my $save_env = $ENV{KERNEL_VERSION};
497
498 $ENV{KERNEL_VERSION} = $version;
499 run_command "$post_install";
500
501 $ENV{KERNEL_VERSION} = $save_env;
492} 502}
493 503
494sub check_buildlog { 504sub check_buildlog {
@@ -1055,6 +1065,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
1055 $addconfig = set_test_option("ADD_CONFIG", $i); 1065 $addconfig = set_test_option("ADD_CONFIG", $i);
1056 $reboot_type = set_test_option("REBOOT_TYPE", $i); 1066 $reboot_type = set_test_option("REBOOT_TYPE", $i);
1057 $grub_menu = set_test_option("GRUB_MENU", $i); 1067 $grub_menu = set_test_option("GRUB_MENU", $i);
1068 $post_install = set_test_option("POST_INSTALL", $i);
1058 $reboot_script = set_test_option("REBOOT_SCRIPT", $i); 1069 $reboot_script = set_test_option("REBOOT_SCRIPT", $i);
1059 $reboot_on_error = set_test_option("REBOOT_ON_ERROR", $i); 1070 $reboot_on_error = set_test_option("REBOOT_ON_ERROR", $i);
1060 $poweroff_on_error = set_test_option("POWEROFF_ON_ERROR", $i); 1071 $poweroff_on_error = set_test_option("POWEROFF_ON_ERROR", $i);
diff --git a/tools/testing/ktest/sample.conf b/tools/testing/ktest/sample.conf
index 42f803fe4a8d..0115a6762a6d 100644
--- a/tools/testing/ktest/sample.conf
+++ b/tools/testing/ktest/sample.conf
@@ -93,6 +93,11 @@
93# If you are building a 32bit x86 on a 64 bit host 93# If you are building a 32bit x86 on a 64 bit host
94#MAKE_CMD = CC=i386-gcc AS=i386-as make ARCH=i386 94#MAKE_CMD = CC=i386-gcc AS=i386-as make ARCH=i386
95 95
96# If you need an initrd, you can add a script or code here to install
97# it. The environment variable KERNEL_VERSION will be set to the
98# kernel version that is used.
99#POST_INSTALL = ssh user@target /sbin/mkinitrd --allow-missing -f /boot/initramfs-test.img $KERNEL_VERSION
100
96# Way to reboot the box to the test kernel. 101# Way to reboot the box to the test kernel.
97# Only valid options so far are "grub" and "script" 102# Only valid options so far are "grub" and "script"
98# (default grub) 103# (default grub)