aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJag Raman <jag.raman@oracle.com>2022-06-09 14:48:09 -0400
committerGitHub <noreply@github.com>2022-06-09 19:48:09 +0100
commit0b28d205572c80b568a1003db2c8f37ca333e4d7 (patch)
tree3d0f6129c9faf7b966f24a71cb9ccc9a954ddbe7 /test
parent9a5124df49efed644f0db7e573ebd0367df480cd (diff)
downloadlibvfio-user-0b28d205572c80b568a1003db2c8f37ca333e4d7.zip
libvfio-user-0b28d205572c80b568a1003db2c8f37ca333e4d7.tar.gz
libvfio-user-0b28d205572c80b568a1003db2c8f37ca333e4d7.tar.bz2
test/py: fix the arguments for vfu_dev_irq_state_cb_t (#695)
There is a typo in the arguments for vfu_dev_irq_state_cb_t - fix it in this patch. Signed-off-by: Jagannathan Raman <jag.raman@oracle.com> Reviewed-by: John Levon <john.levon@nutanix.com>
Diffstat (limited to 'test')
-rw-r--r--test/py/libvfio_user.py8
-rw-r--r--test/py/test_device_set_irqs.py3
2 files changed, 7 insertions, 4 deletions
diff --git a/test/py/libvfio_user.py b/test/py/libvfio_user.py
index 76d9315..0ebf773 100644
--- a/test/py/libvfio_user.py
+++ b/test/py/libvfio_user.py
@@ -625,7 +625,7 @@ lib.vfu_create_ioeventfd.argtypes = (c.c_void_p, c.c_uint32, c.c_int,
lib.vfu_device_quiesced.argtypes = (c.c_void_p, c.c_int)
vfu_dev_irq_state_cb_t = c.CFUNCTYPE(None, c.c_void_p, c.c_uint32,
- c.c_bool, use_errno=True)
+ c.c_uint32, c.c_bool, use_errno=True)
lib.vfu_setup_irq_state_callback.argtypes = (c.c_void_p, c.c_int,
vfu_dev_irq_state_cb_t)
@@ -1035,13 +1035,13 @@ def vfu_setup_device_nr_irqs(ctx, irqtype, count):
return lib.vfu_setup_device_nr_irqs(ctx, irqtype, count)
-def irq_state(ctx, vector, mask):
+def irq_state(ctx, start, count, mask):
pass
@vfu_dev_irq_state_cb_t
-def __irq_state(ctx, vector, mask):
- irq_state(ctx, vector, mask)
+def __irq_state(ctx, start, count, mask):
+ irq_state(ctx, start, count, mask)
def vfu_setup_irq_state_callback(ctx, irqtype, cb=__irq_state):
diff --git a/test/py/test_device_set_irqs.py b/test/py/test_device_set_irqs.py
index 7525b30..4118cb2 100644
--- a/test/py/test_device_set_irqs.py
+++ b/test/py/test_device_set_irqs.py
@@ -28,6 +28,7 @@
#
from unittest.mock import patch
+from unittest.mock import ANY
from libvfio_user import *
import errno
@@ -324,6 +325,8 @@ def test_irq_state(mock_irq_state):
msg(ctx, sock, VFIO_USER_DEVICE_SET_IRQS, payload)
+ mock_irq_state.assert_called_with(ANY, 0, 1, True)
+
assert mock_irq_state.call_count == 1