[PATCH 2/2] test: Don't assume a configFile exists for Storage Pool tests

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

 



Fix a "bug" in the storage pool test driver code which "assumed"
testStoragePoolObjSetDefaults should fill in the configFile for
both the Define/Create (persistent) and CreateXML (transient) pools
by just VIR_FREE()'ing it during CreateXML.  Because the configFile
was filled in, during Destroy the pool wouldn't be free'd which
could cause issues for future patches which add tests to validate
vHBA creation for the storage pool using the same name.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/test/test_driver.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index cf7820a..361d62e 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -4440,6 +4440,12 @@ testStoragePoolCreateXML(virConnectPtr conn,
         pool = NULL;
         goto cleanup;
     }
+
+    /* *SetDefaults fills this in for the persistent pools, but this
+     * would be a transient pool so remove it; otherwise, the Destroy
+     * code will not Remove the pool */
+    VIR_FREE(pool->configFile);
+
     pool->active = 1;
 
     event = virStoragePoolEventLifecycleNew(pool->def->name, pool->def->uuid,
-- 
2.9.3

--
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