aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-10-17 20:52:55 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-10-17 20:52:55 +0100
commit782d7b30dd8e27ba24346e7c411b476db88b59e7 (patch)
treec0210a939d942717719a7249639b8149f9d9c248 /tests
parente12ce85b2c79d83a340953291912875c30b3af06 (diff)
parentc47110d90fa5401bcc42c17f8ae0724a1c96599a (diff)
downloadqemu-782d7b30dd8e27ba24346e7c411b476db88b59e7.zip
qemu-782d7b30dd8e27ba24346e7c411b476db88b59e7.tar.gz
qemu-782d7b30dd8e27ba24346e7c411b476db88b59e7.tar.bz2
Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging
* Drop ninjatool and just require ninja (Paolo) * Fix docs build under msys2 (Yonggang) * HAX snafu fix (Claudio) * Disable signal handlers during fuzzing (Alex) * Miscellaneous fixes (Bruce, Greg) # gpg: Signature made Sat 17 Oct 2020 15:45:56 BST # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini-gitlab/tags/for-upstream: (22 commits) ci: include configure and meson logs in all jobs if configure fails hax: unbreak accelerator cpu code after cpus.c split fuzz: Disable QEMU's SIG{INT,HUP,TERM} handlers cirrus: Enable doc build on msys2/mingw meson: Move the detection logic for sphinx to meson meson: move SPHINX_ARGS references within "if build_docs" docs: Fix Sphinx configuration for msys2/mingw meson: Only install icons and qemu.desktop if have_system configure: fix handling of --docdir parameter meson: cleanup curses/iconv test meson.build: don't condition iconv detection on library detection build: add --enable/--disable-libudev build: replace ninjatool with ninja build: cleanups to Makefile add ninja to dockerfiles, CI configurations and test VMs dockerfiles: enable Centos 8 PowerTools configure: move QEMU_INCLUDES to meson tests: add missing generated sources to testqapi make: run shell with pipefail tests/Makefile.include: unbreak non-tcg builds ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.include2
-rw-r--r--tests/docker/dockerfiles/centos7.docker1
-rw-r--r--tests/docker/dockerfiles/centos8.docker5
-rw-r--r--tests/docker/dockerfiles/debian10.docker1
-rw-r--r--tests/docker/dockerfiles/fedora.docker1
-rw-r--r--tests/docker/dockerfiles/travis.docker2
-rw-r--r--tests/docker/dockerfiles/ubuntu.docker1
-rw-r--r--tests/docker/dockerfiles/ubuntu1804.docker1
-rw-r--r--tests/docker/dockerfiles/ubuntu2004.docker1
-rw-r--r--tests/include/meson.build8
-rw-r--r--tests/meson.build14
-rw-r--r--tests/qapi-schema/meson.build88
-rw-r--r--tests/qtest/fuzz/fuzz.c8
-rwxr-xr-xtests/vm/centos2
-rwxr-xr-xtests/vm/centos.aarch642
-rwxr-xr-xtests/vm/fedora2
-rwxr-xr-xtests/vm/freebsd1
-rwxr-xr-xtests/vm/netbsd1
-rwxr-xr-xtests/vm/openbsd1
-rwxr-xr-xtests/vm/ubuntu.aarch642
-rwxr-xr-xtests/vm/ubuntu.i3862
21 files changed, 88 insertions, 58 deletions
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 5aca98e..3a0524c 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -140,7 +140,7 @@ QEMU_IOTESTS_HELPERS-$(CONFIG_LINUX) = tests/qemu-iotests/socket_scm_helper$(EXE
check: check-block
check-block: $(SRC_PATH)/tests/check-block.sh qemu-img$(EXESUF) \
qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) \
- $(patsubst %-softmmu,qemu-system-%,$(filter %-softmmu,$(TARGET_DIRS)))
+ $(filter qemu-system-%, $(ninja-targets))
@$<
endif
diff --git a/tests/docker/dockerfiles/centos7.docker b/tests/docker/dockerfiles/centos7.docker
index 4627777..8b27372 100644
--- a/tests/docker/dockerfiles/centos7.docker
+++ b/tests/docker/dockerfiles/centos7.docker
@@ -27,6 +27,7 @@ ENV PACKAGES \
mesa-libEGL-devel \
mesa-libgbm-devel \
nettle-devel \
+ ninja-build \
perl-Test-Harness \
pixman-devel \
python3 \
diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerfiles/centos8.docker
index 0fc2697..585dfad 100644
--- a/tests/docker/dockerfiles/centos8.docker
+++ b/tests/docker/dockerfiles/centos8.docker
@@ -19,6 +19,7 @@ ENV PACKAGES \
make \
mesa-libEGL-devel \
nettle-devel \
+ ninja-build \
perl-Test-Harness \
pixman-devel \
python36 \
@@ -28,5 +29,7 @@ ENV PACKAGES \
tar \
zlib-devel
-RUN dnf install -y $PACKAGES
+RUN dnf install -y dnf-plugins-core && \
+ dnf config-manager --set-enabled PowerTools && \
+ dnf install -y $PACKAGES
RUN rpm -q $PACKAGES | sort > /packages.txt
diff --git a/tests/docker/dockerfiles/debian10.docker b/tests/docker/dockerfiles/debian10.docker
index 1e4188b..21cc671 100644
--- a/tests/docker/dockerfiles/debian10.docker
+++ b/tests/docker/dockerfiles/debian10.docker
@@ -26,6 +26,7 @@ RUN apt update && \
gettext \
git \
libncurses5-dev \
+ ninja-build \
pkg-config \
psmisc \
python3 \
diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
index 85c9755..ac79d95 100644
--- a/tests/docker/dockerfiles/fedora.docker
+++ b/tests/docker/dockerfiles/fedora.docker
@@ -75,6 +75,7 @@ ENV PACKAGES \
mingw64-SDL2 \
ncurses-devel \
nettle-devel \
+ ninja-build \
nss-devel \
numactl-devel \
perl \
diff --git a/tests/docker/dockerfiles/travis.docker b/tests/docker/dockerfiles/travis.docker
index 5912825..cd1435a 100644
--- a/tests/docker/dockerfiles/travis.docker
+++ b/tests/docker/dockerfiles/travis.docker
@@ -9,7 +9,7 @@ ENV LC_ALL en_US.UTF-8
RUN sed -i "s/# deb-src/deb-src/" /etc/apt/sources.list
RUN apt-get update
RUN apt-get -y build-dep qemu
-RUN apt-get -y install device-tree-compiler python3 python3-yaml dh-autoreconf gdb strace lsof net-tools gcovr
+RUN apt-get -y install device-tree-compiler python3 python3-yaml dh-autoreconf gdb strace lsof net-tools gcovr ninja-build
# Travis tools require PhantomJS / Neo4j / Maven accessible
# in their PATH (QEMU build won't access them).
ENV PATH /usr/local/phantomjs/bin:/usr/local/phantomjs:/usr/local/neo4j-3.2.7/bin:/usr/local/maven-3.5.2/bin:/usr/local/cmake-3.9.2/bin:/usr/local/clang-5.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
diff --git a/tests/docker/dockerfiles/ubuntu.docker b/tests/docker/dockerfiles/ubuntu.docker
index b556ed1..b5ef7a8 100644
--- a/tests/docker/dockerfiles/ubuntu.docker
+++ b/tests/docker/dockerfiles/ubuntu.docker
@@ -60,6 +60,7 @@ ENV PACKAGES \
libxen-dev \
libzstd-dev \
make \
+ ninja-build \
python3-yaml \
python3-sphinx \
sparse \
diff --git a/tests/docker/dockerfiles/ubuntu1804.docker b/tests/docker/dockerfiles/ubuntu1804.docker
index a6a7617..9b0a19b 100644
--- a/tests/docker/dockerfiles/ubuntu1804.docker
+++ b/tests/docker/dockerfiles/ubuntu1804.docker
@@ -48,6 +48,7 @@ ENV PACKAGES \
make \
python3-yaml \
python3-sphinx \
+ ninja-build \
sparse \
xfslibs-dev
RUN apt-get update && \
diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker
index f4b9556..17b37cd 100644
--- a/tests/docker/dockerfiles/ubuntu2004.docker
+++ b/tests/docker/dockerfiles/ubuntu2004.docker
@@ -47,6 +47,7 @@ ENV PACKAGES flex bison \
libxen-dev \
libzstd-dev \
make \
+ ninja-build \
python3-numpy \
python3-opencv \
python3-pil \
diff --git a/tests/include/meson.build b/tests/include/meson.build
index fea3a63..9abba30 100644
--- a/tests/include/meson.build
+++ b/tests/include/meson.build
@@ -10,7 +10,7 @@ test_qapi_outputs_extra = [
'test-qapi-visit-sub-module.h',
]
-test_qapi_outputs_extra = custom_target('QAPI test (include)',
- output: test_qapi_outputs_extra,
- input: test_qapi_files,
- command: 'true')
+test_qapi_files_extra = custom_target('QAPI test (include)',
+ output: test_qapi_outputs_extra,
+ input: test_qapi_files,
+ command: 'true')
diff --git a/tests/meson.build b/tests/meson.build
index bf47a38..afeb6be 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -56,8 +56,18 @@ test_qapi_files = custom_target('Test QAPI files',
# perhaps change qapi_gen to replace / with _, like Meson itself does?
subdir('include')
-libtestqapi = static_library('testqapi', sources: [test_qapi_files, genh, test_qapi_outputs_extra])
-testqapi = declare_dependency(link_with: libtestqapi)
+test_qapi_sources = []
+test_qapi_headers = []
+i = 0
+foreach o: test_qapi_files.to_list() + test_qapi_files_extra.to_list()
+ if o.full_path().endswith('.h')
+ test_qapi_headers += o
+ endif
+ test_qapi_sources += o
+endforeach
+
+libtestqapi = static_library('testqapi', sources: [genh, test_qapi_sources])
+testqapi = declare_dependency(link_with: libtestqapi, sources: [genh, test_qapi_headers])
testblock = declare_dependency(dependencies: [block], sources: 'iothread.c')
diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build
index 1f222a7..304ef93 100644
--- a/tests/qapi-schema/meson.build
+++ b/tests/qapi-schema/meson.build
@@ -219,53 +219,53 @@ qapi_doc = custom_target('QAPI doc',
'-p', 'doc-good-', '@INPUT0@' ],
depend_files: qapi_gen_depends)
-# Test the document-comment document generation code by running a test schema
-# file through Sphinx's plain-text builder and comparing the result against
-# a golden reference. This is in theory susceptible to failures if Sphinx
-# changes its output, but the text output has historically been very stable
-# (no changes between Sphinx 1.6 and 3.0), so it is a better bet than
-# texinfo or HTML generation, both of which have had changes. We might
-# need to add more sophisticated logic here in future for some sort of
-# fuzzy comparison if future Sphinx versions produce different text,
-# but for now the simple comparison suffices.
-qapi_doc_out = custom_target('QAPI rST doc',
- output: ['doc-good.txt'],
- input: files('doc-good.json', 'doc-good.rst'),
- build_by_default: build_docs,
- depend_files: sphinx_extn_depends,
- # We use -E to suppress Sphinx's caching, because
- # we want it to always really run the QAPI doc
- # generation code. It also means we don't
- # clutter up the build dir with the cache.
- command: [SPHINX_ARGS,
- '-b', 'text', '-E',
- '-c', meson.source_root() / 'docs',
- '-D', 'master_doc=doc-good',
- meson.current_source_dir(),
- meson.current_build_dir()])
+if build_docs
+ # Test the document-comment document generation code by running a test schema
+ # file through Sphinx's plain-text builder and comparing the result against
+ # a golden reference. This is in theory susceptible to failures if Sphinx
+ # changes its output, but the text output has historically been very stable
+ # (no changes between Sphinx 1.6 and 3.0), so it is a better bet than
+ # texinfo or HTML generation, both of which have had changes. We might
+ # need to add more sophisticated logic here in future for some sort of
+ # fuzzy comparison if future Sphinx versions produce different text,
+ # but for now the simple comparison suffices.
+ qapi_doc_out = custom_target('QAPI rST doc',
+ output: ['doc-good.txt'],
+ input: files('doc-good.json', 'doc-good.rst'),
+ build_by_default: true,
+ depend_files: sphinx_extn_depends,
+ # We use -E to suppress Sphinx's caching, because
+ # we want it to always really run the QAPI doc
+ # generation code. It also means we don't
+ # clutter up the build dir with the cache.
+ command: [SPHINX_ARGS,
+ '-b', 'text', '-E',
+ '-c', meson.source_root() / 'docs',
+ '-D', 'master_doc=doc-good',
+ meson.current_source_dir(),
+ meson.current_build_dir()])
-# Fix possible inconsistency in line endings in generated output and
-# in the golden reference (which could otherwise cause test failures
-# on Windows hosts). Unfortunately diff --strip-trailing-cr
-# is GNU-diff only. The odd-looking perl is because we must avoid
-# using an explicit '\' character in the command arguments to
-# a custom_target(), as Meson will unhelpfully replace it with a '/'
-# (https://github.com/mesonbuild/meson/issues/1564)
-qapi_doc_out_nocr = custom_target('QAPI rST doc newline-sanitized',
- output: ['doc-good.txt.nocr'],
- input: qapi_doc_out[0],
- build_by_default: build_docs,
- command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
- capture: true)
+ # Fix possible inconsistency in line endings in generated output and
+ # in the golden reference (which could otherwise cause test failures
+ # on Windows hosts). Unfortunately diff --strip-trailing-cr
+ # is GNU-diff only. The odd-looking perl is because we must avoid
+ # using an explicit '\' character in the command arguments to
+ # a custom_target(), as Meson will unhelpfully replace it with a '/'
+ # (https://github.com/mesonbuild/meson/issues/1564)
+ qapi_doc_out_nocr = custom_target('QAPI rST doc newline-sanitized',
+ output: ['doc-good.txt.nocr'],
+ input: qapi_doc_out[0],
+ build_by_default: true,
+ command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
+ capture: true)
-qapi_doc_ref_nocr = custom_target('QAPI rST doc reference newline-sanitized',
- output: ['doc-good.ref.nocr'],
- input: files('doc-good.txt'),
- build_by_default: build_docs,
- command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
- capture: true)
+ qapi_doc_ref_nocr = custom_target('QAPI rST doc reference newline-sanitized',
+ output: ['doc-good.ref.nocr'],
+ input: files('doc-good.txt'),
+ build_by_default: true,
+ command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
+ capture: true)
-if build_docs
# "full_path()" needed here to work around
# https://github.com/mesonbuild/meson/issues/7585
test('QAPI rST doc', diff, args: ['-u', qapi_doc_ref_nocr[0].full_path(),
diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index d926c49..eb00704 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -217,5 +217,13 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
/* re-enable the rcu atfork, which was previously disabled in qemu_init */
rcu_enable_atfork();
+ /*
+ * Disable QEMU's signal handlers, since we manually control the main_loop,
+ * and don't check for main_loop_should_exit
+ */
+ signal(SIGINT, SIG_DFL);
+ signal(SIGHUP, SIG_DFL);
+ signal(SIGTERM, SIG_DFL);
+
return 0;
}
diff --git a/tests/vm/centos b/tests/vm/centos
index 0ad4ecf..efe3dbb 100755
--- a/tests/vm/centos
+++ b/tests/vm/centos
@@ -42,7 +42,7 @@ class CentosVM(basevm.BaseVM):
self.wait_ssh()
self.ssh_root_check("touch /etc/cloud/cloud-init.disabled")
self.ssh_root_check("yum update -y")
- self.ssh_root_check("yum install -y docker make git python3")
+ self.ssh_root_check("yum install -y docker make ninja-build git python3")
self.ssh_root_check("systemctl enable docker")
self.ssh_root("poweroff")
self.wait()
diff --git a/tests/vm/centos.aarch64 b/tests/vm/centos.aarch64
index d5232ec..e687b93 100755
--- a/tests/vm/centos.aarch64
+++ b/tests/vm/centos.aarch64
@@ -23,7 +23,7 @@ import aarch64vm
DEFAULT_CONFIG = {
'cpu' : "max",
'machine' : "virt,gic-version=max",
- 'install_cmds' : "yum install -y make git python3 gcc gcc-c++ flex bison, "\
+ 'install_cmds' : "yum install -y make ninja-build git python3 gcc gcc-c++ flex bison, "\
"yum install -y glib2-devel pixman-devel zlib-devel, "\
"yum install -y perl-Test-Harness, "\
"alternatives --set python /usr/bin/python3, "\
diff --git a/tests/vm/fedora b/tests/vm/fedora
index b2b478f..b977efe 100755
--- a/tests/vm/fedora
+++ b/tests/vm/fedora
@@ -32,7 +32,7 @@ class FedoraVM(basevm.BaseVM):
pkgs = [
# tools
'git-core',
- 'gcc', 'binutils', 'make',
+ 'gcc', 'binutils', 'make', 'ninja-build',
# perl
'perl-Test-Harness',
diff --git a/tests/vm/freebsd b/tests/vm/freebsd
index 5f866e0..04ee793 100755
--- a/tests/vm/freebsd
+++ b/tests/vm/freebsd
@@ -34,6 +34,7 @@ class FreeBSDVM(basevm.BaseVM):
"bzip2",
"python37",
"py37-setuptools",
+ "ninja",
# gnu tools
"bash",
diff --git a/tests/vm/netbsd b/tests/vm/netbsd
index ffb65a8..447de97 100755
--- a/tests/vm/netbsd
+++ b/tests/vm/netbsd
@@ -32,6 +32,7 @@ class NetBSDVM(basevm.BaseVM):
"xz",
"python37",
"py37-setuptools",
+ "ninja-build",
# gnu tools
"bash",
diff --git a/tests/vm/openbsd b/tests/vm/openbsd
index 8356646..ad882a7 100755
--- a/tests/vm/openbsd
+++ b/tests/vm/openbsd
@@ -31,6 +31,7 @@ class OpenBSDVM(basevm.BaseVM):
"pkgconf",
"bzip2", "xz",
"py3-setuptools",
+ "ninja",
# gnu tools
"bash",
diff --git a/tests/vm/ubuntu.aarch64 b/tests/vm/ubuntu.aarch64
index 21d454c..b291945 100755
--- a/tests/vm/ubuntu.aarch64
+++ b/tests/vm/ubuntu.aarch64
@@ -22,7 +22,7 @@ DEFAULT_CONFIG = {
'machine' : "virt,gic-version=3",
'install_cmds' : "apt-get update,"\
"apt-get build-dep -y --arch-only qemu,"\
- "apt-get install -y libfdt-dev pkg-config language-pack-en",
+ "apt-get install -y libfdt-dev pkg-config language-pack-en ninja-build",
# We increase beyond the default time since during boot
# it can take some time (many seconds) to log into the VM
# especially using softmmu.
diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386
index 5ce7261..47681b6 100755
--- a/tests/vm/ubuntu.i386
+++ b/tests/vm/ubuntu.i386
@@ -18,7 +18,7 @@ import ubuntuvm
DEFAULT_CONFIG = {
'install_cmds' : "apt-get update,"\
"apt-get build-dep -y qemu,"\
- "apt-get install -y libfdt-dev language-pack-en",
+ "apt-get install -y libfdt-dev language-pack-en ninja-build",
}
class UbuntuX86VM(ubuntuvm.UbuntuVM):