]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: qemumonitor: Prepare for more test data in testBlockNodeNameDetect
authorPeter Krempa <pkrempa@redhat.com>
Wed, 26 Jul 2017 07:30:18 +0000 (09:30 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 27 Jul 2017 07:27:58 +0000 (09:27 +0200)
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 also require data from 'query-blockstats'.

Reviewed-by: Eric Blake <eblake@redhat.com>
tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-named-nodes.json [moved from tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.json with 100% similarity]
tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-named-nodes.json [moved from tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.json with 100% similarity]
tests/qemumonitorjsondata/qemumonitorjson-nodename-relative-named-nodes.json [moved from tests/qemumonitorjsondata/qemumonitorjson-nodename-relative.json with 100% similarity]
tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing-named-nodes.json [moved from tests/qemumonitorjsondata/qemumonitorjson-nodename-same-backing.json with 100% similarity]
tests/qemumonitorjsontest.c

index c343c0d3820f1198ee130f7a6c91c7a086624a49..5bab9f5077b1bce6d59a719396dab4396eda6fab 100644 (file)
@@ -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;
 }