diff options
author | John Levon <john.levon@nutanix.com> | 2021-06-10 11:35:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-10 11:35:08 +0100 |
commit | c34d6ec02bae297b9256ac45ff71da0e2d4b4bc1 (patch) | |
tree | 1ca0d1f797bb38ffa06a2f132d613fa0e3785fa3 /test/py/test_negotiate.py | |
parent | b665c3982c1efe2bb896fc8b556d24bcf996435a (diff) | |
download | libvfio-user-c34d6ec02bae297b9256ac45ff71da0e2d4b4bc1.zip libvfio-user-c34d6ec02bae297b9256ac45ff71da0e2d4b4bc1.tar.gz libvfio-user-c34d6ec02bae297b9256ac45ff71da0e2d4b4bc1.tar.bz2 |
python tests: add msg() utility function (#562)
Most tests need to send a request, process it, then retrieve the reply.
Add a utility function to avoid lots of tedious boilerplate.
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'test/py/test_negotiate.py')
-rw-r--r-- | test/py/test_negotiate.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/py/test_negotiate.py b/test/py/test_negotiate.py index a3f2a8a..524f59f 100644 --- a/test/py/test_negotiate.py +++ b/test/py/test_negotiate.py @@ -41,6 +41,7 @@ def client_version_json(expect=0, json=''): payload = struct.pack("HH%dsc" % len(json), LIBVFIO_USER_MAJOR, LIBVFIO_USER_MINOR, json, b'\0') + hdr = vfio_user_header(VFIO_USER_VERSION, size=len(payload)) sock.send(hdr + payload) vfu_attach_ctx(ctx, expect=expect) |