aboutsummaryrefslogtreecommitdiff
path: root/test/py/test_irq_trigger.py
diff options
context:
space:
mode:
authorMattias Nissler <122288598+mnissler-rivos@users.noreply.github.com>2023-08-31 11:38:55 +0200
committerGitHub <noreply@github.com>2023-08-31 10:38:55 +0100
commita7eedffe20bd6e480c9e2c65e68daef1beb2af05 (patch)
tree37f46c9cbf8de3fbb0622b7472157d60f1b8550f /test/py/test_irq_trigger.py
parent2e8ec2e17a5252d29bae849eb4ccd7ca6bab216a (diff)
downloadlibvfio-user-a7eedffe20bd6e480c9e2c65e68daef1beb2af05.zip
libvfio-user-a7eedffe20bd6e480c9e2c65e68daef1beb2af05.tar.gz
libvfio-user-a7eedffe20bd6e480c9e2c65e68daef1beb2af05.tar.bz2
Introduce client object in python tests (#772)
Thus far, the client end of the socket is the only piece of client state tracked in tests, for which a global `socket` variable has been used. In preparation to add more state, replace the `socket` global with a `client` global object that groups all client state. Signed-off-by: Mattias Nissler <mnissler@rivosinc.com> Reviewed-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'test/py/test_irq_trigger.py')
-rw-r--r--test/py/test_irq_trigger.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/py/test_irq_trigger.py b/test/py/test_irq_trigger.py
index 18469a4..b835a58 100644
--- a/test/py/test_irq_trigger.py
+++ b/test/py/test_irq_trigger.py
@@ -32,11 +32,11 @@ import ctypes as c
import errno
ctx = None
-sock = None
+client = None
def test_irq_trigger_setup():
- global ctx, sock
+ global ctx, client
ctx = vfu_create_ctx(flags=LIBVFIO_USER_FLAG_ATTACH_NB)
assert ctx is not None
@@ -50,7 +50,7 @@ def test_irq_trigger_setup():
ret = vfu_realize_ctx(ctx)
assert ret == 0
- sock = connect_client(ctx)
+ client = connect_client(ctx)
def test_irq_trigger_bad_subindex():
@@ -76,7 +76,7 @@ def test_irq_trigger():
fd = eventfd(initval=4)
- msg(ctx, sock, VFIO_USER_DEVICE_SET_IRQS, payload, fds=[fd])
+ msg(ctx, client.sock, VFIO_USER_DEVICE_SET_IRQS, payload, fds=[fd])
vfu_irq_trigger(ctx, 8)