virTestLoadFileJSON: Don't try to unwrap JSON documents

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>
This commit is contained in:
Peter Krempa 2021-03-31 09:29:22 +02:00
parent 19659d839c
commit e5124770db

View 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)))