[PATCH 3/3] tests: virschema: Propagate errors from directory traversal in testSchemaDir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



testSchemaDir is a helper which invokes the schema test using virTestRun
on all schema files. Since the function itself is not called inside
virTestRun any helper function call is not dispatched to the user and
thus it's hard to debug the test. Propagate errors from the directory
traversal.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tests/virschematest.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/virschematest.c b/tests/virschematest.c
index 8a2322b3bd..df50ef1717 100644
--- a/tests/virschematest.c
+++ b/tests/virschematest.c
@@ -76,8 +76,10 @@ testSchemaDir(const char *schema,
         .validator = validator,
     };

-    if (virDirOpen(&dir, dir_path) < 0)
+    if (virDirOpen(&dir, dir_path) < 0) {
+        virTestPropagateLibvirtError();
         return -1;
+    }

     while ((rc = virDirRead(dir, &ent, dir_path)) > 0) {
         g_autofree char *test_name = NULL;
@@ -97,8 +99,10 @@ testSchemaDir(const char *schema,
             ret = -1;
     }

-    if (rc < 0)
+    if (rc < 0) {
+        virTestPropagateLibvirtError();
         ret = -1;
+    }

     VIR_DIR_CLOSE(dir);
     return ret;
-- 
2.23.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux