Marc-André Lureau <[email protected]> writes:

> The test is still disabled, and trying to compile it will fail now.
>
> Fix it, and remove the G_TEST_DBUS_DAEMON setting, since it is passed by
> meson test. Fwiw, the test passes here.
>

Hi, I have a series re-enabling this test and doing a few fixes, take a
look whether it helps you. I'm a bit short on time right now, but I
could rebase and post it after the freeze.

https://gitlab.com/farosas/qemu/-/commits/migration-test-dbus-vmstate?ref_type=heads

> Signed-off-by: Marc-André Lureau <[email protected]>
> ---
>  tests/qtest/dbus-vmstate-test.c | 11 ++---------
>  tests/qtest/meson.build         |  3 ++-
>  2 files changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/tests/qtest/dbus-vmstate-test.c b/tests/qtest/dbus-vmstate-test.c
> index 6c990864e3e..ed4a52d0255 100644
> --- a/tests/qtest/dbus-vmstate-test.c
> +++ b/tests/qtest/dbus-vmstate-test.c
> @@ -3,7 +3,7 @@
>  #include <gio/gio.h>

I remember some CI job failed due to the test not declaring this
dependency.

>  #include "libqtest.h"
>  #include "dbus-vmstate1.h"
> -#include "migration-helpers.h"
> +#include "migration/migration-qmp.h"
>  
>  static char *workdir;
>  
> @@ -229,7 +229,7 @@ test_dbus_vmstate(Test *test)
>  
>      thread = g_thread_new("dbus-vmstate-thread", dbus_vmstate_thread, loop);
>  
> -    migrate_qmp(src_qemu, uri, "{}");
> +    migrate_qmp(src_qemu, dst_qemu, uri, NULL, "{}");

This works, however I have patches queued for the hardfreeze that change
some details in the migration tests infra:

- dst cmdline should use -incoming defer
- migrate_incoming_qmp needs to be called
- no more setting: qtest_set_expected_status(dst_qemu, EXIT_FAILURE);

>      test->src_qemu = src_qemu;
>      if (test->migrate_fail) {
>          wait_for_migration_fail(src_qemu, true);
> @@ -342,15 +342,8 @@ int
>  main(int argc, char **argv)
>  {
>      GError *err = NULL;
> -    g_autofree char *dbus_daemon = NULL;
>      int ret;
>  
> -    dbus_daemon = g_build_filename(G_STRINGIFY(SRCDIR),
> -                                   "tests",
> -                                   "dbus-vmstate-daemon.sh",
> -                                   NULL);
> -    g_setenv("G_TEST_DBUS_DAEMON", dbus_daemon, true);
> -
>      g_test_init(&argc, &argv, NULL);
>  
>      workdir = g_dir_make_tmp("dbus-vmstate-test-XXXXXX", &err);
> diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
> index b735f55fc40..5f8cff172c8 100644
> --- a/tests/qtest/meson.build
> +++ b/tests/qtest/meson.build
> @@ -130,7 +130,8 @@ if dbus_daemon.found() and gdbus_codegen.found()
>                                  input: meson.project_source_root() / 
> 'backends/dbus-vmstate1.xml',
>                                  command: [gdbus_codegen, '@INPUT@',
>                                            '--interface-prefix', 'org.qemu',
> -                                          '--generate-c-code', 
> '@BASENAME@']).to_list()
> +                                          '--generate-c-code', '@BASENAME@',
> +                                          '--output-directory', 
> meson.current_build_dir()]).to_list()
>  else
>    dbus_vmstate1 = []
>  endif

Reply via email to