mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
oeqa: Test failure/cleanup improvements
Currently, if qemu segfaults, the tests merrily continue trying to execute which takes time for them to timeout and is a bit silly. Worse, no logs about the segfault are shown to the user, its silent! This patch tries to unravel the tangled web of issues and ensures that we: * install a SIGCHLD handler which tells the user qemu exited * check if qemu is running, if it isn't fail the test outright * don't leave processes behind in sshcontrol which would hold bitbake.lock and block shutdown (From OE-Core rev: 5c04b1ca1e989f569d5755a646734d01a0c56cae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -42,7 +42,7 @@ class SSHProcess(object):
|
||||
with open(self.logfile, "a") as f:
|
||||
f.write("%s" % msg)
|
||||
|
||||
def run(self, command, timeout=None, logfile=None):
|
||||
def _run(self, command, timeout=None, logfile=None):
|
||||
self.logfile = logfile
|
||||
self.starttime = time.time()
|
||||
output = ''
|
||||
@@ -79,8 +79,18 @@ class SSHProcess(object):
|
||||
|
||||
self.status = self.process.wait()
|
||||
self.output = output.rstrip()
|
||||
return (self.status, self.output)
|
||||
|
||||
def run(self, command, timeout=None, logfile=None):
|
||||
try:
|
||||
self._run(command, timeout, logfile)
|
||||
except:
|
||||
# Need to guard against a SystemExit or other exception occuring whilst running
|
||||
# and ensure we don't leave a process behind.
|
||||
if self.process.poll() is None:
|
||||
self.process.kill()
|
||||
self.status = self.process.wait()
|
||||
raise
|
||||
return (self.status, self.output)
|
||||
|
||||
class SSHControl(object):
|
||||
def __init__(self, ip, logfile=None, timeout=300, user='root', port=None):
|
||||
|
||||
Reference in New Issue
Block a user