[libvirt] [PATCH] tests: ignore XML files starting with a .

Daniel P. Berrangé posted 1 patch 5 years, 3 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20181217144249.6820-1-berrange@redhat.com
tests/virschematest.c | 2 ++
1 file changed, 2 insertions(+)
[libvirt] [PATCH] tests: ignore XML files starting with a .
Posted by Daniel P. Berrangé 5 years, 3 months ago
If an editor has an XML file open, it may create a temporary . file. The
existance of this file will cause the virschematest to fail, so just
skip these editor temp files.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/virschematest.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/virschematest.c b/tests/virschematest.c
index 4c348d9909..d1bcdeac9c 100644
--- a/tests/virschematest.c
+++ b/tests/virschematest.c
@@ -84,6 +84,8 @@ testSchemaDir(const char *schema,
     while ((rc = virDirRead(dir, &ent, dir_path)) > 0) {
         if (!virFileHasSuffix(ent->d_name, ".xml"))
             continue;
+        if (ent->d_name[0] == '.')
+            continue;
 
         if (virAsprintf(&xml_path, "%s/%s", dir_path, ent->d_name) < 0)
             goto cleanup;
-- 
2.19.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] tests: ignore XML files starting with a .
Posted by Andrea Bolognani 5 years, 3 months ago
On Mon, 2018-12-17 at 14:42 +0000, Daniel P. Berrangé wrote:
> If an editor has an XML file open, it may create a temporary . file. The
> existance of this file will cause the virschematest to fail, so just
> skip these editor temp files.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  tests/virschematest.c | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Andrea Bolognani <abologna@redhat.com>

-- 
Andrea Bolognani / Red Hat / Virtualization

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