public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 5/8] classes/testimage: if start fails, don't try to stop
Date: Wed, 30 Apr 2014 13:32:01 +0100	[thread overview]
Message-ID: <ffac00dc794434d8e00c74ebf90b0946cec1a248.1398861075.git.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <cover.1398861075.git.paul.eggleton@linux.intel.com>
In-Reply-To: <cover.1398861075.git.paul.eggleton@linux.intel.com>

If we couldn't start the target, it doesn't make sense to try and stop
it here since logically it shouldn't now be in any kind of "started"
state. (It's the start function's job to clean up after itself if it
fails - to that end, fix up the QemuTarget class so that it does.)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/testimage.bbclass | 2 +-
 meta/lib/oeqa/targetcontrol.py | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 691c7f6..285c6a9 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -209,8 +209,8 @@ def testimage_main(d):
 
     target.deploy()
 
+    target.start()
     try:
-        target.start()
         if export:
             exportTests(d,tc)
         else:
diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py
index 02cb370..ff1bb89 100644
--- a/meta/lib/oeqa/targetcontrol.py
+++ b/meta/lib/oeqa/targetcontrol.py
@@ -124,6 +124,7 @@ class QemuTarget(BaseTarget):
             self.server_ip = self.runner.server_ip
             self.connection = SSHControl(ip=self.ip, logfile=self.sshlog)
         else:
+            self.stop()
             raise bb.build.FuncFailed("%s - FAILED to start qemu - check the task log and the boot log" % self.pn)
 
     def stop(self):
-- 
1.9.0



  parent reply	other threads:[~2014-04-30 12:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 12:31 [PATCH 0/8] Automated hardware testing improvements Paul Eggleton
2014-04-30 12:31 ` [PATCH 1/8] oeqa/controllers/masterimage: add a base class for hw targets Paul Eggleton
2014-04-30 12:31 ` [PATCH 2/8] oeqa/targetcontrol: restart method shouldn't be abstract Paul Eggleton
2014-04-30 12:31 ` [PATCH 3/8] oeqa/controllers/masterimage: add a serial control command Paul Eggleton
2014-04-30 12:32 ` [PATCH 4/8] oeqa/controllers/masterimage: more robust master image startup Paul Eggleton
2014-04-30 12:32 ` Paul Eggleton [this message]
2014-04-30 12:32 ` [PATCH 6/8] scripts/contrib/serdevtry: add script to handle transient serial terminals Paul Eggleton
2014-04-30 12:32 ` [PATCH 7/8] scripts/contrib/dialog-power-control: add a trivial power prompt script Paul Eggleton
2014-04-30 12:32 ` [PATCH 8/8] oeqa: add proper handling for command errors where needed Paul Eggleton

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=ffac00dc794434d8e00c74ebf90b0946cec1a248.1398861075.git.paul.eggleton@linux.intel.com \
    --to=paul.eggleton@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.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