diff --git a/test_infra/src/lib.rs b/test_infra/src/lib.rs index bfdccf0c6..d6e21cd5c 100644 --- a/test_infra/src/lib.rs +++ b/test_infra/src/lib.rs @@ -2493,6 +2493,18 @@ pub enum GuestVmType { Confidential, } +impl FromStr for GuestVmType { + type Err = (); + + fn from_str(s: &str) -> Result { + match s { + "regular" => Ok(GuestVmType::Regular), + "confidential" => Ok(GuestVmType::Confidential), + _ => Err(()), + } + } +} + // Get the direct igvm boot file path based on the console type fn direct_igvm_boot_path(console: Option<&str>) -> Option { // get the default hvc0 igvm file if console string is not passed