Add test case for SELinux label generation

This test case validates the correct generation of SELinux labels
for VMs, wrt the current process label. Since we can't actually
change the label of the test program process, we create a shared
library libsecurityselinuxhelper.so which overrides the getcon()
and setcon() libselinux.so functions. When started the test case
will check to see if LD_PRELOAD is set, and if not, it will
re-exec() itself setting LD_PRELOAD=libsecurityselinuxhelper.so

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange
2012-08-10 14:31:14 +01:00
parent 4e365df44f
commit 9136032a66
5 changed files with 437 additions and 0 deletions

1
.gitignore vendored
View File

@@ -146,6 +146,7 @@
/tests/reconnect
/tests/secaatest
/tests/seclabeltest
/tests/securityselinuxtest
/tests/sexpr2xmltest
/tests/shunloadtest
/tests/sockettest