diff options
Diffstat (limited to 'test/sys')
-rw-r--r-- | test/sys/test_sockopt.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/test/sys/test_sockopt.rs b/test/sys/test_sockopt.rs index 5dcdfc02..c4860c0d 100644 --- a/test/sys/test_sockopt.rs +++ b/test/sys/test_sockopt.rs @@ -4,17 +4,9 @@ use nix::sys::socket::{socket, sockopt, getsockopt, setsockopt, AddressFamily, S #[cfg(target_os = "linux")] #[test] fn is_so_mark_functional() { - use ::caps::{Capability, CapSet, has_cap}; - use ::std::io::{self, Write}; use nix::sys::socket::sockopt; - if !has_cap(None, CapSet::Effective, Capability::CAP_NET_ADMIN).unwrap() { - let stderr = io::stderr(); - let mut handle = stderr.lock(); - writeln!(handle, "SO_MARK requires CAP_NET_ADMIN. Skipping test.") - .unwrap(); - return; - } + require_capability!(CAP_NET_ADMIN); let s = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), None).unwrap(); setsockopt(s, sockopt::Mark, &1337).unwrap(); |