microsoft/openvmm
Publicmirrored from https://github.com/microsoft/openvmmAvailable
petri/src/lib.rs
42lines · modecode
| 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` only supports testing OpenVMM and OpenHCL based VMs. |
| 7 | //! In the future, we expect `petri` to also support other VMM backends |
| 8 | //! (notably, Hyper-V). |
| 9 | |
| 10 | #![forbid(unsafe_code)] |
| 11 | #![warn(missing_docs)] |
| 12 | |
| 13 | mod disk_image; |
| 14 | mod linux_direct_serial_agent; |
| 15 | mod openhcl_diag; |
| 16 | mod tracing; |
| 17 | mod vm; |
| 18 | mod worker; |
| 19 | |
| 20 | pub use petri_artifacts_core::ArtifactHandle; |
| 21 | pub use petri_artifacts_core::AsArtifactHandle; |
| 22 | pub use petri_artifacts_core::ErasedArtifactHandle; |
| 23 | pub use petri_artifacts_core::TestArtifactResolver; |
| 24 | pub use petri_artifacts_core::TestArtifactResolverBackend; |
| 25 | pub use petri_artifacts_core::TestArtifacts; |
| 26 | pub use pipette_client as pipette; |
| 27 | pub use vm::*; |
| 28 | |
| 29 | /// 1 kibibyte's worth of bytes. |
| 30 | pub const SIZE_1_KB: u64 = 1024; |
| 31 | /// 1 mebibyte's worth of bytes. |
| 32 | pub const SIZE_1_MB: u64 = 1024 * SIZE_1_KB; |
| 33 | /// 1 gibibyte's worth of bytes. |
| 34 | pub const SIZE_1_GB: u64 = 1024 * SIZE_1_MB; |
| 35 | |
| 36 | /// The kind of shutdown to perform. |
| 37 | #[allow(missing_docs)] // Self-describing names. |
| 38 | pub enum ShutdownKind { |
| 39 | Shutdown, |
| 40 | Reboot, |
| 41 | // TODO: Add hibernate? |
| 42 | } |