• Python 98.6%
  • Shell 1.2%
  • Just 0.2%
Find a file
2025-09-30 16:57:23 +02:00
.cockpit-ci .cockpit-ci: add a test script for Cockpit CI 2025-09-28 15:06:47 +02:00
.forgejo/workflows .forgejo/workflows: add a test package build to CI 2025-09-03 13:42:34 +02:00
doc doc: start a Virtual Machine API specification 2025-09-30 16:32:08 +02:00
test testthing: add a missing f-string marker 2025-09-28 15:11:47 +02:00
workarounds workarounds: update 2025-09-30 15:53:53 +02:00
.gitignore .gitignore: ignore the arch image 2025-09-28 15:06:51 +02:00
COPYING Initial commit 2025-06-23 10:32:45 +02:00
justfile justfile: add a justfile with static checks 2025-07-16 15:10:00 -04:00
pyproject.toml .cockpit-ci: add a test script for Cockpit CI 2025-09-28 15:06:47 +02:00
README.md README.md: minor fix 2025-09-30 16:57:10 +02:00
testthing.py testthing: prepare release 0.4.0 2025-09-30 16:57:23 +02:00

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

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.