Skip to content

Commit

Permalink
Fix query_variable_info test
Browse files Browse the repository at this point in the history
The behavior of OVMF changed recently so that calling
query_variable_info with just the `NON_VOLATILE` attribute is treated as
an error:
tianocore/edk2@21320ef

Fix by OR'ing it with `BOOTSERVICE_ACCESS`.

Also fix a typo in the output, and `unwrap` the result of calling
`query_variable_info` since these calls should always succeed.
  • Loading branch information
nicholasbishop authored and GabrielMajeri committed Jun 13, 2022
1 parent fd5382d commit 45093a1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions uefi-test-runner/src/runtime/vars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,18 @@ fn test_variables(rt: &RuntimeServices) {

fn test_variable_info(rt: &RuntimeServices) {
info!(
"Storage for non-volatile variabls: {:?}",
rt.query_variable_info(VariableAttributes::NON_VOLATILE),
"Storage for non-volatile boot-services variables: {:?}",
rt.query_variable_info(
VariableAttributes::BOOTSERVICE_ACCESS | VariableAttributes::NON_VOLATILE
)
.unwrap(),
);
info!(
"Storage for volatile runtime variables: {:?}",
rt.query_variable_info(
VariableAttributes::BOOTSERVICE_ACCESS | VariableAttributes::RUNTIME_ACCESS
),
)
.unwrap(),
);
}

Expand Down

0 comments on commit 45093a1

Please sign in to comment.