[libvirt] [go PATCH] Avoid clashing path with default storage pool

Daniel P. Berrangé posted 1 patch 5 years, 6 months ago
Failed in applying to current master (apply log)
connect_test.go      | 6 +++---
storage_pool_test.go | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
[libvirt] [go PATCH] Avoid clashing path with default storage pool
Posted by Daniel P. Berrangé 5 years, 6 months ago
The test driver provides a default storage pool at
/default-pool. Libvirt now enforces source path uniqueness, so we must
pick a different path for our test pools.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---

Pushed as a build fix

 connect_test.go      | 6 +++---
 storage_pool_test.go | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/connect_test.go b/connect_test.go
index 29c274d..da24448 100644
--- a/connect_test.go
+++ b/connect_test.go
@@ -789,7 +789,7 @@ func TestStoragePoolDefineXML(t *testing.T) {
 	}()
 	defName := "default-pool-test-0"
 	xml := `<pool type='dir'><name>default-pool-test-0</name><target>
-            <path>/default-pool</path></target></pool>`
+            <path>/default-pool-test-0</path></target></pool>`
 	pool, err := conn.StoragePoolDefineXML(xml, 0)
 	if err != nil {
 		t.Fatal(err)
@@ -900,7 +900,7 @@ func TestLookupStorageVolByKey(t *testing.T) {
 		return
 	}
 	defer pool.Destroy()
-	defPoolPath := "default-pool"
+	defPoolPath := "default-pool-test-1"
 	defVolName := time.Now().String()
 	defVolKey := "/" + defPoolPath + "/" + defVolName
 	vol, err := pool.StorageVolCreateXML(testStorageVolXML(defVolName, defPoolPath), 0)
@@ -942,7 +942,7 @@ func TestLookupStorageVolByPath(t *testing.T) {
 		return
 	}
 	defer pool.Destroy()
-	defPoolPath := "default-pool"
+	defPoolPath := "default-pool-test-1"
 	defVolName := time.Now().String()
 	defVolPath := "/" + defPoolPath + "/" + defVolName
 	vol, err := pool.StorageVolCreateXML(testStorageVolXML(defVolName, defPoolPath), 0)
diff --git a/storage_pool_test.go b/storage_pool_test.go
index 18cdb3a..7e93b17 100644
--- a/storage_pool_test.go
+++ b/storage_pool_test.go
@@ -42,7 +42,7 @@ func buildTestStoragePool(poolName string) (*StoragePool, *Connect) {
 	pool, err := conn.StoragePoolDefineXML(`<pool type='dir'>
   <name>`+name+`</name>
   <target>
-  <path>/default-pool</path>
+  <path>/default-pool-test-1</path>
   </target>
   </pool>`, 0)
 	if err != nil {
-- 
2.17.1

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