nix-rust / nix

Rust friendly bindings to *nix APIs
MIT License
2.63k stars 661 forks source link

test: skip test_utun_ifname if unprivileged #2371

Closed SteveLauC closed 5 months ago

SteveLauC commented 5 months ago

What does this PR do

From this post, the utun interface requires privilege, and this is exactly what happens on my mac:

$ cargo t --all-features test_utun_ifname -q

running 1 test
F
failures:

---- sys::test_sockopt::test_utun_ifname stdout ----
thread 'sys::test_sockopt::test_utun_ifname' panicked at test/sys/test_sockopt.rs:854:36:
called `Result::unwrap()` on an `Err` value: EPERM

This PR skips the test if the process is not privileged.

Checklist: