sw:vec: Temporarily fix the test_runner with force close
Close the Renode simulation without waiting for EOF
BUG: 208647775
Change-Id: I5e4cefa6c188b8328925c2ea6b18637c88a70355
diff --git a/scripts/test_runner.py b/scripts/test_runner.py
index f9e3c72..0e0c1f5 100755
--- a/scripts/test_runner.py
+++ b/scripts/test_runner.py
@@ -91,11 +91,24 @@
tmp.write(self.renode_script)
tmp.flush()
self.simulator_cmd += " %s" % script_path
- test_output = super().run()
+ # TODO(b/208647775): Use super().run() instead.
+ test_output = self.force_run()
finally:
os.remove(script_path)
return test_output
+ def force_run(self, timeout=120):
+ """Temporarily run method to force exit renode.
+ TODO(b/208647775): Remove this function and use super().run().
+ """
+ self.child = pexpect.spawn(self.simulator_cmd, encoding='utf-8')
+ self.child.logfile = self.buffer
+ self.child.expect(self.termination_strings, timeout=timeout)
+ self.child.send("\nq\n")
+ self.child.close()
+ self.buffer.seek(0)
+ return self.buffer.read()
+
Simulators = {
"qemu": QemuSimulation,