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

[libvirt] [PATCH 03/24] tests: qemumonitor: Prepare for more test data in testBlockNodeNameDetect



Rename 'json' and related variables to 'nodeNameJson'. Also rename the
test files along. This is a preparation for modifying how we detect node
names which will require also data from 'query-blockstats'.
---
 ...emumonitorjson-nodename-basic-named-nodes.json} |  0
 ...umonitorjson-nodename-gluster-named-nodes.json} |  0
 ...monitorjson-nodename-relative-named-nodes.json} |  0
 ...torjson-nodename-same-backing-named-nodes.json} |  0
 tests/qemumonitorjsontest.c                        | 22 +++++++++++-----------
 5 files changed, 11 insertions(+), 11 deletions(-)
 rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-basic.json => qemumonitorjson-nodename-basic-named-nodes.json} (100%)
 rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-gluster.json => qemumonitorjson-nodename-gluster-named-nodes.json} (100%)
 rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-relative.json => qemumonitorjson-nodename-relative-named-nodes.json} (100%)
 rename tests/qemumonitorjsondata/{qemumonitorjson-nodename-same-backing.json => qemumonitorjson-nodename-same-backing-named-nodes.json} (100%)

diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-named-nodes.json
similarity index 100%
rename from tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.json
rename to tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-named-nodes.json
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-named-nodes.json
similarity index 100%
rename from tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.json
rename to tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-named-nodes.json
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-relative-named-nodes.json
similarity index 100%
rename from tests/qemumonitorjsondata/qemumonitorjson-nodename-relative.json
rename to tests/qemumonitorjsondata/qemumonitorjson-nodename-relative-named-nodes.json
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing-named-nodes.json
similarity index 100%
rename from tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing.json
rename to tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing-named-nodes.json
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index c343c0d38..5bab9f507 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -2740,19 +2740,19 @@ static int
 testBlockNodeNameDetect(const void *opaque)
 {
     const struct testBlockNodeNameDetectData *data = opaque;
-    char *jsonFile = NULL;
-    char *jsonStr = NULL;
+    char *namedNodesFile = NULL;
+    char *namedNodesStr = NULL;
     char *resultFile = NULL;
     char *actual = NULL;
     char **nodenames = NULL;
     char **next;
-    virJSONValuePtr json = NULL;
+    virJSONValuePtr namedNodesJson = NULL;
     virHashTablePtr nodedata = NULL;
     virBuffer buf = VIR_BUFFER_INITIALIZER;
     int ret = -1;

-    if (virAsprintf(&jsonFile,
-                    "%s/qemumonitorjsondata/qemumonitorjson-nodename-%s.json",
+    if (virAsprintf(&namedNodesFile,
+                    "%s/qemumonitorjsondata/qemumonitorjson-nodename-%s-named-nodes.json",
                     abs_srcdir, data->name) < 0 ||
         virAsprintf(&resultFile,
                     "%s/qemumonitorjsondata/qemumonitorjson-nodename-%s.result",
@@ -2762,13 +2762,13 @@ testBlockNodeNameDetect(const void *opaque)
     if (!(nodenames = virStringSplit(data->nodenames, ",", 0)))
         goto cleanup;

-    if (virTestLoadFile(jsonFile, &jsonStr) < 0)
+    if (virTestLoadFile(namedNodesFile, &namedNodesStr) < 0)
         goto cleanup;

-    if (!(json = virJSONValueFromString(jsonStr)))
+    if (!(namedNodesJson = virJSONValueFromString(namedNodesStr)))
         goto cleanup;

-    if (!(nodedata = qemuBlockNodeNameGetBackingChain(json)))
+    if (!(nodedata = qemuBlockNodeNameGetBackingChain(namedNodesJson)))
         goto cleanup;

     for (next = nodenames; *next; next++)
@@ -2787,13 +2787,13 @@ testBlockNodeNameDetect(const void *opaque)
     ret = 0;

  cleanup:
-    VIR_FREE(jsonFile);
+    VIR_FREE(namedNodesFile);
     VIR_FREE(resultFile);
-    VIR_FREE(jsonStr);
+    VIR_FREE(namedNodesStr);
     VIR_FREE(actual);
     virHashFree(nodedata);
     virStringListFree(nodenames);
-    virJSONValueFree(json);
+    virJSONValueFree(namedNodesJson);

     return ret;
 }
-- 
2.13.2


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