aboutsummaryrefslogtreecommitdiff
path: root/test/py/test_device_get_region_io_fds.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_device_get_region_io_fds.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_device_get_region_io_fds.py')
-rw-r--r--test/py/test_device_get_region_io_fds.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/py/test_device_get_region_io_fds.py b/test/py/test_device_get_region_io_fds.py
index 9e2a09d..cb1b732 100644
--- a/test/py/test_device_get_region_io_fds.py
+++ b/test/py/test_device_get_region_io_fds.py
@@ -88,7 +88,7 @@ def test_device_get_region_io_fds_bad_flags():
index=VFU_PCI_DEV_BAR2_REGION_IDX, count=0)
msg(ctx, sock, VFIO_USER_DEVICE_GET_REGION_IO_FDS, payload,
- expect_reply_errno=errno.EINVAL)
+ expect=errno.EINVAL)
def test_device_get_region_io_fds_bad_count():
@@ -99,7 +99,7 @@ def test_device_get_region_io_fds_bad_count():
index=VFU_PCI_DEV_BAR2_REGION_IDX, count=1)
msg(ctx, sock, VFIO_USER_DEVICE_GET_REGION_IO_FDS, payload,
- expect_reply_errno=errno.EINVAL)
+ expect=errno.EINVAL)
def test_device_get_region_io_fds_buffer_too_small():
@@ -109,7 +109,7 @@ def test_device_get_region_io_fds_buffer_too_small():
index=VFU_PCI_DEV_BAR2_REGION_IDX, count=1)
msg(ctx, sock, VFIO_USER_DEVICE_GET_REGION_IO_FDS, payload,
- expect_reply_errno=errno.EINVAL)
+ expect=errno.EINVAL)
def test_device_get_region_io_fds_buffer_too_large():
@@ -120,7 +120,7 @@ def test_device_get_region_io_fds_buffer_too_large():
count=1)
msg(ctx, sock, VFIO_USER_DEVICE_GET_REGION_IO_FDS, payload,
- expect_reply_errno=errno.EINVAL)
+ expect=errno.EINVAL)
def test_device_get_region_io_fds_no_fds():
@@ -129,7 +129,7 @@ def test_device_get_region_io_fds_no_fds():
index=VFU_PCI_DEV_BAR1_REGION_IDX, count=0)
ret = msg(ctx, sock, VFIO_USER_DEVICE_GET_REGION_IO_FDS, payload,
- expect_reply_errno=0)
+ expect=0)
reply, ret = vfio_user_region_io_fds_reply.pop_from_buffer(ret)
@@ -145,7 +145,7 @@ def test_device_get_region_io_fds_no_regions_setup():
index=VFU_PCI_DEV_BAR3_REGION_IDX, count=0)
msg(ctx, sock, VFIO_USER_DEVICE_GET_REGION_IO_FDS, payload,
- expect_reply_errno=errno.EINVAL)
+ expect=errno.EINVAL)
def test_device_get_region_io_fds_region_no_mmap():
@@ -154,7 +154,7 @@ def test_device_get_region_io_fds_region_no_mmap():
index=VFU_PCI_DEV_BAR5_REGION_IDX, count=0)
ret = msg(ctx, sock, VFIO_USER_DEVICE_GET_REGION_IO_FDS, payload,
- expect_reply_errno=0)
+ expect=0)
reply, ret = vfio_user_region_io_fds_reply.pop_from_buffer(ret)
@@ -170,7 +170,7 @@ def test_device_get_region_io_fds_region_out_of_range():
index=512, count=0)
msg(ctx, sock, VFIO_USER_DEVICE_GET_REGION_IO_FDS, payload,
- expect_reply_errno=errno.EINVAL)
+ expect=errno.EINVAL)
def test_device_get_region_io_fds_fds_read_write():