[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/28] tests/functional: remove time.sleep usage from tuxrun tests
From: |
Alex Bennée |
Subject: |
[PULL 16/28] tests/functional: remove time.sleep usage from tuxrun tests |
Date: |
Mon, 25 Nov 2024 15:20:53 +0000 |
From: Daniel P. Berrangé <berrange@redhat.com>
The tuxrun tests send a series of strings to the guest to login
and then run commands. Since we have been unable to match on
console output that isn't followed by a newline, the test used
many time.sleep() statements to pretend to synchronize with
the guest.
This has proved to be unreliable for the aarch64be instance of
the tuxrun tests, with the test often hanging. The hang is a
very subtle timing problem, and it is suspected that some
(otherwise apparently harmless) I/O error messages could be
resulting in full FIFO buffers, stalling interaction with
the guest.
With the newly rewritten console interaction able to match
strings that don't have a following newline, the tux run
tests can now match directly on the login prompt, and/or
shell PS1 prompt.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2689
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20241121154218.1423005-17-berrange@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20241121165806.476008-17-alex.bennee@linaro.org>
diff --git a/tests/functional/qemu_test/tuxruntest.py
b/tests/functional/qemu_test/tuxruntest.py
index ed2b238c92..ab3b27da43 100644
--- a/tests/functional/qemu_test/tuxruntest.py
+++ b/tests/functional/qemu_test/tuxruntest.py
@@ -124,16 +124,12 @@ def run_tuxtest_tests(self, haltmsg):
then do a few things on the console. Trigger a shutdown and
wait to exit cleanly.
"""
- self.wait_for_console_pattern("Welcome to TuxTest")
- time.sleep(0.2)
- exec_command(self, 'root')
- time.sleep(0.2)
- exec_command(self, 'cat /proc/interrupts')
- time.sleep(0.1)
- exec_command(self, 'cat /proc/self/maps')
- time.sleep(0.1)
- exec_command(self, 'uname -a')
- time.sleep(0.1)
+ ps1='root@tuxtest:~#'
+ self.wait_for_console_pattern('tuxtest login:')
+ exec_command_and_wait_for_pattern(self, 'root', ps1)
+ exec_command_and_wait_for_pattern(self, 'cat /proc/interrupts', ps1)
+ exec_command_and_wait_for_pattern(self, 'cat /proc/self/maps', ps1)
+ exec_command_and_wait_for_pattern(self, 'uname -a', ps1)
exec_command_and_wait_for_pattern(self, 'halt', haltmsg)
# Wait for VM to shut down gracefully if it can
--
2.39.5
- Re: [PULL 07/28] tests/functional: remove comments talking about avocado, (continued)
- [PULL 11/28] tests/functional: enable debug logging for QEMUMachine, Alex Bennée, 2024/11/25
- [PULL 10/28] tests/functional: honour requested test VM name in QEMUMachine, Alex Bennée, 2024/11/25
- [PULL 05/28] tests/functional: remove leftover :avocado: tags, Alex Bennée, 2024/11/25
- [PULL 09/28] tests/functional: put QEMUMachine logs in testcase log directory, Alex Bennée, 2024/11/25
- [PULL 12/28] tests/functional: logs details of console interaction operations, Alex Bennée, 2024/11/25
- [PULL 06/28] tests/functional: remove obsolete reference to avocado bug, Alex Bennée, 2024/11/25
- [PULL 24/28] rust/pl011: Fix range checks for device ID accesses, Alex Bennée, 2024/11/25
- [PULL 08/28] tests/functional: honour self.workdir in ACPI bits tests, Alex Bennée, 2024/11/25
- [PULL 16/28] tests/functional: remove time.sleep usage from tuxrun tests,
Alex Bennée <=
- [PULL 26/28] tests/functional: Convert Aspeed aarch64 SDK tests, Alex Bennée, 2024/11/25
- [PULL 14/28] tests/functional: require non-NULL success_message for console wait, Alex Bennée, 2024/11/25
- [PULL 28/28] tests/functional: Remove sleep workarounds from Aspeed tests, Alex Bennée, 2024/11/25
- [PULL 13/28] tests/functional: don't try to wait for the empty string, Alex Bennée, 2024/11/25
- [PULL 15/28] tests/functional: rewrite console handling to be bytewise, Alex Bennée, 2024/11/25
- [PULL 23/28] plugins: eradicate qemu-plugins.symbols static file, Alex Bennée, 2024/11/25
- [PULL 17/28] tests/functional: add a QMP backdoor for debugging stalled tests, Alex Bennée, 2024/11/25
- [PULL 18/28] tests/functional: avoid accessing log_filename on earlier failures, Alex Bennée, 2024/11/25
- [PULL 20/28] tests/functional: update the aarch64 tuxrun tests, Alex Bennée, 2024/11/25
- [PULL 25/28] docs: explicitly permit a "commonly known identity" with SoB, Alex Bennée, 2024/11/25