mbox series

[v2,0/3] qtest: migration: Add tests for introducing 'channels' argument in migrate QAPIs

Message ID 20240223152517.7834-1-het.gala@nutanix.com
Headers show
Series qtest: migration: Add tests for introducing 'channels' argument in migrate QAPIs | expand

Message

Het Gala Feb. 23, 2024, 3:25 p.m. UTC
With recent migrate QAPI changes, enabling the direct use of the
'channels' argument to avoid redundant URI string parsing is achieved.

To ensure backward compatibility, both 'uri' and 'channels' are kept as
optional parameters in migration QMP commands. However, they are mutually
exclusive, requiring at least one for a successful migration connection.
This patchset adds qtests to validate 'uri' and 'channels' arguments'
mututally exhaustive behaviour.

Additionally, all migration qtests fail to employ 'channel' as the primary
method for validating migration QAPIs. This patchset also adds validation
test to enforce only use of 'channel' argument as the initial entry point
for migration QAPIs.

Patch Summary:
-------------
1. Introduce migrate_qmp(), migrate_qmp_fail() and migrate_incoming_qmp()
   with 'channels' arguments and a conversion function from
   MigrationChannelList to QList.
2. Add a new bool filed - connect_channels and add two negative validation
   tests to confirm QAPI arguments' mutually exhaustive behaviour
3. Include negative validation tests to disallow both arguments in migration
   QAPIs.

v1->v2 Changelog:
-----------------
1. Introduce 'channels' to migrate_incoming_qmp() too.
2. Squash definition of connect_channels and negative test cases together
3. Add one more negative test case where both 'uri' and 'channels' are not
   passed simulatneously to migrate QAPI.
4. The common function do_test_validate_uri_channel() is modified, similar
   to test_baddest() - causing thefunction to always fail.
5. Add a new positive qtest to start migration qmp command with 'channels'
   argument in place of 'uri' argument.

Het Gala (3):
  qtest: migration: Enhance qtest migration functions to support
    'channels' argument
  qtest: migration: Add negative validation tests for 'uri' and
    'channels'
  qtest: migration: Start migration with 'channels' argument

 tests/qtest/dbus-vmstate-test.c   |   2 +-
 tests/qtest/migration-helpers.c   |  78 ++++++++++++--
 tests/qtest/migration-helpers.h   |  15 +--
 tests/qtest/migration-test.c      | 164 +++++++++++++++++++++++++-----
 tests/qtest/virtio-net-failover.c |   8 +-
 5 files changed, 223 insertions(+), 44 deletions(-)