[LTP] [PATCH v3 2/2] Add listxattr04 reproducer

Wei Gao wegao@suse.com
Wed Jul 16 21:56:15 CEST 2025


On Wed, Jul 16, 2025 at 09:34:30AM +0200, Andrea Cervesato wrote:
> On 7/16/25 9:26 PM, Wei Gao wrote:
> > Current tst_selinux_enabled within your patchset not check running state
> > of selinux. so i guess you need check /sys/fs/selinux/enforce value
> > here.
> > Or you can use tst_selinux_enforcing. Correct me if any
> > misunderstanding.
> If SELinux is enabled, we will have /sys/fs/selinux folder filled with files
> that can be used to verify SELinux status (sudo sestatus -v).
> tst_selinux_enabled() is using:
> 
>     access(SELINUX_PATH, F_OK) == 0 && !tst_dir_is_empty(SELINUX_PATH, 0)
> 
> That is enough to know if we have SELinux or not. According to Cyril we
> probably just need:
> 
>     tst_is_mounted(SELINUX_PATH)
> 
> Like it is in is_selinux_enabled().
> 
> - Andrea
> 

If only check enable status then i guess the tst_brk message should use
tst_brk(TCONF, "SELinux is not enabled") instead of 
tst_brk(TCONF, "SELinux is not running") ?


More information about the ltp mailing list