aboutsummaryrefslogtreecommitdiff
path: root/test/py/test_dma_map.py
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2022-02-18 12:24:07 +0000
committerGitHub <noreply@github.com>2022-02-18 12:24:07 +0000
commitf968d297dd5ff00cd5593a5f0828fea5fef7670c (patch)
tree3d7cc48b4d985685fc2fe1c13bf9bd1707f64be1 /test/py/test_dma_map.py
parent403bb2aa6784d445fe18825307cc85ca79820a01 (diff)
downloadlibvfio-user-f968d297dd5ff00cd5593a5f0828fea5fef7670c.zip
libvfio-user-f968d297dd5ff00cd5593a5f0828fea5fef7670c.tar.gz
libvfio-user-f968d297dd5ff00cd5593a5f0828fea5fef7670c.tar.bz2
test/py: simplify errno handling (#645)
We explicitly identify the quiesce EBUSY case for msg(), letting us simplify the handling of expected errno. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Diffstat (limited to 'test/py/test_dma_map.py')
-rw-r--r--test/py/test_dma_map.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/py/test_dma_map.py b/test/py/test_dma_map.py
index 2a9ac96..f33d110 100644
--- a/test/py/test_dma_map.py
+++ b/test/py/test_dma_map.py
@@ -62,7 +62,7 @@ def test_dma_region_too_big():
VFIO_USER_F_DMA_REGION_WRITE),
offset=0, addr=0x10000, size=MAX_DMA_SIZE + 4096)
- msg(ctx, sock, VFIO_USER_DMA_MAP, payload, expect_reply_errno=errno.ENOSPC)
+ msg(ctx, sock, VFIO_USER_DMA_MAP, payload, expect=errno.ENOSPC)
def test_dma_region_too_many():
@@ -79,7 +79,7 @@ def test_dma_region_too_many():
else:
expect = 0
- msg(ctx, sock, VFIO_USER_DMA_MAP, payload, expect_reply_errno=expect)
+ msg(ctx, sock, VFIO_USER_DMA_MAP, payload, expect=expect)
@patch('libvfio_user.quiesce_cb', side_effect=fail_with_errno(errno.EBUSY))
@@ -98,7 +98,7 @@ def test_dma_map_busy(mock_dma_register, mock_quiesce):
offset=0, addr=0x10000, size=0x1000)
msg(ctx, sock, VFIO_USER_DMA_MAP, payload, rsp=False,
- expect_run_ctx_errno=errno.EBUSY)
+ busy=True)
assert mock_dma_register.call_count == 0
@@ -195,7 +195,7 @@ def test_dma_map_busy_reply_fail(mock_dma_register, mock_quiesce, mock_reset):
offset=0, addr=0x10000, size=0x1000)
msg(ctx, sock, VFIO_USER_DMA_MAP, payload, rsp=False,
- expect_run_ctx_errno=errno.EBUSY)
+ busy=True)
mock_quiesce.assert_called_once_with(ctx)