A simple modern VM runner
Project description
test.thing
A simple, modern VM runner.
Goals.
- one-file copypastelib
- easy to hook up to pytest
- future-oriented, built on systemd features in the guest (credentials, ssh-over-vsock, etc)
- might limit usefulness for testing older OSes but we can add workarounds as required
- works without networking configured in guest
- supporting the existing features of cockpit-bots
Host requirements
- Python 3.12, standard library
- qemu
- ssh
- systemd-ssh-proxy (available since systemd v256, polyfill available)
- vhost-device-vsock
Guest requirements
The guest should meet the requirements of the Virtual Machine Image API Specification.
There are polyfills for many of the require functionalities in workarounds/.
Try it
The easiest way to get test.thing is from PyPI:
test.thing.
If you want to depend on the package, please pin the version number exactly. It's early days and there is no guarantees about API (or even CLI) compatibility, even between micro releases. You can also simply copy testthing.py into your project.
For cli use, the easiest thing is to pip install test.thing which will put an
executable called tt in your path. This is sort of like the existing
cockpit-bots vm-run. If you want to test Cockpit images, you can do
something like:
tt \
-v \
-L 9091:127.0.0.1:9090 \
-s cockpit.socket \
bots/images/arch
An ssh control socket is created for sending commands and can also be used externally, avoiding the need to authenticate. A suggested ssh config:
Host tt.*
ControlPath ${XDG_RUNTIME_DIR}/test.thing/%h/ssh
And then you can say ssh tt.0 or scp file tt.0:/tmp.
You can also take a look at test/test_example.py and
run TEST_IMAGE=/path/to/image.qcow2 pytest. This was originally tested with
the examples images from
composefs-rs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file test_thing-0.4.0.tar.gz.
File metadata
- Download URL: test_thing-0.4.0.tar.gz
- Upload date:
- Size: 31.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37831a135ed47c0b2315ee8eef219c3333b9e980a80acf5d925dea16b199bfad
|
|
| MD5 |
bcaebcf38194355d3daf4e0bd69ecadd
|
|
| BLAKE2b-256 |
121bc4a4ad1f2ed16235738743e1f220897788e298138d4302f2d900de5b0aa1
|
File details
Details for the file test_thing-0.4.0-py3-none-any.whl.
File metadata
- Download URL: test_thing-0.4.0-py3-none-any.whl
- Upload date:
- Size: 31.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df6ec9e11d8e37622e548def2e28e9cb114d2c0cd735a93ebcac16ba479c6f86
|
|
| MD5 |
cfcfbdc29dcd05a2f9528b6d84f24feb
|
|
| BLAKE2b-256 |
4ad926df77f33ab03d7e5a22b3271d5346e93e165aa2648b66fbb4eeba6cad30
|