[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/11] tests: skip dbus-display tests that need a console
From: |
Thomas Huth |
Subject: |
[PULL 04/11] tests: skip dbus-display tests that need a console |
Date: |
Fri, 23 Feb 2024 20:09:56 +0100 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
When compiling with "configure --without-default-devices", the
dbus-display-test fails since it implicitly assumes that the
machine comes with a default console.
There doesn't seem to be an easy way to figure this during build time,
so skip the tests requiring the Console interface at runtime.
Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20240221073759.171443-1-marcandre.lureau@redhat.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/dbus-display-test.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/tests/qtest/dbus-display-test.c b/tests/qtest/dbus-display-test.c
index 21edaa1e32..0390bdcb41 100644
--- a/tests/qtest/dbus-display-test.c
+++ b/tests/qtest/dbus-display-test.c
@@ -135,6 +135,13 @@ test_dbus_console_registered(GObject *source_object,
NULL,
#endif
res, &err);
+
+ if (g_error_matches(err, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD)) {
+ g_test_skip("The VM doesn't have a console!");
+ g_main_loop_quit(test->loop);
+ return;
+ }
+
g_assert_no_error(err);
test->listener_conn = g_thread_join(test->thread);
@@ -156,7 +163,7 @@ test_dbus_display_console(void)
g_autoptr(GMainLoop) loop = NULL;
QTestState *qts = NULL;
int pair[2];
- TestDBusConsoleRegister test;
+ TestDBusConsoleRegister test = { 0, };
#ifdef WIN32
WSAPROTOCOL_INFOW info;
g_autoptr(GVariant) listener = NULL;
@@ -245,7 +252,6 @@ test_dbus_display_keyboard(void)
&err));
g_assert_no_error(err);
-
g_assert_cmpint(qtest_inb(qts, 0x64) & 0x1, ==, 0);
g_assert_cmpint(qtest_inb(qts, 0x60), ==, 0);
@@ -256,6 +262,12 @@ test_dbus_display_keyboard(void)
-1,
NULL,
&err);
+ if (g_error_matches(err, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD)) {
+ g_test_skip("The VM doesn't have a console!");
+ qtest_quit(qts);
+ return;
+ }
+
g_assert_no_error(err);
/* may be should wait for interrupt? */
--
2.43.2
- [PULL 00/11] Test and misc patches, Thomas Huth, 2024/02/23
- [PULL 02/11] tests/cdrom-test: Add cdrom test for LoongArch virt machine, Thomas Huth, 2024/02/23
- [PULL 01/11] target/m68k: Fix exception frame format for 68010, Thomas Huth, 2024/02/23
- [PULL 05/11] target/ppc/kvm: Replace variable length array in kvmppc_save_htab(), Thomas Huth, 2024/02/23
- [PULL 03/11] tests/qtest: Fix boot-serial-test when using --without-default-devices, Thomas Huth, 2024/02/23
- [PULL 04/11] tests: skip dbus-display tests that need a console,
Thomas Huth <=
- [PULL 10/11] .gitlab-ci.d/windows.yml: Remove shared-msys2 abstraction, Thomas Huth, 2024/02/23
- [PULL 09/11] .gitlab-ci.d: Drop cross-win32-system job, Thomas Huth, 2024/02/23
- [PULL 11/11] target/i386: do not filter processor tracing features except on KVM, Thomas Huth, 2024/02/23
- [PULL 06/11] target/ppc/kvm: Replace variable length array in kvmppc_read_hptes(), Thomas Huth, 2024/02/23
- [PULL 07/11] meson: Enable -Wvla, Thomas Huth, 2024/02/23
- [PULL 08/11] docs: Document that 32-bit Windows is unsupported, Thomas Huth, 2024/02/23
- Re: [PULL 00/11] Test and misc patches, Peter Maydell, 2024/02/25