From 2af43a6a59d6a113afb34f21b3d81264288ca735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 10 Dec 2020 19:04:17 +0000 Subject: tests/tcg: build tests with -Werror MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hopefully this will guard against sloppy code getting into our tests. Suggested-by: Paolo Bonzini Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20201210190417.31673-9-alex.bennee@linaro.org> --- tests/tcg/Makefile.target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 2ae86776cd..24d75a5801 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -94,7 +94,7 @@ ifdef CONFIG_USER_ONLY -include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.target # Add the common build options -CFLAGS+=-Wall -O0 -g -fno-strict-aliasing +CFLAGS+=-Wall -Werror -O0 -g -fno-strict-aliasing ifeq ($(BUILD_STATIC),y) LDFLAGS+=-static endif -- cgit v1.2.3 From ee381b7fe1469d6ef4e11675608118eca7bc8f05 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 15 Dec 2020 09:34:51 +0100 Subject: gitlab-CI: Test 32-bit builds with the fedora-i386-cross container MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After adding some missing packages, it's possible to check 32-bit builds and tests with the fedora-i386-cross container in the gitlab-CI, too. Unfortunately, the code in subprojects/ ignores the --extra-cflags (on purpose), so the vhost-user part has to be disabled for this. While we're at it, update the container to Fedora 31. Unfortunately the gcc from the later versions emits some very dubious format-truncation warnings, so Fedora 32 and 33 are currently unsuitable for this job. Signed-off-by: Thomas Huth Reviewed-by: Wainer dos Santos Moschetta Message-Id: <20201215083451.92322-1-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/docker/dockerfiles/fedora-i386-cross.docker | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/docker/dockerfiles/fedora-i386-cross.docker b/tests/docker/dockerfiles/fedora-i386-cross.docker index cd16cd1bfa..a6e411291b 100644 --- a/tests/docker/dockerfiles/fedora-i386-cross.docker +++ b/tests/docker/dockerfiles/fedora-i386-cross.docker @@ -1,14 +1,26 @@ -FROM fedora:30 +FROM fedora:31 ENV PACKAGES \ + bzip2 \ + diffutils \ + findutils \ gcc \ + git \ + libtasn1-devel.i686 \ + libzstd-devel.i686 \ + make \ + meson \ + ninja-build \ glib2-devel.i686 \ glibc-devel.i686 \ glibc-static.i686 \ gnutls-devel.i686 \ nettle-devel.i686 \ + perl-Test-Harness \ pixman-devel.i686 \ - zlib-devel.i686 \ - libzstd-devel.i686 + zlib-devel.i686 + +ENV QEMU_CONFIGURE_OPTS --extra-cflags=-m32 --disable-vhost-user +ENV PKG_CONFIG_PATH /usr/lib/pkgconfig RUN dnf install -y $PACKAGES RUN rpm -q $PACKAGES | sort > /packages.txt -- cgit v1.2.3 From c9d78b06c060eeb01c62872a675cafd2a4f1af99 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 15 Dec 2020 09:33:18 +0100 Subject: tests/docker: Remove the remainders of debian9 containers from the Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Debian 9 containers have been removed a while ago, so we can delete the corresponding entries in the Makefile, too. Fixes: e3755276d1 ("tests/docker: Remove old Debian 9 containers") Signed-off-by: Thomas Huth Reviewed-by: Wainer dos Santos Moschetta Message-Id: <20201215083318.92205-1-thuth@redhat.com> Signed-off-by: Alex Bennée --- tests/docker/Makefile.include | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 02ec92830b..c254ac38d0 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -11,8 +11,7 @@ HOST_ARCH = $(if $(ARCH),$(ARCH),$(shell uname -m)) DOCKER_SUFFIX := .docker DOCKER_FILES_DIR := $(SRC_PATH)/tests/docker/dockerfiles # we don't run tests on intermediate images (used as base by another image) -DOCKER_PARTIAL_IMAGES := debian9 debian10 debian11 -DOCKER_PARTIAL_IMAGES += debian9-mxe debian-bootstrap +DOCKER_PARTIAL_IMAGES := debian10 debian11 debian-bootstrap DOCKER_IMAGES := $(sort $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.docker)))) DOCKER_TARGETS := $(patsubst %,docker-image-%,$(DOCKER_IMAGES)) # Use a global constant ccache directory to speed up repetitive builds @@ -96,7 +95,6 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker endif # Enforce dependencies for composite images -docker-image-debian9-mxe: docker-image-debian9 ifeq ($(HOST_ARCH),x86_64) docker-image-debian-amd64: docker-image-debian10 DOCKER_PARTIAL_IMAGES += debian-amd64-cross @@ -104,8 +102,6 @@ else docker-image-debian-amd64-cross: docker-image-debian10 DOCKER_PARTIAL_IMAGES += debian-amd64 endif -docker-image-debian-win32-cross: docker-image-debian9-mxe -docker-image-debian-win64-cross: docker-image-debian9-mxe # For non-x86 hosts not all cross-compilers have been packaged ifneq ($(HOST_ARCH),x86_64) -- cgit v1.2.3 From 90e0c9b3097c861bda9499cd8a5c2f88fc7f859e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Wed, 16 Dec 2020 14:16:53 +0000 Subject: tests: update for rename of CentOS8 PowerTools repo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was intentionally renamed recently to be all lowercase: https://bugs.centos.org/view.php?id=17920 https://wiki.centos.org/Manuals/ReleaseNotes/CentOS8.2011#Yum_repo_file_and_repoid_changes Signed-off-by: Daniel P. Berrangé Reviewed-by: Willian Rampazzo Message-Id: <20201216141653.213980-1-berrange@redhat.com> [AJB: bump up FROM to trigger re-build, add diffutils] Signed-off-by: Alex Bennée --- tests/docker/dockerfiles/centos8.docker | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerfiles/centos8.docker index 54bc6d54cd..64cb7a6eda 100644 --- a/tests/docker/dockerfiles/centos8.docker +++ b/tests/docker/dockerfiles/centos8.docker @@ -1,4 +1,4 @@ -FROM centos:8.1.1911 +FROM centos:8.3.2011 RUN dnf -y update ENV PACKAGES \ @@ -6,6 +6,7 @@ ENV PACKAGES \ bzip2 \ bzip2-devel \ dbus-daemon \ + diffutils \ gcc \ gcc-c++ \ genisoimage \ @@ -31,6 +32,6 @@ ENV PACKAGES \ zlib-devel RUN dnf install -y dnf-plugins-core && \ - dnf config-manager --set-enabled PowerTools && \ + dnf config-manager --set-enabled powertools && \ dnf install -y $PACKAGES RUN rpm -q $PACKAGES | sort > /packages.txt -- cgit v1.2.3 From 08bdf5d44f999c92399ff73df00f2ea2c7ee04bd Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 15 Dec 2020 17:41:32 -0500 Subject: test-char: Destroy chardev correctly at char_file_test_internal() commit 1e419ee68fa5 ("chardev: generate an internal id when none given") changed the reference ownership semantics of qemu_chardev_new(NULL, ...): now all chardevs created using qemu_chardev_new() are added to the /chardevs QOM container, and the caller does not own a reference to the newly created object. However, the code at char_file_test_internal() had not been updated and was calling object_unref() on a chardev object it didn't own. This makes the chardev be destroyed, but leaves a dangling pointer in the /chardev container children list, and seems to be the cause of the following char_serial_test() crash: Unexpected error in object_property_try_add() at ../qom/object.c:1220: \ attempt to add duplicate property 'serial-id' to object (type 'container') ERROR test-char - too few tests run (expected 38, got 9) Update the code to use object_unparent() at the end of char_file_test_internal(), to make sure the chardev will be correctly removed from the QOM tree. Fixes: 1e419ee68fa5 ("chardev: generate an internal id when none given") Signed-off-by: Eduardo Habkost Message-Id: <20201215224133.3545901-2-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini --- tests/test-char.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-char.c b/tests/test-char.c index 953e0d1c1f..06102977b6 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -1298,7 +1298,7 @@ static void char_file_test_internal(Chardev *ext_chr, const char *filepath) g_assert(strncmp(contents, "hello!", 6) == 0); if (!ext_chr) { - object_unref(OBJECT(chr)); + object_unparent(OBJECT(chr)); g_unlink(out); } g_free(contents); -- cgit v1.2.3 From 24496fe851268eec3994489a772842484376507d Mon Sep 17 00:00:00 2001 From: Daniele Buono Date: Fri, 4 Dec 2020 18:06:13 -0500 Subject: check-block: enable iotests with cfi-icall cfi-icall is a form of Control-Flow Integrity for indirect function calls implemented by llvm. It is enabled with a -fsanitize flag. iotests are currently disabled when -fsanitize options is used, with the exception of SafeStack. This patch implements a generic filtering mechanism to allow iotests with a set of known-to-be-safe -fsanitize option. Then marks SafeStack and the new options used for cfi-icall safe for iotests Signed-off-by: Daniele Buono Message-Id: <20201204230615.2392-4-dbuono@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini --- tests/check-block.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/check-block.sh b/tests/check-block.sh index f6b1bda7b9..fb4c1baae9 100755 --- a/tests/check-block.sh +++ b/tests/check-block.sh @@ -21,14 +21,18 @@ if grep -q "CONFIG_GPROF=y" config-host.mak 2>/dev/null ; then exit 0 fi -# Disable tests with any sanitizer except for SafeStack -CFLAGS=$( grep "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null ) -SANITIZE_FLAGS="" -#Remove all occurrencies of -fsanitize=safe-stack -for i in ${CFLAGS}; do - if [ "${i}" != "-fsanitize=safe-stack" ]; then - SANITIZE_FLAGS="${SANITIZE_FLAGS} ${i}" +# Disable tests with any sanitizer except for specific ones +SANITIZE_FLAGS=$( grep "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null ) +ALLOWED_SANITIZE_FLAGS="safe-stack cfi-icall" +#Remove all occurrencies of allowed Sanitize flags +for j in ${ALLOWED_SANITIZE_FLAGS}; do + TMP_FLAGS=${SANITIZE_FLAGS} + SANITIZE_FLAGS="" + for i in ${TMP_FLAGS}; do + if ! echo ${i} | grep -q "${j}" 2>/dev/null; then + SANITIZE_FLAGS="${SANITIZE_FLAGS} ${i}" fi + done done if echo ${SANITIZE_FLAGS} | grep -q "\-fsanitize" 2>/dev/null; then # Have a sanitize flag that is not allowed, stop -- cgit v1.2.3 From acb1e6db849151ef6e271027904b6cfea2d5880c Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 14 Dec 2020 12:12:10 +0100 Subject: configure: move tests/qemu-iotests/common.env generation to meson Signed-off-by: Paolo Bonzini --- tests/qemu-iotests/common.env.in | 3 +++ tests/qemu-iotests/meson.build | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 tests/qemu-iotests/common.env.in (limited to 'tests') diff --git a/tests/qemu-iotests/common.env.in b/tests/qemu-iotests/common.env.in new file mode 100644 index 0000000000..e565cdf40c --- /dev/null +++ b/tests/qemu-iotests/common.env.in @@ -0,0 +1,3 @@ +# Automatically generated by configure - do not modify + +export PYTHON='@PYTHON@' diff --git a/tests/qemu-iotests/meson.build b/tests/qemu-iotests/meson.build index 67aed1e492..26658ce25c 100644 --- a/tests/qemu-iotests/meson.build +++ b/tests/qemu-iotests/meson.build @@ -3,3 +3,6 @@ if 'CONFIG_LINUX' in config_host else socket_scm_helper = [] endif +configure_file(output: 'common.env', + input: files('common.env.in'), + configuration: {'PYTHON': python.full_path()}) -- cgit v1.2.3