]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virTestLoadFileJSON: Don't try to unwrap JSON documents
authorPeter Krempa <pkrempa@redhat.com>
Wed, 31 Mar 2021 07:29:22 +0000 (09:29 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 12 Apr 2021 13:55:10 +0000 (15:55 +0200)
Use virFileReadAll to load the file instead of virTestLoadFile which
tries to unwrap the file.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
tests/testutils.c

index 0f6b3a97057246c3cf6cfb4c0cb55f8135050498..3363d7f0aa67dd21e74624a1e1eaad669fcac26f 100644 (file)
@@ -313,7 +313,7 @@ virTestLoadFileJSON(const char *p, ...)
     if (!(path = virTestLoadFileGetPath(p, ap)))
         goto cleanup;
 
-    if (virTestLoadFile(path, &jsonstr) < 0)
+    if (virFileReadAll(path, INT_MAX, &jsonstr) < 0)
         goto cleanup;
 
     if (!(ret = virJSONValueFromString(jsonstr)))