File tree Expand file tree Collapse file tree 1 file changed +30
-2
lines changed
src/hyperlight_host/src/sandbox Expand file tree Collapse file tree 1 file changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -364,7 +364,28 @@ mod tests {
364
364
None ,
365
365
) ;
366
366
367
- // in process should only be enabled with the inprocess feature and on debug builds, and requires windows
367
+ // debug mode should fail with an elf executable
368
+ assert ! ( sbox. is_err( ) ) ;
369
+
370
+ let simple_guest_path = simple_guest_exe_as_string ( ) . unwrap ( ) ;
371
+ let sbox = UninitializedSandbox :: new (
372
+ GuestBinary :: FilePath ( simple_guest_path. clone ( ) ) ,
373
+ None ,
374
+ Some ( SandboxRunOptions :: RunInProcess ( false ) ) ,
375
+ None ,
376
+ ) ;
377
+
378
+ // in process should only be enabled with the inprocess feature and on debug builds
379
+ assert_eq ! ( sbox. is_ok( ) , cfg!( all( inprocess) ) ) ;
380
+
381
+ let sbox = UninitializedSandbox :: new (
382
+ GuestBinary :: FilePath ( simple_guest_path. clone ( ) ) ,
383
+ None ,
384
+ Some ( SandboxRunOptions :: RunInProcess ( true ) ) ,
385
+ None ,
386
+ ) ;
387
+
388
+ // debug mode should succeed with a PE executable on windows with inprocess enabled
368
389
assert_eq ! ( sbox. is_ok( ) , cfg!( all( inprocess, target_os = "windows" ) ) ) ;
369
390
}
370
391
@@ -592,7 +613,14 @@ mod tests {
592
613
}
593
614
#[ cfg( target_os = "windows" ) ]
594
615
{
595
- let _ = mgr_res. unwrap ( ) ;
616
+ #[ cfg( inprocess) ]
617
+ {
618
+ assert ! ( mgr_res. is_ok( ) )
619
+ }
620
+ #[ cfg( not( inprocess) ) ]
621
+ {
622
+ assert ! ( mgr_res. is_err( ) )
623
+ }
596
624
}
597
625
}
598
626
You can’t perform that action at this time.
0 commit comments