diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/py/libvfio_user.py | 8 | ||||
-rw-r--r-- | test/py/test_migration.py | 10 | ||||
-rw-r--r-- | test/py/test_quiesce.py | 8 | ||||
-rw-r--r-- | test/unit-tests.c | 4 |
4 files changed, 15 insertions, 15 deletions
diff --git a/test/py/libvfio_user.py b/test/py/libvfio_user.py index 246a4f1..ec9da7b 100644 --- a/test/py/libvfio_user.py +++ b/test/py/libvfio_user.py @@ -111,10 +111,10 @@ VFIO_IRQ_SET_ACTION_TRIGGER = (1 << 5) VFIO_DMA_UNMAP_FLAG_ALL = (1 << 1) -VFIO_DEVICE_STATE_STOP = (0) -VFIO_DEVICE_STATE_RUNNING = (1 << 0) -VFIO_DEVICE_STATE_SAVING = (1 << 1) -VFIO_DEVICE_STATE_RESUMING = (1 << 2) +VFIO_DEVICE_STATE_V1_STOP = (0) +VFIO_DEVICE_STATE_V1_RUNNING = (1 << 0) +VFIO_DEVICE_STATE_V1_SAVING = (1 << 1) +VFIO_DEVICE_STATE_V1_RESUMING = (1 << 2) VFIO_DEVICE_STATE_MASK = ((1 << 3) - 1) diff --git a/test/py/test_migration.py b/test/py/test_migration.py index a4da41f..c5da94f 100644 --- a/test/py/test_migration.py +++ b/test/py/test_migration.py @@ -75,7 +75,7 @@ def test_migration_bad_access(mock_trans, mock_quiesce): """ global ctx, sock - data = VFIO_DEVICE_STATE_SAVING.to_bytes(c.sizeof(c.c_int), 'little') + data = VFIO_DEVICE_STATE_V1_SAVING.to_bytes(c.sizeof(c.c_int), 'little') write_region(ctx, sock, VFU_PCI_DEV_MIGR_REGION_IDX, offset=0, count=len(data)-1, data=data, expect=errno.EINVAL) @@ -91,7 +91,7 @@ def test_migration_trans_sync(mock_trans, mock_quiesce): global ctx, sock - data = VFIO_DEVICE_STATE_SAVING.to_bytes(c.sizeof(c.c_int), 'little') + data = VFIO_DEVICE_STATE_V1_SAVING.to_bytes(c.sizeof(c.c_int), 'little') write_region(ctx, sock, VFU_PCI_DEV_MIGR_REGION_IDX, offset=0, count=len(data), data=data) @@ -107,7 +107,7 @@ def test_migration_trans_sync_err(mock_trans): global ctx, sock - data = VFIO_DEVICE_STATE_SAVING.to_bytes(c.sizeof(c.c_int), 'little') + data = VFIO_DEVICE_STATE_V1_SAVING.to_bytes(c.sizeof(c.c_int), 'little') write_region(ctx, sock, VFU_PCI_DEV_MIGR_REGION_IDX, offset=0, count=len(data), data=data, expect=errno.EPERM) @@ -126,7 +126,7 @@ def test_migration_trans_async(mock_trans, mock_quiesce): global ctx, sock mock_quiesce - data = VFIO_DEVICE_STATE_SAVING.to_bytes(c.sizeof(c.c_int), 'little') + data = VFIO_DEVICE_STATE_V1_SAVING.to_bytes(c.sizeof(c.c_int), 'little') write_region(ctx, sock, VFU_PCI_DEV_MIGR_REGION_IDX, offset=0, count=len(data), data=data, rsp=False, busy=True) @@ -151,7 +151,7 @@ def test_migration_trans_async_err(mock_trans, mock_quiesce): global ctx, sock - data = VFIO_DEVICE_STATE_RUNNING.to_bytes(c.sizeof(c.c_int), 'little') + data = VFIO_DEVICE_STATE_V1_RUNNING.to_bytes(c.sizeof(c.c_int), 'little') write_region(ctx, sock, VFU_PCI_DEV_MIGR_REGION_IDX, offset=0, count=len(data), data=data, rsp=False, busy=True) diff --git a/test/py/test_quiesce.py b/test/py/test_quiesce.py index e74eeed..f283ccc 100644 --- a/test/py/test_quiesce.py +++ b/test/py/test_quiesce.py @@ -202,10 +202,10 @@ def test_allowed_funcs_in_quiesed_migration(mock_quiesce, global ctx, sock _map_dma_region(ctx, sock) - data = VFIO_DEVICE_STATE_SAVING.to_bytes(c.sizeof(c.c_int), 'little') + data = VFIO_DEVICE_STATE_V1_SAVING.to_bytes(c.sizeof(c.c_int), 'little') write_region(ctx, sock, VFU_PCI_DEV_MIGR_REGION_IDX, offset=0, count=len(data), data=data) - mock_trans.assert_called_once_with(ctx, VFIO_DEVICE_STATE_SAVING) + mock_trans.assert_called_once_with(ctx, VFIO_DEVICE_STATE_V1_SAVING) @patch('libvfio_user.migr_trans_cb', side_effect=_side_effect) @@ -216,13 +216,13 @@ def test_allowed_funcs_in_quiesed_migration_busy(mock_quiesce, global ctx, sock _map_dma_region(ctx, sock) mock_quiesce.side_effect = fail_with_errno(errno.EBUSY) - data = VFIO_DEVICE_STATE_STOP.to_bytes(c.sizeof(c.c_int), 'little') + data = VFIO_DEVICE_STATE_V1_STOP.to_bytes(c.sizeof(c.c_int), 'little') write_region(ctx, sock, VFU_PCI_DEV_MIGR_REGION_IDX, offset=0, count=len(data), data=data, rsp=False, busy=True) ret = vfu_device_quiesced(ctx, 0) assert ret == 0 - mock_trans.assert_called_once_with(ctx, VFIO_DEVICE_STATE_STOP) + mock_trans.assert_called_once_with(ctx, VFIO_DEVICE_STATE_V1_STOP) @patch('libvfio_user.reset_cb', side_effect=_side_effect) diff --git a/test/unit-tests.c b/test/unit-tests.c index 7d5297e..6b16fe6 100644 --- a/test/unit-tests.c +++ b/test/unit-tests.c @@ -590,13 +590,13 @@ test_device_is_stopped_and_copying(UNUSED void **state) } migration.info.device_state = i; bool r = device_is_stopped_and_copying(vfu_ctx.migration); - if (i == VFIO_DEVICE_STATE_SAVING) { + if (i == VFIO_DEVICE_STATE_V1_SAVING) { assert_true(r); } else { assert_false(r); } r = device_is_stopped(vfu_ctx.migration); - if (i == VFIO_DEVICE_STATE_STOP) { + if (i == VFIO_DEVICE_STATE_V1_STOP) { assert_true(r); } else { assert_false(r); |