libvirt/tests/securityselinuxlabeldata
Eric Blake 95577af442 selinux: enhance test to cover nfs label failure
Daniel Berrange (correctly) pointed out that we should do a better
job of testing selinux labeling fallbacks on NFS disks that lack
labeling support.

* tests/securityselinuxhelper.c (includes): Makefile already
guaranteed xattr support.  Add additional headers.
(init_syms): New function, borrowing from vircgroupmock.c.
(setfilecon_raw, getfilecon_raw): Fake NFS failure.
(statfs): Fake an NFS mount point.
(security_getenforce, security_get_boolean_active): Don't let host
environment affect test.
* tests/securityselinuxlabeldata/nfs.data: New file.
* tests/securityselinuxlabeldata/nfs.xml: New file.
* tests/securityselinuxlabeltest.c (testSELinuxCreateDisks)
(testSELinuxDeleteDisks): Setup and cleanup for fake NFS mount.
(testSELinuxCheckLabels): Test handling of SELinux NFS denial.
Fix memory leak.
(testSELinuxLabeling): Avoid infinite loop on dirty tree.
(mymain): Add new test.
2013-08-20 10:46:58 -06:00
..
chardev.txt Add a test suite for validating SELinux labelling 2013-01-14 13:40:04 +00:00
chardev.xml Add a test suite for validating SELinux labelling 2013-01-14 13:40:04 +00:00
disks.txt Add a test suite for validating SELinux labelling 2013-01-14 13:40:04 +00:00
disks.xml Add a test suite for validating SELinux labelling 2013-01-14 13:40:04 +00:00
kernel.txt Add a test suite for validating SELinux labelling 2013-01-14 13:40:04 +00:00
kernel.xml Add a test suite for validating SELinux labelling 2013-01-14 13:40:04 +00:00
nfs.txt selinux: enhance test to cover nfs label failure 2013-08-20 10:46:58 -06:00
nfs.xml selinux: enhance test to cover nfs label failure 2013-08-20 10:46:58 -06:00