aboutsummaryrefslogtreecommitdiff
path: root/test/py
diff options
context:
space:
mode:
Diffstat (limited to 'test/py')
-rw-r--r--test/py/libvfio_user.py8
-rw-r--r--test/py/test_migration.py10
-rw-r--r--test/py/test_quiesce.py8
3 files changed, 13 insertions, 13 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)