Skip to content

Commit

Permalink
Merge pull request kata-containers#8258 from jodh-intel/protection-fi…
Browse files Browse the repository at this point in the history
…x-tdx-typo

libs: protection: Fix typo in TDX output
  • Loading branch information
jodh-intel authored Oct 20, 2023
2 parents 468a3e4 + 9b14dda commit 79ed501
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/libs/kata-sys-util/src/protection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl fmt::Display for GuestProtection {
match self {
GuestProtection::Tdx(details) => write!(
f,
"tdx (major_version: {}, minor_version: {}",
"tdx (major_version: {}, minor_version: {})",
details.major_version, details.minor_version
),
GuestProtection::Sev => write!(f, "sev"),
Expand Down Expand Up @@ -363,12 +363,15 @@ mod tests {

let result = result.unwrap();

let details = match result {
let details = match &result {
GuestProtection::Tdx(details) => details,
_ => panic!(),
};

assert_eq!(details.major_version, 1);
assert_eq!(details.minor_version, 0);

let displayed_value = result.to_string();
assert_eq!(displayed_value, "tdx (major_version: 1, minor_version: 0)");
}
}

0 comments on commit 79ed501

Please sign in to comment.