public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH 5/5] ktest: Test if target machine is up before install
Date: Wed, 12 Dec 2012 17:14:42 -0500	[thread overview]
Message-ID: <20121212221544.525456597@goodmis.org> (raw)
In-Reply-To: 20121212221437.245229327@goodmis.org

[-- Attachment #1: Type: text/plain, Size: 1492 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

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>
---
 tools/testing/ktest/ktest.pl |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 6b1e0c5..35fc584 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1807,6 +1807,14 @@ sub do_post_install {
 	dodie "Failed to run post install";
 }
 
+# Sometimes the reboot fails, and will hang. We try to ssh to the box
+# and if we fail, we force another reboot, that should powercycle it.
+sub test_booted {
+    if (!run_ssh "echo testing connection") {
+	reboot $sleep_time;
+    }
+}
+
 sub install {
 
     return if ($no_install);
@@ -1819,6 +1827,8 @@ sub install {
 
     my $cp_target = eval_kernel_version $target_image;
 
+    test_booted;
+
     run_scp_install "$outputdir/$build_target", "$cp_target" or
 	dodie "failed to copy image";
 
-- 
1.7.10.4



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  parent reply	other threads:[~2012-12-12 22:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-12 22:14 [PATCH 0/5] [GIT PULL] ktest: fixes and updated for new boot loaders Steven Rostedt
2012-12-12 22:14 ` [PATCH 1/5] ktest: Add support for grub2 Steven Rostedt
2012-12-12 22:14 ` [PATCH 2/5] ktest: Sync before reboot Steven Rostedt
2012-12-12 22:14 ` [PATCH 3/5] ktest: Add native support for syslinux boot loader Steven Rostedt
2012-12-12 22:14 ` [PATCH 4/5] ktest: Fix breakage from change of oldnoconfig to olddefconfig Steven Rostedt
2012-12-13  3:06   ` Adam Lee
2012-12-13  8:51     ` Michal Marek
2012-12-12 22:14 ` Steven Rostedt [this message]
2012-12-12 23:47 ` [PATCH 0/5] [GIT PULL] ktest: fixes and updated for new boot loaders Stephen Rothwell
2012-12-13  0:29   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121212221544.525456597@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox