From b5e0a527434fedfa8dba55ca6b41f3677a960a3a Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 22 May 2026 02:54:25 +0100 Subject: [PATCH] build: use "selinux" instead of "feat_selinux" feature name --- Cargo.toml | 1 + src/uu/cp/Cargo.toml | 2 +- src/uu/id/Cargo.toml | 2 +- src/uu/ls/Cargo.toml | 2 +- tests/by-util/test_chcon.rs | 5 +-- tests/by-util/test_cp.rs | 62 ++++++++--------------------------- tests/by-util/test_dd.rs | 6 ++-- tests/by-util/test_df.rs | 2 +- tests/by-util/test_id.rs | 12 ++----- tests/by-util/test_install.rs | 20 +++-------- tests/by-util/test_ls.rs | 45 +++++++------------------ tests/by-util/test_mkdir.rs | 15 ++------- tests/by-util/test_mkfifo.rs | 15 ++------- tests/by-util/test_mknod.rs | 20 +++-------- tests/by-util/test_mv.rs | 10 ++---- tests/by-util/test_runcon.rs | 15 ++------- tests/by-util/test_stat.rs | 5 +-- tests/by-util/test_tail.rs | 4 +-- 18 files changed, 59 insertions(+), 184 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cb46a50c8e9..3b24b6f38c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,6 +37,7 @@ uudoc = [ "dep:regex", "dep:zip", ] +selinux = ["dep:selinux"] ## features ## Optional feature for stdbuf # "feat_external_libstdbuf" == use an external libstdbuf.so for stdbuf instead of embedding it diff --git a/src/uu/cp/Cargo.toml b/src/uu/cp/Cargo.toml index 1d248b9e936..2ce712ff759 100644 --- a/src/uu/cp/Cargo.toml +++ b/src/uu/cp/Cargo.toml @@ -61,5 +61,5 @@ name = "cp_bench" harness = false [features] -feat_selinux = ["selinux", "uucore/selinux"] +selinux = ["dep:selinux", "uucore/selinux"] feat_acl = ["exacl"] diff --git a/src/uu/id/Cargo.toml b/src/uu/id/Cargo.toml index 3890aadc944..ad75b390471 100644 --- a/src/uu/id/Cargo.toml +++ b/src/uu/id/Cargo.toml @@ -33,5 +33,5 @@ name = "id" path = "src/main.rs" [features] -feat_selinux = ["selinux"] +selinux = ["dep:selinux"] smack = ["uucore/smack"] diff --git a/src/uu/ls/Cargo.toml b/src/uu/ls/Cargo.toml index 260743a1f9b..987490b7862 100644 --- a/src/uu/ls/Cargo.toml +++ b/src/uu/ls/Cargo.toml @@ -65,5 +65,5 @@ name = "ls_bench" harness = false [features] -feat_selinux = ["selinux", "uucore/selinux"] +selinux = ["dep:selinux", "uucore/selinux"] smack = ["uucore/smack"] diff --git a/tests/by-util/test_chcon.rs b/tests/by-util/test_chcon.rs index f90bbdb0c78..722e41c08c9 100644 --- a/tests/by-util/test_chcon.rs +++ b/tests/by-util/test_chcon.rs @@ -4,10 +4,7 @@ // file that was distributed with this source code. // spell-checker:ignore (jargon) xattributes #![allow(clippy::missing_errors_doc, clippy::similar_names)] -#![cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#![cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] use std::ffi::CString; use std::path::Path; diff --git a/tests/by-util/test_cp.rs b/tests/by-util/test_cp.rs index 1b3fde67814..e622ee9b711 100644 --- a/tests/by-util/test_cp.rs +++ b/tests/by-util/test_cp.rs @@ -8,10 +8,7 @@ #[cfg(unix)] use rstest::rstest; use uucore::display::Quotable; -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] use uucore::selinux::get_getfattr_output; use uutests::util::TestScenario; use uutests::{at_and_ucmd, new_ucmd, path_concat, util_name}; @@ -1831,7 +1828,7 @@ fn test_cp_preserve_xattr() { #[test] #[cfg(all( - not(feature = "feat_selinux"), + not(feature = "selinux"), any(target_os = "linux", target_os = "android") ))] fn test_cp_preserve_all_context_fails_on_non_selinux() { @@ -6777,10 +6774,7 @@ fn test_cp_from_stream_permission() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_cp_selinux() { let ts = TestScenario::new(util_name!()); let at = &ts.fixtures; @@ -6805,10 +6799,7 @@ fn test_cp_selinux() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_cp_selinux_invalid() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; @@ -6832,10 +6823,7 @@ fn test_cp_selinux_invalid() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_cp_preserve_selinux() { let ts = TestScenario::new(util_name!()); let at = &ts.fixtures; @@ -6873,10 +6861,7 @@ fn test_cp_preserve_selinux() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_cp_preserve_selinux_admin_context() { let ts = TestScenario::new(util_name!()); let at = &ts.fixtures; @@ -6935,10 +6920,7 @@ fn test_cp_preserve_selinux_admin_context() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_cp_selinux_context_priority() { // This test verifies that -Z takes priority over --context @@ -7018,10 +7000,7 @@ fn test_cp_selinux_context_priority() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_cp_selinux_empty_context() { // This test verifies that --context without a value works like -Z @@ -7067,10 +7046,7 @@ fn test_cp_selinux_empty_context() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_cp_selinux_recursive() { // Test SELinux context preservation in recursive directory copies @@ -7124,10 +7100,7 @@ fn test_cp_selinux_recursive() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_cp_preserve_context_root() { use uutests::util::run_ucmd_as_root; let scene = TestScenario::new(util_name!()); @@ -7830,10 +7803,7 @@ fn test_cp_gnu_preserve_mode() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_cp_a_z_overrides_context() { // Verifies -aZ succeeds (-Z overrides implicit --preserve=context from -a) use std::path::Path; @@ -7851,10 +7821,7 @@ fn test_cp_a_z_overrides_context() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_cp_a_preserves_context() { use std::path::Path; use uucore::selinux::{get_selinux_security_context, set_selinux_security_context}; @@ -7877,10 +7844,7 @@ fn test_cp_a_preserves_context() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_cp_preserve_context_with_z_fails() { let (at, mut ucmd) = at_and_ucmd!(); at.touch("src"); diff --git a/tests/by-util/test_dd.rs b/tests/by-util/test_dd.rs index 309a93ac020..305bbfcb470 100644 --- a/tests/by-util/test_dd.rs +++ b/tests/by-util/test_dd.rs @@ -7,7 +7,7 @@ use uutests::at_and_ucmd; use uutests::new_ucmd; use uutests::util::TestScenario; -#[cfg(all(unix, not(feature = "feat_selinux")))] +#[cfg(all(unix, not(feature = "selinux")))] use uutests::util::run_ucmd_as_root_with_stdin_stdout; #[cfg(all(not(windows), feature = "printf"))] use uutests::util::{UCommand, get_tests_binary}; @@ -1608,7 +1608,7 @@ fn test_nocache_file() { #[test] #[cfg(unix)] -#[cfg(not(feature = "feat_selinux"))] +#[cfg(not(feature = "selinux"))] // Disabled on SELinux for now fn test_skip_past_dev() { // NOTE: This test intends to trigger code which can only be reached with root permissions. @@ -1633,7 +1633,7 @@ fn test_skip_past_dev() { #[test] #[cfg(unix)] -#[cfg(not(feature = "feat_selinux"))] +#[cfg(not(feature = "selinux"))] fn test_seek_past_dev() { // NOTE: This test intends to trigger code which can only be reached with root permissions. let ts = TestScenario::new(util_name!()); diff --git a/tests/by-util/test_df.rs b/tests/by-util/test_df.rs index 2ac91d1a11e..b6e1e36748b 100644 --- a/tests/by-util/test_df.rs +++ b/tests/by-util/test_df.rs @@ -329,7 +329,7 @@ fn test_type_option() { #[test] #[cfg(not(any(target_os = "freebsd", target_os = "openbsd", target_os = "windows")))] // FIXME: fix test for FreeBSD, OpenBSD & Win -#[cfg(not(feature = "feat_selinux"))] +#[cfg(not(feature = "selinux"))] fn test_type_option_with_file() { let fs_type = new_ucmd!() .args(&["--output=fstype", "."]) diff --git a/tests/by-util/test_id.rs b/tests/by-util/test_id.rs index 1a30b75c91c..da5ba572165 100644 --- a/tests/by-util/test_id.rs +++ b/tests/by-util/test_id.rs @@ -34,7 +34,7 @@ fn test_id_no_specified_user() { let exp_result = unwrap_or_return!(expected_result(&ts, &[])); let mut exp_stdout = exp_result.stdout_str().to_string(); - #[cfg(not(feature = "feat_selinux"))] + #[cfg(not(feature = "selinux"))] { // NOTE: strip 'context' part from exp_stdout if selinux not enabled: // example: @@ -383,10 +383,7 @@ fn test_id_zero() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_id_context() { if !uucore::selinux::is_selinux_enabled() { println!("test skipped: Kernel has no support for SElinux context"); @@ -456,10 +453,7 @@ fn test_id_no_specified_user_posixly() { result.success(); } - #[cfg(all( - any(target_os = "linux", target_os = "android"), - feature = "feat_selinux" - ))] + #[cfg(all(any(target_os = "linux", target_os = "android"), feature = "selinux"))] { if uucore::selinux::is_selinux_enabled() { let result = ts.ucmd().succeeds(); diff --git a/tests/by-util/test_install.rs b/tests/by-util/test_install.rs index 88e4ef07c90..ec7339383bd 100644 --- a/tests/by-util/test_install.rs +++ b/tests/by-util/test_install.rs @@ -19,10 +19,7 @@ use std::process; #[cfg(any(target_os = "linux", target_os = "android"))] use std::thread::sleep; use uucore::process::{getegid, geteuid}; -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] use uucore::selinux::get_getfattr_output; use uutests::at_and_ucmd; use uutests::new_ucmd; @@ -2361,10 +2358,7 @@ fn test_install_no_target_basic() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_selinux() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; @@ -2413,10 +2407,7 @@ fn test_selinux() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_selinux_invalid_args() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; @@ -2449,10 +2440,7 @@ fn test_selinux_invalid_args() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_selinux_default_context() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs index 55e9b22e112..07e344bccd6 100644 --- a/tests/by-util/test_ls.rs +++ b/tests/by-util/test_ls.rs @@ -28,7 +28,7 @@ use uutests::new_ucmd; #[cfg(unix)] use uutests::unwrap_or_return; use uutests::util::TestScenario; -#[cfg(any(unix, feature = "feat_selinux"))] +#[cfg(any(unix, feature = "selinux"))] use uutests::util::expected_result; use uutests::{at_and_ucmd, util_name}; @@ -1159,7 +1159,7 @@ fn test_ls_long() { #[cfg(not(windows))] #[test] -#[cfg(not(feature = "feat_selinux"))] +#[cfg(not(feature = "selinux"))] // Disabled on the SELinux runner for now fn test_ls_long_format() { let scene = TestScenario::new(util_name!()); @@ -1757,7 +1757,7 @@ fn test_ls_long_total_size() { } #[test] -#[cfg(not(feature = "feat_selinux"))] +#[cfg(not(feature = "selinux"))] // Disabled on the SELinux runner for now fn test_ls_long_formats() { let scene = TestScenario::new(util_name!()); @@ -3303,7 +3303,7 @@ fn test_ls_color() { #[cfg(unix)] #[test] -#[cfg(not(feature = "feat_selinux"))] +#[cfg(not(feature = "selinux"))] // Disabled on the SELinux runner for now fn test_ls_inode() { let scene = TestScenario::new(util_name!()); @@ -4800,10 +4800,7 @@ fn test_ls_dangling_symlinks() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_ls_context1() { if !uucore::selinux::is_selinux_enabled() { println!("test skipped: Kernel has no support for SElinux context"); @@ -4818,10 +4815,7 @@ fn test_ls_context1() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_ls_context2() { if !uucore::selinux::is_selinux_enabled() { println!("test skipped: Kernel has no support for SElinux context"); @@ -4837,10 +4831,7 @@ fn test_ls_context2() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_ls_context_long() { if !uucore::selinux::is_selinux_enabled() { return; @@ -4859,10 +4850,7 @@ fn test_ls_context_long() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_ls_context_format() { if !uucore::selinux::is_selinux_enabled() { println!("test skipped: Kernel has no support for SElinux context"); @@ -4892,10 +4880,7 @@ fn test_ls_context_format() { } /// Helper function to validate `SELinux` context format -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn validate_selinux_context(context: &str) { assert!( context.contains(':'), @@ -4910,10 +4895,7 @@ fn validate_selinux_context(context: &str) { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_ls_selinux_context_format() { if !uucore::selinux::is_selinux_enabled() { println!("test skipped: Kernel has no support for SElinux context"); @@ -4946,10 +4928,7 @@ fn test_ls_selinux_context_format() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_ls_selinux_context_indicator() { if !uucore::selinux::is_selinux_enabled() { println!("test skipped: Kernel has no support for SElinux context"); @@ -6441,7 +6420,7 @@ fn test_acl_padding_not_inflated() { // setting is also configured). #[cfg(unix)] #[test] -#[cfg(not(feature = "feat_selinux"))] +#[cfg(not(feature = "selinux"))] // Disabled on the SELinux runner for now fn test_ls_color_norm() { let scene = TestScenario::new(util_name!()); diff --git a/tests/by-util/test_mkdir.rs b/tests/by-util/test_mkdir.rs index 5df3c778122..2531da6aa8c 100644 --- a/tests/by-util/test_mkdir.rs +++ b/tests/by-util/test_mkdir.rs @@ -11,10 +11,7 @@ use libc::mode_t; #[cfg(not(windows))] use std::os::unix::fs::PermissionsExt; -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] use uucore::selinux::get_getfattr_output; #[cfg(not(windows))] use uutests::at_and_ucmd; @@ -538,10 +535,7 @@ fn test_empty_argument() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_selinux() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; @@ -565,10 +559,7 @@ fn test_selinux() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_selinux_invalid() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; diff --git a/tests/by-util/test_mkfifo.rs b/tests/by-util/test_mkfifo.rs index 02fa91b2a52..edc57d4f1ea 100644 --- a/tests/by-util/test_mkfifo.rs +++ b/tests/by-util/test_mkfifo.rs @@ -5,10 +5,7 @@ // spell-checker:ignore nconfined -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] use uucore::selinux::get_getfattr_output; use uutests::new_ucmd; use uutests::util::TestScenario; @@ -170,10 +167,7 @@ fn test_create_fifo_permission_denied() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_mkfifo_selinux() { let ts = TestScenario::new(util_name!()); let at = &ts.fixtures; @@ -197,10 +191,7 @@ fn test_mkfifo_selinux() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_mkfifo_selinux_invalid() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; diff --git a/tests/by-util/test_mknod.rs b/tests/by-util/test_mknod.rs index a19a4e4d785..add9e2a05d8 100644 --- a/tests/by-util/test_mknod.rs +++ b/tests/by-util/test_mknod.rs @@ -7,10 +7,7 @@ use std::os::unix::fs::PermissionsExt; -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] use uucore::selinux::get_getfattr_output; use uutests::new_ucmd; use uutests::util::TestScenario; @@ -187,10 +184,7 @@ fn test_mknod_mode_comma_separated() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_mknod_selinux() { let ts = TestScenario::new(util_name!()); let at = &ts.fixtures; @@ -221,10 +215,7 @@ fn test_mknod_selinux() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_mknod_selinux_invalid() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; @@ -251,10 +242,7 @@ fn test_mknod_selinux_invalid() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_mknod_selinux_invalid_cleanup() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; diff --git a/tests/by-util/test_mv.rs b/tests/by-util/test_mv.rs index a8cb184af85..cf18c4d82fd 100644 --- a/tests/by-util/test_mv.rs +++ b/tests/by-util/test_mv.rs @@ -10,10 +10,7 @@ use rstest::rstest; use std::io::Write; #[cfg(not(windows))] use std::path::Path; -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] use uucore::selinux::get_getfattr_output; use uutests::new_ucmd; #[cfg(unix)] @@ -2620,10 +2617,7 @@ fn test_mv_cross_device_permission_denied() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_mv_selinux_context() { let test_cases = [ ("-Z", None), diff --git a/tests/by-util/test_runcon.rs b/tests/by-util/test_runcon.rs index 3d85b8f7b2a..d38e39287a4 100644 --- a/tests/by-util/test_runcon.rs +++ b/tests/by-util/test_runcon.rs @@ -4,10 +4,7 @@ // file that was distributed with this source code. // spell-checker:ignore (jargon) xattributes -#![cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#![cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] use uutests::new_ucmd; @@ -87,10 +84,7 @@ fn invalid() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn plain_context() { let ctx = "unconfined_u:unconfined_r:unconfined_t:s0-s0"; new_ucmd!().args(&[ctx, "/bin/true"]).succeeds(); @@ -109,10 +103,7 @@ fn plain_context() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn custom_context() { let t_ud = "unconfined_t"; let u_ud = "unconfined_u"; diff --git a/tests/by-util/test_stat.rs b/tests/by-util/test_stat.rs index 8802c3a17b2..e862c5da20b 100644 --- a/tests/by-util/test_stat.rs +++ b/tests/by-util/test_stat.rs @@ -583,10 +583,7 @@ fn test_printf_invalid_directive() { } #[test] -#[cfg(all( - feature = "feat_selinux", - any(target_os = "linux", target_os = "android") -))] +#[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))] fn test_stat_selinux() { let ts = TestScenario::new(util_name!()); let at = &ts.fixtures; diff --git a/tests/by-util/test_tail.rs b/tests/by-util/test_tail.rs index 3cd85d28c22..b20c54d6ee3 100644 --- a/tests/by-util/test_tail.rs +++ b/tests/by-util/test_tail.rs @@ -2134,7 +2134,7 @@ fn test_follow_name_truncate3() { #[cfg(all( not(target_vendor = "apple"), not(target_os = "windows"), - not(feature = "feat_selinux") // flaky + not(feature = "selinux") // flaky ))] // FIXME: for currently not working platforms fn test_follow_name_truncate4() { // Truncating a file with the same content it already has should not trigger a truncate event @@ -4556,7 +4556,7 @@ fn test_args_when_directory_given_shorthand_big_f_together_with_retry() { not(target_os = "windows"), not(target_os = "freebsd"), not(target_os = "openbsd"), - not(feature = "feat_selinux") // flaky + not(feature = "selinux") // flaky ))] fn test_follow_when_files_are_pointing_to_same_relative_file_and_file_stays_same_size() { let scene = TestScenario::new(util_name!());