diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-01-01 17:15:29 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-09 03:32:52 +0000 |
| commit | 1165c61f5ab8ada644c7def03e991890c4d380ca (patch) | |
| tree | 1cd1c1d58039afad5a1d24b5c10d8030237e2d7c /tests/pytest.ini | |
| parent | c32e1081c81ba27f0d5a21a1885601f04d329d21 (diff) | |
| download | meta-virtualization-1165c61f5ab8ada644c7def03e991890c4d380ca.tar.gz | |
tests: add pytest framework for vdkr and vpdmn
Add pytest-based test suite for testing vdkr and vpdmn CLI tools.
Tests use a separate state directory (~/.vdkr-test/) to avoid
interfering with production images.
Test files:
- conftest.py: Pytest fixtures for VdkrRunner and VpdmnRunner
- test_vdkr.py: Docker CLI tests (images, vimport, vrun, volumes, etc.)
- test_vpdmn.py: Podman CLI tests (mirrors vdkr test coverage)
- memres-test.sh: Helper script for running tests with memres
- pytest.ini: Pytest configuration and markers
Test categories:
- Basic operations: images, info, version
- Import/export: vimport, load, save
- Container execution: vrun, run, exec
- Storage management: system df, vstorage
- Memory resident mode: memres/vmemres start/stop/status
Running tests:
pytest tests/test_vdkr.py -v --vdkr-dir /tmp/vcontainer-standalone
pytest tests/test_vpdmn.py -v --vdkr-dir /tmp/vcontainer-standalone
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'tests/pytest.ini')
| -rw-r--r-- | tests/pytest.ini | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/pytest.ini b/tests/pytest.ini new file mode 100644 index 00000000..b0a51f7e --- /dev/null +++ b/tests/pytest.ini | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | [pytest] | ||
| 2 | testpaths = . | ||
| 3 | python_files = test_*.py | ||
| 4 | python_classes = Test* | ||
| 5 | python_functions = test_* | ||
| 6 | |||
| 7 | # Markers | ||
| 8 | markers = | ||
| 9 | slow: marks tests as slow (deselect with '-m "not slow"') | ||
| 10 | memres: marks tests that require memory resident mode | ||
| 11 | network: marks tests that require network access | ||
| 12 | boot: marks tests that boot a full QEMU image (requires pexpect) | ||
| 13 | |||
| 14 | # Default options - include junit xml for CI and detailed output | ||
| 15 | addopts = -v --tb=short --junitxml=/tmp/pytest-results.xml | ||
| 16 | |||
| 17 | # Log file for test output (always written, survives test runs) | ||
| 18 | log_file = /tmp/pytest-vcontainer.log | ||
| 19 | log_file_level = DEBUG | ||
| 20 | log_file_format = %(asctime)s %(levelname)s %(message)s | ||
| 21 | log_file_date_format = %Y-%m-%d %H:%M:%S | ||
| 22 | |||
| 23 | # Also show logs on console during test run | ||
| 24 | log_cli = false | ||
| 25 | log_cli_level = INFO | ||
| 26 | |||
| 27 | # Ignore warnings from subprocess | ||
| 28 | filterwarnings = | ||
| 29 | ignore::DeprecationWarning | ||
