A Rust-based lifecycle testing tool for Kata Containers.
The project provides a small end-to-end test harness for creating Kata containers, triggering lifecycle operations, and checking whether related resources are cleaned up correctly.
The first version focuses on the following workflow:
Create a Kata container
→ Trigger a lifecycle operation
→ Remove the containerd task and container
→ Check QEMU and Kata-related processes
→ Produce a structured test result
The initial target environment is:
- Fedora
- containerd
- runtime-rs
- QEMU
- KVM
- busybox
The project is under active development.
Currently implemented:
ctrcommand execution with timeoutsctr versionctr images pullctr runwith the Kata runtimectr tasks listctr tasks killctr tasks rmctr containers rmsigkilllifecycle scenario/procprocess snapshots- QEMU, Kata shim, and virtiofsd detection
- Process baseline comparison
- Process cleanup waiting with a timeout
- Structured leaked-process information
- JSON scenario reports
- Basic CLI commands
Show the available commands:
cargo run -- --helpRun the smoke check:
cargo run -- smokeRun the SIGKILL lifecycle scenario:
cargo run -- run sigkillThe SIGKILL scenario performs the following operations:
ctr run --detach
→ ctr tasks kill --signal SIGKILL
→ ctr tasks rm
→ ctr containers rm
→ Check newly created QEMU, Kata shim, and virtiofsd processes
The real lifecycle scenarios require:
- Rust and Cargo
ctr- containerd
- Kata Containers
- QEMU
- KVM
- A locally available busybox image
- Permission to inspect
/proc
The tests that use fake command runners and temporary procfs fixtures do not require a running containerd or Kata environment.
Run the complete test suite:
cargo testRun a specific test:
cargo test <test_name>Run the formatter:
cargo fmtRun Clippy:
cargo clippy --all-targets --all-features -- -D warningsThe project is organized around a few small interfaces:
CommandRunner
Executes external commands and captures their results
CtrClient
Provides typed operations for ctr commands
Scenario
Describes a container lifecycle workflow
ProcessCollector
Reads process information from procfs
ScenarioReport
Represents the result of a lifecycle test
The implementation uses test doubles for command execution so that lifecycle logic can be tested without requiring a real Kata installation.
The project follows a test-first development workflow:
RED → GREEN → REFACTOR
Each feature is implemented as a vertical slice:
- Add one behavior-focused test.
- Implement the smallest change that makes it pass.
- Refactor only after the test is green.
- Run the complete test suite.
Planned improvements include:
normal-exitscenariosigtermscenariofailed-startscenario- Better cleanup diagnostics
- JUnit XML reports
- Unique run IDs and artifact directories
- Serial stress testing
- Parallel stress testing
- cgroup checks
- mount checks
- network checks
/dev/shmchecks- CI integration
- Reproducible Kata issue reports
The first version does not target:
- Kubernetes
- Dragonball
- Firecracker
- GPU workloads
- Direct containerd API integration
- A complete resource accounting model
License information will be added before the first public release.