diff options
-rw-r--r-- | test/py/test_setup_region.py | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/test/py/test_setup_region.py b/test/py/test_setup_region.py index f06d31c..b55f56f 100644 --- a/test/py/test_setup_region.py +++ b/test/py/test_setup_region.py @@ -35,7 +35,7 @@ import tempfile ctx = None -def test_device_set_irqs_setup(): +def test_setup_region_setup(): global ctx ctx = vfu_create_ctx(flags=LIBVFIO_USER_FLAG_ATTACH_NB) @@ -215,6 +215,30 @@ def test_access_region_zero_count(): disconnect_client(ctx, sock) +def test_access_region_large_count(): + global ctx + + sock = connect_client(ctx) + + read_region(ctx, sock, VFU_PCI_DEV_CFG_REGION_IDX, offset=0, + count=SERVER_MAX_DATA_XFER_SIZE + 8, expect=errno.EINVAL) + + disconnect_client(ctx, sock) + + +def test_region_offset_too_short(): + global ctx + + sock = connect_client(ctx) + + payload = struct.pack("Q", 0) + + msg(ctx, sock, VFIO_USER_REGION_WRITE, payload, + expect_reply_errno=errno.EINVAL) + + disconnect_client(ctx, sock) + + def test_setup_region_cleanup(): vfu_destroy_ctx(ctx) |