@@ -661,11 +661,7 @@ mod tests {
661
661
if let Ok ( mut ctx) = context_info_result {
662
662
// Temporarily override config to point to a non-existent path
663
663
let original_path =
664
- std:: env:: var ( "KEYLIME_CONFIG_PATH" ) . unwrap_or_default ( ) ;
665
- std:: env:: set_var (
666
- "KEYLIME_CONFIG_PATH" ,
667
- "test-data/non-existent-config.conf" ,
668
- ) ;
664
+ std:: env:: var ( "KEYLIME_AGENT_CONFIG" ) . unwrap_or_default ( ) ;
669
665
670
666
// Create a temporary config file with an invalid path for measuredboot_ml_path
671
667
let temp_dir = tempfile:: tempdir ( ) . unwrap ( ) ;
@@ -675,16 +671,20 @@ mod tests {
675
671
writeln ! ( file, "[agent]" ) . unwrap ( ) ;
676
672
writeln ! (
677
673
file,
678
- "measuredboot_ml_path = /path/to/non/existent/log"
674
+ "measuredboot_ml_path = \" /path/to/non/existent/log\" "
679
675
)
680
676
. unwrap ( ) ;
681
- std:: env:: set_var ( "KEYLIME_CONFIG_PATH " , config_path) ;
677
+ std:: env:: set_var ( "KEYLIME_AGENT_CONFIG " , config_path) ;
682
678
683
679
let filler = FillerFromHardware :: new ( & mut ctx) ;
684
680
assert ! ( filler. uefi_log_handler. is_none( ) ) ;
685
681
686
682
// Restore original config path
687
- std:: env:: set_var ( "KEYLIME_CONFIG_PATH" , original_path) ;
683
+ if original_path. is_empty ( ) {
684
+ std:: env:: remove_var ( "KEYLIME_AGENT_CONFIG" ) ;
685
+ } else {
686
+ std:: env:: set_var ( "KEYLIME_AGENT_CONFIG" , original_path) ;
687
+ }
688
688
assert ! ( ctx. flush_context( ) . is_ok( ) ) ;
689
689
}
690
690
}
0 commit comments