From e543733a4cce1dab91155e7bea9510ca9895ecfd Mon Sep 17 00:00:00 2001 From: Ryan Zoeller Date: Sun, 24 Apr 2022 19:04:23 -0500 Subject: Upgrade sysctl to 0.4 Upgrade sysctl dev-dependency to 0.4 and handle its breaking API changes. --- test/common/mod.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'test/common/mod.rs') diff --git a/test/common/mod.rs b/test/common/mod.rs index 544a1ae3..caa39ab4 100644 --- a/test/common/mod.rs +++ b/test/common/mod.rs @@ -35,10 +35,11 @@ cfg_if! { #[cfg(target_os = "freebsd")] #[macro_export] macro_rules! require_mount { ($name:expr) => { - use ::sysctl::CtlValue; + use ::sysctl::{CtlValue, Sysctl}; use nix::unistd::Uid; - if !Uid::current().is_root() && CtlValue::Int(0) == ::sysctl::value("vfs.usermount").unwrap() + let ctl = ::sysctl::Ctl::new("vfs.usermount").unwrap(); + if !Uid::current().is_root() && CtlValue::Int(0) == ctl.value().unwrap() { skip!("{} requires the ability to mount file systems. Skipping test.", $name); } @@ -57,10 +58,10 @@ cfg_if! { #[cfg(target_os = "freebsd")] #[macro_export] macro_rules! skip_if_jailed { ($name:expr) => { - use ::sysctl::CtlValue; + use ::sysctl::{CtlValue, Sysctl}; - if let CtlValue::Int(1) = ::sysctl::value("security.jail.jailed") - .unwrap() + let ctl = ::sysctl::Ctl::new("security.jail.jailed").unwrap(); + if let CtlValue::Int(1) = ctl.value().unwrap() { skip!("{} cannot run in a jail. Skipping test.", $name); } -- cgit v1.2.3