meson: convert unit tests in tests/Makefile.include
Subsystems (2)
cover meson: convert unit tests in tests/Makefile.include
From: Marc-André Lureau <[email protected]>
Hi,
This series convert the unit tests from tests/Makefile.include to meson.
Based-on: <[email protected]>
Marc-André Lureau (16):
meson: build qapi tests library
meson: declare tasn1 dependency
meson: declare keyutils dependency
meson: convert qht-bench
tests: qga has virtio-serial by default when host has it
meson: convert the unit tests
meson: move keyutils dependency check
meson: remove old socket_scm_helper rule
meson: convert vhost-user-bridge
meson: convert atomic*-bench tests/Makefile.include: update check-build
tests: do not print benchmark output to stdout
meson: convert the speed tests tests/migration/stress: remove unused exit_success
meson: fix migration/stress compilation with glib>=2.30
meson: convert migration/initrd-stress
Makefile | 2 +- configure | 25 --- meson.build | 10 + scripts/mtest2make.py | 3 +- tests/Makefile.include | 368 +------------------------------ tests/benchmark-crypto-cipher.c | 8 +- tests/benchmark-crypto-hash.c | 2 +- tests/benchmark-crypto-hmac.c | 8 +- tests/include/meson.build | 13 ++ tests/meson.build | 253 +++++++++++++++++++++ tests/migration/initrd-stress.sh | 10 + tests/migration/meson.build | 14 ++ tests/migration/stress.c | 15 +- tests/test-crypto-secret.c | 10 +- tests/test-qga.c | 4 +- 15 files changed, 325 insertions(+), 420 deletions(-) create mode 100644 tests/include/meson.build create mode 100755 tests/migration/initrd-stress.sh create mode 100644 tests/migration/meson.build
Signature · 1 line
2.26.2
PATCH 1/16 meson: build qapi tests library
From: Marc-André Lureau <[email protected]>
- builds QAPI builtins types/visitor to fix a linking issue with unresolved symbols in the static library.
- work around a meson limitation on generated file output directories.
--- tests/Makefile.include | 79 +-------------------------------------- tests/include/meson.build | 13 +++++++ tests/meson.build | 44 ++++++++++++++++++++++ 3 files changed, 58 insertions(+), 78 deletions(-) create mode 100644 tests/include/meson.build
tests/Makefile.include +1 -78
@@ -34,23 +34,6 @@ endif ifneq ($(wildcard config-host.mak),) export SRC_PATH -# TODO don't duplicate $(SRC_PATH)/Makefile's qapi-py here -qapi-py = $(SRC_PATH)/scripts/qapi/__init__.py \ -$(SRC_PATH)/scripts/qapi/commands.py \ -$(SRC_PATH)/scripts/qapi/common.py \ -$(SRC_PATH)/scripts/qapi/doc.py \ -$(SRC_PATH)/scripts/qapi/error.py \ -$(SRC_PATH)/scripts/qapi/events.py \ -$(SRC_PATH)/scripts/qapi/expr.py \ -$(SRC_PATH)/scripts/qapi/gen.py \ -$(SRC_PATH)/scripts/qapi/introspect.py \ -$(SRC_PATH)/scripts/qapi/parser.py \ -$(SRC_PATH)/scripts/qapi/schema.py \ -$(SRC_PATH)/scripts/qapi/source.py \ -$(SRC_PATH)/scripts/qapi/types.py \ -$(SRC_PATH)/scripts/qapi/visit.py \ -$(SRC_PATH)/scripts/qapi-gen.py - # Get the list of all supported sysemu targets SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \ $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak)))
@@ -164,36 +147,13 @@ ifeq ($(CONFIG_BLOCK)$(CONFIG_REPLICATION)$(CONFIG_POSIX),yyy) check-unit-y += tests/test-replication$(EXESUF) endif -generated-files-y += tests/test-qapi-types.h -generated-files-y += tests/include/test-qapi-types-sub-module.h -generated-files-y += tests/test-qapi-types-sub-sub-module.h -generated-files-y += tests/test-qapi-visit.h -generated-files-y += tests/include/test-qapi-visit-sub-module.h -generated-files-y += tests/test-qapi-visit-sub-sub-module.h -generated-files-y += tests/test-qapi-commands.h -generated-files-y += tests/test-qapi-init-commands.h -generated-files-y += tests/include/test-qapi-commands-sub-module.h -generated-files-y += tests/test-qapi-commands-sub-sub-module.h -generated-files-y += tests/test-qapi-emit-events.h -generated-files-y += tests/test-qapi-events.h -generated-files-y += tests/include/test-qapi-events-sub-module.h -generated-files-y += tests/test-qapi-events-sub-sub-module.h -generated-files-y += tests/test-qapi-introspect.h - QEMU_CFLAGS += -I$(SRC_PATH)/tests -I$(SRC_PATH)/tests/qtest # Deps that are common to various different sets of tests below test-util-obj-y = libqemuutil.a test-qom-obj-y = $(qom-obj-y) $(test-util-obj-y) -test-qapi-obj-y = tests/test-qapi-types.o \ - tests/include/test-qapi-types-sub-module.o \ - tests/test-qapi-types-sub-sub-module.o \ - tests/test-qapi-visit.o \ - tests/include/test-qapi-visit-sub-module.o \ - tests/test-qapi-visit-sub-sub-module.o \ - tests/test-qapi-introspect.o \ - $(test-qom-obj-y) +test-qapi-obj-y = $(test-qom-obj-y) tests/libtestqapi.a benchmark-crypto-obj-$(CONFIG_BLOCK) = $(authz-obj-y) $(crypto-obj-y) $(test-qom-obj-y) test-crypto-obj-$(CONFIG_BLOCK) = $(authz-obj-y) $(crypto-obj-y) $(test-qom-obj-y) test-io-obj-$(CONFIG_BLOCK) = $(io-obj-y) $(test-crypto-obj-y)
@@ -264,42 +224,6 @@ tests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y) tests/test-replication$(EXESUF): tests/test-replication.o $(test-util-obj-y) \ $(test-block-obj-y) -tests/test-qapi-types.c tests/test-qapi-types.h \ -tests/include/test-qapi-types-sub-module.c \ -tests/include/test-qapi-types-sub-module.h \ -tests/test-qapi-types-sub-sub-module.c \ -tests/test-qapi-types-sub-sub-module.h \ -tests/test-qapi-visit.c tests/test-qapi-visit.h \ -tests/include/test-qapi-visit-sub-module.c \ -tests/include/test-qapi-visit-sub-module.h \ -tests/test-qapi-visit-sub-sub-module.c \ -tests/test-qapi-visit-sub-sub-module.h \ -tests/test-qapi-commands.h tests/test-qapi-commands.c \ -tests/include/test-qapi-commands-sub-module.h \ -tests/include/test-qapi-commands-sub-module.c \ -tests/test-qapi-commands-sub-sub-module.h \ -tests/test-qapi-commands-sub-sub-module.c \ -tests/test-qapi-emit-events.c tests/test-qapi-emit-events.h \ -tests/test-qapi-events.c tests/test-qapi-events.h \ -tests/test-qapi-init-commands.c \ -tests/test-qapi-init-commands.h \ -tests/include/test-qapi-events-sub-module.c \ -tests/include/test-qapi-events-sub-module.h \ -tests/test-qapi-events-sub-sub-module.c \ -tests/test-qapi-events-sub-sub-module.h \ -tests/test-qapi-introspect.c tests/test-qapi-introspect.h: \ -tests/test-qapi-gen-timestamp ; -tests/test-qapi-gen-timestamp: \ - $(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json \ - $(SRC_PATH)/tests/qapi-schema/include/sub-module.json \ - $(SRC_PATH)/tests/qapi-schema/sub-sub-module.json \ - $(qapi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \ - -o tests -p "test-" $<, \ - "GEN","$(@:%-timestamp=%)") - @rm -f tests/test-qapi-doc.texi - @>$@ - tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) tests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y) tests/test-qapi-emit-events.o tests/test-qapi-events.o
@@ -532,7 +456,6 @@ check-build: build-unit check-clean: rm -rf $(check-unit-y) tests/*.o tests/*/*.o $(QEMU_IOTESTS_HELPERS-y) - rm -f tests/test-qapi-gen-timestamp rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR) check: check-unit
tests/include/meson.build new file +13 -0
@@ -0,0 +1,13 @@ +# an extra target to workaround meson limitation on output files location +test_qapi_outputs_extra = [ + 'test-qapi-commands-sub-module.c', + 'test-qapi-commands-sub-module.h', + 'test-qapi-events-sub-module.c', + 'test-qapi-events-sub-module.h', + 'test-qapi-types-sub-module.c', + 'test-qapi-types-sub-module.h', + 'test-qapi-visit-sub-module.c', + 'test-qapi-visit-sub-module.h', +] + +test_qapi_outputs_extra = custom_target('QAPI test include', output: test_qapi_outputs_extra, command: 'true')
tests/meson.build +44 -0
47 lines not on this page · raw message
Signature · 1 line
2.26.2
PATCH 2/16 meson: declare tasn1 dependency
In reply to [email protected]From: Marc-André Lureau <[email protected]>
--- meson.build | 5 +++++ 1 file changed, 5 insertions(+)
meson.build +5 -0
@@ -401,6 +401,11 @@ libdaxctl = not_found if 'CONFIG_LIBDAXCTL' in config_host libdaxctl = declare_dependency(link_args: config_host['LIBDAXCTL_LIBS'].split()) endif +tasn1 = not_found +if 'CONFIG_TASN1' in config_host + tasn1 = declare_dependency(compile_args: config_host['TASN1_CFLAGS'].split(), + link_args: config_host['TASN1_LIBS'].split()) +endif # Create config-host.h
Signature · 1 line
2.26.2
PATCH 3/16 meson: declare keyutils dependency
In reply to [email protected]From: Marc-André Lureau <[email protected]>
Rename the variable to be more explicit. A further clean-up patch will move the actual to dependency check to meson entirely.
--- configure | 2 +- meson.build | 4 ++++ tests/Makefile.include | 2 +- tests/test-crypto-secret.c | 10 +++++----- 4 files changed, 11 insertions(+), 7 deletions(-)
configure +1 -1
@@ -7536,7 +7536,7 @@ fi if test "$secret_keyring" = "yes" ; then echo "CONFIG_SECRET_KEYRING=y" >> $config_host_mak if test "$have_keyutils" = "yes" ; then - echo "CONFIG_TEST_SECRET_KEYRING=y" >> $config_host_mak + echo "CONFIG_KEYUTILS=y" >> $config_host_mak fi fi
meson.build +4 -0
@@ -406,6 +406,10 @@ if 'CONFIG_TASN1' in config_host tasn1 = declare_dependency(compile_args: config_host['TASN1_CFLAGS'].split(), link_args: config_host['TASN1_LIBS'].split()) endif +keyutils = not_found +if 'CONFIG_KEYUTILS' in config_host + keyutils = declare_dependency(link_args: '-lkeyutils') +endif # Create config-host.h
tests/Makefile.include +1 -1
@@ -248,7 +248,7 @@ tests/benchmark-crypto-cipher$(EXESUF): tests/benchmark-crypto-cipher.o $(test-c tests/test-crypto-secret$(EXESUF): tests/test-crypto-secret.o $(test-crypto-obj-y) tests/test-crypto-xts$(EXESUF): tests/test-crypto-xts.o $(test-crypto-obj-y) -ifeq ($(CONFIG_TEST_SECRET_KEYRING),y) +ifeq ($(CONFIG_KEYUTILS),y) tests/test-crypto-secret.o-libs := -lkeyutils endif
tests/test-crypto-secret.c +5 -5
@@ -24,7 +24,7 @@#include "crypto/secret.h" #include "qapi/error.h" #include "qemu/module.h" -#ifdef CONFIG_TEST_SECRET_KEYRING +#ifdef CONFIG_KEYUTILS #include "crypto/secret_keyring.h" #include <keyutils.h> #endif
@@ -128,7 +128,7 @@ static void test_secret_indirect_emptyfile(void)g_free (fname); } -#ifdef CONFIG_TEST_SECRET_KEYRING +#ifdef CONFIG_KEYUTILS #define DESCRIPTION "qemu_test_secret"#define PAYLOAD "Test Payload"
@@ -268,7 +268,7 @@ static void test_secret_keyring_bad_key_access_right(void) keyctl_unlink(key, KEY_SPEC_PROCESS_KEYRING); } -#endif /* CONFIG_TEST_SECRET_KEYRING */ +#endif /* CONFIG_KEYUTILS */ static void test_secret_noconv_base64_good (void ) {
@@ -571,7 +571,7 @@ int main(int argc, char **argv)g_test_add_func ("/crypto/secret/indirect/emptyfile" , test_secret_indirect_emptyfile); -#ifdef CONFIG_TEST_SECRET_KEYRING +#ifdef CONFIG_KEYUTILS g_test_add_func ("/crypto/secret/keyring/good" , test_secret_keyring_good); g_test_add_func("/crypto/secret/keyring/revoked_key",
@@ -582,7 +582,7 @@ int main(int argc, char **argv) test_secret_keyring_bad_serial_key);g_test_add_func ("/crypto/secret/keyring/bad_key_access_right" , test_secret_keyring_bad_key_access_right); -#endif /* CONFIG_TEST_SECRET_KEYRING */ +#endif /* CONFIG_KEYUTILS */ g_test_add_func ("/crypto/secret/noconv/base64/good" , test_secret_noconv_base64_good);
Signature · 1 line
2.26.2
PATCH 4/16 meson: convert qht-bench
In reply to [email protected]From: Marc-André Lureau <[email protected]>
This is required by test-qht-par unit test.
--- tests/Makefile.include | 1 - tests/meson.build | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-)
tests/Makefile.include +0 -1
@@ -201,7 +201,6 @@ tests/test-rcu-slist$(EXESUF): tests/test-rcu-slist.o $(test-util-obj-y) tests/test-qdist$(EXESUF): tests/test-qdist.o $(test-util-obj-y) tests/test-qht$(EXESUF): tests/test-qht.o $(test-util-obj-y) tests/test-qht-par$(EXESUF): tests/test-qht-par.o tests/qht-bench$(EXESUF) $(test-util-obj-y) -tests/qht-bench$(EXESUF): tests/qht-bench.o $(test-util-obj-y) tests/test-bufferiszero$(EXESUF): tests/test-bufferiszero.o $(test-util-obj-y) tests/atomic_add-bench$(EXESUF): tests/atomic_add-bench.o $(test-util-obj-y) tests/atomic64-bench$(EXESUF): tests/atomic64-bench.o $(test-util-obj-y)
tests/meson.build +4 -0
@@ -1,3 +1,7 @@ +qht_bench = executable('qht-bench', + sources: files('qht-bench.c'), + dependencies: [qemuutil]) + test_qapi_outputs = [ 'qapi-builtin-types.c', 'qapi-builtin-types.h',
Signature · 1 line
2.26.2
PATCH 5/16 tests: qga has virtio-serial by default when host has it
In reply to [email protected]From: Marc-André Lureau <[email protected]>
When dumping the default configuration, don't expect virtio-serial as the configured method, unless the host has CONFIG_VIRTIO_SERIAL.
--- tests/test-qga.c | 2 ++ 1 file changed, 2 insertions(+)
tests/test-qga.c +2 -0
@@ -728,10 +728,12 @@ static void test_qga_config(gconstpointer data)g_assert_false (g_key_file_get_boolean (kf,"general" ,"daemon" , &error));g_assert_no_error (error); +#ifdef CONFIG_VIRTIO_SERIAL str =g_key_file_get_string (kf,"general" ,"method" , &error);g_assert_no_error (error); g_assert_cmpstr(str, ==, "virtio-serial");g_free (str); +#endif str =g_key_file_get_string (kf,"general" ,"path" , &error);g_assert_no_error (error);
Signature · 1 line
2.26.2
Re: [PATCH 05/16] tests: qga has virtio-serial by default when host has it
Quoted 17 lines · On 28/08/2020 13.07, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
When dumping the default configuration, don't expect virtio-serial as the configured method, unless the host has
CONFIG_VIRTIO_SERIAL.Signed-off-by Marc-André Lureau <[email protected]>--- tests/test-qga.c | 2 ++ 1 file changed, 2 insertions(+)tests/test-qga.c +0
-0@@ -728,10 +728,12 @@ static void test_qga_config(gconstpointer data)g_assert_false (g_key_file_get_boolean (kf,"general" ,"daemon" , &error));g_assert_no_error (error);
tests/test-qga.c static void test_qga_config(gconstpointer data) · line 739
Quoted 10 lines
tests/test-qga.c +2
-0+#ifdef CONFIG_VIRTIO_SERIAL str =g_key_file_get_string (kf,"general" ,"method" , &error);g_assert_no_error (error); g_assert_cmpstr(str, ==, "virtio-serial");g_free (str); +#endif str =g_key_file_get_string (kf,"general" ,"path" , &error);g_assert_no_error (error);
Does this work as expected? I thought that CONFIG_VIRTIO_SERIAL is a *target* specific config switch, not a host specific one ?
Thomas
Re: [PATCH 05/16] tests: qga has virtio-serial by default when host has it
Hi
Quoted 27 lines · Thomas Huth
Quoted 25 lines · On 28/08/2020 13.07, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
When dumping the default configuration, don't expect virtio-serial as the configured method, unless the host has
CONFIG_VIRTIO_SERIAL.Signed-off-by Marc-André Lureau <[email protected]>--- tests/test-qga.c | 2 ++ 1 file changed, 2 insertions(+)tests/test-qga.c +2
-0@@ -728,10 +728,12 @@ static void test_qga_config(gconstpointer data)g_assert_false (g_key_file_get_boolean (kf,"general" ,"daemon" , &error));g_assert_no_error (error); +#ifdef CONFIG_VIRTIO_SERIAL str =g_key_file_get_string (kf,"general" ,"method" , &error);g_assert_no_error (error); g_assert_cmpstr(str, ==, "virtio-serial");g_free (str); +#endif
Quoted 5 lines
tests/test-qga.c static void test_qga_config(gconstpointer data) · line 739
Quoted 2 lines
tests/test-qga.c +0
-0str =g_key_file_get_string (kf,"general" ,"path" , &error);g_assert_no_error (error);Does this work as expected? I thought that
CONFIG_VIRTIO_SERIALis a *target* specific config switch, not a host specific one ?
You are right, it's basically dead code then. I'll drop this patch for now, or come up with something better. It was from an earlier attempt where test-qga was running under !linux. I will try that again.
PATCH 6/16 meson: convert the unit tests
In reply to [email protected]From: Marc-André Lureau <[email protected]>
--- tests/Makefile.include | 256 +---------------------------------------- tests/meson.build | 169 +++++++++++++++++++++++++++ tests/test-qga.c | 2 +- 3 files changed, 173 insertions(+), 254 deletions(-)
tests/Makefile.include +3 -253
@@ -38,256 +38,20 @@ export SRC_PATH SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \ $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak))) -check-unit-y += tests/check-qdict$(EXESUF) -check-unit-y += tests/check-block-qdict$(EXESUF) -check-unit-y += tests/check-qnum$(EXESUF) -check-unit-y += tests/check-qstring$(EXESUF) -check-unit-y += tests/check-qlist$(EXESUF) -check-unit-y += tests/check-qnull$(EXESUF) -check-unit-y += tests/check-qobject$(EXESUF) -check-unit-y += tests/check-qjson$(EXESUF) -check-unit-y += tests/check-qlit$(EXESUF) -check-unit-y += tests/test-qobject-output-visitor$(EXESUF) -check-unit-y += tests/test-clone-visitor$(EXESUF) -check-unit-y += tests/test-qobject-input-visitor$(EXESUF) -check-unit-$(CONFIG_SOFTMMU) += tests/test-qmp-cmds$(EXESUF) -check-unit-y += tests/test-string-input-visitor$(EXESUF) -check-unit-y += tests/test-string-output-visitor$(EXESUF) -check-unit-y += tests/test-qmp-event$(EXESUF) -check-unit-y += tests/test-opts-visitor$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-coroutine$(EXESUF) -check-unit-y += tests/test-visitor-serialization$(EXESUF) -check-unit-$(CONFIG_SOFTMMU) += tests/test-iov$(EXESUF) -check-unit-y += tests/test-bitmap$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-aio$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-aio-multithread$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-throttle$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-thread-pool$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-hbitmap$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-bdrv-drain$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-bdrv-graph-mod$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-blockjob$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-blockjob-txn$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-block-backend$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-block-iothread$(EXESUF) -ifeq ($(CONFIG_POSIX),y) -check-unit-$(CONFIG_BLOCK) += tests/test-image-locking$(EXESUF) -endif -check-unit-y += tests/test-x86-cpuid$(EXESUF) -# all code tested by test-x86-cpuid is inside topology.h -ifeq ($(CONFIG_SOFTMMU),y) -check-unit-y += tests/test-xbzrle$(EXESUF) -check-unit-$(CONFIG_POSIX) += tests/test-vmstate$(EXESUF) -endif -check-unit-y += tests/test-cutils$(EXESUF) -check-unit-y += tests/test-shift128$(EXESUF) -check-unit-y += tests/test-mul64$(EXESUF) -check-unit-y += tests/test-int128$(EXESUF) -# all code tested by test-int128 is inside int128.h -check-unit-y += tests/rcutorture$(EXESUF) -check-unit-y += tests/test-rcu-list$(EXESUF) -check-unit-y += tests/test-rcu-simpleq$(EXESUF) -check-unit-y += tests/test-rcu-tailq$(EXESUF) -check-unit-y += tests/test-rcu-slist$(EXESUF) -check-unit-y += tests/test-qdist$(EXESUF) -check-unit-y += tests/test-qht$(EXESUF) -check-unit-y += tests/test-qht-par$(EXESUF) -check-unit-y += tests/test-bitops$(EXESUF) -check-unit-y += tests/test-bitcnt$(EXESUF) -check-unit-y += tests/test-qgraph$(EXESUF) -check-unit-y += tests/check-qom-interface$(EXESUF) -check-unit-y += tests/check-qom-proplist$(EXESUF) -check-unit-y += tests/test-qemu-opts$(EXESUF) -check-unit-y += tests/test-keyval$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-write-threshold$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-crypto-hash$(EXESUF) check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-hash$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-crypto-hmac$(EXESUF) check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-hmac$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-crypto-cipher$(EXESUF) check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-cipher$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-crypto-secret$(EXESUF) -check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-crypto-tlscredsx509$(EXESUF) -check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-crypto-tlssession$(EXESUF) -ifndef CONFIG_TSAN -# Some tests: test-char, test-qdev-global-props, and test-qga, -# are not runnable under TSan due to a known issue. -# https://github.com/google/sanitizers/issues/1116 -check-unit-$(CONFIG_SOFTMMU) += tests/test-char$(EXESUF) -check-unit-$(CONFIG_SOFTMMU) += tests/test-qdev-global-props$(EXESUF) -ifeq ($(CONFIG_GUEST_AGENT),y) -check-unit-$(call land,$(CONFIG_LINUX),$(CONFIG_VIRTIO_SERIAL)) += tests/test-qga$(EXESUF) -endif -endif -check-unit-$(CONFIG_SOFTMMU) += tests/test-timed-average$(EXESUF) -check-unit-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_INOTIFY1)) += tests/test-util-filemonitor$(EXESUF) -check-unit-$(CONFIG_SOFTMMU) += tests/test-util-sockets$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-authz-simple$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-authz-list$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-authz-listfile$(EXESUF) -check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_AUTH_PAM)) += tests/test-authz-pam$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-io-task$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-socket$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-file$(EXESUF) -check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-io-channel-tls$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-command$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-io-channel-buffer$(EXESUF) -check-unit-$(CONFIG_SOFTMMU) += tests/test-base64$(EXESUF) -check-unit-$(call land,$(CONFIG_BLOCK),$(if $(CONFIG_NETTLE),y,$(CONFIG_GCRYPT))) += tests/test-crypto-pbkdf$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-crypto-ivgen$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-crypto-afsplit$(EXESUF) -check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_QEMU_PRIVATE_XTS)) += tests/test-crypto-xts$(EXESUF) -check-unit-$(CONFIG_BLOCK) += tests/test-crypto-block$(EXESUF) -check-unit-y += tests/test-logging$(EXESUF) -check-unit-$(CONFIG_SOFTMMU) += tests/test-bufferiszero$(EXESUF) -check-unit-y += tests/test-uuid$(EXESUF) -check-unit-y += tests/ptimer-test$(EXESUF) -check-unit-y += tests/test-qapi-util$(EXESUF) -ifeq ($(CONFIG_BLOCK)$(CONFIG_REPLICATION)$(CONFIG_POSIX),yyy) -check-unit-y += tests/test-replication$(EXESUF) -endif QEMU_CFLAGS += -I$(SRC_PATH)/tests -I$(SRC_PATH)/tests/qtest - # Deps that are common to various different sets of tests below test-util-obj-y = libqemuutil.a -test-qom-obj-y = $(qom-obj-y) $(test-util-obj-y) -test-qapi-obj-y = $(test-qom-obj-y) tests/libtestqapi.a -benchmark-crypto-obj-$(CONFIG_BLOCK) = $(authz-obj-y) $(crypto-obj-y) $(test-qom-obj-y) -test-crypto-obj-$(CONFIG_BLOCK) = $(authz-obj-y) $(crypto-obj-y) $(test-qom-obj-y) -test-io-obj-$(CONFIG_BLOCK) = $(io-obj-y) $(test-crypto-obj-y) -test-authz-obj-$(CONFIG_BLOCK) = $(test-qom-obj-y) $(authz-obj-y) -test-block-obj-$(CONFIG_BLOCK) = $(block-obj-y) $(test-io-obj-y) tests/iothread.o - -tests/check-qnum$(EXESUF): tests/check-qnum.o $(test-util-obj-y) -tests/check-qstring$(EXESUF): tests/check-qstring.o $(test-util-obj-y) -tests/check-qdict$(EXESUF): tests/check-qdict.o $(test-util-obj-y) -tests/check-block-qdict$(EXESUF): tests/check-block-qdict.o $(test-util-obj-y) -tests/check-qlist$(EXESUF): tests/check-qlist.o $(test-util-obj-y) -tests/check-qnull$(EXESUF): tests/check-qnull.o $(test-util-obj-y) -tests/check-qobject$(EXESUF): tests/check-qobject.o $(test-util-obj-y) -tests/check-qjson$(EXESUF): tests/check-qjson.o $(test-util-obj-y) -tests/check-qlit$(EXESUF): tests/check-qlit.o $(test-util-obj-y) -tests/check-qom-interface$(EXESUF): tests/check-qom-interface.o $(test-qom-obj-y) -tests/check-qom-proplist$(EXESUF): tests/check-qom-proplist.o $(test-qom-obj-y) - -tests/test-char$(EXESUF): tests/test-char.o $(test-util-obj-y) $(test-io-obj-y) $(chardev-obj-y) tests/socket-helpers.o -tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(test-block-obj-y) -tests/test-aio$(EXESUF): tests/test-aio.o $(test-block-obj-y) -tests/test-aio-multithread$(EXESUF): tests/test-aio-multithread.o $(test-block-obj-y) -tests/test-throttle$(EXESUF): tests/test-throttle.o $(test-block-obj-y) -tests/test-bdrv-drain$(EXESUF): tests/test-bdrv-drain.o $(test-block-obj-y) $(test-util-obj-y) -tests/test-bdrv-graph-mod$(EXESUF): tests/test-bdrv-graph-mod.o $(test-block-obj-y) $(test-util-obj-y) -tests/test-blockjob$(EXESUF): tests/test-blockjob.o $(test-block-obj-y) $(test-util-obj-y) -tests/test-blockjob-txn$(EXESUF): tests/test-blockjob-txn.o $(test-block-obj-y) $(test-util-obj-y) -tests/test-block-backend$(EXESUF): tests/test-block-backend.o $(test-block-obj-y) $(test-util-obj-y) -tests/test-block-iothread$(EXESUF): tests/test-block-iothread.o $(test-block-obj-y) $(test-util-obj-y) -tests/test-image-locking$(EXESUF): tests/test-image-locking.o $(test-block-obj-y) $(test-util-obj-y) -tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(test-block-obj-y) -tests/test-iov$(EXESUF): tests/test-iov.o $(test-util-obj-y) -tests/test-hbitmap$(EXESUF): tests/test-hbitmap.o $(test-util-obj-y) $(test-crypto-obj-y) -tests/test-bitmap$(EXESUF): tests/test-bitmap.o $(test-util-obj-y) -tests/test-x86-cpuid$(EXESUF): tests/test-x86-cpuid.o -tests/test-xbzrle$(EXESUF): tests/test-xbzrle.o migration/libmigration.fa $(test-util-obj-y) \ - $(test-io-obj-y) -tests/test-cutils$(EXESUF): tests/test-cutils.o util/cutils.o $(test-util-obj-y) -tests/test-int128$(EXESUF): tests/test-int128.o -tests/rcutorture$(EXESUF): tests/rcutorture.o $(test-util-obj-y) -tests/test-rcu-list$(EXESUF): tests/test-rcu-list.o $(test-util-obj-y) -tests/test-rcu-simpleq$(EXESUF): tests/test-rcu-simpleq.o $(test-util-obj-y) -tests/test-rcu-tailq$(EXESUF): tests/test-rcu-tailq.o $(test-util-obj-y) -tests/test-rcu-slist$(EXESUF): tests/test-rcu-slist.o $(test-util-obj-y) -tests/test-qdist$(EXESUF): tests/test-qdist.o $(test-util-obj-y) -tests/test-qht$(EXESUF): tests/test-qht.o $(test-util-obj-y) -tests/test-qht-par$(EXESUF): tests/test-qht-par.o tests/qht-bench$(EXESUF) $(test-util-obj-y) -tests/test-bufferiszero$(EXESUF): tests/test-bufferiszero.o $(test-util-obj-y) tests/atomic_add-bench$(EXESUF): tests/atomic_add-bench.o $(test-util-obj-y) tests/atomic64-bench$(EXESUF): tests/atomic64-bench.o $(test-util-obj-y) -tests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o hw/core/libhwcore.fa \ - $(test-qapi-obj-y) -tests/test-vmstate$(EXESUF): tests/test-vmstate.o migration/libmigration.fa \ - $(test-io-obj-y) -tests/test-timed-average$(EXESUF): tests/test-timed-average.o $(test-util-obj-y) -tests/test-base64$(EXESUF): tests/test-base64.o $(test-util-obj-y) -tests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o hw/core/ptimer.o -tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o $(test-util-obj-y) -tests/test-keyval$(EXESUF): tests/test-keyval.o $(test-util-obj-y) $(test-qapi-obj-y) -tests/test-write-threshold$(EXESUF): tests/test-write-threshold.o $(test-block-obj-y) -tests/test-uuid$(EXESUF): tests/test-uuid.o $(test-util-obj-y) -tests/test-qapi-util$(EXESUF): tests/test-qapi-util.o $(test-util-obj-y) - -tests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y) - -tests/test-replication$(EXESUF): tests/test-replication.o $(test-util-obj-y) \ - $(test-block-obj-y) - -tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y) -tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y) -tests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y) tests/test-qapi-emit-events.o tests/test-qapi-events.o -tests/test-qobject-output-visitor$(EXESUF): tests/test-qobject-output-visitor.o $(test-qapi-obj-y) -tests/test-clone-visitor$(EXESUF): tests/test-clone-visitor.o $(test-qapi-obj-y) -tests/test-qobject-input-visitor$(EXESUF): tests/test-qobject-input-visitor.o $(test-qapi-obj-y) -tests/test-qmp-cmds$(EXESUF): tests/test-qmp-cmds.o tests/test-qapi-commands.o tests/test-qapi-init-commands.o $(test-qapi-obj-y) -tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y) -tests/test-opts-visitor$(EXESUF): tests/test-opts-visitor.o $(test-qapi-obj-y) - -tests/test-shift128$(EXESUF): tests/test-shift128.o $(test-util-obj-y) -tests/test-mul64$(EXESUF): tests/test-mul64.o $(test-util-obj-y) -tests/test-bitops$(EXESUF): tests/test-bitops.o $(test-util-obj-y) -tests/test-bitcnt$(EXESUF): tests/test-bitcnt.o $(test-util-obj-y) -tests/test-qgraph$(EXESUF): tests/test-qgraph.o tests/qtest/libqos/qgraph.o $(test-util-obj-y) -tests/test-crypto-hash$(EXESUF): tests/test-crypto-hash.o $(test-crypto-obj-y) tests/benchmark-crypto-hash$(EXESUF): tests/benchmark-crypto-hash.o $(test-crypto-obj-y) -tests/test-crypto-hmac$(EXESUF): tests/test-crypto-hmac.o $(test-crypto-obj-y) tests/benchmark-crypto-hmac$(EXESUF): tests/benchmark-crypto-hmac.o $(test-crypto-obj-y) -tests/test-crypto-cipher$(EXESUF): tests/test-crypto-cipher.o $(test-crypto-obj-y) tests/benchmark-crypto-cipher$(EXESUF): tests/benchmark-crypto-cipher.o $(test-crypto-obj-y) -tests/test-crypto-secret$(EXESUF): tests/test-crypto-secret.o $(test-crypto-obj-y) -tests/test-crypto-xts$(EXESUF): tests/test-crypto-xts.o $(test-crypto-obj-y) - -ifeq ($(CONFIG_KEYUTILS),y) -tests/test-crypto-secret.o-libs := -lkeyutils -endif - -tests/crypto-tls-x509-helpers.o-cflags := $(TASN1_CFLAGS) -tests/crypto-tls-x509-helpers.o-libs := $(TASN1_LIBS) -tests/pkix_asn1_tab.o-cflags := $(TASN1_CFLAGS) - -tests/test-crypto-tlscredsx509.o-cflags := $(TASN1_CFLAGS) -tests/test-crypto-tlscredsx509$(EXESUF): tests/test-crypto-tlscredsx509.o \ - tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o $(test-crypto-obj-y) - -tests/test-crypto-tlssession.o-cflags := $(TASN1_CFLAGS) -tests/test-crypto-tlssession$(EXESUF): tests/test-crypto-tlssession.o \ - tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o \ - tests/crypto-tls-psk-helpers.o \ - $(test-crypto-obj-y) -tests/test-util-filemonitor$(EXESUF): tests/test-util-filemonitor.o \ - $(test-util-obj-y) -tests/test-util-sockets$(EXESUF): tests/test-util-sockets.o \ - tests/socket-helpers.o $(test-util-obj-y) -tests/test-authz-simple$(EXESUF): tests/test-authz-simple.o $(test-authz-obj-y) -tests/test-authz-list$(EXESUF): tests/test-authz-list.o $(test-authz-obj-y) -tests/test-authz-listfile$(EXESUF): tests/test-authz-listfile.o $(test-authz-obj-y) -tests/test-authz-pam$(EXESUF): tests/test-authz-pam.o $(test-authz-obj-y) -tests/test-io-task$(EXESUF): tests/test-io-task.o $(test-io-obj-y) -tests/test-io-channel-socket$(EXESUF): tests/test-io-channel-socket.o \ - tests/io-channel-helpers.o tests/socket-helpers.o $(test-io-obj-y) -tests/test-io-channel-file$(EXESUF): tests/test-io-channel-file.o \ - tests/io-channel-helpers.o $(test-io-obj-y) -tests/test-io-channel-tls$(EXESUF): tests/test-io-channel-tls.o \ - tests/crypto-tls-x509-helpers.o tests/pkix_asn1_tab.o \ - tests/io-channel-helpers.o $(test-io-obj-y) -tests/test-io-channel-command$(EXESUF): tests/test-io-channel-command.o \ - tests/io-channel-helpers.o $(test-io-obj-y) -tests/test-io-channel-buffer$(EXESUF): tests/test-io-channel-buffer.o \ - tests/io-channel-helpers.o $(test-io-obj-y) -tests/test-crypto-pbkdf$(EXESUF): tests/test-crypto-pbkdf.o $(test-crypto-obj-y) -tests/test-crypto-ivgen$(EXESUF): tests/test-crypto-ivgen.o $(test-crypto-obj-y) -tests/test-crypto-afsplit$(EXESUF): tests/test-crypto-afsplit.o $(test-crypto-obj-y) -tests/test-crypto-block$(EXESUF): tests/test-crypto-block.o $(test-crypto-obj-y) tests/migration/stress$(EXESUF): tests/migration/stress.o $(call quiet-command, $(LINKPROG) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"LINK","$(TARGET_DIR)$@")
@@ -301,8 +65,6 @@ tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF) rm $(INITRD_WORK_DIR)/init rmdir $(INITRD_WORK_DIR) -tests/test-qga$(EXESUF): qga/qemu-ga$(EXESUF) -tests/test-qga$(EXESUF): tests/test-qga.o tests/qtest/libqtest.o $(test-util-obj-y) tests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o $(test-util-obj-y) libvhost-user.a tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o
@@ -343,19 +105,9 @@ define do_test_tap "TAP","$@") endef -build-unit: $(check-unit-y) - -check-unit: $(check-unit-y) - $(call do_test_human, $^) - check-speed: $(check-speed-y) $(call do_test_human, $^) -# gtester tests with TAP output - -check-report-unit.tap: $(check-unit-y) - $(call do_test_tap,$^) - # Per guest TCG tests BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS))
@@ -449,16 +201,14 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images # Consolidated targets -.PHONY: check-block check-unit check check-clean get-vm-images +.PHONY: check-block check check-clean get-vm-images check-block: -check-build: build-unit +check-build: check-clean: - rm -rf $(check-unit-y) tests/*.o tests/*/*.o $(QEMU_IOTESTS_HELPERS-y) + rm -rf tests/*.o tests/*/*.o $(QEMU_IOTESTS_HELPERS-y) rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR) -check: check-unit - clean: check-clean # Build the help program automatically
tests/meson.build +169 -0
178 lines not on this page · raw message
tests/test-qga.c +1 -1
@@ -4,7 +4,7 @@#include <sys/socket.h> #include <sys/un.h> -#include "libqos/libqtest.h" +#include "qtest/libqos/libqtest.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h"
Signature · 1 line
2.26.2
PATCH 7/16 meson: move keyutils dependency check
In reply to [email protected]From: Marc-André Lureau <[email protected]>
Since there is not minimum version specified, and it's a test-only dependency, it's fair to depend on a version that ships with a .pc I suppose.
--- configure | 25 ------------------------- meson.build | 6 ++---- 2 files changed, 2 insertions(+), 29 deletions(-)
configure +0 -25
@@ -6324,28 +6324,6 @@ but not implemented on your system" fi fi -########################################## -# check for usable keyutils.h - -if test "$linux" = "yes" ; then - - have_keyutils=no - cat > $TMPC << EOF -#include <errno.h> -#include <asm/unistd.h> -#include <unistd.h> -#include <sys/types.h> -#include <keyutils.h> -int main(void) { - return request_key("user", NULL, NULL, 0); -} -EOF - if compile_prog "" "-lkeyutils"; then - have_keyutils=yes - fi -fi - - ########################################## # End of CC checks # After here, no more $cc or $ld runs
@@ -7535,9 +7513,6 @@ fi if test "$secret_keyring" = "yes" ; then echo "CONFIG_SECRET_KEYRING=y" >> $config_host_mak - if test "$have_keyutils" = "yes" ; then - echo "CONFIG_KEYUTILS=y" >> $config_host_mak - fi fi if test "$tcg_interpreter" = "yes"; then
meson.build +2 -4
@@ -406,10 +406,7 @@ if 'CONFIG_TASN1' in config_host tasn1 = declare_dependency(compile_args: config_host['TASN1_CFLAGS'].split(), link_args: config_host['TASN1_LIBS'].split()) endif -keyutils = not_found -if 'CONFIG_KEYUTILS' in config_host - keyutils = declare_dependency(link_args: '-lkeyutils') -endif +keyutils = dependency('keyutils', required: false) # Create config-host.h
@@ -420,6 +417,7 @@ config_host_data.set('CONFIG_VNC_JPEG', jpeg.found()) config_host_data.set('CONFIG_VNC_PNG', png.found()) config_host_data.set('CONFIG_VNC_SASL', sasl.found()) config_host_data.set('CONFIG_XKBCOMMON', xkbcommon.found()) +config_host_data.set('CONFIG_KEYUTILS', keyutils.found()) config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version())) config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0]) config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])
Signature · 1 line
2.26.2
PATCH 8/16 meson: remove old socket_scm_helper rule
In reply to [email protected]From: Marc-André Lureau <[email protected]>
It was covered already in commit d3ca592b3c10 ("meson: convert check-block")
--- tests/Makefile.include | 1 - 1 file changed, 1 deletion(-)
tests/Makefile.include +0 -1
@@ -66,7 +66,6 @@ tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF) rmdir $(INITRD_WORK_DIR) tests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o $(test-util-obj-y) libvhost-user.a -tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o SPEED = quick
Signature · 1 line
2.26.2
PATCH 9/16 meson: convert vhost-user-bridge
In reply to [email protected]From: Marc-André Lureau <[email protected]>
--- tests/Makefile.include | 2 -- tests/meson.build | 9 +++++++++ 2 files changed, 9 insertions(+), 2 deletions(-)
tests/Makefile.include +0 -2
@@ -65,8 +65,6 @@ tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF) rm $(INITRD_WORK_DIR)/init rmdir $(INITRD_WORK_DIR) -tests/vhost-user-bridge$(EXESUF): tests/vhost-user-bridge.o $(test-util-obj-y) libvhost-user.a - SPEED = quick # gtester tests, possibly with verbose output
tests/meson.build +9 -0
@@ -215,6 +215,15 @@ foreach test_name, extra_args: tests suite: suite) endforeach + +if have_tools and 'CONFIG_VHOST_USER' in config_host + executable('vhost-user-bridge', + sources: files('vhost-user-bridge.c'), + link_with: [libvhost_user], + dependencies: [qemuutil], + build_by_default: false) +endif + if have_system and 'CONFIG_POSIX' in config_host subdir('qemu-iotests') endif
Signature · 1 line
2.26.2
PATCH 10/16 meson: convert atomic*-bench
In reply to [email protected]From: Marc-André Lureau <[email protected]>
--- tests/Makefile.include | 5 ----- tests/meson.build | 10 ++++++++++ 2 files changed, 10 insertions(+), 5 deletions(-)
tests/Makefile.include +0 -5
@@ -44,11 +44,6 @@ check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-cipher$(EXESUF) QEMU_CFLAGS += -I$(SRC_PATH)/tests -I$(SRC_PATH)/tests/qtest -# Deps that are common to various different sets of tests below -test-util-obj-y = libqemuutil.a -tests/atomic_add-bench$(EXESUF): tests/atomic_add-bench.o $(test-util-obj-y) -tests/atomic64-bench$(EXESUF): tests/atomic64-bench.o $(test-util-obj-y) - tests/benchmark-crypto-hash$(EXESUF): tests/benchmark-crypto-hash.o $(test-crypto-obj-y) tests/benchmark-crypto-hmac$(EXESUF): tests/benchmark-crypto-hmac.o $(test-crypto-obj-y) tests/benchmark-crypto-cipher$(EXESUF): tests/benchmark-crypto-cipher.o $(test-crypto-obj-y)
tests/meson.build +10 -0
@@ -4,6 +4,16 @@ qht_bench = executable('qht-bench', sources: files('qht-bench.c'), dependencies: [qemuutil]) +executable('atomic_add-bench', + sources: files('atomic_add-bench.c'), + dependencies: [qemuutil], + build_by_default: false) + +executable('atomic64-bench', + sources: files('atomic64-bench.c'), + dependencies: [qemuutil], + build_by_default: false) + test_qapi_outputs = [ 'qapi-builtin-types.c', 'qapi-builtin-types.h',
Signature · 1 line
2.26.2
PATCH 11/16 tests/Makefile.include: update check-build
In reply to [email protected]From: Marc-André Lureau <[email protected]>
--- tests/Makefile.include | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tests/Makefile.include +1 -2
@@ -23,7 +23,7 @@ endif @echo " $(MAKE) check-clean Clean the tests and related data" @echo @echo "The following are useful for CI builds" - @echo " $(MAKE) check-build Build most test binaris" + @echo " $(MAKE) check-build Build most test binaries" @echo " $(MAKE) get-vm-images Downloads all images used by acceptance tests, according to configured targets (~350 MB each, 1.5 GB max)" @echo @echo
@@ -195,7 +195,6 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images .PHONY: check-block check check-clean get-vm-images check-block: -check-build: check-clean: rm -rf tests/*.o tests/*/*.o $(QEMU_IOTESTS_HELPERS-y)
Signature · 1 line
2.26.2
PATCH 12/16 tests: do not print benchmark output to stdout
In reply to [email protected]From: Marc-André Lureau <[email protected]>
As this makes the TAP output invalid. Use g_test_message().
--- tests/benchmark-crypto-cipher.c | 8 ++++---- tests/benchmark-crypto-hash.c | 2 +- tests/benchmark-crypto-hmac.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-)
tests/benchmark-crypto-cipher.c +4 -4
@@ -70,8 +70,8 @@ static void test_cipher_speed(size_t chunk_size, }g_test_timer_elapsed (); -g_print ("Enc chunk %zu bytes " , chunk_size); -g_print ("%.2f MB/sec " , (double )total / MiB /g_test_timer_last ()); +g_test_message ("Enc chunk %zu bytes " , chunk_size); +g_test_message ("%.2f MB/sec " , (double )total / MiB /g_test_timer_last ());g_test_timer_start (); remain = total;
@@ -85,8 +85,8 @@ static void test_cipher_speed(size_t chunk_size, }g_test_timer_elapsed (); -g_print ("Dec chunk %zu bytes " , chunk_size); -g_print ("%.2f MB/sec " , (double )total / MiB /g_test_timer_last ()); +g_test_message ("Dec chunk %zu bytes " , chunk_size); +g_test_message ("%.2f MB/sec " , (double )total / MiB /g_test_timer_last ());qcrypto_cipher_free (cipher);g_free (plaintext);
tests/benchmark-crypto-hash.c +1 -1
@@ -48,7 +48,7 @@ static void test_hash_speed(const void *opaque) }g_test_timer_elapsed (); -g_print ("%.2f MB/sec " , (double )total / MiB /g_test_timer_last ()); +g_test_message ("%.2f MB/sec " , (double )total / MiB /g_test_timer_last ());g_free (out);g_free (in);
tests/benchmark-crypto-hmac.c +4 -4
@@ -55,10 +55,10 @@ static void test_hmac_speed(const void *opaque) }while (g_test_timer_elapsed () <5.0 ); total /= MiB; -g_print ("hmac(sha256): " ); -g_print ("Testing chunk_size %zu bytes " , chunk_size); -g_print ("done: %.2f MB in %.2f secs: " , total,g_test_timer_last ()); -g_print ("%.2f MB/sec\n" , total /g_test_timer_last ()); +g_test_message ("hmac(sha256): " ); +g_test_message ("Testing chunk_size %zu bytes " , chunk_size); +g_test_message ("done: %.2f MB in %.2f secs: " , total,g_test_timer_last ()); +g_test_message ("%.2f MB/sec\n" , total /g_test_timer_last ());g_free (out);g_free (in);
Signature · 1 line
2.26.2
Re: [PATCH 12/16] tests: do not print benchmark output to stdout
Quoted 6 lines · Le ven. 28 août 2020 13:11, <[email protected]> a écrit :
From: Marc-André Lureau <[email protected]>
As this makes the TAP output invalid. Use
g_test_message().Signed-off-by Marc-André Lureau <[email protected]>
---
Quoted 73 lines
tests/benchmark-crypto-cipher.c | 8 ++++---- tests/benchmark-crypto-hash.c | 2 +- tests/benchmark-crypto-hmac.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-)tests/benchmark-crypto-cipher.c +2
-2@@ -70,8 +70,8 @@ static void test_cipher_speed(size_t chunk_size, }g_test_timer_elapsed (); -g_print ("Enc chunk %zu bytes " , chunk_size); -g_print ("%.2f MB/sec " , (double )total / MiB /g_test_timer_last ()); +g_test_message ("Enc chunk %zu bytes " , chunk_size); +g_test_message ("%.2f MB/sec " , (double )total / MiB /g_test_timer_last ());g_test_timer_start ();remain = total;tests/benchmark-crypto-cipher.c +2
-2@@ -85,8 +85,8 @@ static void test_cipher_speed(size_t chunk_size, }g_test_timer_elapsed (); -g_print ("Dec chunk %zu bytes " , chunk_size); -g_print ("%.2f MB/sec " , (double )total / MiB /g_test_timer_last ()); +g_test_message ("Dec chunk %zu bytes " , chunk_size); +g_test_message ("%.2f MB/sec " , (double )total / MiB /g_test_timer_last ());qcrypto_cipher_free (cipher);g_free(plaintext);tests/benchmark-crypto-hash.c +1
-1@@ -48,7 +48,7 @@ static void test_hash_speed(const void *opaque) }g_test_timer_elapsed (); -g_print ("%.2f MB/sec " , (double )total / MiB /g_test_timer_last ()); +g_test_message ("%.2f MB/sec " , (double )total / MiB /g_test_timer_last ());g_free (out);g_free(in);tests/benchmark-crypto-hmac.c +4
-4@@ -55,10 +55,10 @@ static void test_hmac_speed(const void *opaque) }while (g_test_timer_elapsed () <5.0 ); total /= MiB; -g_print ("hmac(sha256): " ); -g_print ("Testing chunk_size %zu bytes " , chunk_size); -g_print ("done: %.2f MB in %.2f secs: " , total,g_test_timer_last ()); -g_print ("%.2f MB/sec\n" , total /g_test_timer_last ()); +g_test_message ("hmac(sha256): " ); +g_test_message ("Testing chunk_size %zu bytes " , chunk_size); +g_test_message ("done: %.2f MB in %.2f secs: " , total,g_test_timer_last ()); +g_test_message ("%.2f MB/sec\n" , total /g_test_timer_last ());g_free (out);g_free(in);--
2.26.2
PATCH 13/16 meson: convert the speed tests
In reply to [email protected]From: Marc-André Lureau <[email protected]>
Use meson benchmark() for them, adjust mtest2make.py for that.
--- Makefile | 2 +- scripts/mtest2make.py | 3 ++- tests/Makefile.include | 11 ----------- tests/meson.build | 16 ++++++++++++++++ 4 files changed, 19 insertions(+), 13 deletions(-)
Makefile +1 -1
@@ -71,7 +71,7 @@ ${ninja-targets-c_COMPILER} ${ninja-targets-cpp_COMPILER}: .var.command += -MP # reread (and MESON won't be empty anymore). ifneq ($(MESON),) Makefile.mtest: build.ninja scripts/mtest2make.py - $(MESON) introspect --tests | $(PYTHON) scripts/mtest2make.py > $@ + $(MESON) introspect --tests --benchmarks | $(PYTHON) scripts/mtest2make.py > $@ -include Makefile.mtest endif
scripts/mtest2make.py +2 -1
@@ -50,7 +50,8 @@ endef suites = defaultdict(Suite) i = 0 -for test in json.load(sys.stdin): +introspect = json.load(sys.stdin) +for test in introspect['tests'] + introspect['benchmarks']: env = ' '.join(('%s=%s' % (shlex.quote(k), shlex.quote(v)) for k, v in test['env'].items())) executable = test['cmd'][0]
tests/Makefile.include +0 -11
@@ -38,16 +38,8 @@ export SRC_PATH SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \ $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak))) -check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-hash$(EXESUF) -check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-hmac$(EXESUF) -check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-cipher$(EXESUF) - QEMU_CFLAGS += -I$(SRC_PATH)/tests -I$(SRC_PATH)/tests/qtest -tests/benchmark-crypto-hash$(EXESUF): tests/benchmark-crypto-hash.o $(test-crypto-obj-y) -tests/benchmark-crypto-hmac$(EXESUF): tests/benchmark-crypto-hmac.o $(test-crypto-obj-y) -tests/benchmark-crypto-cipher$(EXESUF): tests/benchmark-crypto-cipher.o $(test-crypto-obj-y) - tests/migration/stress$(EXESUF): tests/migration/stress.o $(call quiet-command, $(LINKPROG) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"LINK","$(TARGET_DIR)$@")
@@ -97,9 +89,6 @@ define do_test_tap "TAP","$@") endef -check-speed: $(check-speed-y) - $(call do_test_human, $^) - # Per guest TCG tests BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS))
tests/meson.build +16 -0
@@ -108,6 +108,8 @@ tests = { 'test-qapi-util': {}, } +benchs = {} + if have_block tests += { 'test-coroutine': {'deps': [testblock]},
@@ -166,6 +168,11 @@ if have_block if 'CONFIG_NETTLE' in config_host or 'CONFIG_GCRYPT' in config_host tests += {'test-crypto-pbkdf': {'deps': [io]}} endif + benchs += { + 'benchmark-crypto-hash': {'deps': [crypto]}, + 'benchmark-crypto-hmac': {'deps': [crypto]}, + 'benchmark-crypto-cipher': {'deps': [crypto]}, + } endif if have_system
@@ -225,6 +232,15 @@ foreach test_name, extra_args: tests suite: suite) endforeach +foreach bench_name, extra_args: benchs + src = extra_args.get('src', [bench_name + '.c']) + exe = executable(bench_name, src, + dependencies: [qemuutil] + extra_args.get('deps', [])) + benchmark(bench_name, exe, + args: ['--tap', '-k'], + protocol: 'tap', + suite: ['speed']) +endforeach if have_tools and 'CONFIG_VHOST_USER' in config_host executable('vhost-user-bridge',
Signature · 1 line
2.26.2
PATCH 14/16 tests/migration/stress: remove unused exit_success
In reply to [email protected]From: Marc-André Lureau <[email protected]>
--- tests/migration/stress.c | 13 ------------- 1 file changed, 13 deletions(-)
tests/migration/stress.c +0 -13
@@ -47,19 +47,6 @@ static __attribute__((noreturn)) void exit_failure(void) } } -static __attribute__((noreturn))void exit_success (void ) -{ -if (getpid () ==1 ) { -sync (); -reboot (RB_POWER_OFF ); -fprintf (stderr,"%s (%05d): ERROR: cannot reboot: %s\n" , - argv0,gettid (),strerror (errno)); -abort (); - }else { -exit (0 ); - } -} -static int get_command_arg_str (const char *name,char **val) {
Signature · 1 line
2.26.2
PATCH 15/16 meson: fix migration/stress compilation with glib>=2.30
In reply to [email protected]From: Marc-André Lureau <[email protected]>
gettid() was introduced with glibc 2.30.
--- meson.build | 3 +++ tests/migration/stress.c | 2 ++ 2 files changed, 5 insertions(+)
meson.build +3 -0
@@ -408,6 +408,8 @@ if 'CONFIG_TASN1' in config_host endif keyutils = dependency('keyutils', required: false) +has_gettid = cc.has_function('gettid') + # Create config-host.h config_host_data.set('CONFIG_SDL', sdl.found())
@@ -418,6 +420,7 @@ config_host_data.set('CONFIG_VNC_PNG', png.found()) config_host_data.set('CONFIG_VNC_SASL', sasl.found()) config_host_data.set('CONFIG_XKBCOMMON', xkbcommon.found()) config_host_data.set('CONFIG_KEYUTILS', keyutils.found()) +config_host_data.set('CONFIG_GETTID', has_gettid) config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version())) config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0]) config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])
tests/migration/stress.c +2 -0
@@ -29,10 +29,12 @@ const char *argv0;#define PAGE_SIZE 4096 +#ifndef CONFIG_GETTID static int gettid (void ) {return syscall (SYS_gettid); } +#endif static __attribute__((noreturn))void exit_failure (void ) {
Signature · 1 line
2.26.2
PATCH 16/16 meson: convert migration/initrd-stress
In reply to [email protected]From: Marc-André Lureau <[email protected]>
--- tests/Makefile.include | 14 -------------- tests/meson.build | 1 + tests/migration/initrd-stress.sh | 10 ++++++++++ tests/migration/meson.build | 14 ++++++++++++++ 4 files changed, 25 insertions(+), 14 deletions(-) create mode 100755 tests/migration/initrd-stress.sh create mode 100644 tests/migration/meson.build
tests/Makefile.include +0 -14
@@ -38,20 +38,6 @@ export SRC_PATH SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \ $(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak))) -QEMU_CFLAGS += -I$(SRC_PATH)/tests -I$(SRC_PATH)/tests/qtest - -tests/migration/stress$(EXESUF): tests/migration/stress.o - $(call quiet-command, $(LINKPROG) -static -O3 $(PTHREAD_LIB) -o $@ $< ,"LINK","$(TARGET_DIR)$@") - -INITRD_WORK_DIR=tests/migration/initrd - -tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF) - mkdir -p $(INITRD_WORK_DIR) - cp $< $(INITRD_WORK_DIR)/init - (cd $(INITRD_WORK_DIR) && (find | cpio --quiet -o -H newc | gzip -9)) > $@ - rm $(INITRD_WORK_DIR)/init - rmdir $(INITRD_WORK_DIR) - SPEED = quick # gtester tests, possibly with verbose output
tests/meson.build +1 -0
@@ -268,3 +268,4 @@ endif subdir('qapi-schema') subdir('qtest') +subdir('migration')
tests/migration/initrd-stress.sh new file +10 -0
@@ -0,0 +1,10 @@ +#!/bin/sh + +INITRD="$1" +STRESS="$2" + +INITRD_DIR=$(mktemp -d -p '' "initrd-stress.XXXXXX") +trap 'rm -rf $INITRD_DIR' EXIT + +cp "$STRESS" "$INITRD_DIR/init" +(cd "$INITRD_DIR" && (find | cpio --quiet -o -H newc | gzip -9)) > "$INITRD"
tests/migration/meson.build new file +14 -0
@@ -0,0 +1,14 @@ +stress = executable( + 'stress', + files('stress.c'), + dependencies: [glib], + link_args: ['-static'], + build_by_default: false, +) + +custom_target( + 'initrd-stress.img', + output: 'initrd-stress.img', + input: stress, + command: [find_program('initrd-stress.sh'), '@OUTPUT@', '@INPUT@'] +)
Signature · 1 line
2.26.2
Quoted 5 lines · On 28/08/2020 13.07, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
Hi,
This series convert the unit tests from tests/Makefile.include to meson.
Just an optional idea: What about moving the unit tests to a separate subdirectory a la tests/unit/ , too?
Thomas
Hi
Quoted 11 lines · Thomas Huth
Quoted 5 lines · On 28/08/2020 13.07, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
Hi,
This series convert the unit tests from tests/Makefile.include to meson.
Just an optional idea: What about moving the unit tests to a separate subdirectory a la tests/unit/ , too?
Sounds like a good idea to me, but there is already quite a lot going on in this series :) Let's add that to the todo list, shall we?
Signature · 1 line
Marc-André Lureau
Quoted 15 lines · Marc-André Lureau
Hi
On Fri, Aug 28, 2020 at 4:56 PM Thomas Huth <[email protected] <mailto:[email protected]>> wrote:
On 28/08/2020 13.07, [email protected] <mailto:[email protected]> wrote:
> From: Marc-André Lureau <[email protected] <mailto:[email protected]>>
>
> Hi,
>
> This series convert the unit tests from tests/Makefile.include to meson.
Quoted 6 lines
Just an optional idea: What about moving the unit tests to a separate subdirectory a la tests/unit/ , too?
Sounds like a good idea to me, but there is already quite a lot going on in this series :) Let's add that to the todo list, shall we?
Sure, that's why I wrote "optional" :-)
Thomas