Add perf tests

This commit is contained in:
Lucian Petrut
2026-09-07 12:22:15 +00:00
parent ac0baeca86
commit cefae300b9
3 changed files with 20 additions and 2 deletions
+3 -2
View File
@@ -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
+8
View File
@@ -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.
+9
View File
@@ -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 =