From 585d3e41e2c0625306272af86b7bac849d7d03f1 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Tue, 4 Aug 2026 21:30:57 -0400 Subject: [PATCH 1/3] QEMU VMs: make seabios log files easier to correlate Some tests will have multiple instances of QEMU VMs, one example is a migration test. Some files are not created with names unique enough to identify each instance. There's some prior art to name them after the QEMU process (if that has been created already). This adds the seabios log files to the same pattern, so it's easier to correlate them. Before this: $ avocado run migrate.default.tcp.default $ ls -1 $TEST_RESULTS | grep avocado-vt-vm1 | grep \.log\$ catch_monitor-avocado-vt-vm1-pid-564872.log catch_monitor-avocado-vt-vm1-pid-565316.log qmpmonitor1-avocado-vt-vm1-pid-564872.log qmpmonitor1-avocado-vt-vm1-pid-565316.log seabios-avocado-vt-vm1.log After this: ... catch_monitor-avocado-vt-vm1-pid-562753.log catch_monitor-avocado-vt-vm1-pid-563200.log qmpmonitor1-avocado-vt-vm1-pid-562753.log qmpmonitor1-avocado-vt-vm1-pid-563200.log seabios-avocado-vt-vm1-pid-562753.log seabios-avocado-vt-vm1-pid-563200.log ... Signed-off-by: Cleber Rosa --- virttest/qemu_vm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/virttest/qemu_vm.py b/virttest/qemu_vm.py index b753f7299d..1948844e7a 100644 --- a/virttest/qemu_vm.py +++ b/virttest/qemu_vm.py @@ -3984,7 +3984,8 @@ def create( for key, value in list(self.logs.items()): outfile = os.path.join( - utils_logfile.get_log_file_dir(), "%s-%s.log" % (key, name) + utils_logfile.get_log_file_dir(), + "%s-%s-pid-%s.log" % (key, name, self.get_pid()), ) self.logsessions[key] = aexpect.Tail( "nc -U %s" % value, From c1036f721999d0d726adadcfe39daa4688afa4a1 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Tue, 4 Aug 2026 21:30:57 -0400 Subject: [PATCH 2/3] QEMU VMs: make cloned images unique Larger changes are necessary to allow for Avocado-VT to transparently support running multiple tp-qemu tests in parallel. But, enabling automatic cloning of images and making them unique (based on the prior art of one file per VM and process) goes a long way. This follows a naming pattern used for log files, and although the default directories for data are not the same for log files, it makes them *somewhat* easier to correlate. The PIDs won't match given that the creation of the image files happen before the creation of the QEMU process, but their parent PIDs should match. Signed-off-by: Cleber Rosa --- virttest/storage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/virttest/storage.py b/virttest/storage.py index 8b43bda3e8..1759cf5651 100644 --- a/virttest/storage.py +++ b/virttest/storage.py @@ -1210,7 +1210,8 @@ def clone_image(params, vm_name, image_name, root_dir): if not params.get("image_name_%s_%s" % (image_name, vm_name)): m_image_name = params.get("image_name", "image") vm_image_name = params.get( - "image_name_%s" % vm_name, "%s_%s" % (m_image_name, vm_name) + "image_name_%s" % vm_name, + "%s_%s" % (m_image_name, f"{vm_name}-pid-{os.getpid()}"), ) if params.get("clone_master", "yes") == "yes": image_params = params.object_params(image_name) From 442a284c84c59c7a4667e7bc40239b1b74cbbbd6 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Tue, 4 Aug 2026 22:17:54 -0400 Subject: [PATCH 3/3] Docs: add short section on how to run some tests in parallel Signed-off-by: Cleber Rosa --- docs/source/GetStartedGuide.rst | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/source/GetStartedGuide.rst b/docs/source/GetStartedGuide.rst index a897caccdc..abc7c17391 100644 --- a/docs/source/GetStartedGuide.rst +++ b/docs/source/GetStartedGuide.rst @@ -166,6 +166,35 @@ Now let's run a virt test:: If you have trouble executing the steps provided in this guide, you have a few options: +Running tests in parallel +========================= + +Avocado itself has supported running tests in parallel for a long time, but due +to the nature of VT tests, this is not common practice. Still, some tests can +run in parallel with a few extra options set. + +This takes into consideration tp-qemu tests. A command line such as the +following demonstrates that:: + + $ avocado run --max-parallel-tasks=2 --vt-extra-params 'master_images_clone=vm1' --vt-extra-params='remove_image_image1=yes' --vt-extra-params='backup_image_before_testing=no' --vt-extra-params='display=nographic' -- boot boot + JOB ID : + JOB LOG : /home//avocado/job-results/job-2026-08-04T22.13-a336310/job.log + (2/2) io-github-autotest-qemu.boot: STARTED + (1/2) io-github-autotest-qemu.boot: STARTED + (2/2) io-github-autotest-qemu.boot: PASS (32.79 s) + (1/2) io-github-autotest-qemu.boot: PASS (32.82 s) + RESULTS : PASS 2 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 + JOB TIME : 36.15 s + +Notice how the job run time and each test's individual time are very close. + +This assumes a guest image has already been prepared (either a JeOS +image downloaded as part of the ``vt-bootstrap`` execution) or an +unattended install test has been run. + +Please use this "parallelization support" with a grain of salt, given +that it's highly test dependent. + * For in-depth information, or to ask questions, please consult the `deepwiki `__. * Send an e-mail to `the avocado mailing list `__. * Open an issue on `the avocado-vt github area `__.