File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/uucore/src/lib/features Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -325,6 +325,11 @@ mod tests {
325325
326326 #[ test]
327327 fn test_get_selinux_security_context ( ) {
328+ if !is_selinux_enabled ( ) {
329+ // Skip the test if SELinux is not enabled
330+ return ;
331+ }
332+
328333 let tmpfile = NamedTempFile :: new ( ) . expect ( "Failed to create tempfile" ) ;
329334 let path = tmpfile. path ( ) ;
330335 if !is_selinux_enabled ( ) {
@@ -394,6 +399,11 @@ mod tests {
394399
395400 #[ test]
396401 fn test_get_selinux_context_nonexistent_file ( ) {
402+ if !is_selinux_enabled ( ) {
403+ // Skip the test if SELinux is not enabled
404+ return ;
405+ }
406+
397407 let path = Path :: new ( "/nonexistent/file/that/does/not/exist" ) ;
398408 if !is_selinux_enabled ( ) {
399409 println ! ( "test skipped: Kernel has no support for SElinux context" ) ;
You can’t perform that action at this time.
0 commit comments