All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anuj Mittal" <anuj.mittal@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [hardknott][PATCH 04/15] oeqa/qemurunner: Improve handling of run_serial for shutdown commands
Date: Wed, 12 May 2021 16:35:36 +0800	[thread overview]
Message-ID: <a72572532b976a4c3e8fa68fe63f63e39399ee88.1620808329.git.anuj.mittal@intel.com> (raw)
In-Reply-To: <cover.1620808329.git.anuj.mittal@intel.com>

From: Richard Purdie <richard.purdie@linuxfoundation.org>

When running a shutdown command, the serial port can close without the
command returning. This is seen as the socket being readable but having
no data. Change the way this case is handled in the code to avoid
tracebacks.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 396a3ba884820d040c91f7592daf20ac28c49b5d)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 meta/lib/oeqa/utils/qemurunner.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 526b493669..a0f17d557b 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -71,6 +71,8 @@ class QemuRunner:
         self.monitorpipe = None
 
         self.logger = logger
+        # Whether we're expecting an exit and should show related errors
+        self.canexit = False
 
         # Enable testing other OS's
         # Set commands for target communication, and default to Linux ALWAYS
@@ -472,6 +474,7 @@ class QemuRunner:
             self.thread.join()
 
     def allowexit(self):
+        self.canexit = True
         if self.thread:
             self.thread.allowexit()
 
@@ -530,7 +533,9 @@ class QemuRunner:
                     if re.search(self.boot_patterns['search_cmd_finished'], data):
                         break
                 else:
-                    raise Exception("No data on serial console socket")
+                    if self.canexit:
+                        return (1, "")
+                    raise Exception("No data on serial console socket, connection closed?")
 
         if data:
             if raw:
-- 
2.31.1


  parent reply	other threads:[~2021-05-12  8:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12  8:35 [hardknott][PATCH 00/15] review request Anuj Mittal
2021-05-12  8:35 ` [hardknott][PATCH 01/15] sanity.bbclass: mention CONNECTIVITY_CHECK_URIS in network failure message Anuj Mittal
2021-05-12  8:35 ` [hardknott][PATCH 02/15] oeqa/qemurunner: Improve logging thread exit handling for qemu shutdown test Anuj Mittal
2021-05-12  8:35 ` [hardknott][PATCH 03/15] oeqa/qemurunner: Fix binary vs str issue Anuj Mittal
2021-05-12  8:35 ` Anuj Mittal [this message]
2021-05-12  8:35 ` [hardknott][PATCH 05/15] db: update CVE_PRODUCT Anuj Mittal
2021-05-12  8:35 ` [hardknott][PATCH 06/15] linux-firmware: upgrade 20210208 -> 20210315 Anuj Mittal
2021-05-12  8:35 ` [hardknott][PATCH 07/15] linux-yocto/5.4: qemuppc32: reduce serial shutdown issues Anuj Mittal
2021-05-12  8:35 ` [hardknott][PATCH 08/15] lttng-modules: backport patches to fix build against 5.12+ kernel Anuj Mittal
2021-05-12  8:35 ` [hardknott][PATCH 09/15] libcap: Configure Make variables correctly without a horrible hack Anuj Mittal
2021-05-12  8:35 ` [hardknott][PATCH 10/15] dejagnu: needs expect at runtime Anuj Mittal
2021-05-12  8:35 ` [hardknott][PATCH 11/15] grub2.inc: remove '-O2' from CFLAGS Anuj Mittal
2021-05-12  8:35 ` [hardknott][PATCH 12/15] ruby: upgrade 3.0.0 -> 3.0.1 Anuj Mittal
2021-05-12  8:35 ` [hardknott][PATCH 13/15] lsb-release: fix reproducibility failure Anuj Mittal
2021-05-12  8:35 ` [hardknott][PATCH 14/15] linux-firmware: include all relevant files in -bcm4356 Anuj Mittal
2021-05-12  8:35 ` [hardknott][PATCH 15/15] puzzles: Upstream changed to main branch for development Anuj Mittal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a72572532b976a4c3e8fa68fe63f63e39399ee88.1620808329.git.anuj.mittal@intel.com \
    --to=anuj.mittal@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.