aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2025-09-08 14:57:19 +0100
committerThomas Huth <thuth@redhat.com>2025-09-09 12:41:18 +0200
commitfb352b3c85a990ba81e41e4e8c7eb53ccc3059a3 (patch)
tree8a360e55b2fa1000866fe0becb192e0932e47fed
parentba87a01e1af04599e1952cacfb7eb25f06e15da5 (diff)
downloadqemu-fb352b3c85a990ba81e41e4e8c7eb53ccc3059a3.zip
qemu-fb352b3c85a990ba81e41e4e8c7eb53ccc3059a3.tar.gz
qemu-fb352b3c85a990ba81e41e4e8c7eb53ccc3059a3.tar.bz2
tests/functional: fix infinite loop on console EOF
The 'recv' method will return an empty byte array, not None, when the socket has EOF. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-ID: <20250908135722.3375580-2-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--tests/functional/qemu_test/cmd.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/functional/qemu_test/cmd.py b/tests/functional/qemu_test/cmd.py
index 8069c89..f544566 100644
--- a/tests/functional/qemu_test/cmd.py
+++ b/tests/functional/qemu_test/cmd.py
@@ -54,7 +54,7 @@ def _console_read_line_until_match(test, vm, success, failure):
done = False
while True:
c = vm.console_socket.recv(1)
- if c is None:
+ if not c:
done = True
test.fail(
f"EOF in console, expected '{success}'")