test/run: uncompressed raw images before running image-info

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2019-11-30 20:34:13 +01:00
parent e62ba4577a
commit 0217b4b590

View file

@ -126,6 +126,11 @@ def run_test(case, store):
else:
filename, _ = urllib.request.urlretrieve(case["url"])
fn, ex = os.path.splitext(filename)
if ex == ".xz":
with open(fn, "w") as f:
subprocess.run(["xz", "--decompress", "--stdout", filename], stdout=f)
filename = fn
info = json.loads(subprocess.check_output(["tools/image-info", filename]))
if info != case["expected"]:
with temporary_json_file(case["expected"]) as a, temporary_json_file(info) as b: