From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Stefan Hajnoczi" <stefanha@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Mark Cave-Ayland" <mark.caveayland@nutanix.com>
Subject: [PULL 04/10] tests/functional: Speed up the avr_mega2560 test
Date: Wed, 11 Jun 2025 14:58:40 +0200 [thread overview]
Message-ID: <20250611125846.125918-5-thuth@redhat.com> (raw)
In-Reply-To: <20250611125846.125918-1-thuth@redhat.com>
From: Thomas Huth <thuth@redhat.com>
We can simply check for the expected pattern on the console,
no need to wait for two seconds here to search for the pattern
in the log at the end.
While we're at it, also remove the obsolete "timeout" variable
from this test.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250603184710.25651-1-thuth@redhat.com>
---
tests/functional/test_avr_mega2560.py | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/tests/functional/test_avr_mega2560.py b/tests/functional/test_avr_mega2560.py
index 8e47b4200b1..6359b72af39 100755
--- a/tests/functional/test_avr_mega2560.py
+++ b/tests/functional/test_avr_mega2560.py
@@ -18,12 +18,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-import time
+from qemu_test import QemuSystemTest, Asset, wait_for_console_pattern
-from qemu_test import QemuSystemTest, Asset
class AVR6Machine(QemuSystemTest):
- timeout = 5
ASSET_ROM = Asset(('https://github.com/seharris/qemu-avr-tests'
'/raw/36c3e67b8755dcf/free-rtos/Demo'
@@ -40,13 +38,12 @@ def test_freertos(self):
self.set_machine('arduino-mega-2560-v3')
self.vm.add_args('-bios', rom_path)
self.vm.add_args('-nographic')
+ self.vm.set_console()
self.vm.launch()
- time.sleep(2)
- self.vm.shutdown()
+ wait_for_console_pattern(self,
+ 'XABCDEFGHIJKLMNOPQRSTUVWXABCDEFGHIJKLMNOPQRSTUVWXA')
- self.assertIn('ABCDEFGHIJKLMNOPQRSTUVWXABCDEFGHIJKLMNOPQRSTUVWX',
- self.vm.get_log())
if __name__ == '__main__':
QemuSystemTest.main()
--
2.49.0
next prev parent reply other threads:[~2025-06-11 13:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 12:58 [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Thomas Huth
2025-06-11 12:58 ` [PULL 01/10] travis.yml: Remove the aarch64 job Thomas Huth
2025-06-11 12:58 ` [PULL 02/10] hw/s390x/s390-virtio-ccw: Remove the deprecated 4.1 machine type Thomas Huth
2025-06-11 12:58 ` [PULL 03/10] tests/functional: Use the 'none' machine for the VNC test Thomas Huth
2025-06-11 12:58 ` Thomas Huth [this message]
2025-06-11 12:58 ` [PULL 05/10] tests/functional: add skipLockedMemoryTest decorator Thomas Huth
2025-06-11 12:58 ` [PULL 06/10] tests/functional: add memlock tests Thomas Huth
2025-10-24 7:45 ` Philippe Mathieu-Daudé
2025-10-24 7:51 ` Philippe Mathieu-Daudé
2025-06-11 12:58 ` [PULL 07/10] tests/vm/README: fix documentation path in tests/vm/README Thomas Huth
2025-06-11 12:58 ` [PULL 08/10] MAINTAINERS: Update the paths to the testing documentation files Thomas Huth
2025-06-11 12:58 ` [PULL 09/10] MAINTAINERS: Update Akihiko Odaki's affiliation Thomas Huth
2025-06-11 12:58 ` [PULL 10/10] scripts/meson-buildoptions: Sort coroutine_backend choices lexicographically Thomas Huth
2025-06-11 18:22 ` [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Stefan Hajnoczi
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=20250611125846.125918-5-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=mark.caveayland@nutanix.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).