qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 11/18] tests: expand the migration precopy helper to support


From: Peter Xu
Subject: Re: [PATCH 11/18] tests: expand the migration precopy helper to support failures
Date: Mon, 7 Mar 2022 15:39:22 +0800

On Wed, Mar 02, 2022 at 05:49:25PM +0000, Daniel P. Berrangé wrote:
> The migration precopy testing helper function always expects the
> migration to run to a completion state. There will be test scenarios
> for TLS where expect either the client or server to fail the migration.
> This expands the helper to cope with these scenarios.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  tests/qtest/migration-test.c | 47 +++++++++++++++++++++++++++++-------
>  1 file changed, 38 insertions(+), 9 deletions(-)
> 
> diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
> index 2082c58e8b..e40b408988 100644
> --- a/tests/qtest/migration-test.c
> +++ b/tests/qtest/migration-test.c
> @@ -827,17 +827,32 @@ typedef void (*TestMigrateFinishHook)(QTestState *from,
>   * @connect_uri: the URI for the src QEMU to connect to
>   * @start_hook: (optional) callback to run at start to set migration 
> parameters
>   * @finish_hook: (optional) callback to run at finish to cleanup
> + * @expect_fail: true if we expect migration to fail
> + * @dst_quit: true if we expect the dst QEMU to quit with an
> + *            abnormal exit status on failure

"dst_quit" sounds a bit confusing to me, as setting dst_quit=false seems to
mean "dest qemu should not quit" but it's actually for checking an abnormal
quit only.

Rename may work. Or, IMHO it's nicer if we could merge the two parameters:

  @expected_result: What is the expectation of this migration test

  typedef enum {
    /* This test should succeed, the default */
    MIG_TEST_SUCCEED = 0,
    /* This test should fail, dest qemu should keep alive */
    MIG_TEST_FAIL,
    /* This test should fail, dest qemu should fail with abnormal status */
    MIG_TEST_FAIL_DEST_QUIT_ERR,
  };

Because fundamentally the two parameters are correlated, e.g. there is no
combination of expect_fail==false && dst_quit==true.

No strong opinion, though.

Thanks,

-- 
Peter Xu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]