Skip to contentSkip to conversation

testing and gitlab updates

GIT PULL Alex Bennée 2 participants 9 messages Jun 22

lore
Share & tools
lore
#0 lore raw

The following changes since commit b83371668192a705b878e909c5ae9c1233cbd5fb:

Merge tag 'pbouvier/pr/plugins-20260618' of https://gitlab.com/p-b-o/qemu into staging (2026-06-19 15:00:01 -0400)

are available in the Git repository at:

https://gitlab.com/stsquad/qemu.git tags/pull-11.1-testing-updates-220626-1

for you to fetch changes up to 2e020310e15d8452407c438271f3c06d4fa0c416:

gitlab: update bug template for sec issues & tool assistance (2026-06-22 13:45:37 +0100)

----------------------------------------------------------------
testing and gitlab updates:

- present a dev friendly cmd line in functional test logs
- tell pylint to skip c-modules
- widen the capture of functional tests logs in gitlab
- remove workaround for MacOS build targets
- update the gitlab bug template for security process

----------------------------------------------------------------
Alex Bennée (5):
python/qemu: split arg between base and harness lists python/qemu: split console from harness args python/qemu: dump a developer friendly version of cmdline to logs tests/functional: tell pylint not to check c-modules
gitlab: remove build target hacks

Daniel P. Berrangé (2):
gitlab: ensure "check-XXX' jobs capture functional test logs
gitlab: update bug template for sec issues & tool assistance

 .gitlab-ci.d/buildtest-template.yml | 18 +++++++++---------
 .gitlab-ci.d/macos.yml              |  7 ++-----
 .gitlab/issue_templates/bug.md      | 11 +++++++++--
 python/qemu/machine/machine.py      | 29 ++++++++++++++++++++++++-----
 tests/functional/pylintrc           |  1 +
 5 files changed, 45 insertions(+), 21 deletions(-)
Signature · 1 line
2.47.3
#1 lore raw

[PULL 1/7] python/qemu: split arg between base and harness lists

There are argument we add because we want the test harness to control QEMU and arguments we default for handling the display and machine type. Split the obvious ones between base_args and a new list called harness_args.

We will leave the complexity of the serial ports for now.

Message-ID: <[email protected]>

python/qemu/machine/machine.py +10 -4
index ebb58d5b68c..e8973a87394 100644
@@ -292,8 +292,8 @@ def _load_io_log(self) -> None:
                 self._iolog = iolog.read()
 
     @property
-    def _base_args(self) -> List[str]:
-        args = ['-display', 'none', '-vga', 'none']
+    def _harness_args(self) -> List[str]:
+        args: List[str] = []
 
         if self._qmp_set:
             if self._sock_pair:
@@ -307,8 +307,6 @@ def _base_args(self) -> List[str]:
             args.extend(['-chardev', moncdev, '-mon',
                          'chardev=mon,mode=control'])
 
-        if self._machine is not None:
-            args.extend(['-machine', self._machine])
         for _ in range(self._console_index):
             args.extend(['-serial', 'null'])
         if self._console_set:
@@ -323,6 +321,13 @@ def _base_args(self) -> List[str]:
                 args.extend(['-device', device])
         return args
 
+    @property
+    def _base_args(self) -> List[str]:
+        args: List[str] = ['-display', 'none', '-vga', 'none']
+        if self._machine is not None:
+            args.extend(['-machine', self._machine])
+        return args
+
     @property
     def args(self) -> List[str]:
         """Returns the list of arguments given to the QEMU binary."""
@@ -366,6 +371,7 @@ def _pre_launch(self) -> None:
         self._qemu_full_args = tuple(chain(
             self._wrapper,
             [self._binary],
+            self._harness_args,
             self._base_args,
             self._args
         ))
Signature · 1 line
2.47.3
#2 lore raw

[PULL 6/7] gitlab: remove build target hacks

In reply to Alex Bennée

Since eef29e060dc (meson: build macOS signed binary as part of the default target) we should be able to do a plain build and everything just work.

Message-ID: <[email protected]>

.gitlab-ci.d/macos.yml +2 -5
index 8366b4ad564..efa0fb666e2 100644
@@ -29,7 +29,6 @@
     - cd build
     - ../configure --enable-werror $CONFIGURE_ARGS || { cat config.log meson-logs/meson-log.txt; exit 1; }
     - $MAKE -j$(sysctl -n hw.ncpu)
-    - for TARGET in $TEST_BINARIES ; do $MAKE $TARGET ; done
     - for TARGET in $TEST_TARGETS ; do $MAKE $TARGET ; done
 
 aarch64-macos-15-build:
@@ -45,8 +44,7 @@ aarch64-macos-15-build:
         --cross-prefix-i386=i686-elf-
         --cross-prefix-x86_64=x86_64-elf-
         --disable-plugins
-    TEST_BINARIES: qemu-system-aarch64 qemu-system-i386 qemu-system-x86_64
-    TEST_TARGETS: check-unit run-tcg-tests-aarch64-softmmu run-tcg-tests-i386-softmmu run-tcg-tests-x86_64-softmmu
+    TEST_TARGETS: check-unit check-tcg
 
 aarch64-macos-26-build:
   extends: .macos_job_template
@@ -62,5 +60,4 @@ aarch64-macos-26-build:
         --cross-prefix-i386=i686-elf-
         --cross-prefix-x86_64=x86_64-elf-
         --disable-plugins
-    TEST_BINARIES: qemu-system-aarch64 qemu-system-i386 qemu-system-x86_64
-    TEST_TARGETS: check-unit run-tcg-tests-aarch64-softmmu run-tcg-tests-i386-softmmu run-tcg-tests-x86_64-softmmu
+    TEST_TARGETS: check-unit check-tcg
Signature · 1 line
2.47.3
#3 lore raw

[PULL 3/7] python/qemu: dump a developer friendly version of cmdline to logs

In reply to Alex Bennée

Now we have the arguments nicely split up we can make _console_args a function call and present a slightly different version to the logs to save developers manually hacking the command line up.

Message-ID: <[email protected]>

python/qemu/machine/machine.py +12 -4
index 18ee5ec0147..26a7bf5948f 100644
@@ -308,12 +308,15 @@ def _harness_args(self) -> List[str]:
                          'chardev=mon,mode=control'])
         return args
 
-    @property
-    def _console_args(self) -> List[str]:
+    def _console_args(self, interactive=False) -> List[str]:
         args: List[str] = []
+        # redirect pre_console_index serials to null
         for _ in range(self._console_index):
             args.extend(['-serial', 'null'])
-        if self._console_set:
+
+        if interactive:
+            args.extend(['-serial', 'mon:stdio'])
+        elif self._console_set:
             assert self._cons_sock_pair is not None
             fd = self._cons_sock_pair[0].fileno()
             chardev = f"socket,id=console,fd={fd}"
@@ -376,7 +379,7 @@ def _pre_launch(self) -> None:
             self._wrapper,
             [self._binary],
             self._harness_args,
-            self._console_args,
+            self._console_args(),
             self._base_args,
             self._args
         ))
@@ -485,6 +488,11 @@ def _launch(self) -> None:
         """
         self._pre_launch()
         LOG.debug('VM launch command: %r', ' '.join(self._qemu_full_args))
+        # Log a simplified, developer-runnable command:
+        # Exclude harness-managed infrastructure args (harness_args)
+        # and wrapper.
+        debug_cmd = [self._binary] + self._console_args(interactive=True) + self._base_args + self._args
+        LOG.debug('Developer-runnable command: %r', ' '.join(debug_cmd))
 
         # Cleaning up of this subprocess is guaranteed by _do_shutdown.
         # pylint: disable=consider-using-with
Signature · 1 line
2.47.3
#4 lore raw

[PULL 5/7] gitlab: ensure "check-XXX' jobs capture functional test logs

In reply to Alex Bennée

From: Daniel P. Berrangé <[email protected]>

A small subset of functional tests are run by default with 'make check', and so run in the context of 'check-XXX' CI jobs, rather than 'functional-XXX' CI jobs. Thus we need to capture the functional test logs unconditionally for all test jobs.

Message-ID: <[email protected]>
Message-ID: <[email protected]>

.gitlab-ci.d/buildtest-template.yml +9 -9
index 005058625eb..3b003abc999 100644
@@ -78,6 +78,15 @@
   extends: .meson_job_template
   stage: test
   image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
+  artifacts:
+    name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
+    when: always
+    expire_in: 7 days
+    paths:
+      - build/meson-logs
+      - build/tests/functional/*/*/*.log
+    reports:
+      junit: build/meson-logs/*.junit.xml
   script:
     - source scripts/ci/gitlab-ci-section
     - section_start buildenv "Setting up to run tests"
@@ -111,15 +120,6 @@
     paths:
       - ${CI_PROJECT_DIR}/functional-cache
     policy: pull-push
-  artifacts:
-    name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
-    when: always
-    expire_in: 7 days
-    paths:
-      - build/meson-logs
-      - build/tests/functional/*/*/*.log
-    reports:
-      junit: build/meson-logs/*.junit.xml
   before_script:
     - export QEMU_TEST_ALLOW_UNTRUSTED_CODE=1
     - export QEMU_TEST_CACHE_DIR=${CI_PROJECT_DIR}/functional-cache
Signature · 1 line
2.47.3
#5 lore raw

[PULL 2/7] python/qemu: split console from harness args

In reply to Alex Bennée

Before we mess with the console output lets create a new helper just for that.

Message-ID: <[email protected]>

python/qemu/machine/machine.py +5 -0
index e8973a87394..18ee5ec0147 100644
@@ -306,7 +306,11 @@ def _harness_args(self) -> List[str]:
                 moncdev = f"socket,id=mon,path={self._monitor_address}"
             args.extend(['-chardev', moncdev, '-mon',
                          'chardev=mon,mode=control'])
+        return args
 
+    @property
+    def _console_args(self) -> List[str]:
+        args: List[str] = []
         for _ in range(self._console_index):
             args.extend(['-serial', 'null'])
         if self._console_set:
@@ -372,6 +376,7 @@ def _pre_launch(self) -> None:
             self._wrapper,
             [self._binary],
             self._harness_args,
+            self._console_args,
             self._base_args,
             self._args
         ))
Signature · 1 line
2.47.3
#6 lore raw

[PULL 7/7] gitlab: update bug template for sec issues & tool assistance

In reply to Alex Bennée

From: Daniel P. Berrangé <[email protected]>

Warn that a security issue must have the "confidential" flag set and that any findings from automated tools must be validated before submission.

Message-ID: <[email protected]>

Message-ID: <[email protected]>

.gitlab/issue_templates/bug.md +9 -2
index e20f586008d..faeeb002252 100644
@@ -13,8 +13,9 @@ older than this should be reported to the distribution instead.
 See https://www.qemu.org/contribute/report-a-bug/ for additional
 guidance.
 
-If this is a security issue, please consult
-https://www.qemu.org/contribute/security-process/
+If this is a security issue, ensure this ticket is marked 'confidential'
+before submission. See https://www.qemu.org/contribute/security-process/
+for additional guidance
 -->
 
 ## Host environment
@@ -49,6 +50,12 @@ https://www.qemu.org/contribute/security-process/
 2.
 3.
 
+<!--
+Note: if this issue was discovered with the assistance of automated
+tooling LLM, static analysis, fuzzers), the reporter must disclose
+that in the description. The steps to reproduce, and any other findings,
+must be fully validated by the user of the tool prior to submission.
+-->
 
 ## Additional information
 
Signature · 1 line
2.47.3
#7 lore raw

[PULL 4/7] tests/functional: tell pylint not to check c-modules

In reply to Alex Bennée

To fix:

qemu-test.test_pylint "/home/alex/lsrc/qemu.git/tests/functional/arm/test_integratorcp.py:83: I1101: Module 'cv2' has no 'imread' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member)"

Manually running python3 showed I could indeed import cv2 and call those functions. Rather than allowing pylint to introspect lets just tell it to skip c modules.

Message-ID: <[email protected]>

tests/functional/pylintrc +1 -0
index 049c3e76f12..949bea611fe 100644
@@ -58,6 +58,7 @@ confidence=HIGH,
 # no Warning level messages displayed, use "--disable=all --enable=classes
 # --disable=W".
 disable=bad-inline-option,
+        c-extension-no-member,
         consider-using-f-string,
         file-ignored,
         fixme,
Signature · 1 line
2.47.3
#8 lore raw
In reply to Alex Bennée
Quoted 13 lines · Alex Bennée

The following changes since commit b83371668192a705b878e909c5ae9c1233cbd5fb:

Merge tag 'pbouvier/pr/plugins-20260618' of https://gitlab.com/p-b-o/qemu into staging (2026-06-19 15:00:01 -0400)

are available in the Git repository at:

https://gitlab.com/stsquad/qemu.git tags/pull-11.1-testing-updates-220626-1

for you to fetch changes up to 2e020310e15d8452407c438271f3c06d4fa0c416:

gitlab: update bug template for sec issues & tool assistance (2026-06-22 13:45:37 +0100)

Quoted 8 lines

----------------------------------------------------------------
testing and gitlab updates:

- present a dev friendly cmd line in functional test logs
- tell pylint to skip c-modules
- widen the capture of functional tests logs in gitlab
- remove workaround for MacOS build targets
- update the gitlab bug template for security process

Hi Alex,
Please take a look at this CI failure and resend this pull request with a fix:
https://gitlab.com/qemu-project/qemu/-/jobs/14979433360#L169

Thanks,
Stefan

Quoted 24 lines

----------------------------------------------------------------
Alex Bennée (5):
python/qemu: split arg between base and harness lists python/qemu: split console from harness args python/qemu: dump a developer friendly version of cmdline to logs tests/functional: tell pylint not to check c-modules
gitlab: remove build target hacks

Daniel P. Berrangé (2):
gitlab: ensure "check-XXX' jobs capture functional test logs
gitlab: update bug template for sec issues & tool assistance

 .gitlab-ci.d/buildtest-template.yml | 18 +++++++++---------
 .gitlab-ci.d/macos.yml              |  7 ++-----
 .gitlab/issue_templates/bug.md      | 11 +++++++++--
 python/qemu/machine/machine.py      | 29 ++++++++++++++++++++++++-----
 tests/functional/pylintrc           |  1 +
 5 files changed, 45 insertions(+), 21 deletions(-)

--
2.47.3