]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: tests: add selinux specific tests
authorPavel Hrdina <phrdina@redhat.com>
Thu, 25 Jun 2020 11:06:59 +0000 (13:06 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:06 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
tests/Makefile.am
tests/meson.build

index 80580b3e700da5a34d3b9a408696099fbfe9e934..27eb3c7c4494b293295857b865aca8023b533f42 100644 (file)
 ## 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)
index ced67183e3df7c9ce6ddbbbd174272b149e4e12d..7a2e982f891d80d7dc08cb8da09ced2730f7d1b5 100644 (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(