[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: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH 11/18] tests: expand the migration precopy helper to support failures |
Date: |
Mon, 7 Mar 2022 10:10:14 +0000 |
User-agent: |
Mutt/2.1.5 (2021-12-30) |
On Mon, Mar 07, 2022 at 03:39:22PM +0800, Peter Xu wrote:
> 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.
Using enums is more clear to someone reading code, so a good idea.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [PATCH 08/18] tests: merge code for UNIX and TCP migration pre-copy tests, (continued)
- [PATCH 08/18] tests: merge code for UNIX and TCP migration pre-copy tests, Daniel P . Berrangé, 2022/03/02
- [PATCH 09/18] tests: introduce ability to provide hooks for migration precopy test, Daniel P . Berrangé, 2022/03/02
- [PATCH 10/18] tests: switch migration FD passing test to use common precopy helper, Daniel P . Berrangé, 2022/03/02
- [PATCH 11/18] tests: expand the migration precopy helper to support failures, Daniel P . Berrangé, 2022/03/02
- [PATCH 12/18] tests: add migration tests of TLS with PSK credentials, Daniel P . Berrangé, 2022/03/02
- [PATCH 13/18] tests: add migration tests of TLS with x509 credentials, Daniel P . Berrangé, 2022/03/02
- [PATCH 04/18] tests: print newline after QMP response in qtest logs, Daniel P . Berrangé, 2022/03/02