testing and misc updates

- add LE microblaze test to avocado
   - use modern snapshot=on to avoid trashing disk image
   - use plain bool for fe_is_open
   - various updates to qtest timeouts
   - enable meson test timeouts
   - tweak the readthedocs environment
   - partially revert un-flaking x86_64
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAmWhPccACgkQ+9DbCVqe
 KkS5agf+OoW6HOitt34YeL6cGGtIKaxbta+Fs6jq+ucIbN63TmLTuKrmPiRNxjuo
 Fj2Qvh9R7Tl7Q/a7ZAym0Fze7GtsvvsidkiQS4pmi9vYuJrhS734CxXHT8JS6zJr
 ymQ0nGZODg1cVB4oAR9sXo/OwEQdDTSgKp8wdNr930fxYwokUKBUgcOqElu3SWHv
 duSYDuaflnP5B8ZGbb1ZnOlwS9lZIHTwjZyN5J1YtxF0T8Ez4A+xseEOpQ/00MoE
 Ecjdp3ELCxzOI+1U33Yni7ol//fxQpRKi+xf2fGIxhuSA3i32rmY5NWTvl7VwuS1
 gXryjX2rukSujySP3vkdtTp0dmkbpg==
 =ZuDd
 -----END PGP SIGNATURE-----

Merge tag 'pull-testing-updates-120124-2' of https://gitlab.com/stsquad/qemu into staging

testing and misc updates

  - add LE microblaze test to avocado
  - use modern snapshot=on to avoid trashing disk image
  - use plain bool for fe_is_open
  - various updates to qtest timeouts
  - enable meson test timeouts
  - tweak the readthedocs environment
  - partially revert un-flaking x86_64

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAmWhPccACgkQ+9DbCVqe
# KkS5agf+OoW6HOitt34YeL6cGGtIKaxbta+Fs6jq+ucIbN63TmLTuKrmPiRNxjuo
# Fj2Qvh9R7Tl7Q/a7ZAym0Fze7GtsvvsidkiQS4pmi9vYuJrhS734CxXHT8JS6zJr
# ymQ0nGZODg1cVB4oAR9sXo/OwEQdDTSgKp8wdNr930fxYwokUKBUgcOqElu3SWHv
# duSYDuaflnP5B8ZGbb1ZnOlwS9lZIHTwjZyN5J1YtxF0T8Ez4A+xseEOpQ/00MoE
# Ecjdp3ELCxzOI+1U33Yni7ol//fxQpRKi+xf2fGIxhuSA3i32rmY5NWTvl7VwuS1
# gXryjX2rukSujySP3vkdtTp0dmkbpg==
# =ZuDd
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 12 Jan 2024 13:25:27 GMT
# gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* tag 'pull-testing-updates-120124-2' of https://gitlab.com/stsquad/qemu: (22 commits)
  tests/avocado: partially revert unmasking of replay_linux tests
  readthodocs: fully specify a build environment
  mtest2make: stop disabling meson test timeouts
  tests/fp: Bump fp-test-mulAdd test timeout to 3 minutes
  tests/unit: Bump test-crypto-block test timeout to 5 minutes
  tests/unit: Bump test-aio-multithread test timeout to 2 minutes
  tests/qtest: Bump the device-introspect-test timeout to 12 minutes
  qtest: bump bios-table-test timeout to 9 minutes
  qtest: bump aspeed_smc-test timeout to 6 minutes
  qtest: bump qos-test timeout to 2 minutes
  qtest: bump boot-serial-test timeout to 3 minutes
  qtest: bump prom-env-test timeout to 6 minutes
  qtest: bump pxe-test timeout to 10 minutes
  qtest: bump test-hmp timeout to 4 minutes
  qtest: bump npcm7xx_pwm-test timeout to 5 minutes
  qtest: bump qom-test timeout to 15 minutes
  qtest: bump migration-test timeout to 8 minutes
  qtest: bump min meson timeout to 60 seconds
  chardev: use bool for fe_is_open
  gitlab: include microblazeel in testing
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2024-01-12 14:02:53 +00:00
commit 977542ded7
13 changed files with 85 additions and 40 deletions

View File

@ -41,7 +41,7 @@ build-system-ubuntu:
variables:
IMAGE: ubuntu2204
CONFIGURE_ARGS: --enable-docs
TARGETS: alpha-softmmu microblaze-softmmu mips64el-softmmu
TARGETS: alpha-softmmu microblazeel-softmmu mips64el-softmmu
MAKE_CHECK_ARGS: check-build
check-system-ubuntu:
@ -61,7 +61,7 @@ avocado-system-ubuntu:
variables:
IMAGE: ubuntu2204
MAKE_CHECK_ARGS: check-avocado
AVOCADO_TAGS: arch:alpha arch:microblaze arch:mips64el
AVOCADO_TAGS: arch:alpha arch:microblazeel arch:mips64el
build-system-debian:
extends:

View File

@ -5,16 +5,21 @@
# Required
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
# We want all the document formats
formats: all
# For consistency, we require that QEMU's Sphinx extensions
# run with at least the same minimum version of Python that
# we require for other Python in our codebase (our conf.py
# enforces this, and some code needs it.)
python:
version: 3.6

View File

@ -211,7 +211,7 @@ bool qemu_chr_fe_init(CharBackend *b, Chardev *s, Error **errp)
}
}
b->fe_open = false;
b->fe_is_open = false;
b->tag = tag;
b->chr = s;
return true;
@ -257,7 +257,7 @@ void qemu_chr_fe_set_handlers_full(CharBackend *b,
bool sync_state)
{
Chardev *s;
int fe_open;
bool fe_open;
s = b->chr;
if (!s) {
@ -265,10 +265,10 @@ void qemu_chr_fe_set_handlers_full(CharBackend *b,
}
if (!opaque && !fd_can_read && !fd_read && !fd_event) {
fe_open = 0;
fe_open = false;
remove_fd_in_watch(s);
} else {
fe_open = 1;
fe_open = true;
}
b->chr_can_read = fd_can_read;
b->chr_read = fd_read;
@ -336,7 +336,7 @@ void qemu_chr_fe_set_echo(CharBackend *be, bool echo)
}
}
void qemu_chr_fe_set_open(CharBackend *be, int fe_open)
void qemu_chr_fe_set_open(CharBackend *be, bool is_open)
{
Chardev *chr = be->chr;
@ -344,12 +344,12 @@ void qemu_chr_fe_set_open(CharBackend *be, int fe_open)
return;
}
if (be->fe_open == fe_open) {
if (be->fe_is_open == is_open) {
return;
}
be->fe_open = fe_open;
be->fe_is_open = is_open;
if (CHARDEV_GET_CLASS(chr)->chr_set_fe_open) {
CHARDEV_GET_CLASS(chr)->chr_set_fe_open(chr, fe_open);
CHARDEV_GET_CLASS(chr)->chr_set_fe_open(chr, is_open);
}
}

View File

@ -762,7 +762,7 @@ static int qmp_query_chardev_foreach(Object *obj, void *data)
value->label = g_strdup(chr->label);
value->filename = g_strdup(chr->filename);
value->frontend_open = chr->be && chr->be->fe_open;
value->frontend_open = chr->be && chr->be->fe_is_open;
QAPI_LIST_PREPEND(*list, value);

2
docs/requirements.txt Normal file
View File

@ -0,0 +1,2 @@
sphinx==5.3.0
sphinx_rtd_theme==1.1.1

View File

@ -7,8 +7,12 @@
typedef void IOEventHandler(void *opaque, QEMUChrEvent event);
typedef int BackendChangeHandler(void *opaque);
/* This is the backend as seen by frontend, the actual backend is
* Chardev */
/**
* struct CharBackend - back end as seen by front end
* @fe_is_open: the front end is ready for IO
*
* The actual backend is Chardev
*/
struct CharBackend {
Chardev *chr;
IOEventHandler *chr_event;
@ -17,7 +21,7 @@ struct CharBackend {
BackendChangeHandler *chr_be_change;
void *opaque;
int tag;
int fe_open;
bool fe_is_open;
};
/**
@ -156,12 +160,13 @@ void qemu_chr_fe_set_echo(CharBackend *be, bool echo);
/**
* qemu_chr_fe_set_open:
* @be: a CharBackend
* @is_open: the front end open status
*
* Set character frontend open status. This is an indication that the
* front end is ready (or not) to begin doing I/O.
* Without associated Chardev, do nothing.
* This is an indication that the front end is ready (or not) to begin
* doing I/O. Without associated Chardev, do nothing.
*/
void qemu_chr_fe_set_open(CharBackend *be, int fe_open);
void qemu_chr_fe_set_open(CharBackend *be, bool is_open);
/**
* qemu_chr_fe_printf:

View File

@ -27,7 +27,8 @@ SPEED = quick
.speed.slow = $(foreach s,$(sort $(filter-out %-thorough, $1)), --suite $s)
.speed.thorough = $(foreach s,$(sort $1), --suite $s)
.mtestargs = --no-rebuild -t 0
TIMEOUT_MULTIPLIER = 1
.mtestargs = --no-rebuild -t $(TIMEOUT_MULTIPLIER)
ifneq ($(SPEED), quick)
.mtestargs += --setup $(SPEED)
endif

View File

@ -59,7 +59,7 @@ class KVMXenGuest(QemuSystemTest, LinuxSSHMixIn):
def run_and_check(self):
self.vm.add_args('-kernel', self.kernel_path,
'-append', self.kernel_params,
'-drive', f"file={self.rootfs},if=none,format=raw,id=drv0",
'-drive', f"file={self.rootfs},if=none,snapshot=on,format=raw,id=drv0",
'-device', 'xen-disk,drive=drv0,vdev=xvda',
'-device', 'virtio-net-pci,netdev=unet',
'-netdev', 'user,id=unet,hostfwd=:127.0.0.1:0-:22')

View File

@ -5,6 +5,8 @@
# This work is licensed under the terms of the GNU GPL, version 2 or
# later. See the COPYING file in the top-level directory.
import time
from avocado_qemu import exec_command, exec_command_and_wait_for_pattern
from avocado_qemu import QemuSystemTest
from avocado_qemu import wait_for_console_pattern
from avocado.utils import archive
@ -33,3 +35,27 @@ class MicroblazeMachine(QemuSystemTest):
# The kernel sometimes gets stuck after the "This architecture ..."
# message, that's why we don't test for a later string here. This
# needs some investigation by a microblaze wizard one day...
def test_microblazeel_s3adsp1800(self):
"""
:avocado: tags=arch:microblazeel
:avocado: tags=machine:petalogix-s3adsp1800
"""
self.require_netdev('user')
tar_url = ('http://www.qemu-advent-calendar.org/2023/download/'
'day13.tar.gz')
tar_hash = '6623d5fff5f84cfa8f34e286f32eff6a26546f44'
file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
archive.extract(file_path, self.workdir)
self.vm.set_console()
self.vm.add_args('-kernel', self.workdir + '/day13/xmaton.bin')
self.vm.add_args('-nic', 'user,tftp=' + self.workdir + '/day13/')
self.vm.launch()
wait_for_console_pattern(self, 'QEMU Advent Calendar 2023')
time.sleep(0.1)
exec_command(self, 'root')
time.sleep(0.1)
exec_command_and_wait_for_pattern(self,
'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png',
'821cd3cab8efd16ad6ee5acc3642a8ea')

View File

@ -98,10 +98,13 @@ class ReplayKernelNormal(ReplayKernelBase):
self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5)
# See https://gitlab.com/qemu-project/qemu/-/issues/2094
@skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test sometimes gets stuck')
def test_x86_64_pc(self):
"""
:avocado: tags=arch:x86_64
:avocado: tags=machine:pc
:avocado: tags=flaky
"""
kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
'/linux/releases/29/Everything/x86_64/os/images/pxeboot'

View File

@ -124,7 +124,7 @@ test('fp-test-mulAdd', fptest,
# no fptest_rounding_args
args: fptest_args +
['f16_mulAdd', 'f32_mulAdd', 'f64_mulAdd', 'f128_mulAdd'],
suite: ['softfloat-slow', 'softfloat-ops-slow', 'slow'], timeout: 90)
suite: ['softfloat-slow', 'softfloat-ops-slow', 'slow'], timeout: 180)
executable(
'fp-bench',

View File

@ -1,14 +1,15 @@
slow_qtests = {
'ahci-test' : 60,
'bios-tables-test' : 120,
'boot-serial-test' : 60,
'migration-test' : 150,
'npcm7xx_pwm-test': 150,
'prom-env-test' : 60,
'pxe-test' : 60,
'qos-test' : 60,
'qom-test' : 300,
'test-hmp' : 120,
'aspeed_smc-test': 360,
'bios-tables-test' : 540,
'device-introspect-test' : 720,
'migration-test' : 480,
'npcm7xx_pwm-test': 300,
'qom-test' : 900,
'test-hmp' : 240,
'pxe-test': 600,
'prom-env-test': 360,
'boot-serial-test': 180,
'qos-test': 120,
}
qtests_generic = [
@ -383,8 +384,8 @@ foreach dir : target_dirs
env: qtest_env,
args: ['--tap', '-k'],
protocol: 'tap',
timeout: slow_qtests.get(test, 30),
priority: slow_qtests.get(test, 30),
timeout: slow_qtests.get(test, 60),
priority: slow_qtests.get(test, 60),
suite: ['qtest', 'qtest-' + target_base])
endforeach
endforeach

View File

@ -172,6 +172,8 @@ test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
slow_tests = {
'test-aio-multithread' : 120,
'test-crypto-block' : 300,
'test-crypto-tlscredsx509': 45,
'test-crypto-tlssession': 45
}