@@ -612,21 +612,23 @@ mod tests {
612612
613613 let mut sbox: MultiUseSandbox = usbox. evolve ( ) ?;
614614
615- let res: Result < u64 > = sbox. call ( "ViolateSeccompFilters" , ( ) ) ;
616-
617- #[ cfg( feature = "seccomp" ) ]
618- match res {
619- Ok ( _) => panic ! ( "Expected to fail due to seccomp violation" ) ,
620- Err ( e) => match e {
621- HyperlightError :: DisallowedSyscall => { }
622- _ => panic ! ( "Expected DisallowedSyscall error: {}" , e) ,
623- } ,
624- }
615+ for _ in 0 ..10 {
616+ let res: Result < u64 > = sbox. call ( "ViolateSeccompFilters" , ( ) ) ;
617+
618+ #[ cfg( feature = "seccomp" ) ]
619+ match res {
620+ Ok ( _) => panic ! ( "Expected to fail due to seccomp violation" ) ,
621+ Err ( e) => match e {
622+ HyperlightError :: DisallowedSyscall => { }
623+ _ => panic ! ( "Expected DisallowedSyscall error: {}" , e) ,
624+ } ,
625+ }
625626
626- #[ cfg( not( feature = "seccomp" ) ) ]
627- match res {
628- Ok ( _) => ( ) ,
629- Err ( e) => panic ! ( "Expected to succeed without seccomp: {}" , e) ,
627+ #[ cfg( not( feature = "seccomp" ) ) ]
628+ match res {
629+ Ok ( _) => ( ) ,
630+ Err ( e) => panic ! ( "Expected to succeed without seccomp: {}" , e) ,
631+ }
630632 }
631633 }
632634
@@ -648,11 +650,13 @@ mod tests {
648650
649651 let mut sbox: MultiUseSandbox = usbox. evolve ( ) ?;
650652
651- let res: Result < u64 > = sbox. call ( "ViolateSeccompFilters" , ( ) ) ;
653+ for _ in 0 ..10 {
654+ let res: Result < u64 > = sbox. call ( "ViolateSeccompFilters" , ( ) ) ;
652655
653- match res {
654- Ok ( _) => { }
655- Err ( e) => panic ! ( "Expected to succeed due to seccomp violation: {}" , e) ,
656+ match res {
657+ Ok ( _) => { }
658+ Err ( e) => panic ! ( "Expected to succeed due to seccomp violation: {}" , e) ,
659+ }
656660 }
657661 }
658662
0 commit comments