petri/
lib.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4//! A Rust-based testing framework for VMMs.
5//!
6//! At this time - `petri` supports testing OpenVMM, OpenHCL,
7//! and Hyper-V based VMs.
8
9#![forbid(unsafe_code)]
10
11pub mod disk_image;
12mod linux_direct_serial_agent;
13mod openhcl_diag;
14mod test;
15mod tracing;
16mod vm;
17mod worker;
18
19pub use petri_artifacts_core::ArtifactHandle;
20pub use petri_artifacts_core::ArtifactResolver;
21pub use petri_artifacts_core::AsArtifactHandle;
22pub use petri_artifacts_core::ErasedArtifactHandle;
23pub use petri_artifacts_core::ResolveTestArtifact;
24pub use petri_artifacts_core::ResolvedArtifact;
25pub use petri_artifacts_core::ResolvedOptionalArtifact;
26pub use petri_artifacts_core::TestArtifactRequirements;
27pub use petri_artifacts_core::TestArtifacts;
28pub use pipette_client as pipette;
29pub use test::PetriTestParams;
30pub use test::RunTest;
31pub use test::SimpleTest;
32pub use test::TestCase;
33pub use test::test_macro_support;
34pub use test::test_main;
35pub use tracing::*;
36pub use vm::*;
37
38/// 1 kibibyte's worth of bytes.
39pub const SIZE_1_KB: u64 = 1024;
40/// 1 mebibyte's worth of bytes.
41pub const SIZE_1_MB: u64 = 1024 * SIZE_1_KB;
42/// 1 gibibyte's worth of bytes.
43pub const SIZE_1_GB: u64 = 1024 * SIZE_1_MB;
44
45/// The kind of shutdown to perform.
46#[expect(missing_docs)] // Self-describing names.
47pub enum ShutdownKind {
48    Shutdown,
49    Reboot,
50    // TODO: Add hibernate?
51}