From 9a485a96d368d3b987ec378ca2d175e7a0e91337 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Mon, 25 Oct 2021 14:01:21 +0100 Subject: [PATCH] arm/oeqa/fvp: handle the FVP process exiting If the FVP has already quit when we're stopping an exception is raised, so catch that and do nothing. Signed-off-by: Ross Burton Signed-off-by: Jon Mason --- meta-arm/lib/oeqa/controllers/fvp.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/meta-arm/lib/oeqa/controllers/fvp.py b/meta-arm/lib/oeqa/controllers/fvp.py index 1e26a519..79d2f2ef 100644 --- a/meta-arm/lib/oeqa/controllers/fvp.py +++ b/meta-arm/lib/oeqa/controllers/fvp.py @@ -75,13 +75,14 @@ class OEFVPTarget(oeqa.core.target.ssh.OESSHTarget): def stop(self, **kwargs): loop = asyncio.get_event_loop() - # Kill the process group so that the telnet and FVP die too - gid = os.getpgid(self.fvp.pid) - try: + # Kill the process group so that the telnet and FVP die too + gid = os.getpgid(self.fvp.pid) self.logger.debug(f"Sending SIGTERM to {gid}") os.killpg(gid, signal.SIGTERM) loop.run_until_complete(asyncio.wait_for(self.fvp.wait(), 10)) except TimeoutError: self.logger.debug(f"Timed out, sending SIGKILL to {gid}") os.killpg(gid, signal.SIGKILL) + except ProcessLookupError: + return