Skip to contentSkip to conversation

Tests and misc patches

GIT PULL Thomas Huth 2 participants 25 messages Sep 10, 2024

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

[PULL 01/22] meson: Split --enable-sanitizers to --enable-{asan, ubsan}

In reply to Thomas Huth

From: Richard Henderson <[email protected]>

We do not always want both address and undefined behavior sanitizers running at the same time.

For the gitlab custom-runners, drop to only --enable-ubsan. These jobs are not run by default, but as will be obvious in the next patch, we don't run ASan on x86 either, and it seems wrong to hold aarch64 and s390x to a different standard.

Message-ID: <[email protected]>

---
 docs/devel/testing/fuzzing.rst                    |  4 ++--
 meson.build                                       | 15 +++++++++++----
 tests/qtest/fdc-test.c                            |  2 +-
 .../custom-runners/ubuntu-22.04-aarch64.yml       |  2 +-
 .../custom-runners/ubuntu-22.04-s390x.yml         |  2 +-
 meson_options.txt                                 |  6 ++++--
 scripts/meson-buildoptions.sh                     |  9 ++++++---
 tests/docker/test-debug                           |  4 ++--
 8 files changed, 28 insertions(+), 16 deletions(-)
docs/devel/testing/fuzzing.rst +2 -2
index 3bfcb33fc4..dfe1973cf8 100644
@@ -24,8 +24,8 @@ Configure with (substitute the clang binaries with the version you installed).
 Here, enable-sanitizers, is optional but it allows us to reliably detect bugs
 such as out-of-bounds accesses, use-after-frees, double-frees etc.::
 
-    CC=clang-8 CXX=clang++-8 /path/to/configure --enable-fuzzing \
-                                                --enable-sanitizers
+    CC=clang-8 CXX=clang++-8 /path/to/configure \
+        --enable-fuzzing --enable-asan --enable-ubsan
 
 Fuzz targets are built similarly to system targets::
 
meson.build +11 -4
index fbda17c987..f6b8060b72 100644
@@ -479,24 +479,31 @@ if get_option('safe_stack') and coroutine_backend != 'ucontext'
   error('SafeStack is only supported with the ucontext coroutine backend')
 endif
 
-if get_option('sanitizers')
+if get_option('asan')
   if cc.has_argument('-fsanitize=address')
     qemu_cflags = ['-fsanitize=address'] + qemu_cflags
     qemu_ldflags = ['-fsanitize=address'] + qemu_ldflags
+  else
+    error('Your compiler does not support -fsanitize=address')
   endif
+endif
 
-  # Detect static linking issue with ubsan - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84285
+if get_option('ubsan')
+  # Detect static linking issue with ubsan:
+  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84285
   if cc.links('int main(int argc, char **argv) { return argc + 1; }',
               args: [qemu_ldflags, '-fsanitize=undefined'])
     qemu_cflags = ['-fsanitize=undefined'] + qemu_cflags
     qemu_ldflags = ['-fsanitize=undefined'] + qemu_ldflags
+  else
+    error('Your compiler does not support -fsanitize=undefined')
   endif
 endif
 
 # Thread sanitizer is, for now, much noisier than the other sanitizers;
 # keep it separate until that is not the case.
 if get_option('tsan')
-  if get_option('sanitizers')
+  if get_option('asan') or get_option('ubsan')
     error('TSAN is not supported with other sanitizers')
   endif
   if not cc.has_function('__tsan_create_fiber',
@@ -2516,7 +2523,7 @@ if rdma.found()
 endif
 
 have_asan_fiber = false
-if get_option('sanitizers') and \
+if get_option('asan') and \
    not cc.has_function('__sanitizer_start_switch_fiber',
                          args: '-fsanitize=address',
                          prefix: '#include <sanitizer/asan_interface.h>')
tests/qtest/fdc-test.c +1 -1
index 5e8fbda9df..8645b080f7 100644
@@ -552,7 +552,7 @@ static bool qtest_check_clang_sanitizer(void)
 #ifdef QEMU_SANITIZE_ADDRESS
     return true;
 #else
-    g_test_skip("QEMU not configured using --enable-sanitizers");
+    g_test_skip("QEMU not configured using --enable-asan");
     return false;
 #endif
 }
.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml +1 -1
index 263a3c2140..ca2f140471 100644
@@ -103,7 +103,7 @@ ubuntu-22.04-aarch64-clang:
  script:
  - mkdir build
  - cd build
- - ../configure --disable-libssh --cc=clang --cxx=clang++ --enable-sanitizers
+ - ../configure --disable-libssh --cc=clang --cxx=clang++ --enable-ubsan
    || { cat config.log meson-logs/meson-log.txt; exit 1; }
  - make --output-sync -j`nproc --ignore=40`
  - make --output-sync -j`nproc --ignore=40` check
.gitlab-ci.d/custom-runners/ubuntu-22.04-s390x.yml +1 -1
index 69ddd3e7d5..ca374acb8c 100644
@@ -80,7 +80,7 @@ ubuntu-22.04-s390x-clang:
  script:
  - mkdir build
  - cd build
- - ../configure --cc=clang --cxx=clang++ --enable-sanitizers
+ - ../configure --cc=clang --cxx=clang++ --enable-ubsan
    || { cat config.log meson-logs/meson-log.txt; exit 1; }
  - make --output-sync -j`nproc`
  - make --output-sync -j`nproc` check
meson_options.txt +4 -2
index 0269fa0f16..98615c3c4e 100644
@@ -91,8 +91,10 @@ option('tcg_interpreter', type: 'boolean', value: false,
        description: 'TCG with bytecode interpreter (slow)')
 option('safe_stack', type: 'boolean', value: false,
        description: 'SafeStack Stack Smash Protection (requires clang/llvm and coroutine backend ucontext)')
-option('sanitizers', type: 'boolean', value: false,
-       description: 'enable default sanitizers')
+option('asan', type: 'boolean', value: false,
+       description: 'enable address sanitizer')
+option('ubsan', type: 'boolean', value: false,
+       description: 'enable undefined behaviour sanitizer')
 option('tsan', type: 'boolean', value: false,
        description: 'enable thread sanitizer')
 option('stack_protector', type: 'feature', value: 'auto',
scripts/meson-buildoptions.sh +6 -3
index c97079a38c..a6ee2d9c01 100644
@@ -21,6 +21,7 @@ meson_options_help() {
   printf "%s\n" '  --disable-relocatable    toggle relocatable install'
   printf "%s\n" '  --docdir=VALUE           Base directory for documentation installation'
   printf "%s\n" '                           (can be empty) [share/doc]'
+  printf "%s\n" '  --enable-asan            enable address sanitizer'
   printf "%s\n" '  --enable-block-drv-whitelist-in-tools'
   printf "%s\n" '                           use block whitelist also in tools instead of only'
   printf "%s\n" '                           QEMU'
@@ -46,13 +47,13 @@ meson_options_help() {
   printf "%s\n" '                           getrandom()'
   printf "%s\n" '  --enable-safe-stack      SafeStack Stack Smash Protection (requires'
   printf "%s\n" '                           clang/llvm and coroutine backend ucontext)'
-  printf "%s\n" '  --enable-sanitizers      enable default sanitizers'
   printf "%s\n" '  --enable-strip           Strip targets on install'
   printf "%s\n" '  --enable-tcg-interpreter TCG with bytecode interpreter (slow)'
   printf "%s\n" '  --enable-trace-backends=CHOICES'
   printf "%s\n" '                           Set available tracing backends [log] (choices:'
   printf "%s\n" '                           dtrace/ftrace/log/nop/simple/syslog/ust)'
   printf "%s\n" '  --enable-tsan            enable thread sanitizer'
+  printf "%s\n" '  --enable-ubsan           enable undefined behaviour sanitizer'
   printf "%s\n" '  --firmwarepath=VALUES    search PATH for firmware files [share/qemu-'
   printf "%s\n" '                           firmware]'
   printf "%s\n" '  --iasl=VALUE             Path to ACPI disassembler'
@@ -230,6 +231,8 @@ _meson_option_parse() {
     --disable-af-xdp) printf "%s" -Daf_xdp=disabled ;;
     --enable-alsa) printf "%s" -Dalsa=enabled ;;
     --disable-alsa) printf "%s" -Dalsa=disabled ;;
+    --enable-asan) printf "%s" -Dasan=true ;;
+    --disable-asan) printf "%s" -Dasan=false ;;
     --enable-attr) printf "%s" -Dattr=enabled ;;
     --disable-attr) printf "%s" -Dattr=disabled ;;
     --audio-drv-list=*) quote_sh "-Daudio_drv_list=$2" ;;
@@ -456,8 +459,6 @@ _meson_option_parse() {
     --disable-rutabaga-gfx) printf "%s" -Drutabaga_gfx=disabled ;;
     --enable-safe-stack) printf "%s" -Dsafe_stack=true ;;
     --disable-safe-stack) printf "%s" -Dsafe_stack=false ;;
-    --enable-sanitizers) printf "%s" -Dsanitizers=true ;;
-    --disable-sanitizers) printf "%s" -Dsanitizers=false ;;
     --enable-sdl) printf "%s" -Dsdl=enabled ;;
     --disable-sdl) printf "%s" -Dsdl=disabled ;;
     --enable-sdl-image) printf "%s" -Dsdl_image=enabled ;;
@@ -505,6 +506,8 @@ _meson_option_parse() {
     --disable-u2f) printf "%s" -Du2f=disabled ;;
     --enable-uadk) printf "%s" -Duadk=enabled ;;
     --disable-uadk) printf "%s" -Duadk=disabled ;;
+    --enable-ubsan) printf "%s" -Dubsan=true ;;
+    --disable-ubsan) printf "%s" -Dubsan=false ;;
     --enable-usb-redir) printf "%s" -Dusb_redir=enabled ;;
     --disable-usb-redir) printf "%s" -Dusb_redir=disabled ;;
     --enable-vde) printf "%s" -Dvde=enabled ;;
tests/docker/test-debug +2 -2
index f52f16328c..678ceccc27 100755
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Compile and check with clang & --enable-debug --enable-sanitizers.
+# Compile and check with clang & debug & sanitizers
 #
 # Copyright (c) 2016-2018 Red Hat Inc.
 #
@@ -19,7 +19,7 @@ requires_binary clang
 cd "$BUILD_DIR"
 
 OPTS="--cxx=clang++ --cc=clang --host-cc=clang"
-OPTS="--enable-debug --enable-sanitizers $OPTS"
+OPTS="--enable-debug --enable-asan --enable-ubsan $OPTS"
 
 export ASAN_OPTIONS=detect_leaks=0
 build_qemu $OPTS
Signature · 1 line
2.46.0
#2 lore raw

[PULL 09/22] tests/functional: Convert mips64el Fuloong2e avocado test (2/2)

In reply to Thomas Huth

From: Philippe Mathieu-Daudé <[email protected]>

Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays.

Message-ID: <[email protected]> [thuth: Use LinuxKernelTest class for this test]
Message-ID: <[email protected]>

---
 tests/avocado/boot_linux_console.py         | 21 -----------------
 tests/functional/test_mips64el_fuloong2e.py | 25 ++++++++++++++++++---
 2 files changed, 22 insertions(+), 24 deletions(-)
tests/avocado/boot_linux_console.py +0 -21
index 396836bf64..e1e20c36f7 100644
@@ -170,27 +170,6 @@ def test_mips64el_malta(self):
         console_pattern = 'Kernel command line: %s' % kernel_command_line
         self.wait_for_console_pattern(console_pattern)
 
-    def test_mips64el_fuloong2e(self):
-        """
-        :avocado: tags=arch:mips64el
-        :avocado: tags=machine:fuloong2e
-        :avocado: tags=endian:little
-        """
-        deb_url = ('http://archive.debian.org/debian/pool/main/l/linux/'
-                   'linux-image-3.16.0-6-loongson-2e_3.16.56-1+deb8u1_mipsel.deb')
-        deb_hash = 'd04d446045deecf7b755ef576551de0c4184dd44'
-        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
-        kernel_path = self.extract_from_deb(deb_path,
-                                            '/boot/vmlinux-3.16.0-6-loongson-2e')
-
-        self.vm.set_console()
-        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
-        self.vm.add_args('-kernel', kernel_path,
-                         '-append', kernel_command_line)
-        self.vm.launch()
-        console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
-
     def test_mips_malta_cpio(self):
         """
         :avocado: tags=arch:mips
tests/functional/test_mips64el_fuloong2e.py +22 -3
index 7688a32713..a32d5f9d08 100755
@@ -12,14 +12,33 @@
 import os
 import subprocess
 
-from qemu_test import QemuSystemTest
+from qemu_test import LinuxKernelTest, Asset
 from qemu_test import wait_for_console_pattern
 from unittest import skipUnless
 
-class MipsFuloong2e(QemuSystemTest):
+class MipsFuloong2e(LinuxKernelTest):
 
     timeout = 60
 
+    ASSET_KERNEL = Asset(
+        ('http://archive.debian.org/debian/pool/main/l/linux/'
+         'linux-image-3.16.0-6-loongson-2e_3.16.56-1+deb8u1_mipsel.deb'),
+        '2a70f15b397f4ced632b0c15cb22660394190644146d804d60a4796eefbe1f50')
+
+    def test_linux_kernel_3_16(self):
+        deb_path = self.ASSET_KERNEL.fetch()
+        kernel_path = self.extract_from_deb(deb_path,
+                                            '/boot/vmlinux-3.16.0-6-loongson-2e')
+
+        self.set_machine('fuloong2e')
+        self.vm.set_console()
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
+        self.vm.add_args('-kernel', kernel_path,
+                         '-append', kernel_command_line)
+        self.vm.launch()
+        console_pattern = 'Kernel command line: %s' % kernel_command_line
+        self.wait_for_console_pattern(console_pattern)
+
     @skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
     @skipUnless(os.getenv('RESCUE_YL_PATH'), 'RESCUE_YL_PATH not available')
     def test_linux_kernel_2_6_27_isa_serial(self):
@@ -42,4 +61,4 @@ def test_linux_kernel_2_6_27_isa_serial(self):
 
 
 if __name__ == '__main__':
-    QemuSystemTest.main()
+    LinuxKernelTest.main()
Signature · 1 line
2.46.0
#3 lore raw

[PULL 10/22] tests/functional: Convert mips64el I6400 Malta avocado tests

In reply to Thomas Huth

From: Philippe Mathieu-Daudé <[email protected]>

Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays.

Message-ID: <[email protected]>

Message-ID: <[email protected]>

---
 MAINTAINERS                             |   1 +
 tests/avocado/machine_mips_malta.py     | 108 ------------------------
 tests/functional/meson.build            |   1 +
 tests/functional/test_mips64el_malta.py | 108 ++++++++++++++++++++++++
 4 files changed, 110 insertions(+), 108 deletions(-)
 create mode 100755 tests/functional/test_mips64el_malta.py
MAINTAINERS +1 -0
index a25022a77a..dcf3823169 100644
@@ -1371,6 +1371,7 @@ F: hw/pci-host/gt64120.c
 F: include/hw/southbridge/piix.h
 F: tests/avocado/linux_ssh_mips_malta.py
 F: tests/avocado/machine_mips_malta.py
+F: tests/functional/test_mips64el_malta.py
 
 Mipssim
 R: Aleksandar Rikalo <[email protected]>
tests/avocado/machine_mips_malta.py +0 -108

121 lines not on this page · raw message

tests/functional/meson.build +1 -0
index c6bb345d2c..9baf903e39 100644
@@ -75,6 +75,7 @@ tests_mips64el_system_quick = [
 
 tests_mips64el_system_thorough = [
   'mips64el_loongson3v',
+  'mips64el_malta',
 ]
 
 tests_ppc_system_quick = [
tests/functional/test_mips64el_malta.py new file +108 -0

108 lines not on this page · raw message

Signature · 1 line
2.46.0
#4 lore raw

[PULL 15/22] tests/functional: Convert ARM Raspi2 avocado tests

In reply to Thomas Huth

From: Philippe Mathieu-Daudé <[email protected]>

Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays.

Message-ID: <[email protected]> [thuth: Use LinuxKernelTest class]
Message-ID: <[email protected]>

---
 MAINTAINERS                         |  1 +
 tests/avocado/boot_linux_console.py | 85 --------------------------
 tests/functional/meson.build        |  1 +
 tests/functional/test_arm_raspi2.py | 95 +++++++++++++++++++++++++++++
 4 files changed, 97 insertions(+), 85 deletions(-)
 create mode 100755 tests/functional/test_arm_raspi2.py
MAINTAINERS +1 -0
index 6e0044ab58..3cc9c19d02 100644
@@ -911,6 +911,7 @@ F: hw/*/bcm283*
 F: include/hw/arm/rasp*
 F: include/hw/*/bcm283*
 F: docs/system/arm/raspi.rst
+F: tests/functional/test_arm_raspi2.py
 
 Real View
 M: Peter Maydell <[email protected]>
tests/avocado/boot_linux_console.py +0 -85

91 lines not on this page · raw message

tests/functional/meson.build +1 -0
index eb2de2a8fd..ff3fe7981e 100644
@@ -42,6 +42,7 @@ tests_aarch64_system_thorough = [
 tests_arm_system_thorough = [
   'arm_canona1100',
   'arm_integratorcp',
+  'arm_raspi2',
 ]
 
 tests_arm_linuxuser_thorough = [
tests/functional/test_arm_raspi2.py new file +95 -0

95 lines not on this page · raw message

Signature · 1 line
2.46.0
#5 lore raw

[PULL 08/22] tests/functional: Convert the m68k Q800 Avocado test into a functional test

In reply to Thomas Huth

Just had to update the asset checksum to use SHA256 instead of SHA1, but apart from that it is a pretty much straightforward conversion.

Message-ID: <[email protected]>

---
 MAINTAINERS                         |  1 +
 tests/avocado/boot_linux_console.py | 24 -------------------
 tests/functional/meson.build        |  3 ++-
 tests/functional/test_m68k_q800.py  | 37 +++++++++++++++++++++++++++++
 4 files changed, 40 insertions(+), 25 deletions(-)
 create mode 100755 tests/functional/test_m68k_q800.py
MAINTAINERS +1 -0
index 822f89847b..a25022a77a 100644
@@ -1310,6 +1310,7 @@ F: include/hw/m68k/q800-glue.h
 F: include/hw/misc/djmemc.h
 F: include/hw/misc/iosb.h
 F: include/hw/audio/asc.h
+F: tests/functional/test_m68k_q800.py
 
 virt
 M: Laurent Vivier <[email protected]>
tests/avocado/boot_linux_console.py +0 -24
index 18c69d6acc..396836bf64 100644
@@ -1325,30 +1325,6 @@ def test_alpha_clipper(self):
         console_pattern = 'Kernel command line: %s' % kernel_command_line
         self.wait_for_console_pattern(console_pattern)
 
-    def test_m68k_q800(self):
-        """
-        :avocado: tags=arch:m68k
-        :avocado: tags=machine:q800
-        """
-        deb_url = ('https://snapshot.debian.org/archive/debian-ports'
-                   '/20191021T083923Z/pool-m68k/main'
-                   '/l/linux/kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb')
-        deb_hash = '044954bb9be4160a3ce81f8bc1b5e856b75cccd1'
-        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
-        kernel_path = self.extract_from_deb(deb_path,
-                                            '/boot/vmlinux-5.3.0-1-m68k')
-
-        self.vm.set_console()
-        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
-                               'console=ttyS0 vga=off')
-        self.vm.add_args('-kernel', kernel_path,
-                         '-append', kernel_command_line)
-        self.vm.launch()
-        console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
-        console_pattern = 'No filesystem could mount root'
-        self.wait_for_console_pattern(console_pattern)
-
     def do_test_advcal_2018(self, day, tar_hash, kernel_name, console=0):
         tar_url = ('https://qemu-advcal.gitlab.io'
                    '/qac-best-of-multiarch/download/day' + day + '.tar.xz')
tests/functional/meson.build +2 -1
index cda89c4b0c..c6bb345d2c 100644
@@ -57,7 +57,8 @@ tests_loongarch64_system_thorough = [
 ]
 
 tests_m68k_system_thorough = [
-  'm68k_nextcube'
+  'm68k_nextcube',
+  'm68k_q800',
 ]
 
 tests_microblaze_system_thorough = [
tests/functional/test_m68k_q800.py new file +37 -0
new file mode 100755
index 0000000000..3b17244b98
@@ -0,0 +1,37 @@
+#!/usr/bin/env python3
+#
+# Functional test for testing the q800 m68k machine
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or
+# later.  See the COPYING file in the top-level directory.
+
+from qemu_test import LinuxKernelTest, Asset
+
+class Q800MachineTest(LinuxKernelTest):
+
+    ASSET_KERNEL = Asset(
+        ('https://snapshot.debian.org/'
+         'archive/debian-ports/20191021T083923Z/pool-m68k/main/l/linux/'
+         'kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb'),
+        '949e50d74d4b9bc15d26c06d402717b7a4c0e32ff8100014f5930d8024de7b73')
+
+    def test_m68k_q800(self):
+        self.set_machine('q800')
+
+        deb_path = self.ASSET_KERNEL.fetch()
+        kernel_path = self.extract_from_deb(deb_path,
+                                            '/boot/vmlinux-5.3.0-1-m68k')
+
+        self.vm.set_console()
+        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
+                               'console=ttyS0 vga=off')
+        self.vm.add_args('-kernel', kernel_path,
+                         '-append', kernel_command_line)
+        self.vm.launch()
+        console_pattern = 'Kernel command line: %s' % kernel_command_line
+        self.wait_for_console_pattern(console_pattern)
+        console_pattern = 'No filesystem could mount root'
+        self.wait_for_console_pattern(console_pattern)
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
Signature · 1 line
2.46.0
#6 lore raw

[PULL 13/22] tests/functional: Convert nanomips Malta avocado tests

In reply to Thomas Huth

From: Philippe Mathieu-Daudé <[email protected]>

Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays.

  $ QEMU_TEST_ALLOW_UNTRUSTED_CODE=1 \
        make check-functional-mipsel
  ...
  ▶ 4/4 test_mipsel_malta.MaltaMachineConsole.test_mips_malta32el_nanomips_16k_up   OK
  ▶ 4/4 test_mipsel_malta.MaltaMachineConsole.test_mips_malta32el_nanomips_4k       OK
  ▶ 4/4 test_mipsel_malta.MaltaMachineConsole.test_mips_malta32el_nanomips_64k_dbg  OK
  ▶ 4/4 test_mipsel_malta.MaltaMachineYAMON.test_mipsel_malta_yamon                 OK
  4/4 qemu:func-thorough+func-mipsel-thorough+thorough / func-mipsel-mipsel_malta   OK   9.95s   4 subtests passed

Message-ID: <[email protected]> [thuth: Use LinuxKernelTest]
Message-ID: <[email protected]>

---
 tests/avocado/boot_linux_console.py   | 59 ---------------------------
 tests/functional/test_mipsel_malta.py | 51 ++++++++++++++++++++++-
 2 files changed, 50 insertions(+), 60 deletions(-)
tests/avocado/boot_linux_console.py +0 -59
index 84b31cb84e..34f4abadd0 100644
@@ -179,65 +179,6 @@ def test_mips_malta_cpio(self):
         # Wait for VM to shut down gracefully
         self.vm.wait()
 
-    def do_test_mips_malta32el_nanomips(self, kernel_path_xz):
-        kernel_path = self.workdir + "kernel"
-        with lzma.open(kernel_path_xz, 'rb') as f_in:
-            with open(kernel_path, 'wb') as f_out:
-                shutil.copyfileobj(f_in, f_out)
-
-        self.vm.set_console()
-        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
-                               + 'mem=256m@@0x0 '
-                               + 'console=ttyS0')
-        self.vm.add_args('-no-reboot',
-                         '-kernel', kernel_path,
-                         '-append', kernel_command_line)
-        self.vm.launch()
-        console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
-
-    def test_mips_malta32el_nanomips_4k(self):
-        """
-        :avocado: tags=arch:mipsel
-        :avocado: tags=machine:malta
-        :avocado: tags=endian:little
-        :avocado: tags=cpu:I7200
-        """
-        kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/'
-                      'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
-                      'generic_nano32r6el_page4k.xz')
-        kernel_hash = '477456aafd2a0f1ddc9482727f20fe9575565dd6'
-        kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
-        self.do_test_mips_malta32el_nanomips(kernel_path_xz)
-
-    def test_mips_malta32el_nanomips_16k_up(self):
-        """
-        :avocado: tags=arch:mipsel
-        :avocado: tags=machine:malta
-        :avocado: tags=endian:little
-        :avocado: tags=cpu:I7200
-        """
-        kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/'
-                      'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
-                      'generic_nano32r6el_page16k_up.xz')
-        kernel_hash = 'e882868f944c71c816e832e2303b7874d044a7bc'
-        kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
-        self.do_test_mips_malta32el_nanomips(kernel_path_xz)
-
-    def test_mips_malta32el_nanomips_64k_dbg(self):
-        """
-        :avocado: tags=arch:mipsel
-        :avocado: tags=machine:malta
-        :avocado: tags=endian:little
-        :avocado: tags=cpu:I7200
-        """
-        kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/'
-                      'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
-                      'generic_nano32r6el_page64k_dbg.xz')
-        kernel_hash = '18d1c68f2e23429e266ca39ba5349ccd0aeb7180'
-        kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
-        self.do_test_mips_malta32el_nanomips(kernel_path_xz)
-
     def test_aarch64_xlnx_versal_virt(self):
         """
         :avocado: tags=arch:aarch64
tests/functional/test_mipsel_malta.py +50 -1

62 lines not on this page · raw message

Signature · 1 line
2.46.0
#7 lore raw

[PULL 03/22] gitlab-ci: Build MSYS2 job using multiple CPUs

In reply to Thomas Huth

From: Philippe Mathieu-Daudé <[email protected]>

Message-ID: <[email protected]>

---
 .gitlab-ci.d/windows.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
.gitlab-ci.d/windows.yml +2 -1
index 759e9a76b5..45ed0c96fe 100644
@@ -88,6 +88,7 @@ msys2-64bit:
       mingw-w64-x86_64-python
       mingw-w64-x86_64-zstd"
   - Write-Output "Running build at $(Get-Date -Format u)"
+  - $env:JOBS = $(.\msys64\usr\bin\bash -lc nproc)
   - $env:CHERE_INVOKING = 'yes'  # Preserve the current working directory
   - $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink
   - $env:CCACHE_BASEDIR = "$env:CI_PROJECT_DIR"
@@ -99,7 +100,7 @@ msys2-64bit:
   - cd build
   - ..\msys64\usr\bin\bash -lc "ccache --zero-stats"
   - ..\msys64\usr\bin\bash -lc "../configure $CONFIGURE_ARGS"
-  - ..\msys64\usr\bin\bash -lc "make"
+  - ..\msys64\usr\bin\bash -lc "make -j$env:JOBS"
   - ..\msys64\usr\bin\bash -lc "make check MTESTARGS='$TEST_ARGS' || { cat meson-logs/testlog.txt; exit 1; } ;"
   - ..\msys64\usr\bin\bash -lc "ccache --show-stats"
   - Write-Output "Finished build at $(Get-Date -Format u)"
Signature · 1 line
2.46.0
#8 lore raw

[PULL 05/22] MAINTAINERS: Remove myself as reviewer

In reply to Thomas Huth

From: Beraldo Leal <[email protected]>

Finally taking this off my to-do list. It’s been a privilege to be part of this project, but I am no longer actively involved in reviewing Python code here, so I believe it's best to update the list to reflect the current maintainers.

Please, feel free to reach out if any questions arise.

Message-ID: <[email protected]>

---
 MAINTAINERS | 3 ---
 1 file changed, 3 deletions(-)
MAINTAINERS +0 -3
index 0c1bc69828..8c7358fd5b 100644
@@ -3188,7 +3188,6 @@ F: qapi/cryptodev.json
 Python library
 M: John Snow <[email protected]>
 M: Cleber Rosa <[email protected]>
-R: Beraldo Leal <[email protected]>
 S: Maintained
 F: python/
 T: git https://gitlab.com/jsnow/qemu.git python
@@ -4135,7 +4134,6 @@ M: Alex Bennée <[email protected]>
 M: Philippe Mathieu-Daudé <[email protected]>
 M: Thomas Huth <[email protected]>
 R: Wainer dos Santos Moschetta <[email protected]>
-R: Beraldo Leal <[email protected]>
 S: Maintained
 F: .github/workflows/lockdown.yml
 F: .gitlab-ci.yml
@@ -4181,7 +4179,6 @@ W: https://trello.com/b/6Qi1pxVn/avocado-qemu
 R: Cleber Rosa <[email protected]>
 R: Philippe Mathieu-Daudé <[email protected]>
 R: Wainer dos Santos Moschetta <[email protected]>
-R: Beraldo Leal <[email protected]>
 S: Odd Fixes
 F: tests/avocado/
 
Signature · 1 line
2.46.0
#9 lore raw

[PULL 17/22] tests/functional: Convert Aarch64 Raspi4 avocado tests

In reply to Thomas Huth

From: Philippe Mathieu-Daudé <[email protected]>

Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays.

Message-ID: <[email protected]> [thuth: Use LinuxKernelTest class]
Message-ID: <[email protected]>

---
 MAINTAINERS                             |  1 +
 tests/avocado/boot_linux_console.py     | 97 ------------------------
 tests/functional/meson.build            |  1 +
 tests/functional/test_aarch64_raspi4.py | 99 +++++++++++++++++++++++++
 4 files changed, 101 insertions(+), 97 deletions(-)
 create mode 100755 tests/functional/test_aarch64_raspi4.py
MAINTAINERS +1 -0
index 828c469478..c59f7b2538 100644
@@ -913,6 +913,7 @@ F: include/hw/*/bcm283*
 F: docs/system/arm/raspi.rst
 F: tests/functional/test_arm_raspi2.py
 F: tests/functional/test_aarch64_raspi3.py
+F: tests/functional/test_aarch64_raspi4.py
 
 Real View
 M: Peter Maydell <[email protected]>
tests/avocado/boot_linux_console.py +0 -97

103 lines not on this page · raw message

tests/functional/meson.build +1 -0
index 35eebbe9b9..a79083b0f9 100644
@@ -36,6 +36,7 @@ tests_generic_bsduser = [
 
 tests_aarch64_system_thorough = [
   'aarch64_raspi3',
+  'aarch64_raspi4',
   'aarch64_sbsaref',
   'aarch64_virt',
 ]
tests/functional/test_aarch64_raspi4.py new file +99 -0

99 lines not on this page · raw message

Signature · 1 line
2.46.0
#10 lore raw

[PULL 06/22] MAINTAINERS: Remove myself from the Meson section

In reply to Thomas Huth

The Meson section has plenty of reviewers, and in order to reduce the load on my Inbox a little bit, I'm stepping back as a reviewer here.

Message-ID: <[email protected]>

---
 MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)
MAINTAINERS +0 -1
index 8c7358fd5b..822f89847b 100644
@@ -4212,7 +4212,6 @@ Meson
 M: Paolo Bonzini <[email protected]>
 R: Marc-André Lureau <[email protected]>
 R: Daniel P. Berrange <[email protected]>
-R: Thomas Huth <[email protected]>
 R: Philippe Mathieu-Daudé <[email protected]>
 S: Maintained
 F: meson.build
Signature · 1 line
2.46.0
#11 lore raw

[PULL 19/22] tests/functional: Convert the m68k MCF5208EVB Avocado test

In reply to Thomas Huth

We've got to do_test_advcal_2018() here now that the test resides in a separate file. Also switch back to the original URL (since the site did not vanish as originally expected) and update the hashsum to use SHA256.

Message-ID: <[email protected]>

---
 tests/avocado/boot_linux_console.py      |  8 -------
 tests/functional/meson.build             |  1 +
 tests/functional/test_m68k_mcf5208evb.py | 29 ++++++++++++++++++++++++
 3 files changed, 30 insertions(+), 8 deletions(-)
 create mode 100755 tests/functional/test_m68k_mcf5208evb.py
tests/avocado/boot_linux_console.py +0 -8
index 75aab90320..db72bd1b5e 100644
@@ -927,14 +927,6 @@ def test_arm_ast2600_debian(self):
         self.wait_for_console_pattern("SMP: Total of 2 processors activated")
         self.wait_for_console_pattern("No filesystem could mount root")
 
-    def test_m68k_mcf5208evb(self):
-        """
-        :avocado: tags=arch:m68k
-        :avocado: tags=machine:mcf5208evb
-        """
-        tar_hash = 'ac688fd00561a2b6ce1359f9ff6aa2b98c9a570c'
-        self.do_test_advcal_2018('07', tar_hash, 'sanity-clause.elf')
-
     def test_or1k_sim(self):
         """
         :avocado: tags=arch:or1k
tests/functional/meson.build +1 -0
index e1903132a1..8f9694244f 100644
@@ -64,6 +64,7 @@ tests_loongarch64_system_thorough = [
 ]
 
 tests_m68k_system_thorough = [
+  'm68k_mcf5208evb',
   'm68k_nextcube',
   'm68k_q800',
 ]
tests/functional/test_m68k_mcf5208evb.py new file +29 -0
new file mode 100755
index 0000000000..869ccc88df
@@ -0,0 +1,29 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a Linux kernel on an MCF5208EVB machine
+# and checks the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import os
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import archive_extract
+
+class Mcf5208EvbTest(LinuxKernelTest):
+
+    ASSET_DAY07 = Asset(
+        'https://www.qemu-advent-calendar.org/2018/download/day07.tar.xz',
+        '753c2f3837126b7c6ba92d0b1e0b156e8a2c5131d2d576bb0b9a763fae73c08a')
+
+    def test_m68k_mcf5208evb(self):
+        self.set_machine('mcf5208evb')
+        file_path = self.ASSET_DAY07.fetch()
+        archive_extract(file_path, self.workdir)
+        self.vm.set_console()
+        self.vm.add_args('-kernel', self.workdir + '/day07/sanity-clause.elf')
+        self.vm.launch()
+        self.wait_for_console_pattern('QEMU advent calendar')
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
Signature · 1 line
2.46.0
#12 lore raw

[PULL 14/22] tests/functional: Convert mips32eb 4Kc Malta avocado tests

In reply to Thomas Huth

From: Philippe Mathieu-Daudé <[email protected]>

Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays.

Message-ID: <[email protected]> [thuth: Use LinuxKernelTest class]
Message-ID: <[email protected]>

---
 MAINTAINERS                         |  1 +
 tests/avocado/boot_linux_console.py | 63 ----------------------
 tests/functional/meson.build        |  4 ++
 tests/functional/test_mips_malta.py | 81 +++++++++++++++++++++++++++++
 4 files changed, 86 insertions(+), 63 deletions(-)
 create mode 100755 tests/functional/test_mips_malta.py
MAINTAINERS +1 -0
index 2f76098230..6e0044ab58 100644
@@ -1370,6 +1370,7 @@ F: hw/mips/malta.c
 F: hw/pci-host/gt64120.c
 F: include/hw/southbridge/piix.h
 F: tests/avocado/linux_ssh_mips_malta.py
+F: tests/functional/test_mips_malta.py
 F: tests/functional/test_mipsel_malta.py
 F: tests/functional/test_mips64el_malta.py
 
tests/avocado/boot_linux_console.py +0 -63

69 lines not on this page · raw message

tests/functional/meson.build +4 -0
index daee61ec3c..eb2de2a8fd 100644
@@ -69,6 +69,10 @@ tests_microblazeel_system_thorough = [
   'microblazeel_s3adsp1800'
 ]
 
+tests_mips_system_thorough = [
+  'mips_malta',
+]
+
 tests_mipsel_system_thorough = [
   'mipsel_malta',
 ]
tests/functional/test_mips_malta.py new file +81 -0

81 lines not on this page · raw message

Signature · 1 line
2.46.0
#13 lore raw

[PULL 04/22] contrib/plugins/Makefile: Add a 'distclean' target

In reply to Thomas Huth

Running "make distclean" in the build tree currently fails since this tries to run the "distclean" target in the contrib/plugins/ folder, too, but the Makefile there is missing this target. Thus add 'distclean' there to fix this issue.

And to avoid regressions with "make distclean", add this command to one of the build jobs, too.

Message-ID: <[email protected]>

---
 .gitlab-ci.d/buildtest.yml | 2 ++
 contrib/plugins/Makefile   | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
.gitlab-ci.d/buildtest.yml +2 -0
index 9ac0776b94..98bac9e2c8 100644
@@ -345,6 +345,8 @@ build-tcg-disabled:
             124 132 139 142 144 145 151 152 155 157 165 194 196 200 202
             208 209 216 218 227 234 246 247 248 250 254 255 257 258
             260 261 262 263 264 270 272 273 277 279 image-fleecing
+    - cd ../..
+    - make distclean
 
 build-user:
   extends: .native_build_job_template
contrib/plugins/Makefile +1 -1
index edf256cd9d..05a2a45c5c 100644
@@ -77,7 +77,7 @@ lib%$(SO_SUFFIX): %.o
 endif
 
 
-clean:
+clean distclean:
 	rm -f *.o *$(SO_SUFFIX) *.d
 	rm -Rf .libs
 
Signature · 1 line
2.46.0
#0 lore raw

The following changes since commit 7bbadc60b58b742494555f06cd342311ddab9351:

Merge tag 'crypto-fixes-pull-request' of https://gitlab.com/berrange/qemu into staging (2024-09-09 15:19:32 +0100)

are available in the Git repository at:

https://gitlab.com/thuth/qemu.git tags/pull-request-2024-09-10

for you to fetch changes up to cc3e005eb22332ba277bff2e39025d0087f3795e:

tests/functional: Fix bad usage of has_cmd (2024-09-10 13:44:42 +0200)

----------------------------------------------------------------
* Split --enable-sanitizers to --enable-{asan, ubsan}
* Build MSYS2 job using multiple CPUs
* Fix "make distclean" wrt contrib/plugins/
* Convert more Avocado tests to plain standalone functional tests
* Fix bug that breaks "make check-functional" when tesseract is missing

----------------------------------------------------------------
Beraldo Leal (1):
MAINTAINERS: Remove myself as reviewer

Philippe Mathieu-Daudé (10):
gitlab-ci: Build MSYS2 job using multiple CPUs tests/functional: Convert mips64el Fuloong2e avocado test (2/2) tests/functional: Convert mips64el I6400 Malta avocado tests tests/functional: Convert mips64el 5KEc Malta avocado tests tests/functional: Convert mips32el Malta YAMON avocado test tests/functional: Convert nanomips Malta avocado tests tests/functional: Convert mips32eb 4Kc Malta avocado tests tests/functional: Convert ARM Raspi2 avocado tests tests/functional: Convert Aarch64 Raspi3 avocado tests tests/functional: Convert Aarch64 Raspi4 avocado tests

Richard Henderson (2):
meson: Split --enable-sanitizers to --enable-{asan, ubsan}
meson: Move -fsanitize=undefined into normal configuraton

Thomas Huth (9):
contrib/plugins/Makefile: Add a 'distclean' target
MAINTAINERS: Remove myself from the Meson section tests/functional: Add the LinuxKernelTest for testing the Linux boot process tests/functional: Convert the m68k Q800 Avocado test into a functional test tests/functional: Convert the Alpha Clipper Avocado test tests/functional: Convert the m68k MCF5208EVB Avocado test tests/functional: Convert the or1k-sim Avocado test tests/functional: Convert the multiprocess avocado test into a standalone test tests/functional: Fix bad usage of has_cmd

 MAINTAINERS                                        |  12 +-
 docs/devel/testing/fuzzing.rst                     |   4 +-
 meson.build                                        |  26 +-
 tests/qtest/fdc-test.c                             |   2 +-
 .gitlab-ci.d/buildtest.yml                         |  12 +-
 .../custom-runners/ubuntu-22.04-aarch64.yml        |   2 +-
 .gitlab-ci.d/custom-runners/ubuntu-22.04-s390x.yml |   2 +-
 .gitlab-ci.d/windows.yml                           |   3 +-
 contrib/plugins/Makefile                           |   2 +-
 meson_options.txt                                  |   6 +-
 scripts/meson-buildoptions.sh                      |   9 +-
 tests/avocado/avocado_qemu/__init__.py             |  10 -
 tests/avocado/boot_linux_console.py                | 483 ---------------------
 tests/avocado/machine_mips_malta.py                | 162 -------
 tests/avocado/multiprocess.py                      | 102 -----
 tests/docker/test-debug                            |   4 +-
 tests/functional/meson.build                       |  26 +-
 tests/functional/qemu_test/__init__.py             |   1 +
 tests/functional/qemu_test/cmd.py                  |   6 +-
 tests/functional/qemu_test/linuxkernel.py          |  41 ++
 tests/functional/qemu_test/tesseract.py            |   3 +-
 tests/functional/test_aarch64_raspi3.py            |  41 ++
 tests/functional/test_aarch64_raspi4.py            |  99 +++++
 tests/functional/test_alpha_clipper.py             |  38 ++
 tests/functional/test_arm_raspi2.py                |  95 ++++
 tests/functional/test_m68k_mcf5208evb.py           |  29 ++
 tests/functional/test_m68k_q800.py                 |  37 ++
 tests/functional/test_mips64el_fuloong2e.py        |  25 +-
 tests/functional/test_mips64el_malta.py            | 186 ++++++++
 tests/functional/test_mips_malta.py                |  81 ++++
 tests/functional/test_mipsel_malta.py              |  96 ++++
 tests/functional/test_multiprocess.py              | 100 +++++
 tests/functional/test_or1k_sim.py                  |  29 ++
 33 files changed, 978 insertions(+), 796 deletions(-)
 delete mode 100644 tests/avocado/machine_mips_malta.py
 delete mode 100644 tests/avocado/multiprocess.py
 create mode 100644 tests/functional/qemu_test/linuxkernel.py
 create mode 100755 tests/functional/test_aarch64_raspi3.py
 create mode 100755 tests/functional/test_aarch64_raspi4.py
 create mode 100755 tests/functional/test_alpha_clipper.py
 create mode 100755 tests/functional/test_arm_raspi2.py
 create mode 100755 tests/functional/test_m68k_mcf5208evb.py
 create mode 100755 tests/functional/test_m68k_q800.py
 create mode 100755 tests/functional/test_mips64el_malta.py
 create mode 100755 tests/functional/test_mips_malta.py
 create mode 100755 tests/functional/test_mipsel_malta.py
 create mode 100755 tests/functional/test_multiprocess.py
 create mode 100755 tests/functional/test_or1k_sim.py
#14 lore raw

[PULL 18/22] tests/functional: Convert the Alpha Clipper Avocado test

Straight forward conversion, just switch to SHA256 hashsum now.

Message-ID: <[email protected]>

---
 tests/avocado/boot_linux_console.py    | 21 --------------
 tests/functional/meson.build           |  4 +++
 tests/functional/test_alpha_clipper.py | 38 ++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 21 deletions(-)
 create mode 100755 tests/functional/test_alpha_clipper.py
tests/avocado/boot_linux_console.py +0 -21
index a8eac44d9f..75aab90320 100644
@@ -882,27 +882,6 @@ def test_arm_orangepi_uboot_netbsd9(self):
         # Wait for user-space
         wait_for_console_pattern(self, 'Starting root file system check')
 
-    def test_alpha_clipper(self):
-        """
-        :avocado: tags=arch:alpha
-        :avocado: tags=machine:clipper
-        """
-        kernel_url = ('http://archive.debian.org/debian/dists/lenny/main/'
-                      'installer-alpha/20090123lenny10/images/cdrom/vmlinuz')
-        kernel_hash = '3a943149335529e2ed3e74d0d787b85fb5671ba3'
-        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
-
-        uncompressed_kernel = archive.uncompress(kernel_path, self.workdir)
-
-        self.vm.set_console()
-        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
-        self.vm.add_args('-nodefaults',
-                         '-kernel', uncompressed_kernel,
-                         '-append', kernel_command_line)
-        self.vm.launch()
-        console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
-
     def do_test_advcal_2018(self, day, tar_hash, kernel_name, console=0):
         tar_url = ('https://qemu-advcal.gitlab.io'
                    '/qac-best-of-multiarch/download/day' + day + '.tar.xz')
tests/functional/meson.build +4 -0
index a79083b0f9..e1903132a1 100644
@@ -41,6 +41,10 @@ tests_aarch64_system_thorough = [
   'aarch64_virt',
 ]
 
+tests_alpha_system_thorough = [
+  'alpha_clipper',
+]
+
 tests_arm_system_thorough = [
   'arm_canona1100',
   'arm_integratorcp',
tests/functional/test_alpha_clipper.py new file +38 -0
new file mode 100755
index 0000000000..c1fbf0e395
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a Linux kernel on an Alpha Clipper machine
+# and checks the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import os
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import gzip_uncompress
+
+
+class AlphaClipperTest(LinuxKernelTest):
+
+    ASSET_KERNEL = Asset(
+        ('http://archive.debian.org/debian/dists/lenny/main/'
+         'installer-alpha/20090123lenny10/images/cdrom/vmlinuz'),
+        '34f53da3fa32212e4f00b03cb944b2ad81c06bc8faaf9b7193b2e544ceeca576')
+
+    def test_alpha_clipper(self):
+        self.set_machine('clipper')
+        kernel_path = self.ASSET_KERNEL.fetch()
+
+        uncompressed_kernel = os.path.join(self.workdir, 'vmlinux')
+        gzip_uncompress(kernel_path, uncompressed_kernel)
+
+        self.vm.set_console()
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
+        self.vm.add_args('-nodefaults',
+                         '-kernel', uncompressed_kernel,
+                         '-append', kernel_command_line)
+        self.vm.launch()
+        console_pattern = 'Kernel command line: %s' % kernel_command_line
+        self.wait_for_console_pattern(console_pattern)
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
Signature · 1 line
2.46.0
#15 lore raw

[PULL 21/22] tests/functional: Convert the multiprocess avocado test into a standalone test

In reply to Thomas Huth

This test handles both, aarch64 and x86_64, with the same test code (apart from some initial setup), so don't split this file by target but add a check for self.arch in the main test function.

Message-ID: <[email protected]>

---
 tests/avocado/avocado_qemu/__init__.py |  10 ---
 tests/avocado/multiprocess.py          | 102 -------------------------
 tests/functional/meson.build           |   2 +
 tests/functional/test_multiprocess.py  | 100 ++++++++++++++++++++++++
 4 files changed, 102 insertions(+), 112 deletions(-)
 delete mode 100644 tests/avocado/multiprocess.py
 create mode 100755 tests/functional/test_multiprocess.py
tests/avocado/avocado_qemu/__init__.py +0 -10
index 0e4ecea7a0..93c3460242 100644
@@ -307,16 +307,6 @@ def require_netdev(self, netdevname):
         if netdevhelp.find('\n' + netdevname + '\n') < 0:
             self.cancel('no support for user networking')
 
-    def require_multiprocess(self):
-        """
-        Test for the presence of the x-pci-proxy-dev which is required
-        to support multiprocess.
-        """
-        devhelp = run_cmd([self.qemu_bin,
-                           '-M', 'none', '-device', 'help'])[0];
-        if devhelp.find('x-pci-proxy-dev') < 0:
-            self.cancel('no support for multiprocess device emulation')
-
     def _new_vm(self, name, *args):
         self._sd = tempfile.TemporaryDirectory(prefix="qemu_")
         vm = QEMUMachine(self.qemu_bin, base_temp_dir=self.workdir,
tests/avocado/multiprocess.py deleted +0 -102

102 lines not on this page · raw message

tests/functional/meson.build +2 -0
index 68a7570119..975e609073 100644
@@ -39,6 +39,7 @@ tests_aarch64_system_thorough = [
   'aarch64_raspi4',
   'aarch64_sbsaref',
   'aarch64_virt',
+  'multiprocess',
 ]
 
 tests_alpha_system_thorough = [
@@ -141,6 +142,7 @@ tests_x86_64_system_quick = [
 tests_x86_64_system_thorough = [
   'acpi_bits',
   'linux_initrd',
+  'multiprocess',
   'netdev_ethtool',
   'virtio_gpu',
 ]
tests/functional/test_multiprocess.py new file +100 -0

100 lines not on this page · raw message

Signature · 1 line
2.46.0
#16 lore raw

[PULL 20/22] tests/functional: Convert the or1k-sim Avocado test

In reply to Thomas Huth

We've got to do_test_advcal_2018() here now that the test resides in a separate file. Also switch back to the original URL (since the site did not vanish as originally expected) and update the hashsum to use SHA256.

Message-ID: <[email protected]>

---
 tests/avocado/boot_linux_console.py |  8 --------
 tests/functional/meson.build        |  4 ++++
 tests/functional/test_or1k_sim.py   | 29 +++++++++++++++++++++++++++++
 3 files changed, 33 insertions(+), 8 deletions(-)
 create mode 100755 tests/functional/test_or1k_sim.py
tests/avocado/boot_linux_console.py +0 -8
index db72bd1b5e..6c50284986 100644
@@ -927,14 +927,6 @@ def test_arm_ast2600_debian(self):
         self.wait_for_console_pattern("SMP: Total of 2 processors activated")
         self.wait_for_console_pattern("No filesystem could mount root")
 
-    def test_or1k_sim(self):
-        """
-        :avocado: tags=arch:or1k
-        :avocado: tags=machine:or1k-sim
-        """
-        tar_hash = '20334cdaf386108c530ff0badaecc955693027dd'
-        self.do_test_advcal_2018('20', tar_hash, 'vmlinux')
-
     def test_ppc64_e500(self):
         """
         :avocado: tags=arch:ppc64
tests/functional/meson.build +4 -0
index 8f9694244f..68a7570119 100644
@@ -94,6 +94,10 @@ tests_mips64el_system_thorough = [
   'mips64el_malta',
 ]
 
+tests_or1k_system_quick = [
+  'or1k_sim',
+]
+
 tests_ppc_system_quick = [
   'ppc_74xx',
 ]
tests/functional/test_or1k_sim.py new file +29 -0
new file mode 100755
index 0000000000..aa2a1f08d2
@@ -0,0 +1,29 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a Linux kernel on an OpenRISC-1000 SIM machine
+# and checks the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import os
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import archive_extract
+
+class OpenRISC1kSimTest(LinuxKernelTest):
+
+    ASSET_DAY20 = Asset(
+        'https://www.qemu-advent-calendar.org/2018/download/day20.tar.xz',
+        'ff9d7dd7c6bdba325bd85ee85c02db61ff653e129558aeffe6aff55bffb6763a')
+
+    def test_or1k_sim(self):
+        self.set_machine('or1k-sim')
+        file_path = self.ASSET_DAY20.fetch()
+        archive_extract(file_path, self.workdir)
+        self.vm.set_console()
+        self.vm.add_args('-kernel', self.workdir + '/day20/vmlinux')
+        self.vm.launch()
+        self.wait_for_console_pattern('QEMU advent calendar')
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
Signature · 1 line
2.46.0
#17 lore raw

[PULL 22/22] tests/functional: Fix bad usage of has_cmd

In reply to Thomas Huth

has_cmd returns a tuple, not a boolean value. This fixes a crash when e.g. "tesseract" is not available in the test_m68k_nextcube test.

Message-ID: <[email protected]>

---
 tests/functional/qemu_test/cmd.py       | 6 +++---
 tests/functional/qemu_test/tesseract.py | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)
tests/functional/qemu_test/cmd.py +3 -3
index 3acd617324..cbabb1ceed 100644
@@ -187,7 +187,7 @@ def get_qemu_img(test):
     qemu_img = os.path.join(BUILD_DIR, 'qemu-img')
     if os.path.exists(qemu_img):
         return qemu_img
-    if has_cmd('qemu-img'):
+    (has_system_qemu_img, errmsg) = has_cmd('qemu-img')
+    if has_system_qemu_img:
         return 'qemu-img'
-    test.skipTest('Could not find "qemu-img", which is required to '
-                  'create temporary images')
+    test.skipTest(errmsg)
tests/functional/qemu_test/tesseract.py +2 -1
index c4087b7c11..db441027b9 100644
@@ -11,7 +11,8 @@
 from . import has_cmd, run_cmd
 
 def tesseract_available(expected_version):
-    if not has_cmd('tesseract'):
+    (has_tesseract, _) = has_cmd('tesseract')
+    if not has_tesseract:
         return False
     (stdout, stderr, ret) = run_cmd([ 'tesseract', '--version'])
     if ret:
Signature · 1 line
2.46.0
#18 lore raw

[PULL 12/22] tests/functional: Convert mips32el Malta YAMON avocado test

In reply to Thomas Huth

From: Philippe Mathieu-Daudé <[email protected]>

Straight forward conversion using the Python standard zipfile module instead of avocado.utils package. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays.

Message-ID: <[email protected]>

Message-ID: <[email protected]>

---
 MAINTAINERS                             |  2 +-
 tests/avocado/machine_mips_malta.py     | 54 -------------------------
 tests/functional/meson.build            |  4 ++
 tests/functional/test_mips64el_malta.py | 16 ++++----
 tests/functional/test_mipsel_malta.py   | 47 +++++++++++++++++++++
 5 files changed, 61 insertions(+), 62 deletions(-)
 delete mode 100644 tests/avocado/machine_mips_malta.py
 create mode 100755 tests/functional/test_mipsel_malta.py
MAINTAINERS +1 -1
index dcf3823169..2f76098230 100644
@@ -1370,7 +1370,7 @@ F: hw/mips/malta.c
 F: hw/pci-host/gt64120.c
 F: include/hw/southbridge/piix.h
 F: tests/avocado/linux_ssh_mips_malta.py
-F: tests/avocado/machine_mips_malta.py
+F: tests/functional/test_mipsel_malta.py
 F: tests/functional/test_mips64el_malta.py
 
 Mipssim
tests/avocado/machine_mips_malta.py deleted +0 -54

54 lines not on this page · raw message

tests/functional/meson.build +4 -0
index 9baf903e39..daee61ec3c 100644
@@ -69,6 +69,10 @@ tests_microblazeel_system_thorough = [
   'microblazeel_s3adsp1800'
 ]
 
+tests_mipsel_system_thorough = [
+  'mipsel_malta',
+]
+
 tests_mips64el_system_quick = [
   'mips64el_fuloong2e',
 ]
tests/functional/test_mips64el_malta.py +9 -7
index 1be93d7ff0..6c6355b131 100755
@@ -30,7 +30,7 @@
     CV2_AVAILABLE = False
 
 
-class MaltaMachineConsole(QemuSystemTest):
+class MaltaMachineConsole(LinuxKernelTest):
 
     ASSET_KERNEL_2_63_2 = Asset(
         ('http://snapshot.debian.org/archive/debian/'
@@ -52,17 +52,17 @@ def test_mips64el_malta(self):
             ch-common-tasks.html#s-common-official
         """
         deb_path = self.ASSET_KERNEL_2_63_2.fetch()
-        kernel_path = extract_from_deb(deb_path, self.workdir,
-                                       '/boot/vmlinux-2.6.32-5-5kc-malta')
+        kernel_path = self.extract_from_deb(deb_path,
+                                            '/boot/vmlinux-2.6.32-5-5kc-malta')
 
         self.set_machine('malta')
         self.vm.set_console()
-        kernel_command_line = KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
+        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
         self.vm.add_args('-kernel', kernel_path,
                          '-append', kernel_command_line)
         self.vm.launch()
         console_pattern = 'Kernel command line: %s' % kernel_command_line
-        linux_kernel_wait_for_pattern(self, console_pattern)
+        self.wait_for_console_pattern(console_pattern)
 
     ASSET_KERNEL_3_19_3 = Asset(
         ('https://github.com/philmd/qemu-testing-blob/'
@@ -85,7 +85,7 @@ def test_mips64el_malta_5KEc_cpio(self):
 
         self.set_machine('malta')
         self.vm.set_console()
-        kernel_command_line = (KERNEL_COMMON_COMMAND_LINE
+        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
                                + 'console=ttyS0 console=tty '
                                + 'rdinit=/sbin/init noreboot')
         self.vm.add_args('-cpu', '5KEc',
@@ -94,7 +94,7 @@ def test_mips64el_malta_5KEc_cpio(self):
                          '-append', kernel_command_line,
                          '-no-reboot')
         self.vm.launch()
-        linux_kernel_wait_for_pattern(self, 'Boot successful.')
+        self.wait_for_console_pattern('Boot successful.')
 
         exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
                                                 'MIPS 5KE')
@@ -180,5 +180,7 @@ def test_mips_malta_i6400_framebuffer_logo_8cores(self):
         self.do_test_i6400_framebuffer_logo(8)
 
 
+from test_mipsel_malta import MaltaMachineYAMON
+
 if __name__ == '__main__':
     LinuxKernelTest.main()
tests/functional/test_mipsel_malta.py new file +47 -0

47 lines not on this page · raw message

Signature · 1 line
2.46.0
#19 lore raw

[PULL 16/22] tests/functional: Convert Aarch64 Raspi3 avocado tests

In reply to Thomas Huth

From: Philippe Mathieu-Daudé <[email protected]>

Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays.

Message-ID: <[email protected]> [thuth: Use the LinuxKernelTest class]
Message-ID: <[email protected]>

---
 MAINTAINERS                             |  1 +
 tests/avocado/boot_linux_console.py     | 23 --------------
 tests/functional/meson.build            |  1 +
 tests/functional/test_aarch64_raspi3.py | 41 +++++++++++++++++++++++++
 4 files changed, 43 insertions(+), 23 deletions(-)
 create mode 100755 tests/functional/test_aarch64_raspi3.py
MAINTAINERS +1 -0
index 3cc9c19d02..828c469478 100644
@@ -912,6 +912,7 @@ F: include/hw/arm/rasp*
 F: include/hw/*/bcm283*
 F: docs/system/arm/raspi.rst
 F: tests/functional/test_arm_raspi2.py
+F: tests/functional/test_aarch64_raspi3.py
 
 Real View
 M: Peter Maydell <[email protected]>
tests/avocado/boot_linux_console.py +0 -23
index 827a286429..e4caf34379 100644
@@ -979,29 +979,6 @@ def test_arm_orangepi_uboot_netbsd9(self):
         # Wait for user-space
         wait_for_console_pattern(self, 'Starting root file system check')
 
-    def test_aarch64_raspi3_atf(self):
-        """
-        :avocado: tags=accel:tcg
-        :avocado: tags=arch:aarch64
-        :avocado: tags=machine:raspi3b
-        :avocado: tags=cpu:cortex-a53
-        :avocado: tags=device:pl011
-        :avocado: tags=atf
-        """
-        zip_url = ('https://github.com/pbatard/RPi3/releases/download/'
-                   'v1.15/RPi3_UEFI_Firmware_v1.15.zip')
-        zip_hash = '74b3bd0de92683cadb14e008a7575e1d0c3cafb9'
-        zip_path = self.fetch_asset(zip_url, asset_hash=zip_hash)
-
-        archive.extract(zip_path, self.workdir)
-        efi_fd = os.path.join(self.workdir, 'RPI_EFI.fd')
-
-        self.vm.set_console(console_index=1)
-        self.vm.add_args('-nodefaults',
-                         '-device', 'loader,file=%s,force-raw=true' % efi_fd)
-        self.vm.launch()
-        self.wait_for_console_pattern('version UEFI Firmware v1.15')
-
     def test_alpha_clipper(self):
         """
         :avocado: tags=arch:alpha
tests/functional/meson.build +1 -0
index ff3fe7981e..35eebbe9b9 100644
@@ -35,6 +35,7 @@ tests_generic_bsduser = [
 ]
 
 tests_aarch64_system_thorough = [
+  'aarch64_raspi3',
   'aarch64_sbsaref',
   'aarch64_virt',
 ]
tests/functional/test_aarch64_raspi3.py new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
2.46.0
#20 lore raw

[PULL 11/22] tests/functional: Convert mips64el 5KEc Malta avocado tests

In reply to Thomas Huth

From: Philippe Mathieu-Daudé <[email protected]>

Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays.

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

---
 tests/avocado/boot_linux_console.py     | 74 ------------------------
 tests/functional/test_mips64el_malta.py | 76 +++++++++++++++++++++++++
 2 files changed, 76 insertions(+), 74 deletions(-)
tests/avocado/boot_linux_console.py +0 -74
index e1e20c36f7..84b31cb84e 100644
@@ -138,38 +138,6 @@ def test_mips_malta(self):
         console_pattern = 'Kernel command line: %s' % kernel_command_line
         self.wait_for_console_pattern(console_pattern)
 
-    def test_mips64el_malta(self):
-        """
-        This test requires the ar tool to extract "data.tar.gz" from
-        the Debian package.
-
-        The kernel can be rebuilt using this Debian kernel source [1] and
-        following the instructions on [2].
-
-        [1] http://snapshot.debian.org/package/linux-2.6/2.6.32-48/
-            #linux-source-2.6.32_2.6.32-48
-        [2] https://kernel-team.pages.debian.net/kernel-handbook/
-            ch-common-tasks.html#s-common-official
-
-        :avocado: tags=arch:mips64el
-        :avocado: tags=machine:malta
-        """
-        deb_url = ('http://snapshot.debian.org/archive/debian/'
-                   '20130217T032700Z/pool/main/l/linux-2.6/'
-                   'linux-image-2.6.32-5-5kc-malta_2.6.32-48_mipsel.deb')
-        deb_hash = '1aaec92083bf22fda31e0d27fa8d9a388e5fc3d5'
-        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
-        kernel_path = self.extract_from_deb(deb_path,
-                                            '/boot/vmlinux-2.6.32-5-5kc-malta')
-
-        self.vm.set_console()
-        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
-        self.vm.add_args('-kernel', kernel_path,
-                         '-append', kernel_command_line)
-        self.vm.launch()
-        console_pattern = 'Kernel command line: %s' % kernel_command_line
-        self.wait_for_console_pattern(console_pattern)
-
     def test_mips_malta_cpio(self):
         """
         :avocado: tags=arch:mips
@@ -211,48 +179,6 @@ def test_mips_malta_cpio(self):
         # Wait for VM to shut down gracefully
         self.vm.wait()
 
-    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
-    def test_mips64el_malta_5KEc_cpio(self):
-        """
-        :avocado: tags=arch:mips64el
-        :avocado: tags=machine:malta
-        :avocado: tags=endian:little
-        :avocado: tags=cpu:5KEc
-        """
-        kernel_url = ('https://github.com/philmd/qemu-testing-blob/'
-                      'raw/9ad2df38/mips/malta/mips64el/'
-                      'vmlinux-3.19.3.mtoman.20150408')
-        kernel_hash = '00d1d268fb9f7d8beda1de6bebcc46e884d71754'
-        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
-        initrd_url = ('https://github.com/groeck/linux-build-test/'
-                      'raw/8584a59e/rootfs/'
-                      'mipsel64/rootfs.mipsel64r1.cpio.gz')
-        initrd_hash = '1dbb8a396e916847325284dbe2151167'
-        initrd_path_gz = self.fetch_asset(initrd_url, algorithm='md5',
-                                          asset_hash=initrd_hash)
-        initrd_path = self.workdir + "rootfs.cpio"
-        archive.gzip_uncompress(initrd_path_gz, initrd_path)
-
-        self.vm.set_console()
-        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
-                               + 'console=ttyS0 console=tty '
-                               + 'rdinit=/sbin/init noreboot')
-        self.vm.add_args('-kernel', kernel_path,
-                         '-initrd', initrd_path,
-                         '-append', kernel_command_line,
-                         '-no-reboot')
-        self.vm.launch()
-        wait_for_console_pattern(self, 'Boot successful.')
-
-        exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
-                                                'MIPS 5KE')
-        exec_command_and_wait_for_pattern(self, 'uname -a',
-                                                '3.19.3.mtoman.20150408')
-        exec_command_and_wait_for_pattern(self, 'reboot',
-                                                'reboot: Restarting system')
-        # Wait for VM to shut down gracefully
-        self.vm.wait()
-
     def do_test_mips_malta32el_nanomips(self, kernel_path_xz):
         kernel_path = self.workdir + "kernel"
         with lzma.open(kernel_path_xz, 'rb') as f_in:
tests/functional/test_mips64el_malta.py +76 -0

82 lines not on this page · raw message

Signature · 1 line
2.46.0
#21 lore raw

[PULL 02/22] meson: Move -fsanitize=undefined into normal configuraton

In reply to Thomas Huth

From: Richard Henderson <[email protected]>

With 8e466dd09246 and 23ef50ae2d0c, we disable function pointer sanitization in CI because the qemu code base does not support it. We must disable this for normal usage of --enable-ubsan as well, so move it there.

Append options rather than prepend, since all of this requires proper ordering of options.

Message-ID: <[email protected]>

---
 meson.build                | 11 +++++++++--
 .gitlab-ci.d/buildtest.yml | 10 ++++------
 2 files changed, 13 insertions(+), 8 deletions(-)
meson.build +9 -2
index f6b8060b72..4701ee3aab 100644
@@ -493,8 +493,15 @@ if get_option('ubsan')
   # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84285
   if cc.links('int main(int argc, char **argv) { return argc + 1; }',
               args: [qemu_ldflags, '-fsanitize=undefined'])
-    qemu_cflags = ['-fsanitize=undefined'] + qemu_cflags
-    qemu_ldflags = ['-fsanitize=undefined'] + qemu_ldflags
+    qemu_cflags += ['-fsanitize=undefined']
+    qemu_ldflags += ['-fsanitize=undefined']
+
+    # Suppress undefined behaviour from function call to mismatched type.
+    # In addition, tcg prologue does not emit function type prefix
+    # required by function call sanitizer.
+    if cc.has_argument('-fno-sanitize=function')
+      qemu_cflags += ['-fno-sanitize=function']
+    endif
   else
     error('Your compiler does not support -fsanitize=undefined')
   endif
.gitlab-ci.d/buildtest.yml +4 -6
index 1d2afae996..9ac0776b94 100644
@@ -428,9 +428,8 @@ clang-system:
     job: amd64-fedora-container
   variables:
     IMAGE: fedora
-    CONFIGURE_ARGS: --cc=clang --cxx=clang++
-      --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
-      --extra-cflags=-fno-sanitize=function
+    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-ubsan
+      --extra-cflags=-fno-sanitize-recover=undefined
     TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu s390x-softmmu
     MAKE_CHECK_ARGS: check-qtest check-tcg
 
@@ -441,10 +440,9 @@ clang-user:
   timeout: 70m
   variables:
     IMAGE: debian-all-test-cross
-    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
+    CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system --enable-ubsan
       --target-list-exclude=alpha-linux-user,microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
-      --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
-      --extra-cflags=-fno-sanitize=function
+      --extra-cflags=-fno-sanitize-recover=undefined
     MAKE_CHECK_ARGS: check-unit check-tcg
 
 # Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
Signature · 1 line
2.46.0
#22 lore raw

[PULL 07/22] tests/functional: Add the LinuxKernelTest for testing the Linux boot process

In reply to Thomas Huth

Copy the LinuxKernelTest from tests/acceptance/boot_linux_console.py to be able to convert the related tests to the functional test framework in the following patches.

Message-ID: <[email protected]>

---
 tests/functional/qemu_test/__init__.py    |  1 +
 tests/functional/qemu_test/linuxkernel.py | 41 +++++++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 100644 tests/functional/qemu_test/linuxkernel.py
tests/functional/qemu_test/__init__.py +1 -0
index f33282efe8..67f87be9c4 100644
@@ -12,3 +12,4 @@
     interrupt_interactive_console_until_pattern, wait_for_console_pattern, \
     exec_command, exec_command_and_wait_for_pattern, get_qemu_img
 from .testcase import QemuBaseTest, QemuUserTest, QemuSystemTest
+from .linuxkernel import LinuxKernelTest
tests/functional/qemu_test/linuxkernel.py new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
2.46.0
#23 lore raw
In reply to Thomas Huth
Quoted 13 lines · Thomas Huth

The following changes since commit 7bbadc60b58b742494555f06cd342311ddab9351:

Merge tag 'crypto-fixes-pull-request' of https://gitlab.com/berrange/qemu into staging (2024-09-09 15:19:32 +0100)

are available in the Git repository at:

https://gitlab.com/thuth/qemu.git tags/pull-request-2024-09-10

for you to fetch changes up to cc3e005eb22332ba277bff2e39025d0087f3795e:

tests/functional: Fix bad usage of has_cmd (2024-09-10 13:44:42 +0200)

Quoted 8 lines

----------------------------------------------------------------
* Split --enable-sanitizers to --enable-{asan, ubsan}
* Build MSYS2 job using multiple CPUs
* Fix "make distclean" wrt contrib/plugins/
* Convert more Avocado tests to plain standalone functional tests
* Fix bug that breaks "make check-functional" when tesseract is missing

----------------------------------------------------------------

On the 'make check-vm-openbsd' test I run:

595/944 qemu:func-quick+func-mips64el /
func-mips64el-mips64el_fuloong2e ERROR 6.16s
exit status 1
602/944 qemu:func-quick+func-or1k / func-or1k-or1k_sim
ERROR 6.91s exit status 1

Slightly more detail further up in the log:

595/944 qemu:func-quick+func-mips64el /
func-mips64el-mips64el_fuloong2e ERROR 6.16s
exit status 1
――――――――――――――――――――――――――――――――――――― ✀ ――――――――――――――――――――――――――――――――――――― stderr:
Traceback (most recent call last):
File "/home/qemu/qemu-test.fsnflZ/src/tests/functional/test_mips64el_fuloong2e.py",
line 29, in test_linux_kernel_3_16
deb_path = self.ASSET_KERNEL.fetch()
File "/home/qemu/qemu-test.fsnflZ/src/tests/functional/qemu_test/asset.py",
line 135, in fetch
if not self._check(tmp_cache_file):
File "/home/qemu/qemu-test.fsnflZ/src/tests/functional/qemu_test/asset.py",
line 52, in _check

    checksum = subprocess.check_output(

File "/usr/local/lib/python3.10/subprocess.py", line 421, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/local/lib/python3.10/subprocess.py", line 503, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/local/lib/python3.10/subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/local/lib/python3.10/subprocess.py", line 1863, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'sha256sum'

(test program exited with status code 1)

Similarly for the or1k failure.

If you want to use sha256sum in "make check" then we should ensure that it's installed in these BSD VM images.

Also, does this mean that "make check" is now going to run a lot of the tests that were previously in "make check-avocado"? That seems like it might make our CI jobs take longer...

thanks
-- PMM

#24 lore raw
Quoted 60 lines · Peter Maydell
Quoted 13 lines · Thomas Huth

The following changes since commit 7bbadc60b58b742494555f06cd342311ddab9351:

   Merge tag 'crypto-fixes-pull-request' of https://gitlab.com/berrange/qemu into staging (2024-09-09 15:19:32 +0100)

are available in the Git repository at:

   https://gitlab.com/thuth/qemu.git tags/pull-request-2024-09-10

for you to fetch changes up to cc3e005eb22332ba277bff2e39025d0087f3795e:

   tests/functional: Fix bad usage of has_cmd (2024-09-10 13:44:42 +0200)
Quoted 8 lines

----------------------------------------------------------------
* Split --enable-sanitizers to --enable-{asan, ubsan}
* Build MSYS2 job using multiple CPUs
* Fix "make distclean" wrt contrib/plugins/
* Convert more Avocado tests to plain standalone functional tests
* Fix bug that breaks "make check-functional" when tesseract is missing

----------------------------------------------------------------

On the 'make check-vm-openbsd' test I run:

595/944 qemu:func-quick+func-mips64el /
func-mips64el-mips64el_fuloong2e ERROR 6.16s
exit status 1
602/944 qemu:func-quick+func-or1k / func-or1k-or1k_sim
ERROR 6.91s exit status 1

Slightly more detail further up in the log:

595/944 qemu:func-quick+func-mips64el /
func-mips64el-mips64el_fuloong2e ERROR 6.16s
exit status 1
――――――――――――――――――――――――――――――――――――― ✀ ――――――――――――――――――――――――――――――――――――― stderr:
Traceback (most recent call last):
File "/home/qemu/qemu-test.fsnflZ/src/tests/functional/test_mips64el_fuloong2e.py",
line 29, in test_linux_kernel_3_16
deb_path = self.ASSET_KERNEL.fetch()
File "/home/qemu/qemu-test.fsnflZ/src/tests/functional/qemu_test/asset.py",
line 135, in fetch
if not self._check(tmp_cache_file):
File "/home/qemu/qemu-test.fsnflZ/src/tests/functional/qemu_test/asset.py",
line 52, in _check

     checksum = subprocess.check_output(

File "/usr/local/lib/python3.10/subprocess.py", line 421, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/local/lib/python3.10/subprocess.py", line 503, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/local/lib/python3.10/subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/local/lib/python3.10/subprocess.py", line 1863, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'sha256sum'

Quoted 7 lines

(test program exited with status code 1)

Similarly for the or1k failure.

If you want to use sha256sum in "make check" then we should ensure that it's installed in these BSD VM images.

Ok ... I'm looking into using the hashlib from Python instead, that way we'll be independent from external binaries here.

Quoted 3 lines

Also, does this mean that "make check" is now going to run a lot of the tests that were previously in "make check-avocado"? That seems like it might make our CI jobs take longer...

No, it will only some basic tests that don't download any assets. These should be the rather quick ones.

Thomas