diff mbox series

[v1,01/10] tests/guest-debug: catch hanging guests

Message ID 20200513175134.19619-2-alex.bennee@linaro.org
State Superseded
Headers show
Series testing and tcg tweaks | expand

Commit Message

Alex Bennée May 13, 2020, 5:51 p.m. UTC
If gdb never actually connected with the guest we need to catch that
and clean-up after ourselves.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Message-Id: <20200512104338.27365-1-alex.bennee@linaro.org>
---
 tests/guest-debug/run-test.py | 6 ++++++
 1 file changed, 6 insertions(+)

-- 
2.20.1

Comments

Philippe Mathieu-Daudé May 21, 2020, 2:06 p.m. UTC | #1
On 5/13/20 7:51 PM, Alex Bennée wrote:
> If gdb never actually connected with the guest we need to catch that

> and clean-up after ourselves.

> 

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> Message-Id: <20200512104338.27365-1-alex.bennee@linaro.org>

> ---

>   tests/guest-debug/run-test.py | 6 ++++++

>   1 file changed, 6 insertions(+)

> 

> diff --git a/tests/guest-debug/run-test.py b/tests/guest-debug/run-test.py

> index d9af9573b9e..71c55690546 100755

> --- a/tests/guest-debug/run-test.py

> +++ b/tests/guest-debug/run-test.py

> @@ -80,4 +80,10 @@ if __name__ == '__main__':

>           print("GDB crashed? SKIPPING")

>           exit(0)

>   

> +    try:

> +        inferior.wait(2)

> +    except subprocess.TimeoutExpired:

> +        print("GDB never connected? Killed guest")


Maybe "Killing guest"?

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


> +        inferior.kill()

> +

>       exit(result)

>
diff mbox series

Patch

diff --git a/tests/guest-debug/run-test.py b/tests/guest-debug/run-test.py
index d9af9573b9e..71c55690546 100755
--- a/tests/guest-debug/run-test.py
+++ b/tests/guest-debug/run-test.py
@@ -80,4 +80,10 @@  if __name__ == '__main__':
         print("GDB crashed? SKIPPING")
         exit(0)
 
+    try:
+        inferior.wait(2)
+    except subprocess.TimeoutExpired:
+        print("GDB never connected? Killed guest")
+        inferior.kill()
+
     exit(result)