aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThanos Makatos <thanos.makatos@nutanix.com>2022-10-05 14:57:21 +0100
committerGitHub <noreply@github.com>2022-10-05 14:57:21 +0100
commit7e91fd213bd25a704783a47c2207f508db2250c1 (patch)
treeb98487b9179f9d11d939970972be0cf509e67d74 /test
parentaa19ba90f73c9b456a03a03d0d453e79fd8cf2d9 (diff)
downloadlibvfio-user-7e91fd213bd25a704783a47c2207f508db2250c1.zip
libvfio-user-7e91fd213bd25a704783a47c2207f508db2250c1.tar.gz
libvfio-user-7e91fd213bd25a704783a47c2207f508db2250c1.tar.bz2
don't duplicate FD in get region info (#715)
This is out of spec. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
Diffstat (limited to 'test')
-rw-r--r--test/py/test_device_get_region_info.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/test/py/test_device_get_region_info.py b/test/py/test_device_get_region_info.py
index 3260193..5df33d4 100644
--- a/test/py/test_device_get_region_info.py
+++ b/test/py/test_device_get_region_info.py
@@ -120,17 +120,6 @@ def test_device_get_region_info_bad_index():
expect=errno.EINVAL)
-# python tests use max client fds of 8, but this region has 9 mmap areas.
-def test_device_get_region_info_caps_too_few_fds():
- payload = vfio_region_info(argsz=192, flags=0,
- index=VFU_PCI_DEV_BAR3_REGION_IDX, cap_offset=0,
- size=0, offset=0)
- payload = bytes(payload) + b'\0' * (192 - 32)
-
- msg(ctx, sock, VFIO_USER_DEVICE_GET_REGION_INFO, payload,
- expect=errno.ENOSPC)
-
-
def test_device_get_region_info_larger_argsz():
payload = vfio_region_info(argsz=argsz + 8, flags=0,
@@ -191,7 +180,7 @@ def test_device_get_region_info_caps():
size=0, offset=0)
payload = bytes(payload) + b'\0' * (80 - 32)
- result = msg(ctx, sock, VFIO_USER_DEVICE_GET_REGION_INFO, payload)
+ fds, result = msg_fds(ctx, sock, VFIO_USER_DEVICE_GET_REGION_INFO, payload)
info, result = vfio_region_info.pop_from_buffer(result)
cap, result = vfio_region_info_cap_sparse_mmap.pop_from_buffer(result)
@@ -213,7 +202,7 @@ def test_device_get_region_info_caps():
assert area2.offset == 0x4000
assert area2.size == 0x2000
- # skip reading the SCM_RIGHTS
+ assert(len(fds) == 1)
disconnect_client(ctx, sock)