[libvirt] [PATCHv3 21/36] tests: virstoragetest: Remove "expBackingStore" field

Peter Krempa pkrempa at redhat.com
Fri May 30 08:37:43 UTC 2014


Now that we changed ordering of the stored metadata so that the backing
store is described by the child element the test should reflect this
change too.

Remove the expected backing store field as it's actually described by
the next element in the backing chain, so there's no need for
duplication.
---
 tests/virstoragetest.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index 3c892d5..03f8552 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -282,7 +282,6 @@ testPrepImages(void)
 typedef struct _testFileData testFileData;
 struct _testFileData
 {
-    const char *expBackingStore;
     const char *expBackingStoreRaw;
     unsigned long long expCapacity;
     bool expEncrypted;
@@ -314,12 +313,11 @@ struct testChainData


 static const char testStorageChainFormat[] =
-    "store: %s\n"
+    "path:%s\n"
     "backingStoreRaw: %s\n"
     "capacity: %lld\n"
     "encryption: %d\n"
     "relPath:%s\n"
-    "path:%s\n"
     "relDir:%s\n"
     "type:%d\n"
     "format:%d\n";
@@ -386,23 +384,21 @@ testStorageChain(const void *args)
             : data->files[i]->relDirRel;
         if (virAsprintf(&expect,
                         testStorageChainFormat,
-                        NULLSTR(data->files[i]->expBackingStore),
+                        NULLSTR(data->files[i]->path),
                         NULLSTR(data->files[i]->expBackingStoreRaw),
                         data->files[i]->expCapacity,
                         data->files[i]->expEncrypted,
                         NULLSTR(expPath),
-                        NULLSTR(data->files[i]->path),
                         NULLSTR(expRelDir),
                         data->files[i]->type,
                         data->files[i]->format) < 0 ||
             virAsprintf(&actual,
                         testStorageChainFormat,
-                        NULLSTR(elt->backingStore ? elt->backingStore->path : NULL),
+                        NULLSTR(elt->path),
                         NULLSTR(elt->backingStoreRaw),
                         elt->capacity,
                         !!elt->encryption,
                         NULLSTR(elt->relPath),
-                        NULLSTR(elt->path),
                         NULLSTR(elt->relDir),
                         elt->type,
                         elt->format) < 0) {
@@ -793,7 +789,6 @@ mymain(void)
     /* Qcow2 file with relative raw backing, format provided */
     raw.pathAbs = "raw";
     testFileData qcow2 = {
-        .expBackingStore = canonraw,
         .expBackingStoreRaw = "raw",
         .expCapacity = 1024,
         .pathRel = "qcow2",
@@ -849,7 +844,6 @@ mymain(void)

     /* Wrapped file access */
     testFileData wrap = {
-        .expBackingStore = canonqcow2,
         .expBackingStoreRaw = absqcow2,
         .expCapacity = 1024,
         .pathRel = "wrap",
@@ -885,7 +879,6 @@ mymain(void)

     /* Qcow2 file with raw as absolute backing, backing format omitted */
     testFileData wrap_as_raw = {
-        .expBackingStore = canonqcow2,
         .expBackingStoreRaw = absqcow2,
         .expCapacity = 1024,
         .pathRel = "wrap",
@@ -909,7 +902,6 @@ mymain(void)
                                "qcow2", NULL);
     if (virCommandRun(cmd, NULL) < 0)
         ret = -1;
-    qcow2.expBackingStore = NULL;
     qcow2.expBackingStoreRaw = datadir "/bogus";
     qcow2.pathRel = "qcow2";
     qcow2.relDirRel = ".";
@@ -942,7 +934,6 @@ mymain(void)
                                "qcow2", NULL);
     if (virCommandRun(cmd, NULL) < 0)
         ret = -1;
-    qcow2.expBackingStore = "blah";
     qcow2.expBackingStoreRaw = "nbd:example.org:6000:exportname=blah";

     /* Qcow2 file with backing protocol instead of file */
@@ -963,7 +954,6 @@ mymain(void)

     /* qed file */
     testFileData qed = {
-        .expBackingStore = canonraw,
         .expBackingStoreRaw = absraw,
         .expCapacity = 1024,
         .pathRel = "qed",
@@ -1028,7 +1018,6 @@ mymain(void)

     /* Behavior of symlinks to qcow2 with relative backing files */
     testFileData link1 = {
-        .expBackingStore = canonraw,
         .expBackingStoreRaw = "../raw",
         .expCapacity = 1024,
         .pathRel = "../sub/link1",
@@ -1040,7 +1029,6 @@ mymain(void)
         .format = VIR_STORAGE_FILE_QCOW2,
     };
     testFileData link2 = {
-        .expBackingStore = canonqcow2,
         .expBackingStoreRaw = "../sub/link1",
         .expCapacity = 1024,
         .pathRel = "sub/link2",
@@ -1068,7 +1056,6 @@ mymain(void)
                                "-F", "qcow2", "-b", "qcow2", "qcow2", NULL);
     if (virCommandRun(cmd, NULL) < 0)
         ret = -1;
-    qcow2.expBackingStore = NULL;
     qcow2.expBackingStoreRaw = "qcow2";

     /* Behavior of an infinite loop chain */
-- 
1.9.3




More information about the libvir-list mailing list