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§
- Artifact
Handle - A type-safe handle to a particular Artifact, as declared using the
declare_artifacts!
macro. - Artifact
Resolver - An artifact resolver, used both to express requirements for artifacts and to resolve them to paths.
- Boot
Image Config - Configuration information for the boot drive of the VM.
- Erased
Artifact Handle - A type-erased handle to a particular Artifact, with no information as to what exactly the artifact is.
- Memory
Config - Common memory configuration information for the VM.
- NoPetri
VmFramebuffer Access - Use this for the associated type if not supported
- NoPetri
VmInspector - Use this for the associated type if not supported
- Open
HclConfig - OpenHCL configuration
- Open
HclServicing Flags - Flags controlling servicing behavior.
- Petri
LogFile - A log file for writing test output.
- Petri
LogSource - A source of
PetriLogFile
log files for test output. - Petri
Test Params - Parameters passed to a
RunTest
when it is run. - PetriVm
- A constructed Petri VM
- Petri
VmArtifacts - The set of artifacts and resources needed to instantiate a
PetriVmBuilder
. - Petri
VmBuilder - Petri VM builder
- Petri
VmConfig - Petri VM configuration
- Petri
VmResources - Resources used by a Petri VM during contruction and runtime
- Petri
Vmgs Disk - Petri VMGS disk
- Processor
Topology - Common processor topology information for the VM.
- Resolved
Artifact - A resolved artifact path for artifact
A
. - Resolved
Optional Artifact - A resolve artifact path for an optional artifact
A
. - Simple
Test - A test defined by an artifact resolver function and a run function.
- Test
Artifact Requirements - A set of dependencies required to run a test.
- Test
Artifacts - A resolved set of test artifacts, returned by
TestArtifactRequirements::resolve
. - Test
Case - A single test case.
- Uefi
Config - UEFI firmware configuration
- VmScreenshot
Meta - 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§
- Apic
Mode - The APIC mode for the VM.
- Boot
Device Type - The boot device type.
- Command
Error - Error running command
- Firmware
- Firmware to load into the test VM.
- Isolation
Type - Isolation type
- Open
HclLog Config - Control the logging configuration of OpenHCL for this VM.
- Pcat
Guest - The guest the VM will boot into. A boot drive with the chosen setup will be automatically configured.
- Petri
Disk Type - Petri disk type
- Petri
Guest State Lifetime - Petri VM guest state lifetime
- Petri
Halt Reason - The reason that the VM halted
- Petri
Vmgs Resource - Petri VM guest state resource
- Secure
Boot Template - UEFI secure boot template
- Shutdown
Kind - The kind of shutdown to perform.
- Uefi
Guest - 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§
- AsArtifact
Handle - Helper trait to allow uniform handling of both typed and untyped artifact handles in various contexts.
- Petri
VmFramebuffer Access - Interface for getting screenshots of the VM
- Petri
VmInspector - Interface for getting information about the state of the VM
- Petri
VmRuntime - A running VM that tests can interact with.
- Petri
VmmBackend - Trait for VMM-specific contruction and runtime resources
- Resolve
Test Artifact - 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
intolog_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.