[PATCH 13/43] testParseXMLDocFromFile: Validate that the replaced node is identical with parsed root

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

 



When replacing a definition node by contents of a file the root node in
the file must match the replaced node.

Enforce that by passing the original node name as the 'rootnode'
argument of virXMLParse.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/test/test_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 26c6c95c28..5eae22f591 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -851,7 +851,8 @@ testParseXMLDocFromFile(xmlNodePtr node,
         g_autofree char *absFile = testBuildFilename(file, relFile);
         xmlNodePtr newnode = NULL;

-        if (!(doc = virXMLParse(absFile, NULL, NULL, NULL, NULL, NULL, false)))
+        if (!(doc = virXMLParse(absFile, NULL, NULL, (const char *) node->name,
+                                NULL, NULL, false)))
             return NULL;

         if (!(newnode = xmlCopyNode(xmlDocGetRootElement(doc), 1))) {
-- 
2.37.3




[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