Crate petri

Source
Expand description

A Rust-based testing framework for VMMs.

At this time - petri supports testing OpenVMM, OpenHCL, and Hyper-V based VMs.

Re-exports§

pub use pipette_client as pipette;

Modules§

boot_image_type
Type-tags for BootImageConfig
disk_image
Tools for building a disk image for a VM.
openvmm
OpenVMM VM management Code managing the lifetime of a PetriVmOpenVmm. All VMs live the same lifecycle:

Macros§

log
Write a formatted log entry to the given PetriLogFile.
multitest
Defines a set of tests from a TestCase.
test
Defines a single test from a value that implements RunTest.

Structs§

ArtifactHandle
A type-safe handle to a particular Artifact, as declared using the declare_artifacts! macro.
ArtifactResolver
An artifact resolver, used both to express requirements for artifacts and to resolve them to paths.
BootImageConfig
Configuration information for the boot drive of the VM.
ErasedArtifactHandle
A type-erased handle to a particular Artifact, with no information as to what exactly the artifact is.
OpenHclServicingFlags
Flags controlling servicing behavior.
PetriLogFile
A log file for writing test output.
PetriLogSource
A source of PetriLogFile log files for test output.
PetriTestParams
Parameters passed to a RunTest when it is run.
ProcessorTopology
Common processor topology information for the VM.
ResolvedArtifact
A resolved artifact path for artifact A.
ResolvedOptionalArtifact
A resolve artifact path for an optional artifact A.
SimpleTest
A test defined by an artifact resolver function and a run function.
TestArtifactRequirements
A set of dependencies required to run a test.
TestArtifacts
A resolved set of test artifacts, returned by TestArtifactRequirements::resolve.
TestCase
A single test case.

Enums§

ApicMode
The APIC mode for the VM.
Firmware
Firmware to load into the test VM.
IsolationType
Isolation type
PcatGuest
The guest the VM will boot into. A boot drive with the chosen setup will be automatically configured.
PetriVmgsResource
Virtual machine guest state resource
ShutdownKind
The kind of shutdown to perform.
UefiGuest
The guest the VM will boot into. A boot drive with the chosen setup will be automatically configured.

Constants§

SIZE_1_GB
1 gibibyte’s worth of bytes.
SIZE_1_KB
1 kibibyte’s worth of bytes.
SIZE_1_MB
1 mebibyte’s worth of bytes.

Traits§

AsArtifactHandle
Helper trait to allow uniform handling of both typed and untyped artifact handles in various contexts.
PetriVm
A running VM that tests can interact with.
PetriVmConfig
Configuration state for a test VM.
ResolveTestArtifact
A trait to resolve artifacts to paths.
RunTest
A test that can be run.

Functions§

kmsg_log_task
read from the kmsg stream and write entries to the log
log_stream
Logs lines from reader into log_file.
test_main
Entry point for test binaries.
try_init_tracing
Initialize Petri tracing with the given output path for log files.