test: add user_xattr check for securityselinuxlabeltest
libvirt unit test used setxattr with "user.libvirt.selinux" name to emulate setfilecon of selinux. But for some old kernel filesystem (like 2.6.32-431.el6.x86_64), if the filesystem is not mounted with user_xattr flag, the setxattr with "user.libvirt.selinux" will fail. So adding testUserXattrEnabled() in securityselinuxlabeltest.c, if user_xattr is not enabled, skip this case. The user_xattr is departed in newer kernel, therefore this commit is only for the compatablity for old kernel. Signed-off-by: NJincheng Miao <jmiao@redhat.com> Signed-off-by: NEric Blake <eblake@redhat.com> Tested-by: NScott Sullivan <ssullivan@liquidweb.com>
Showing