From 5d255f43d0b998ebc051ca50809a4c01642423d5 Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Thu, 25 Jun 2020 13:06:59 +0200 Subject: [PATCH] meson: tests: add selinux specific tests Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa Reviewed-by: Neal Gompa --- tests/Makefile.am | 39 --------------------------------------- tests/meson.build | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 39 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 80580b3e70..27eb3c7c44 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,16 +16,6 @@ ## License along with this library. If not, see ## . -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) diff --git a/tests/meson.build b/tests/meson.build index ced67183e3..7a2e982f89 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -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(