From a82711fe4520538a732a16795d50573b6f1d4463 Mon Sep 17 00:00:00 2001 From: Mariano Lopez Date: Tue, 11 Aug 2015 13:24:44 +0000 Subject: qemurunner.py: Add method run_serial The only need for the console before this patch was to check if the target has booted. This allows to send commands to the terminal. This new method is based on the method with the same name of the QemuTinyRunner class. The difference here is it will remove the command and the prompt. The other diference is it will send an echo $? to check if the last command was successful. [YOCTO #8118] Signed-off-by: Mariano Lopez Signed-off-by: Ross Burton --- meta/lib/oeqa/utils/qemurunner.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'meta/lib') diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index 9bb1f4bb2d..81ca32e11b 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -262,3 +262,33 @@ class QemuRunner: basecmd = os.path.basename(basecmd) if "qemu-system" in basecmd and "-serial tcp" in commands[p]: return [int(p),commands[p]] + + def run_serial(self, command): + # We assume target system have echo to get command status + self.server_socket.sendall("%s; echo $?\n" % command) + data = '' + status = 0 + stopread = False + endtime = time.time()+5 + while time.time()