[PATCH 00.5/51] securityselinuxlabeltest: Convert to testQemuInsertRealCaps

Peter Krempa posted 1 patch 7 months, 4 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/2f3d5acdb03dda9d3fec8599eb0024e66c6a71db.1693926975.git.pkrempa@redhat.com
tests/securityselinuxlabeltest.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
[PATCH 00.5/51] securityselinuxlabeltest: Convert to testQemuInsertRealCaps
Posted by Peter Krempa 7 months, 4 weeks ago
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>
---
 tests/securityselinuxlabeltest.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c
index 30bd68b550..04bffe4356 100644
--- a/tests/securityselinuxlabeltest.c
+++ b/tests/securityselinuxlabeltest.c
@@ -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) \
-- 
2.41.0
Re: [PATCH 00.5/51] securityselinuxlabeltest: Convert to testQemuInsertRealCaps
Posted by Ján Tomko 7 months, 4 weeks ago
On a Tuesday in 2023, Peter Krempa wrote:
>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>
>---
> tests/securityselinuxlabeltest.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano