diff options
author | John Levon <john.levon@nutanix.com> | 2023-09-18 18:35:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-18 18:35:43 +0100 |
commit | 7da33b5aaef3e1bafe530138451e53cda541a504 (patch) | |
tree | f7e9aff7318161928f4ba23eb9ea704c1929659a /test | |
parent | 1c0cf16e49544a849b5382cc0622dc7cd01f0f36 (diff) | |
download | libvfio-user-7da33b5aaef3e1bafe530138451e53cda541a504.zip libvfio-user-7da33b5aaef3e1bafe530138451e53cda541a504.tar.gz libvfio-user-7da33b5aaef3e1bafe530138451e53cda541a504.tar.bz2 |
test_negotiate: add migration testing (#781)
Add migration support to the test setup, and complete some additional
testing for the migration JSON capability.
Signed-off-by: John Levon <john.levon@nutanix.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/py/test_negotiate.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/py/test_negotiate.py b/test/py/test_negotiate.py index 7404902..64840df 100644 --- a/test/py/test_negotiate.py +++ b/test/py/test_negotiate.py @@ -55,6 +55,9 @@ def test_server_setup(): ctx = vfu_create_ctx() assert ctx is not None + ret = vfu_setup_device_migration_callbacks(ctx) + assert ret == 0 + ret = vfu_realize_ctx(ctx) assert ret == 0 @@ -150,14 +153,9 @@ def test_invalid_json_bad_pgsize(): b'{ "migration": { "pgsize": "foo" } } }') -# -# FIXME: need vfu_setup_device_migration_callbacks() to be able to test this -# failure mode. -# def test_invalid_json_bad_pgsize2(): - if False: - client_version_json(errno.EINVAL, - b'{ "capabilities": { "migration": { "pgsize": 4095 } } }') + client_version_json(errno.EINVAL, + b'{ "capabilities": { "migration": { "pgsize": 4095 } } }') def test_valid_negotiate_no_json(): @@ -177,7 +175,7 @@ def test_valid_negotiate_no_json(): json = parse_json(json_str) assert json.capabilities.max_msg_fds == SERVER_MAX_FDS assert json.capabilities.max_data_xfer_size == SERVER_MAX_DATA_XFER_SIZE - # FIXME: migration object checks + assert json.capabilities.migration.pgsize == PAGE_SIZE client.disconnect(ctx) |