]> git.ipfire.org Git - thirdparty/libvirt.git/commit
test: add user_xattr check for securityselinuxlabeltest
authorJincheng Miao <jmiao@redhat.com>
Mon, 9 Jun 2014 11:36:07 +0000 (19:36 +0800)
committerEric Blake <eblake@redhat.com>
Thu, 26 Jun 2014 21:36:46 +0000 (15:36 -0600)
commitcaf164f1e476f254cb67498e8fc615ec1e0dd444
treeb1e375adc8c29cea286f25064c053147cdc48747
parent9b291bbe20c36c0820c6e7cd2bf6229bf41807e8
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: Jincheng Miao <jmiao@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Tested-by: Scott Sullivan <ssullivan@liquidweb.com>
tests/securityselinuxlabeltest.c