From cefae300b91fc3b365b66cf13ec67ee4c2b979e8 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Mon, 7 Sep 2026 12:22:15 +0000 Subject: [PATCH] Add perf tests --- AGENTS.md | 5 +++-- README.md | 8 ++++++++ tox.ini | 9 +++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 774539c..5413f9a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,7 +8,7 @@ to retrieve VMware disk contents. - Integration tests under `tests/integration/` are a good starting point for interacting with the VMware NBD / NFC APIs. They take a session-scoped - `lab` fixture from `tests/integration/conftest.py` (credentials and VM + `lab` fixture from `tests/conftest.py` (credentials and VM settings in `tests.integration.base.LabEnv`). The fixture creates a temporary empty VM for the pytest session. We can make use of them to reverse engineer the VMware protocol, for example making various @@ -41,7 +41,8 @@ fixture creates one temporary empty VM with a 10 GiB disk for the whole run and destroys it at session end. Run them with `tox -e integration` or - `.venv/bin/pytest tests/integration`. + `.venv/bin/pytest tests/integration`. Throughput comparison against + native VDDK lives under `tests/perf/` (`tox -e perf`). ## Other rules diff --git a/README.md b/README.md index 646bdd1..1545ef6 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ VDDK-shaped handle. | `openvixdisklib/nfc_auth.py` | VIM login, NFC ticket, authd on 902 | | `openvixdisklib/nfc_open.py` | Classic NFC handshake, AIO open, sector read/write | | `tests/integration/` | Live pytest suite against a lab vCenter | +| `tests/perf/` | Throughput comparison of openvixdisklib vs VDDK | | `tests/integration/vixdisklib.py` | Native VDDK wrapper used only to cross-check | | `docs/` | Protocol notes and reverse-engineering steps | @@ -95,6 +96,13 @@ tox -e integration .venv/bin/pytest tests/integration ``` +Compare write/read throughput of openvixdisklib and native VDDK +(`64KiB`, 129-sector, and `32MiB` transfers): + +```bash +tox -e perf +``` + VDDK cross-check tests skip when `libvixDiskLib` is not loadable from `.vddk`. `tox -e integration` sets `LD_LIBRARY_PATH` to that directory and clears `LD_PRELOAD`. For a direct pytest run, do the same. diff --git a/tox.ini b/tox.ini index 82248d7..6e549be 100644 --- a/tox.ini +++ b/tox.ini @@ -51,6 +51,15 @@ commands = pycobertura show --format html --source openvixdisklib \ coverage.xml -o coverage.html +[testenv:perf] +description = Compare openvixdisklib and VDDK I/O throughput against the lab. +sitepackages = True +usedevelop = True +setenv = + {[testenv:integration]setenv} +commands = + python -m pytest -v -s tests/perf/ {posargs} + [testenv:fmt] description = Format the code based on the coding style standards. deps =