Skip to content

Commit

Permalink
Relax some procctl tests on FreeBSD too.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Jul 2, 2023
1 parent ef97178 commit 917f4e4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/process/procctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ fn test_trace_status() {

#[test]
fn test_reaper_status() {
assert_eq!(set_reaper_status(false), Err(io::Errno::INVAL));
match set_reaper_status(false).unwrap_err() {
io::Errno::INVAL => (),
io::Errno::PERM => return, // FreeBSD 12 doesn't support this
err => Err(err).unwrap(),
};
set_reaper_status(true).unwrap();
let status_while_acq = dbg!(get_reaper_status(None).unwrap());
set_reaper_status(false).unwrap();
Expand All @@ -38,7 +42,11 @@ fn test_trapcap() {

#[test]
fn test_no_new_privs() {
assert!(!no_new_privs(None).unwrap());
match no_new_privs(None) {
Ok(flag) => assert!(!flag),
Err(io::Errno::INVAL) => return, // FreeBSD 12 doesn't support this
Err(err) => Err(err).unwrap(),
};
set_no_new_privs(None).unwrap();
assert!(no_new_privs(None).unwrap());
// No going back but, well, we're not gonna execute SUID binaries from the
Expand Down

0 comments on commit 917f4e4

Please sign in to comment.