From 3e312b8e42d1712dd33263f59ed921e5e3d77c9d Mon Sep 17 00:00:00 2001 From: Steve Lau Date: Sat, 13 Apr 2024 20:22:21 +0800 Subject: [PATCH] test: skip test_utun_ifname if unpriviledged --- test/sys/test_sockopt.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/sys/test_sockopt.rs b/test/sys/test_sockopt.rs index 427edf24e0..4ec650ea30 100644 --- a/test/sys/test_sockopt.rs +++ b/test/sys/test_sockopt.rs @@ -832,6 +832,11 @@ fn test_ktls() { #[test] #[cfg(apple_targets)] fn test_utun_ifname() { + // Skip this is the current process is not priviledged + if !nix::unistd::Uid::effective().is_root() { + return; + } + use nix::sys::socket::connect; use nix::sys::socket::SysControlAddr;