12 changes: 9 additions & 3 deletions .gitlab-ci.d/crossbuilds.yml
Expand Up @@ -44,23 +44,29 @@ cross-arm64-user:
IMAGE: debian-arm64-cross

cross-i386-system:
extends: .cross_system_build_job
extends:
- .cross_system_build_job
- .cross_test_artifacts
needs:
job: i386-fedora-cross-container
variables:
IMAGE: fedora-i386-cross
MAKE_CHECK_ARGS: check-qtest

cross-i386-user:
extends: .cross_user_build_job
extends:
- .cross_user_build_job
- .cross_test_artifacts
needs:
job: i386-fedora-cross-container
variables:
IMAGE: fedora-i386-cross
MAKE_CHECK_ARGS: check

cross-i386-tci:
extends: .cross_accel_build_job
extends:
- .cross_accel_build_job
- .cross_test_artifacts
timeout: 60m
needs:
job: i386-fedora-cross-container
Expand Down
3 changes: 2 additions & 1 deletion .gitlab-ci.d/custom-runners.yml
Expand Up @@ -15,7 +15,8 @@ variables:

# All custom runners can extend this template to upload the testlog
# data as an artifact and also feed the junit report
.custom_artifacts_template:
.custom_runner_template:
extends: .base_job_template
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
expire_in: 7 days
Expand Down
10 changes: 5 additions & 5 deletions .gitlab-ci.d/custom-runners/ubuntu-20.04-s390x.yml
Expand Up @@ -3,7 +3,7 @@
# "Install basic packages to build QEMU on Ubuntu 20.04/20.04"

ubuntu-20.04-s390x-all-linux-static:
extends: .custom_artifacts_template
extends: .custom_runner_template
needs: []
stage: build
tags:
Expand All @@ -24,7 +24,7 @@ ubuntu-20.04-s390x-all-linux-static:
- make --output-sync -j`nproc` check

ubuntu-20.04-s390x-all:
extends: .custom_artifacts_template
extends: .custom_runner_template
needs: []
stage: build
tags:
Expand All @@ -43,7 +43,7 @@ ubuntu-20.04-s390x-all:
- make --output-sync -j`nproc` check

ubuntu-20.04-s390x-alldbg:
extends: .custom_artifacts_template
extends: .custom_runner_template
needs: []
stage: build
tags:
Expand All @@ -66,7 +66,7 @@ ubuntu-20.04-s390x-alldbg:
- make --output-sync -j`nproc` check

ubuntu-20.04-s390x-clang:
extends: .custom_artifacts_template
extends: .custom_runner_template
needs: []
stage: build
tags:
Expand Down Expand Up @@ -108,7 +108,7 @@ ubuntu-20.04-s390x-tci:
- make --output-sync -j`nproc`

ubuntu-20.04-s390x-notcg:
extends: .custom_artifacts_template
extends: .custom_runner_template
needs: []
stage: build
tags:
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.d/custom-runners/ubuntu-22.04-aarch32.yml
Expand Up @@ -3,7 +3,7 @@
# "Install basic packages to build QEMU on Ubuntu 20.04"

ubuntu-22.04-aarch32-all:
extends: .custom_artifacts_template
extends: .custom_runner_template
needs: []
stage: build
tags:
Expand Down
10 changes: 5 additions & 5 deletions .gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml
Expand Up @@ -3,7 +3,7 @@
# "Install basic packages to build QEMU on Ubuntu 20.04"

ubuntu-22.04-aarch64-all-linux-static:
extends: .custom_artifacts_template
extends: .custom_runner_template
needs: []
stage: build
tags:
Expand All @@ -24,7 +24,7 @@ ubuntu-22.04-aarch64-all-linux-static:
- make --output-sync -j`nproc --ignore=40` check

ubuntu-22.04-aarch64-all:
extends: .custom_artifacts_template
extends: .custom_runner_template
needs: []
stage: build
tags:
Expand All @@ -46,7 +46,7 @@ ubuntu-22.04-aarch64-all:
- make --output-sync -j`nproc --ignore=40` check

ubuntu-22.04-aarch64-alldbg:
extends: .custom_artifacts_template
extends: .custom_runner_template
needs: []
stage: build
tags:
Expand All @@ -65,7 +65,7 @@ ubuntu-22.04-aarch64-alldbg:
- make --output-sync -j`nproc --ignore=40` check

ubuntu-22.04-aarch64-clang:
extends: .custom_artifacts_template
extends: .custom_runner_template
needs: []
stage: build
tags:
Expand Down Expand Up @@ -107,7 +107,7 @@ ubuntu-22.04-aarch64-tci:
- make --output-sync -j`nproc --ignore=40`

ubuntu-22.04-aarch64-notcg:
extends: .custom_artifacts_template
extends: .custom_runner_template
needs: []
stage: build
tags:
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Expand Up @@ -3766,6 +3766,7 @@ F: scripts/ci/
F: tests/docker/
F: tests/vm/
F: tests/lcitool/
F: tests/avocado/tuxrun_baselines.py
F: scripts/archive-source.sh
F: docs/devel/testing.rst
W: https://gitlab.com/qemu-project/qemu/pipelines
Expand Down
3 changes: 3 additions & 0 deletions configure
Expand Up @@ -1790,6 +1790,7 @@ fi
# functions to probe cross compilers

container="no"
runc=""
if test $use_containers = "yes" && (has "docker" || has "podman"); then
case $($python "$source_path"/tests/docker/docker.py probe) in
*docker) container=docker ;;
Expand All @@ -1798,6 +1799,7 @@ if test $use_containers = "yes" && (has "docker" || has "podman"); then
esac
if test "$container" != "no"; then
docker_py="$python $source_path/tests/docker/docker.py --engine $container"
runc=$($python "$source_path"/tests/docker/docker.py probe)
fi
fi

Expand Down Expand Up @@ -2397,6 +2399,7 @@ fi

if test "$container" != no; then
echo "ENGINE=$container" >> $config_host_mak
echo "RUNC=$runc" >> $config_host_mak
fi
echo "ROMS=$roms" >> $config_host_mak
echo "MAKE=$make" >> $config_host_mak
Expand Down
4 changes: 2 additions & 2 deletions docs/devel/testing.rst
Expand Up @@ -588,13 +588,13 @@ https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual

Thread Sanitizer in Docker
~~~~~~~~~~~~~~~~~~~~~~~~~~
TSan is currently supported in the ubuntu2004 docker.
TSan is currently supported in the ubuntu2204 docker.

The test-tsan test will build using TSan and then run make check.

.. code::
make docker-test-tsan@ubuntu2004
make docker-test-tsan@ubuntu2204
TSan warnings under docker are placed in files located at build/tsan/.

Expand Down
3 changes: 3 additions & 0 deletions tests/avocado/boot_linux.py
Expand Up @@ -84,13 +84,16 @@ def test_virt_kvm(self):
self.launch_and_wait(set_up_ssh_connection=False)


# See the tux_baseline.py tests for almost the same coverage in a lot
# less time.
class BootLinuxPPC64(LinuxTest):
"""
:avocado: tags=arch:ppc64
"""

timeout = 360

@skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
def test_pseries_tcg(self):
"""
:avocado: tags=machine:pseries
Expand Down
1 change: 1 addition & 0 deletions tests/avocado/replay_kernel.py
Expand Up @@ -349,6 +349,7 @@ def test_or1k_sim(self):
file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
self.do_test_advcal_2018(file_path, 'vmlinux')

@skip("nios2 emulation is buggy under record/replay")
def test_nios2_10m50(self):
"""
:avocado: tags=arch:nios2
Expand Down
423 changes: 423 additions & 0 deletions tests/avocado/tuxrun_baselines.py

Large diffs are not rendered by default.

28 changes: 17 additions & 11 deletions tests/docker/Makefile.include
Expand Up @@ -7,13 +7,16 @@ SPACE := $(NULL) #
COMMA := ,

HOST_ARCH = $(if $(ARCH),$(ARCH),$(shell uname -m))
USER = $(if $(NOUSER),,$(shell id -un))
UID = $(if $(NOUSER),,$(shell id -u))

DOCKER_FILES_DIR := $(SRC_PATH)/tests/docker/dockerfiles
ifeq ($(HOST_ARCH),x86_64)
DOCKER_DEFAULT_REGISTRY := registry.gitlab.com/qemu-project/qemu
endif
DOCKER_REGISTRY := $(if $(REGISTRY),$(REGISTRY),$(DOCKER_DEFAULT_REGISTRY))

RUNC ?= docker
ENGINE ?= auto
DOCKER_SCRIPT=$(SRC_PATH)/tests/docker/docker.py --engine $(ENGINE)

Expand All @@ -35,15 +38,17 @@ docker-qemu-src: $(DOCKER_SRC_COPY)

# General rule for building docker images.
docker-image-%: $(DOCKER_FILES_DIR)/%.docker
$(call quiet-command,\
$(DOCKER_SCRIPT) build -t qemu/$* -f $< \
$(if $V,,--quiet) \
$(if $(NOCACHE),--no-cache, \
$(if $(DOCKER_REGISTRY),--registry $(DOCKER_REGISTRY))) \
$(if $(NOUSER),,--add-current-user) \
$(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))\
$(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)),\
"BUILD","$*")
$(call quiet-command, \
$(RUNC) build \
$(if $V,,--quiet) \
$(if $(NOCACHE),--no-cache, \
$(if $(DOCKER_REGISTRY),--cache-from $(DOCKER_REGISTRY)/qemu/$*)) \
--build-arg BUILDKIT_INLINE_CACHE=1 \
$(if $(NOUSER),, \
--build-arg USER=$(USER) \
--build-arg UID=$(UID)) \
-t qemu/$* - < $<, \
"BUILD", $1)

# Special rule for debootstraped binfmt linux-user images
docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker
Expand Down Expand Up @@ -219,8 +224,9 @@ docker-run: docker-qemu-src
$(IMAGE) --executable $(EXECUTABLE), \
" COPYING $(EXECUTABLE) to $(IMAGE)"))
$(call quiet-command, \
$(DOCKER_SCRIPT) run \
$(if $(NOUSER),,--run-as-current-user) \
$(RUNC) run \
--rm \
$(if $(NOUSER),,-u $(UID)) \
--security-opt seccomp=unconfined \
$(if $(DEBUG),-ti,) \
$(if $(NETWORK),$(if $(subst $(NETWORK),,1),--net=$(NETWORK)),--net=none) \
Expand Down
7 changes: 7 additions & 0 deletions tests/docker/dockerfiles/alpine.docker
Expand Up @@ -94,6 +94,7 @@ RUN apk update && \
sed \
snappy-dev \
sndio-dev \
socat \
sparse \
spice-dev \
spice-protocol \
Expand All @@ -109,6 +110,7 @@ RUN apk update && \
xfsprogs-dev \
zlib-dev \
zlib-static \
zstd \
zstd-dev && \
apk list | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
Expand All @@ -123,3 +125,8 @@ ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 8 additions & 1 deletion tests/docker/dockerfiles/centos8.docker
Expand Up @@ -103,6 +103,7 @@ RUN dnf distro-sync -y && \
rpm \
sed \
snappy-devel \
socat \
spice-protocol \
spice-server-devel \
systemd-devel \
Expand All @@ -115,7 +116,8 @@ RUN dnf distro-sync -y && \
which \
xfsprogs-devel \
zlib-devel \
zlib-static && \
zlib-static \
zstd && \
dnf autoremove -y && \
dnf clean all -y && \
rpm -qa | sort > /packages.txt && \
Expand All @@ -137,3 +139,8 @@ ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3.8"
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/debian-all-test-cross.docker
Expand Up @@ -61,3 +61,8 @@ RUN DEBIAN_FRONTEND=noninteractive eatmydata \

ENV QEMU_CONFIGURE_OPTS --disable-system --disable-docs --disable-tools
ENV DEF_TARGET_LIST aarch64-linux-user,alpha-linux-user,arm-linux-user,hppa-linux-user,i386-linux-user,m68k-linux-user,mips-linux-user,mips64-linux-user,mips64el-linux-user,mipsel-linux-user,ppc-linux-user,ppc64-linux-user,ppc64le-linux-user,riscv64-linux-user,s390x-linux-user,sh4-linux-user,sparc64-linux-user
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/debian-alpha-cross.docker
Expand Up @@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
gcc-alpha-linux-gnu \
libc6.1-dev-alpha-cross
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 8 additions & 1 deletion tests/docker/dockerfiles/debian-amd64-cross.docker
Expand Up @@ -52,10 +52,12 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
python3-yaml \
rpm2cpio \
sed \
socat \
sparse \
tar \
tesseract-ocr \
tesseract-ocr-eng && \
tesseract-ocr-eng \
zstd && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
Expand Down Expand Up @@ -168,3 +170,8 @@ ENV ABI "x86_64-linux-gnu"
ENV MESON_OPTS "--cross-file=x86_64-linux-gnu"
ENV QEMU_CONFIGURE_OPTS --cross-prefix=x86_64-linux-gnu-
ENV DEF_TARGET_LIST x86_64-softmmu,x86_64-linux-user,i386-softmmu,i386-linux-user
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 8 additions & 1 deletion tests/docker/dockerfiles/debian-amd64.docker
Expand Up @@ -120,13 +120,15 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
python3-yaml \
rpm2cpio \
sed \
socat \
sparse \
systemtap-sdt-dev \
tar \
tesseract-ocr \
tesseract-ocr-eng \
xfslibs-dev \
zlib1g-dev && \
zlib1g-dev \
zstd && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
Expand Down Expand Up @@ -154,3 +156,8 @@ RUN git clone https://github.com/luigirizzo/netmap.git /usr/src/netmap
RUN cd /usr/src/netmap && git checkout v11.3
RUN cd /usr/src/netmap/LINUX && ./configure --no-drivers --no-apps --kernel-dir=$(ls -d /usr/src/linux-headers-*-amd64) && make install
ENV QEMU_CONFIGURE_OPTS --enable-netmap
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 8 additions & 1 deletion tests/docker/dockerfiles/debian-arm64-cross.docker
Expand Up @@ -52,10 +52,12 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
python3-yaml \
rpm2cpio \
sed \
socat \
sparse \
tar \
tesseract-ocr \
tesseract-ocr-eng && \
tesseract-ocr-eng \
zstd && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
Expand Down Expand Up @@ -167,3 +169,8 @@ ENV ABI "aarch64-linux-gnu"
ENV MESON_OPTS "--cross-file=aarch64-linux-gnu"
ENV QEMU_CONFIGURE_OPTS --cross-prefix=aarch64-linux-gnu-
ENV DEF_TARGET_LIST aarch64-softmmu,aarch64-linux-user
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 8 additions & 1 deletion tests/docker/dockerfiles/debian-armel-cross.docker
Expand Up @@ -52,10 +52,12 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
python3-yaml \
rpm2cpio \
sed \
socat \
sparse \
tar \
tesseract-ocr \
tesseract-ocr-eng && \
tesseract-ocr-eng \
zstd && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
Expand Down Expand Up @@ -166,3 +168,8 @@ ENV ABI "arm-linux-gnueabi"
ENV MESON_OPTS "--cross-file=arm-linux-gnueabi"
ENV QEMU_CONFIGURE_OPTS --cross-prefix=arm-linux-gnueabi-
ENV DEF_TARGET_LIST arm-softmmu,arm-linux-user,armeb-linux-user
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 8 additions & 1 deletion tests/docker/dockerfiles/debian-armhf-cross.docker
Expand Up @@ -52,10 +52,12 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
python3-yaml \
rpm2cpio \
sed \
socat \
sparse \
tar \
tesseract-ocr \
tesseract-ocr-eng && \
tesseract-ocr-eng \
zstd && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
Expand Down Expand Up @@ -167,3 +169,8 @@ ENV ABI "arm-linux-gnueabihf"
ENV MESON_OPTS "--cross-file=arm-linux-gnueabihf"
ENV QEMU_CONFIGURE_OPTS --cross-prefix=arm-linux-gnueabihf-
ENV DEF_TARGET_LIST arm-softmmu,arm-linux-user
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/debian-hexagon-cross.docker
Expand Up @@ -33,3 +33,8 @@ ENV TOOLCHAIN_URL https://codelinaro.jfrog.io/artifactory/codelinaro-toolchain-f

RUN curl -#SL "$TOOLCHAIN_URL" | tar -xJC "$TOOLCHAIN_INSTALL"
ENV PATH $PATH:${TOOLCHAIN_INSTALL}/${TOOLCHAIN_BASENAME}/x86_64-linux-gnu/bin
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/debian-hppa-cross.docker
Expand Up @@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
gcc-hppa-linux-gnu \
libc6-dev-hppa-cross
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/debian-loongarch-cross.docker
Expand Up @@ -25,3 +25,8 @@ RUN curl -#SL https://github.com/loongson/build-tools/releases/download/2022.05.

ENV PATH $PATH:/opt/cross-tools/bin
ENV LD_LIBRARY_PATH /opt/cross-tools/lib:/opt/cross-tools/loongarch64-unknown-linux-gnu/lib:$LD_LIBRARY_PATH
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/debian-m68k-cross.docker
Expand Up @@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
gcc-m68k-linux-gnu \
libc6-dev-m68k-cross
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/debian-mips-cross.docker
Expand Up @@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
gcc-mips-linux-gnu \
libc6-dev-mips-cross
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/debian-mips64-cross.docker
Expand Up @@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
gcc-mips64-linux-gnuabi64 \
libc6-dev-mips64-cross
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 8 additions & 1 deletion tests/docker/dockerfiles/debian-mips64el-cross.docker
Expand Up @@ -52,10 +52,12 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
python3-yaml \
rpm2cpio \
sed \
socat \
sparse \
tar \
tesseract-ocr \
tesseract-ocr-eng && \
tesseract-ocr-eng \
zstd && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
Expand Down Expand Up @@ -164,3 +166,8 @@ ENV ABI "mips64el-linux-gnuabi64"
ENV MESON_OPTS "--cross-file=mips64el-linux-gnuabi64"
ENV QEMU_CONFIGURE_OPTS --cross-prefix=mips64el-linux-gnuabi64-
ENV DEF_TARGET_LIST mips64el-softmmu,mips64el-linux-user
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 8 additions & 1 deletion tests/docker/dockerfiles/debian-mipsel-cross.docker
Expand Up @@ -52,10 +52,12 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
python3-yaml \
rpm2cpio \
sed \
socat \
sparse \
tar \
tesseract-ocr \
tesseract-ocr-eng && \
tesseract-ocr-eng \
zstd && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
Expand Down Expand Up @@ -164,3 +166,8 @@ ENV ABI "mipsel-linux-gnu"
ENV MESON_OPTS "--cross-file=mipsel-linux-gnu"
ENV QEMU_CONFIGURE_OPTS --cross-prefix=mipsel-linux-gnu-
ENV DEF_TARGET_LIST mipsel-softmmu,mipsel-linux-user
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/debian-native.docker
Expand Up @@ -47,3 +47,8 @@ RUN apt update && \

ENV QEMU_CONFIGURE_OPTS $QEMU_CONFIGURE_OPTS
ENV DEF_TARGET_LIST "none"
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
6 changes: 5 additions & 1 deletion tests/docker/dockerfiles/debian-powerpc-test-cross.docker
Expand Up @@ -16,4 +16,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libc6-dev-ppc64-cross \
gcc-10-powerpc64le-linux-gnu \
libc6-dev-ppc64el-cross

# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 8 additions & 1 deletion tests/docker/dockerfiles/debian-ppc64el-cross.docker
Expand Up @@ -52,10 +52,12 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
python3-yaml \
rpm2cpio \
sed \
socat \
sparse \
tar \
tesseract-ocr \
tesseract-ocr-eng && \
tesseract-ocr-eng \
zstd && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
Expand Down Expand Up @@ -166,3 +168,8 @@ ENV ABI "powerpc64le-linux-gnu"
ENV MESON_OPTS "--cross-file=powerpc64le-linux-gnu"
ENV QEMU_CONFIGURE_OPTS --cross-prefix=powerpc64le-linux-gnu-
ENV DEF_TARGET_LIST ppc64-softmmu,ppc64-linux-user
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/debian-riscv64-cross.docker
Expand Up @@ -50,3 +50,8 @@ RUN apt update && \
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=riscv64-linux-gnu-
ENV DEF_TARGET_LIST riscv64-softmmu,riscv64-linux-user
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/debian-riscv64-test-cross.docker
Expand Up @@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
gcc-riscv64-linux-gnu \
libc6-dev-riscv64-cross
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 8 additions & 1 deletion tests/docker/dockerfiles/debian-s390x-cross.docker
Expand Up @@ -52,10 +52,12 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
python3-yaml \
rpm2cpio \
sed \
socat \
sparse \
tar \
tesseract-ocr \
tesseract-ocr-eng && \
tesseract-ocr-eng \
zstd && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
Expand Down Expand Up @@ -165,3 +167,8 @@ ENV ABI "s390x-linux-gnu"
ENV MESON_OPTS "--cross-file=s390x-linux-gnu"
ENV QEMU_CONFIGURE_OPTS --cross-prefix=s390x-linux-gnu-
ENV DEF_TARGET_LIST s390x-softmmu,s390x-linux-user
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/debian-sh4-cross.docker
Expand Up @@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
gcc-sh4-linux-gnu \
libc6-dev-sh4-cross
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/debian-sparc64-cross.docker
Expand Up @@ -12,3 +12,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
eatmydata apt-get install --no-install-recommends -y \
gcc-sparc64-linux-gnu \
libc6-dev-sparc64-cross
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 7 additions & 2 deletions tests/docker/dockerfiles/debian-toolchain.docker
Expand Up @@ -30,7 +30,12 @@ ADD build-toolchain.sh /root/build-toolchain.sh
RUN cd /root && ./build-toolchain.sh

# Throw away the extra toolchain build deps, the downloaded source,
# and the build trees by restoring the original debian10 image,
# and the build trees by restoring the original image,
# then copying the built toolchain from stage 0.
FROM docker.io/library/debian:bullseye-slim
FROM docker.io/library/debian:11-slim
COPY --from=0 /usr/local /usr/local
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
15 changes: 8 additions & 7 deletions tests/docker/dockerfiles/debian-tricore-cross.docker
Expand Up @@ -20,6 +20,7 @@ RUN apt update && \
bzip2 \
ca-certificates \
ccache \
curl \
flex \
g++ \
gcc \
Expand All @@ -34,14 +35,14 @@ RUN apt update && \
python3-setuptools \
python3-wheel

RUN git clone --single-branch \
https://github.com/bkoppelmann/tricore-binutils.git \
/usr/src/binutils && \
cd /usr/src/binutils && chmod +x missing && \
CFLAGS=-w ./configure --prefix=/usr/local --disable-nls --target=tricore && \
make && make install && \
rm -rf /usr/src/binutils
RUN curl -#SL https://github.com/bkoppelmann/package_940/releases/download/tricore-toolchain-9.40/tricore-toolchain-9.4.0.tar.gz \
| tar -xzC /usr/local/

# This image can only build a very minimal QEMU as well as the tests
ENV DEF_TARGET_LIST tricore-softmmu
ENV QEMU_CONFIGURE_OPTS --disable-user --disable-tools --disable-fdt
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/debian-xtensa-cross.docker
Expand Up @@ -27,3 +27,8 @@ RUN for cpu in $CPU_LIST; do \
done

ENV PATH $PATH:/opt/$TOOLCHAIN_RELEASE/xtensa-dc232b-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-dc233c-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-de233_fpu-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-dsp3400-elf/bin
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/fedora-cris-cross.docker
Expand Up @@ -6,3 +6,8 @@ FROM registry.fedoraproject.org/fedora:33
ENV PACKAGES gcc-cris-linux-gnu
RUN dnf install -y $PACKAGES
RUN rpm -q $PACKAGES | sort > /packages.txt
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/fedora-i386-cross.docker
Expand Up @@ -32,3 +32,8 @@ ENV PKG_CONFIG_LIBDIR /usr/lib/pkgconfig

RUN dnf update -y && dnf install -y $PACKAGES
RUN rpm -q $PACKAGES | sort > /packages.txt
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 8 additions & 1 deletion tests/docker/dockerfiles/fedora-win32-cross.docker
Expand Up @@ -52,13 +52,15 @@ exec "$@"' > /usr/bin/nosync && \
python3-sphinx_rtd_theme \
rpm \
sed \
socat \
sparse \
spice-protocol \
tar \
tesseract \
tesseract-langpack-eng \
util-linux \
which && \
which \
zstd && \
nosync dnf autoremove -y && \
nosync dnf clean all -y

Expand Down Expand Up @@ -100,3 +102,8 @@ ENV ABI "i686-w64-mingw32"
ENV MESON_OPTS "--cross-file=/usr/share/mingw/toolchain-mingw32.meson"
ENV QEMU_CONFIGURE_OPTS --cross-prefix=i686-w64-mingw32-
ENV DEF_TARGET_LIST i386-softmmu
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 8 additions & 1 deletion tests/docker/dockerfiles/fedora-win64-cross.docker
Expand Up @@ -52,13 +52,15 @@ exec "$@"' > /usr/bin/nosync && \
python3-sphinx_rtd_theme \
rpm \
sed \
socat \
sparse \
spice-protocol \
tar \
tesseract \
tesseract-langpack-eng \
util-linux \
which && \
which \
zstd && \
nosync dnf autoremove -y && \
nosync dnf clean all -y

Expand Down Expand Up @@ -100,3 +102,8 @@ ENV ABI "x86_64-w64-mingw32"
ENV MESON_OPTS "--cross-file=/usr/share/mingw/toolchain-mingw64.meson"
ENV QEMU_CONFIGURE_OPTS --cross-prefix=x86_64-w64-mingw32-
ENV DEF_TARGET_LIST x86_64-softmmu
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 8 additions & 1 deletion tests/docker/dockerfiles/fedora.docker
Expand Up @@ -113,6 +113,7 @@ exec "$@"' > /usr/bin/nosync && \
rpm \
sed \
snappy-devel \
socat \
sparse \
spice-protocol \
spice-server-devel \
Expand All @@ -129,7 +130,8 @@ exec "$@"' > /usr/bin/nosync && \
xen-devel \
xfsprogs-devel \
zlib-devel \
zlib-static && \
zlib-static \
zstd && \
nosync dnf autoremove -y && \
nosync dnf clean all -y && \
rpm -qa | sort > /packages.txt && \
Expand All @@ -145,3 +147,8 @@ ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
9 changes: 8 additions & 1 deletion tests/docker/dockerfiles/opensuse-leap.docker
Expand Up @@ -97,6 +97,7 @@ RUN zypper update -y && \
sed \
snappy-devel \
sndio-devel \
socat \
sparse \
spice-protocol-devel \
systemd-devel \
Expand All @@ -112,7 +113,8 @@ RUN zypper update -y && \
xen-devel \
xfsprogs-devel \
zlib-devel \
zlib-devel-static && \
zlib-devel-static \
zstd && \
zypper clean --all && \
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
Expand All @@ -134,3 +136,8 @@ ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3.9"
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
5 changes: 5 additions & 0 deletions tests/docker/dockerfiles/python.docker
Expand Up @@ -15,3 +15,8 @@ ENV PACKAGES \

RUN dnf install -y $PACKAGES
RUN rpm -q $PACKAGES | sort > /packages.txt
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
12 changes: 8 additions & 4 deletions tests/docker/dockerfiles/ubuntu2004.docker
Expand Up @@ -119,13 +119,15 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
python3-yaml \
rpm2cpio \
sed \
socat \
sparse \
systemtap-sdt-dev \
tar \
tesseract-ocr \
tesseract-ocr-eng \
xfslibs-dev \
zlib1g-dev && \
zlib1g-dev \
zstd && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
Expand All @@ -145,6 +147,8 @@ ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
# Apply patch https://reviews.llvm.org/D75820
# This is required for TSan in clang-10 to compile with QEMU.
RUN sed -i 's/^const/static const/g' /usr/lib/llvm-10/lib/clang/10.0.0/include/sanitizer/tsan_interface.h
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
153 changes: 153 additions & 0 deletions tests/docker/dockerfiles/ubuntu2204.docker
@@ -0,0 +1,153 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool dockerfile --layers all ubuntu-2204 qemu
#
# https://gitlab.com/libvirt/libvirt-ci

FROM docker.io/library/ubuntu:22.04

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
bash \
bc \
bison \
bsdextrautils \
bzip2 \
ca-certificates \
ccache \
clang \
dbus \
debianutils \
diffutils \
exuberant-ctags \
findutils \
flex \
g++ \
gcc \
gcovr \
genisoimage \
gettext \
git \
hostname \
libaio-dev \
libasan5 \
libasound2-dev \
libattr1-dev \
libbpf-dev \
libbrlapi-dev \
libbz2-dev \
libc6-dev \
libcacard-dev \
libcap-ng-dev \
libcapstone-dev \
libcmocka-dev \
libcurl4-gnutls-dev \
libdaxctl-dev \
libdrm-dev \
libepoxy-dev \
libfdt-dev \
libffi-dev \
libfuse3-dev \
libgbm-dev \
libgcrypt20-dev \
libglib2.0-dev \
libglusterfs-dev \
libgnutls28-dev \
libgtk-3-dev \
libibumad-dev \
libibverbs-dev \
libiscsi-dev \
libjemalloc-dev \
libjpeg-turbo8-dev \
libjson-c-dev \
liblttng-ust-dev \
liblzo2-dev \
libncursesw5-dev \
libnfs-dev \
libnuma-dev \
libpam0g-dev \
libpcre2-dev \
libpixman-1-dev \
libpmem-dev \
libpng-dev \
libpulse-dev \
librbd-dev \
librdmacm-dev \
libsasl2-dev \
libsdl2-dev \
libsdl2-image-dev \
libseccomp-dev \
libselinux1-dev \
libslirp-dev \
libsnappy-dev \
libsndio-dev \
libspice-protocol-dev \
libspice-server-dev \
libssh-dev \
libsystemd-dev \
libtasn1-6-dev \
libubsan1 \
libudev-dev \
liburing-dev \
libusb-1.0-0-dev \
libusbredirhost-dev \
libvdeplug-dev \
libvirglrenderer-dev \
libvte-2.91-dev \
libxen-dev \
libzstd-dev \
llvm \
locales \
make \
meson \
multipath-tools \
ncat \
nettle-dev \
ninja-build \
openssh-client \
pkgconf \
python3 \
python3-numpy \
python3-opencv \
python3-pillow \
python3-pip \
python3-sphinx \
python3-sphinx-rtd-theme \
python3-venv \
python3-yaml \
rpm2cpio \
sed \
socat \
sparse \
systemtap-sdt-dev \
tar \
tesseract-ocr \
tesseract-ocr-eng \
xfslibs-dev \
zlib1g-dev \
zstd && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc

ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
# As a final step configure the user (if env is defined)
ARG USER
ARG UID
RUN if [ "${USER}" ]; then \
id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
2 changes: 1 addition & 1 deletion tests/docker/test-tsan
Expand Up @@ -21,7 +21,7 @@ setup_tsan()
tsan_log_dir="/tmp/qemu-test/build/tsan"
mkdir -p $tsan_log_dir > /dev/null || true
EXTRA_CONFIGURE_OPTS="${EXTRA_CONFIGURE_OPTS} --enable-tsan \
--cc=clang-10 --cxx=clang++-10 \
--cc=clang --cxx=clang++ \
--disable-werror --extra-cflags=-O0"
# detect deadlocks is false currently simply because
# TSan crashes immediately with deadlock detector enabled.
Expand Down
2 changes: 1 addition & 1 deletion tests/fp/berkeley-testfloat-3
Submodule berkeley-testfloat-3 updated from 5a59dc to 40619c
19 changes: 14 additions & 5 deletions tests/fp/fp-test.c
Expand Up @@ -106,7 +106,8 @@ static const char commands_string[] =
" -l = thoroughness level (1 (default), 2)\n"
" -r = rounding mode (even (default), zero, down, up, tieaway, odd)\n"
" Set to 'all' to test all rounding modes, if applicable\n"
" -s = stop when a test fails";
" -s = stop when a test fails\n"
" -q = minimise noise when testing, just show each function being tested";

static void usage_complete(int argc, char *argv[])
{
Expand Down Expand Up @@ -190,9 +191,11 @@ static void do_testfloat(int op, int rmode, bool exact)
ab_f128M_z_bool true_ab_f128M_z_bool;
ab_f128M_z_bool subj_ab_f128M_z_bool;

fputs(">> Testing ", stderr);
verCases_writeFunctionName(stderr);
fputs("\n", stderr);
if (verCases_verbosity) {
fputs(">> Testing ", stderr);
verCases_writeFunctionName(stderr);
fputs("\n", stderr);
}

if (!is_allowed(op, rmode)) {
not_implemented();
Expand Down Expand Up @@ -837,7 +840,7 @@ static void parse_args(int argc, char *argv[])
int c;

for (;;) {
c = getopt(argc, argv, "he:f:l:r:s");
c = getopt(argc, argv, "he:f:l:r:sq");
if (c < 0) {
break;
}
Expand Down Expand Up @@ -874,9 +877,15 @@ static void parse_args(int argc, char *argv[])
}
}
break;
/*
* The following flags are declared in testfloat/source/verCases_common.c
*/
case 's':
verCases_errorStop = true;
break;
case 'q':
verCases_verbosity = 0;
break;
case '?':
/* invalid option or missing argument; getopt prints error info */
exit(EXIT_FAILURE);
Expand Down
2 changes: 1 addition & 1 deletion tests/fp/meson.build
Expand Up @@ -609,7 +609,7 @@ softfloat_tests = {
# The full test suite can take a bit of time, default to a quick run
# "-l 2 -r all" can take more than a day for some operations and is best
# run manually
fptest_args = ['-s', '-l', '1']
fptest_args = ['-q', '-s', '-l', '1']
fptest_rounding_args = ['-r', 'all']

# Conversion Routines:
Expand Down
2 changes: 1 addition & 1 deletion tests/lcitool/libvirt-ci
Submodule libvirt-ci updated from 1c3e16 to 232f41
2 changes: 2 additions & 0 deletions tests/lcitool/projects/qemu.yml
Expand Up @@ -101,6 +101,7 @@ packages:
- sed
- snappy
- sndio
- socat
- sparse
- spice-protocol
- spice-server
Expand All @@ -115,5 +116,6 @@ packages:
- which
- xen
- xfsprogs
- zstdtools
- zlib
- zlib-static
26 changes: 17 additions & 9 deletions tests/lcitool/refresh
Expand Up @@ -53,13 +53,28 @@ def generate(filename, cmd, trailer):
content += trailer
atomic_write(filename, content)

# Optional user setting, this will always be the last thing added
# so maximise the number of layers that are cached
add_user_mapping = [
"# As a final step configure the user (if env is defined)",
"ARG USER",
"ARG UID",
"RUN if [ \"${USER}\" ]; then \\",
" id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi\n"
]

def generate_dockerfile(host, target, cross=None, trailer=None):
filename = Path(src_dir, "tests", "docker", "dockerfiles", host + ".docker")
cmd = lcitool_cmd + ["dockerfile"]
if cross is not None:
cmd.extend(["--cross", cross])
cmd.extend([target, "qemu"])

if trailer is not None:
trailer += "\n".join(add_user_mapping)
else:
trailer = "\n".join(add_user_mapping)

generate(filename, cmd, trailer)


Expand All @@ -69,13 +84,6 @@ def generate_cirrus(target, trailer=None):
generate(filename, cmd, trailer)


ubuntu2004_tsanhack = [
"# Apply patch https://reviews.llvm.org/D75820\n",
"# This is required for TSan in clang-10 to compile with QEMU.\n",
"RUN sed -i 's/^const/static const/g' /usr/lib/llvm-10/lib/clang/10.0.0/include/sanitizer/tsan_interface.h\n"
]


# Netmap still needs to be manually built as it is yet to be packaged
# into a distro. We also add cscope and gtags which are used in the CI
# test
Expand Down Expand Up @@ -113,8 +121,8 @@ try:
trailer="".join(debian11_extras))
generate_dockerfile("fedora", "fedora-37")
generate_dockerfile("opensuse-leap", "opensuse-leap-153")
generate_dockerfile("ubuntu2004", "ubuntu-2004",
trailer="".join(ubuntu2004_tsanhack))
generate_dockerfile("ubuntu2004", "ubuntu-2004")
generate_dockerfile("ubuntu2204", "ubuntu-2204")

#
# Cross compiling builds
Expand Down
4 changes: 2 additions & 2 deletions tests/qtest/fuzz-lsi53c895a-test.c
Expand Up @@ -112,12 +112,12 @@ static void test_lsi_do_dma_empty_queue(void)

int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);

if (!qtest_has_device("lsi53c895a")) {
return 0;
}

g_test_init(&argc, &argv, NULL);

qtest_add_func("fuzz/lsi53c895a/lsi_do_dma_empty_queue",
test_lsi_do_dma_empty_queue);

Expand Down
3 changes: 2 additions & 1 deletion tests/qtest/rtl8139-test.c
Expand Up @@ -207,9 +207,10 @@ int main(int argc, char **argv)
verbosity_level = atoi(v_env);
}

g_test_init(&argc, &argv, NULL);

qtest_start("-device rtl8139");

g_test_init(&argc, &argv, NULL);
qtest_add_func("/rtl8139/nop", nop);
qtest_add_func("/rtl8139/timer", test_init);

Expand Down
6 changes: 3 additions & 3 deletions tests/tcg/tricore/Makefile.softmmu-target
@@ -1,7 +1,7 @@
TESTS_PATH = $(SRC_PATH)/tests/tcg/tricore

LDFLAGS = -T$(TESTS_PATH)/link.ld
ASFLAGS =
LDFLAGS = -T$(TESTS_PATH)/link.ld --mcpu=tc162
ASFLAGS = -mtc162

TESTS += test_abs.tst
TESTS += test_bmerge.tst
Expand All @@ -19,7 +19,7 @@ TESTS += test_madd.tst
TESTS += test_msub.tst
TESTS += test_muls.tst

QEMU_OPTS += -M tricore_testboard -nographic -kernel
QEMU_OPTS += -M tricore_testboard -cpu tc27x -nographic -kernel

%.pS: $(TESTS_PATH)/%.S
$(HOST_CC) -E -o $@ $<
Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/tricore/macros.h
Expand Up @@ -174,7 +174,7 @@ test_ ## num: \
TEST_CASE_E(num, res_lo, res_hi, \
LI(DREG_RS1, rs1); \
rstv; \
insn EREG_CALC_RESULT, imm1, DREG_RS1, imm2); \
insn EREG_CALC_RESULT, imm1, DREG_RS1, imm2; \
)


Expand Down
10 changes: 7 additions & 3 deletions tests/unit/test-io-channel-command.c
Expand Up @@ -31,7 +31,7 @@

static char *socat = NULL;

#ifndef _WIN32
#if !defined(_WIN32) && !defined(CONFIG_DARWIN)
static void test_io_channel_command_fifo(bool async)
{
g_autofree gchar *tmpdir = g_dir_make_tmp("qemu-test-io-channel.XXXXXX", NULL);
Expand All @@ -42,6 +42,7 @@ static void test_io_channel_command_fifo(bool async)
g_auto(GStrv) dstargv = g_strsplit(dstargs, " ", -1);
QIOChannel *src, *dst;
QIOChannelTest *test;
int err;

if (mkfifo(fifo, 0600)) {
g_error("mkfifo: %s", strerror(errno));
Expand All @@ -61,7 +62,10 @@ static void test_io_channel_command_fifo(bool async)
object_unref(OBJECT(src));
object_unref(OBJECT(dst));

g_rmdir(tmpdir);
err = g_unlink(fifo);
g_assert(err == 0);
err = g_rmdir(tmpdir);
g_assert(err == 0);
}

static void test_io_channel_command_fifo_async(void)
Expand Down Expand Up @@ -128,7 +132,7 @@ int main(int argc, char **argv)

socat = g_find_program_in_path("socat");

#ifndef _WIN32
#if !defined(_WIN32) && !defined(CONFIG_DARWIN)
g_test_add_func("/io/channel/command/fifo/sync",
test_io_channel_command_fifo_sync);
g_test_add_func("/io/channel/command/fifo/async",
Expand Down