]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/testimage: if start fails, don't try to stop
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Wed, 30 Apr 2014 12:32:01 +0000 (13:32 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 30 Apr 2014 20:52:12 +0000 (21:52 +0100)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/testimage.bbclass
meta/lib/oeqa/targetcontrol.py

index 691c7f6785bffb9a1cf68cf54f6b0c1af4f3bf03..285c6a9d428054c72552789e16a3cefcf9ea6207 100644 (file)
@@ -209,8 +209,8 @@ def testimage_main(d):
 
     target.deploy()
 
+    target.start()
     try:
-        target.start()
         if export:
             exportTests(d,tc)
         else:
index 02cb370f2e94d09262486718d2683d6c29f15671..ff1bb89176f26f59ee50911a69815e57d3926dc1 100644 (file)
@@ -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):