aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSteven Rostedt2012-12-11 20:19:41 -0600
committerSteven Rostedt2012-12-11 20:19:41 -0600
commite1a6c3d748ef0ee093e764af3fdd0c1a5cd2b664 (patch)
tree256c3d582473b5448858b758a78044beb59dd487 /tools
parent189251705649bdfdf5e5850eb178f8cbfdac5480 (diff)
downloadkernel-video-e1a6c3d748ef0ee093e764af3fdd0c1a5cd2b664.tar.gz
kernel-video-e1a6c3d748ef0ee093e764af3fdd0c1a5cd2b664.tar.xz
kernel-video-e1a6c3d748ef0ee093e764af3fdd0c1a5cd2b664.zip
ktest: Test if target machine is up before install
Sometimes a test kernel will crash or hang on reboot (this is even more apparent when testing a config without CGROUPS on a box running systemd). When this happens, on the next iteration of installing a kernel, ktest will fail when it tries to install. Have ktest do a check to see if the target can be connected to via ssh before it tries to install. If it can't connect, then reboot again. This time the reboot will fail because it can't connect and will force a power cycle. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/ktest/ktest.pl10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 6b1e0c5edc5..35fc584a4ff 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1807,6 +1807,14 @@ sub do_post_install {
1807 dodie "Failed to run post install"; 1807 dodie "Failed to run post install";
1808} 1808}
1809 1809
1810# Sometimes the reboot fails, and will hang. We try to ssh to the box
1811# and if we fail, we force another reboot, that should powercycle it.
1812sub test_booted {
1813 if (!run_ssh "echo testing connection") {
1814 reboot $sleep_time;
1815 }
1816}
1817
1810sub install { 1818sub install {
1811 1819
1812 return if ($no_install); 1820 return if ($no_install);
@@ -1819,6 +1827,8 @@ sub install {
1819 1827
1820 my $cp_target = eval_kernel_version $target_image; 1828 my $cp_target = eval_kernel_version $target_image;
1821 1829
1830 test_booted;
1831
1822 run_scp_install "$outputdir/$build_target", "$cp_target" or 1832 run_scp_install "$outputdir/$build_target", "$cp_target" or
1823 dodie "failed to copy image"; 1833 dodie "failed to copy image";
1824 1834