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.
openhcl_diag
openvmm
OpenVMM VM management Code managing the lifetime of a PetriVmOpenVmm. All VMs live the same lifecycle:
requirements
Test requirements framework for runtime test filtering.
vtl2_settings
Convenience methods for tests to generate and modify the VTL2 settings of a VM under test.

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.
MemoryConfig
Common memory configuration information for the VM.
NoPetriVmFramebufferAccess
Use this for the associated type if not supported
NoPetriVmInspector
Use this for the associated type if not supported
OpenHclConfig
OpenHCL configuration
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.
PetriVm
A constructed Petri VM
PetriVmArtifacts
The set of artifacts and resources needed to instantiate a PetriVmBuilder.
PetriVmBuilder
Petri VM builder
PetriVmConfig
Petri VM configuration
PetriVmResources
Resources used by a Petri VM during contruction and runtime
PetriVmgsDisk
Petri VMGS disk
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.
UefiConfig
UEFI firmware configuration
VmScreenshotMeta
Raw VM screenshot
VmmQuirks
Quirks to workaround certain bugs that only manifest when using a particular VMM, and do not depend on which guest is running.

Enums§

ApicMode
The APIC mode for the VM.
BootDeviceType
The boot device type.
CommandError
Error running command
Firmware
Firmware to load into the test VM.
IsolationType
Isolation type
OpenHclLogConfig
Control the logging configuration of OpenHCL for this VM.
PcatGuest
The guest the VM will boot into. A boot drive with the chosen setup will be automatically configured.
PetriDiskType
Petri disk type
PetriGuestStateLifetime
Petri VM guest state lifetime
PetriHaltReason
The reason that the VM halted
PetriVmgsResource
Petri VM guest state resource
SecureBootTemplate
UEFI secure boot template
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.
PetriVmFramebufferAccess
Interface for getting screenshots of the VM
PetriVmInspector
Interface for getting information about the state of the VM
PetriVmRuntime
A running VM that tests can interact with.
PetriVmmBackend
Trait for VMM-specific contruction and runtime resources
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_task
Logs lines from reader into log_file.
run_host_cmd
Run a command on the host and return the output
test_main
Entry point for test binaries.
try_init_tracing
Initialize Petri tracing with the given output path for log files.