]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
securityselinuxlabeltest: Convert to testQemuInsertRealCaps
authorPeter Krempa <pkrempa@redhat.com>
Tue, 5 Sep 2023 15:02:33 +0000 (17:02 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 6 Sep 2023 12:09:42 +0000 (14:09 +0200)
Use the modern infrastructure to populate capabilities cache with real
capabilities instead of the faked one which will be soon removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/securityselinuxlabeltest.c

index 30bd68b5506d2508cd8a1ef74780e34d266bd1d7..04bffe43567855b33582cd28b519a06a22721bad 100644 (file)
@@ -299,7 +299,8 @@ mymain(void)
 {
     int ret = 0;
     int rc = testUserXattrEnabled();
-    g_autoptr(virQEMUCaps) qemuCaps = NULL;
+    g_autoptr(GHashTable) capslatest = testQemuGetLatestCaps();
+    g_autoptr(GHashTable) capscache = virHashNew(virObjectUnref);
 
     if (rc < 0) {
         VIR_TEST_VERBOSE("failed to determine xattr support");
@@ -322,12 +323,10 @@ mymain(void)
     if (qemuTestDriverInit(&driver) < 0)
         return EXIT_FAILURE;
 
-    qemuCaps = virQEMUCapsNew();
+    qemuTestSetHostArch(&driver, VIR_ARCH_X86_64);
 
-    virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA);
-    virQEMUCapsSet(qemuCaps, QEMU_CAPS_VNC);
-
-    if (qemuTestCapsCacheInsert(driver.qemuCapsCache, qemuCaps) < 0)
+    if (testQemuInsertRealCaps(driver.qemuCapsCache, "x86_64", "latest", "",
+                               capslatest, capscache, NULL, NULL) < 0)
         return EXIT_FAILURE;
 
 #define DO_TEST_LABELING(name) \