mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-20 08:18:24 +00:00
Merge pull request #8258 from jodh-intel/protection-fix-tdx-typo
libs: protection: Fix typo in TDX output
This commit is contained in:
@@ -42,7 +42,7 @@ impl fmt::Display for GuestProtection {
|
|||||||
match self {
|
match self {
|
||||||
GuestProtection::Tdx(details) => write!(
|
GuestProtection::Tdx(details) => write!(
|
||||||
f,
|
f,
|
||||||
"tdx (major_version: {}, minor_version: {}",
|
"tdx (major_version: {}, minor_version: {})",
|
||||||
details.major_version, details.minor_version
|
details.major_version, details.minor_version
|
||||||
),
|
),
|
||||||
GuestProtection::Sev => write!(f, "sev"),
|
GuestProtection::Sev => write!(f, "sev"),
|
||||||
@@ -363,12 +363,15 @@ mod tests {
|
|||||||
|
|
||||||
let result = result.unwrap();
|
let result = result.unwrap();
|
||||||
|
|
||||||
let details = match result {
|
let details = match &result {
|
||||||
GuestProtection::Tdx(details) => details,
|
GuestProtection::Tdx(details) => details,
|
||||||
_ => panic!(),
|
_ => panic!(),
|
||||||
};
|
};
|
||||||
|
|
||||||
assert_eq!(details.major_version, 1);
|
assert_eq!(details.major_version, 1);
|
||||||
assert_eq!(details.minor_version, 0);
|
assert_eq!(details.minor_version, 0);
|
||||||
|
|
||||||
|
let displayed_value = result.to_string();
|
||||||
|
assert_eq!(displayed_value, "tdx (major_version: 1, minor_version: 0)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user