]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/utils/qemurunner: Avoid tracebacks on closed files
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 2 Dec 2018 11:23:17 +0000 (11:23 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 6 Dec 2018 10:29:39 +0000 (10:29 +0000)
Reorder the shutdown/teardown to avoid:

  File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/utils/qemurunner.py", line 224, in launch
    op = self.getOutput(output)
  File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/utils/qemurunner.py", line 90, in getOutput
    fl = fcntl.fcntl(o, fcntl.F_GETFL)
ValueError: I/O operation on closed file

(From OE-Core rev: 8e7d756862d2a8d62f3c87497d6d65ddb3c1b962)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/qemurunner.py

index 0f1c5a5cc138d3214908eed2e8df1f0c8d1ebcdb..4f6f1d0b1abf8f9682a8a4e61a5f6494bf513e3d 100644 (file)
@@ -203,8 +203,8 @@ class QemuRunner:
                     # No point waiting any longer
                     self.logger.debug('runqemu exited with code %d' % self.runqemu.returncode)
                     self._dump_host()
-                    self.stop()
                     self.logger.debug("Output from runqemu:\n%s" % self.getOutput(output))
+                    self.stop()
                     return False
             time.sleep(0.5)
 
@@ -216,8 +216,8 @@ class QemuRunner:
             processes = ps.decode("utf-8")
             self.logger.debug("Running processes:\n%s" % processes)
             self._dump_host()
-            self.stop()
             op = self.getOutput(output)
+            self.stop()
             if op:
                 self.logger.error("Output from runqemu:\n%s" % op)
             else: