From: Daniel P. Berrangé Date: Mon, 8 Sep 2025 13:57:19 +0000 (+0100) Subject: tests/functional: fix infinite loop on console EOF X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb352b3c85a990ba81e41e4e8c7eb53ccc3059a3;p=thirdparty%2Fqemu.git 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é Reviewed-by: Thomas Huth Reviewed-by: Alex Bennée Message-ID: <20250908135722.3375580-2-berrange@redhat.com> Signed-off-by: Thomas Huth --- diff --git a/tests/functional/qemu_test/cmd.py b/tests/functional/qemu_test/cmd.py index 8069c89730b..f544566245b 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}'")