Skip to content

Commit

Permalink
Require namespace tests to succeed (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
cd-work authored Sep 26, 2023
1 parent b940485 commit b3afcf8
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tests/net_without_seccomp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,10 @@ fn main() {
seccompiler::apply_filter(&program).unwrap();

let birdcage = Birdcage::new().unwrap();
let result = birdcage.lock();
birdcage.lock().unwrap();

match result {
// Namespaces are supported, so networking should still be blocked.
Ok(_) => {
let result = TcpStream::connect("8.8.8.8:443");
assert!(result.is_err());
},
// Namespaces aren't supported, so failure is desired.
Err(_) => (),
}
let result = TcpStream::connect("8.8.8.8:443");
assert!(result.is_err());
}

#[cfg(not(target_os = "linux"))]
Expand Down

0 comments on commit b3afcf8

Please sign in to comment.