Add perf tests
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
to retrieve VMware disk contents.
|
to retrieve VMware disk contents.
|
||||||
- Integration tests under `tests/integration/` are a good starting point for
|
- Integration tests under `tests/integration/` are a good starting point for
|
||||||
interacting with the VMware NBD / NFC APIs. They take a session-scoped
|
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
|
settings in `tests.integration.base.LabEnv`). The fixture creates a
|
||||||
temporary empty VM for the pytest session. We can make use of
|
temporary empty VM for the pytest session. We can make use of
|
||||||
them to reverse engineer the VMware protocol, for example making various
|
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
|
fixture creates one temporary empty VM with a 10 GiB disk for the whole
|
||||||
run and destroys it at session end. Run them with
|
run and destroys it at session end. Run them with
|
||||||
`tox -e integration` or
|
`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
|
## Other rules
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ VDDK-shaped handle.
|
|||||||
| `openvixdisklib/nfc_auth.py` | VIM login, NFC ticket, authd on 902 |
|
| `openvixdisklib/nfc_auth.py` | VIM login, NFC ticket, authd on 902 |
|
||||||
| `openvixdisklib/nfc_open.py` | Classic NFC handshake, AIO open, sector read/write |
|
| `openvixdisklib/nfc_open.py` | Classic NFC handshake, AIO open, sector read/write |
|
||||||
| `tests/integration/` | Live pytest suite against a lab vCenter |
|
| `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 |
|
| `tests/integration/vixdisklib.py` | Native VDDK wrapper used only to cross-check |
|
||||||
| `docs/` | Protocol notes and reverse-engineering steps |
|
| `docs/` | Protocol notes and reverse-engineering steps |
|
||||||
|
|
||||||
@@ -95,6 +96,13 @@ tox -e integration
|
|||||||
.venv/bin/pytest tests/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 cross-check tests skip when `libvixDiskLib` is not loadable from
|
||||||
`.vddk`. `tox -e integration` sets `LD_LIBRARY_PATH` to that directory
|
`.vddk`. `tox -e integration` sets `LD_LIBRARY_PATH` to that directory
|
||||||
and clears `LD_PRELOAD`. For a direct pytest run, do the same.
|
and clears `LD_PRELOAD`. For a direct pytest run, do the same.
|
||||||
|
|||||||
@@ -51,6 +51,15 @@ commands =
|
|||||||
pycobertura show --format html --source openvixdisklib \
|
pycobertura show --format html --source openvixdisklib \
|
||||||
coverage.xml -o coverage.html
|
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]
|
[testenv:fmt]
|
||||||
description = Format the code based on the coding style standards.
|
description = Format the code based on the coding style standards.
|
||||||
deps =
|
deps =
|
||||||
|
|||||||
Reference in New Issue
Block a user