From 2831a7e580e0ee85ff9dbb225a38e5741671542e Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Wed, 20 Nov 2019 10:10:14 +0100 Subject: Remove libbluetooth / bluez from the CI tests Since the bluetooth code has been removed, we don't need to test with this library anymore. Message-Id: <20191120091014.16883-5-thuth@redhat.com> Acked-by: Paolo Bonzini Signed-off-by: Thomas Huth --- tests/docker/dockerfiles/fedora.docker | 1 - tests/docker/dockerfiles/ubuntu.docker | 1 - tests/docker/dockerfiles/ubuntu1804.docker | 1 - 3 files changed, 3 deletions(-) (limited to 'tests') diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker index 47732fc..51d475e 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -2,7 +2,6 @@ FROM fedora:30 ENV PACKAGES \ bc \ bison \ - bluez-libs-devel \ brlapi-devel \ bzip2 \ bzip2-devel \ diff --git a/tests/docker/dockerfiles/ubuntu.docker b/tests/docker/dockerfiles/ubuntu.docker index ecea155..18f1100 100644 --- a/tests/docker/dockerfiles/ubuntu.docker +++ b/tests/docker/dockerfiles/ubuntu.docker @@ -19,7 +19,6 @@ ENV PACKAGES flex bison \ glusterfs-common \ libaio-dev \ libattr1-dev \ - libbluetooth-dev \ libbrlapi-dev \ libbz2-dev \ libcacard-dev \ diff --git a/tests/docker/dockerfiles/ubuntu1804.docker b/tests/docker/dockerfiles/ubuntu1804.docker index 32a6074..0766f94 100644 --- a/tests/docker/dockerfiles/ubuntu1804.docker +++ b/tests/docker/dockerfiles/ubuntu1804.docker @@ -8,7 +8,6 @@ ENV PACKAGES flex bison \ glusterfs-common \ libaio-dev \ libattr1-dev \ - libbluetooth-dev \ libbrlapi-dev \ libbz2-dev \ libcacard-dev \ -- cgit v1.1 From eca3a945234a5f0a499860dd11df64b5f1a2e0a5 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 13 Nov 2019 16:09:35 -0500 Subject: tests: fix modules-test 'duplicate test case' error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ./configure --enable-sdl --audio-drv-list=sdl --enable-modules Will generate two identical test names: /$arch/module/load/sdl Which generates an error like: (tests/modules-test:23814): GLib-ERROR **: 18:23:06.359: duplicate test case path: /aarch64//module/load/sdl Add the subsystem prefix in the name as well, so instead we get: /$arch/module/load/audio-sdl /$arch/module/load/ui-sdl Signed-off-by: Cole Robinson Message-Id: Reviewed-by: Marc-André Lureau Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- tests/modules-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/modules-test.c b/tests/modules-test.c index d1a6ace..8821768 100644 --- a/tests/modules-test.c +++ b/tests/modules-test.c @@ -64,7 +64,8 @@ int main(int argc, char *argv[]) g_test_init(&argc, &argv, NULL); for (i = 0; i < G_N_ELEMENTS(modules); i += 2) { - char *testname = g_strdup_printf("/module/load/%s", modules[i + 1]); + char *testname = g_strdup_printf("/module/load/%s%s", + modules[i], modules[i + 1]); qtest_add_data_func(testname, modules + i, test_modules_load); g_free(testname); } -- cgit v1.1 From 1ee5e144ea6bed4afab8c28f1c552c82ef56bc95 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Wed, 20 Nov 2019 18:09:55 +0100 Subject: pseries: disable migration-test if /dev/kvm cannot be used On ppc64, migration-test only works with kvm_hv, and we already have a check to verify the module is loaded. kvm_hv module can be loaded in memory and /sys/module/kvm_hv exists, but on some systems (like build systems) /dev/kvm can be missing (by administrators choice). And as kvm_hv exists test-migration is started but QEMU falls back to TCG because it cannot be used: Could not access KVM kernel module: No such file or directory failed to initialize KVM: No such file or directory Back to tcg accelerator And as the test is done with TCG, it fails. As for s390x, we must check for the existence and the access rights of /dev/kvm. Reported-by: Cole Robinson Signed-off-by: Laurent Vivier Message-Id: <20191120170955.242900-1-lvivier@redhat.com> Reviewed-by: Thomas Huth Reviewed-by: Greg Kurz Reviewed-by: Juan Quintela Signed-off-by: Thomas Huth --- tests/migration-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/migration-test.c b/tests/migration-test.c index ebd77a5..a5343fd 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -1349,7 +1349,8 @@ int main(int argc, char **argv) * some reason) */ if (g_str_equal(qtest_get_arch(), "ppc64") && - access("/sys/module/kvm_hv", F_OK)) { + (access("/sys/module/kvm_hv", F_OK) || + access("/dev/kvm", R_OK | W_OK))) { g_test_message("Skipping test: kvm_hv not available"); return g_test_run(); } -- cgit v1.1 From e468ffdc6d3b1c7127b785eb73a1f5c94751fb01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 11 Dec 2019 15:23:28 +0100 Subject: glib: use portable g_setenv() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have a setenv() wrapper in os-win32.c that no one is actually using. Drop it and change to g_setenv() uniformly. Signed-off-by: Marc-André Lureau Signed-off-by: Paolo Bonzini Message-Id: <1576074210-52834-7-git-send-email-pbonzini@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/libqtest.c | 2 +- tests/test-crypto-tlscredsx509.c | 2 +- tests/test-crypto-tlssession.c | 2 +- tests/test-io-channel-tls.c | 2 +- tests/test-vmstate.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/libqtest.c b/tests/libqtest.c index 91e9cb2..f36e30a 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -254,7 +254,7 @@ QTestState *qtest_init_without_qmp_handshake(const char *extra_args) s->expected_status = 0; s->qemu_pid = fork(); if (s->qemu_pid == 0) { - setenv("QEMU_AUDIO_DRV", "none", true); + g_setenv("QEMU_AUDIO_DRV", "none", true); execlp("/bin/sh", "sh", "-c", command, NULL); exit(1); } diff --git a/tests/test-crypto-tlscredsx509.c b/tests/test-crypto-tlscredsx509.c index a27efb7..f487349 100644 --- a/tests/test-crypto-tlscredsx509.c +++ b/tests/test-crypto-tlscredsx509.c @@ -141,7 +141,7 @@ int main(int argc, char **argv) module_call_init(MODULE_INIT_QOM); g_test_init(&argc, &argv, NULL); - setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); + g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); mkdir(WORKDIR, 0700); diff --git a/tests/test-crypto-tlssession.c b/tests/test-crypto-tlssession.c index 6560d71..8b2453f 100644 --- a/tests/test-crypto-tlssession.c +++ b/tests/test-crypto-tlssession.c @@ -398,7 +398,7 @@ int main(int argc, char **argv) module_call_init(MODULE_INIT_QOM); g_test_init(&argc, &argv, NULL); - setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); + g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); mkdir(WORKDIR, 0700); diff --git a/tests/test-io-channel-tls.c b/tests/test-io-channel-tls.c index 3c9ef6f..ad7554c 100644 --- a/tests/test-io-channel-tls.c +++ b/tests/test-io-channel-tls.c @@ -273,7 +273,7 @@ int main(int argc, char **argv) module_call_init(MODULE_INIT_QOM); g_test_init(&argc, &argv, NULL); - setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); + g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1); mkdir(WORKDIR, 0700); diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index 1e5be1d..8f184f3 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -1325,7 +1325,7 @@ int main(int argc, char **argv) module_call_init(MODULE_INIT_QOM); - setenv("QTEST_SILENT_ERRORS", "1", 1); + g_setenv("QTEST_SILENT_ERRORS", "1", 1); g_test_init(&argc, &argv, NULL); g_test_add_func("/vmstate/simple/primitive", test_simple_primitive); -- cgit v1.1 From c3088cd306caf965f1901e0a9ed818353c530b4e Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Wed, 11 Dec 2019 15:44:27 -0500 Subject: tests/Makefile: Fix check-report.* targets shown in check-help The check-report.html and check-report.xml targets were replaced with check-report.tap in commit 9df43317b82 but the check-help text was not updated so it still lists check-report.html. Fixes: 9df43317b82 Signed-off-by: Wainer dos Santos Moschetta Message-Id: <20191211204427.4681-2-wainersm@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/Makefile.include | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/Makefile.include b/tests/Makefile.include index 8566f5f..680bd8a 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -16,12 +16,10 @@ check-help: @echo " $(MAKE) check-softfloat Run FPU emulation tests" @echo " $(MAKE) check-acceptance Run all acceptance (functional) tests" @echo - @echo " $(MAKE) check-report.html Generates an HTML test report" + @echo " $(MAKE) check-report.tap Generates an aggregated TAP test report" @echo " $(MAKE) check-venv Creates a Python venv for tests" @echo " $(MAKE) check-clean Clean the tests and related data" @echo - @echo "Please note that HTML reports do not regenerate if the unit tests" - @echo "have not changed." @echo @echo "The variable SPEED can be set to control the gtester speed setting." @echo "Default options are -k and (for $(MAKE) V=1) --verbose; they can be" -- cgit v1.1 From 0f555602c7430ae55b5a4bacf39ce9e483e11193 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 12 Dec 2019 02:17:58 +0100 Subject: tests: use g_test_rand_int g_test_rand_int provides a reproducible random integer number, using a different number seed every time but allowing reproduction using the --seed command line option. It is thus better suited to tests than g_random_int or random. Signed-off-by: Paolo Bonzini Message-Id: <1576113478-42926-1-git-send-email-pbonzini@redhat.com> Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth --- tests/ivshmem-test.c | 2 +- tests/test-bitmap.c | 8 ++++---- tests/test-qga.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c index be9aa92..ecda256 100644 --- a/tests/ivshmem-test.c +++ b/tests/ivshmem-test.c @@ -443,7 +443,7 @@ static gchar *mktempshm(int size, int *fd) while (true) { gchar *name; - name = g_strdup_printf("/qtest-%u-%u", getpid(), g_random_int()); + name = g_strdup_printf("/qtest-%u-%u", getpid(), g_test_rand_int()); *fd = shm_open(name, O_CREAT|O_RDWR|O_EXCL, S_IRWXU|S_IRWXG|S_IRWXO); if (*fd > 0) { diff --git a/tests/test-bitmap.c b/tests/test-bitmap.c index 087e02a..2f5b714 100644 --- a/tests/test-bitmap.c +++ b/tests/test-bitmap.c @@ -22,10 +22,10 @@ static void check_bitmap_copy_with_offset(void) bmap2 = bitmap_new(BMAP_SIZE); bmap3 = bitmap_new(BMAP_SIZE); - bmap1[0] = random(); - bmap1[1] = random(); - bmap1[2] = random(); - bmap1[3] = random(); + bmap1[0] = g_test_rand_int(); + bmap1[1] = g_test_rand_int(); + bmap1[2] = g_test_rand_int(); + bmap1[3] = g_test_rand_int(); total = BITS_PER_LONG * 4; /* Shift 115 bits into bmap2 */ diff --git a/tests/test-qga.c b/tests/test-qga.c index 1ca49bb..d2b2435 100644 --- a/tests/test-qga.c +++ b/tests/test-qga.c @@ -143,7 +143,7 @@ static void qmp_assertion_message_error(const char *domain, static void test_qga_sync_delimited(gconstpointer fix) { const TestFixture *fixture = fix; - guint32 v, r = g_random_int(); + guint32 v, r = g_test_rand_int(); unsigned char c; QDict *ret; @@ -186,7 +186,7 @@ static void test_qga_sync_delimited(gconstpointer fix) static void test_qga_sync(gconstpointer fix) { const TestFixture *fixture = fix; - guint32 v, r = g_random_int(); + guint32 v, r = g_test_rand_int(); QDict *ret; /* -- cgit v1.1