Skip to content

Commit c77c321

Browse files
committed
Update test
Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent 44143b2 commit c77c321

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/hyperlight_host/src/sandbox/uninitialized.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -925,11 +925,7 @@ mod tests {
925925
event_values.get("metadata").unwrap().as_object().unwrap();
926926
let event_values_map = event_values.as_object().unwrap();
927927

928-
#[cfg(target_os = "windows")]
929-
let expected_error =
930-
"IOError(Os { code: 2, kind: NotFound, message: \"The system cannot find the file specified.\" }";
931-
#[cfg(not(target_os = "windows"))]
932-
let expected_error = "IOError(Os { code: 2, kind: NotFound, message: \"No such file or directory\" }";
928+
let expected_error_start = "Error(\"GuestBinary not found:";
933929

934930
let err_vals_res = try_to_strings([
935931
(metadata_values_map, "level"),
@@ -939,7 +935,7 @@ mod tests {
939935
]);
940936
if let Ok(err_vals) = err_vals_res {
941937
if err_vals[0] == "ERROR"
942-
&& err_vals[1].starts_with(expected_error)
938+
&& err_vals[1].starts_with(expected_error_start)
943939
&& err_vals[2] == "hyperlight_host::sandbox::uninitialized"
944940
&& err_vals[3] == "hyperlight_host::sandbox::uninitialized"
945941
{
@@ -1017,7 +1013,9 @@ mod tests {
10171013

10181014
let logcall = TEST_LOGGER.get_log_call(16).unwrap();
10191015
assert_eq!(Level::Error, logcall.level);
1020-
assert!(logcall.args.starts_with("error=IOError(Os { code"));
1016+
assert!(logcall
1017+
.args
1018+
.starts_with("error=Error(\"GuestBinary not found:"));
10211019
assert_eq!("hyperlight_host::sandbox::uninitialized", logcall.target);
10221020

10231021
// Log record 18
@@ -1069,7 +1067,9 @@ mod tests {
10691067

10701068
let logcall = TEST_LOGGER.get_log_call(1).unwrap();
10711069
assert_eq!(Level::Error, logcall.level);
1072-
assert!(logcall.args.starts_with("error=IOError"));
1070+
assert!(logcall
1071+
.args
1072+
.starts_with("error=Error(\"GuestBinary not found:"));
10731073
assert_eq!("hyperlight_host::sandbox::uninitialized", logcall.target);
10741074
}
10751075
{

0 commit comments

Comments
 (0)