mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
selinux: use the uucore::selinux::is_selinux_enabled() function
This commit is contained in:
parent
45b0c39ed7
commit
6091d0b62b
6 changed files with 21 additions and 14 deletions
|
@ -376,8 +376,7 @@ fn test_id_zero() {
|
|||
#[test]
|
||||
#[cfg(feature = "feat_selinux")]
|
||||
fn test_id_context() {
|
||||
use selinux::{self, KernelSupport};
|
||||
if selinux::kernel_support() == KernelSupport::Unsupported {
|
||||
if !uucore::selinux::is_selinux_enabled() {
|
||||
println!("test skipped: Kernel has no support for SElinux context");
|
||||
return;
|
||||
}
|
||||
|
@ -450,12 +449,11 @@ fn test_id_no_specified_user_posixly() {
|
|||
feature = "feat_selinux"
|
||||
))]
|
||||
{
|
||||
use selinux::{self, KernelSupport};
|
||||
if selinux::kernel_support() == KernelSupport::Unsupported {
|
||||
println!("test skipped: Kernel has no support for SElinux context");
|
||||
} else {
|
||||
if uucore::selinux::is_selinux_enabled() {
|
||||
let result = ts.ucmd().succeeds();
|
||||
assert!(result.stdout_str().contains("context="));
|
||||
} else {
|
||||
println!("test skipped: Kernel has no support for SElinux context");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue