meson: tests: add selinux specific tests

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-06-25 13:06:59 +02:00
parent f18813a6c3
commit 5d255f43d0
2 changed files with 15 additions and 39 deletions

View File

@ -16,16 +16,6 @@
## License along with this library. If not, see
## <http://www.gnu.org/licenses/>.
if WITH_SECDRIVER_SELINUX
if WITH_ATTR
test_programs += securityselinuxtest \
viridentitytest
if WITH_QEMU
test_programs += securityselinuxlabeltest
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
if WITH_QEMU
test_helpers += qemucapsprobe
endif WITH_QEMU
@ -211,15 +201,6 @@ virstoragetest_LDADD = $(LDADDS) \
../src/libvirt_driver_storage_impl.la \
$(NULL)
viridentitytest_SOURCES = \
viridentitytest.c testutils.h testutils.c
viridentitytest_LDADD = $(LDADDS)
if WITH_SELINUX
viridentitytest_LDADD += $(SELINUX_LIBS)
viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \
../src/libvirt.la
endif WITH_SELINUX
if WITH_NSS
## Intentionaly not linking with anything else.
## See the test source for more detailed explanation.
@ -253,26 +234,6 @@ test_programs += \
virnetdevopenvswitchtest
endif WITH_YAJL
if WITH_SECDRIVER_SELINUX
if WITH_ATTR
securityselinuxtest_SOURCES = \
securityselinuxtest.c testutils.h testutils.c
securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS)
securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \
../src/libvirt.la
if WITH_QEMU
securityselinuxlabeltest_SOURCES = \
securityselinuxlabeltest.c testutils.h testutils.c \
testutilsqemu.h testutilsqemu.c
securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS)
securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \
../src/libvirt.la
endif WITH_QEMU
endif WITH_ATTR
endif WITH_SECDRIVER_SELINUX
virjsontest_SOURCES = \
virjsontest.c testutils.h testutils.c
virjsontest_LDADD = $(LDADDS)

View File

@ -482,6 +482,21 @@ if conf.has('WITH_REMOTE')
]
endif
if conf.has('WITH_SECDRIVER_SELINUX')
if conf.has('WITH_ATTR')
tests += [
{ 'name': 'securityselinuxtest' },
{ 'name': 'viridentitytest' },
]
if conf.has('WITH_QEMU')
tests += [
{ 'name': 'securityselinuxlabeltest', 'link_whole': [ test_utils_qemu_lib ] },
]
endif
endif
endif
foreach data : tests
test_sources = '@0@.c'.format(data['name'])
test_bin = executable(