aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/qemu_test/utils.py
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-08-30 15:38:32 +0200
committerThomas Huth <thuth@redhat.com>2024-09-04 12:28:00 +0200
commit34917ead7239acfe85580e74f6ebe2fa55a10ab2 (patch)
treea96a82e6921216b5f8f65fcbd36cd26e9540a638 /tests/functional/qemu_test/utils.py
parent99465d3fe451964f1bb3c355054cd7ced05dcf88 (diff)
tests/functional: Convert ARM bFLT linux-user avocado test
Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Expose cpio_extract() in qemu_test.utils for possible reuse. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20240822104238.75045-3-philmd@linaro.org> [thuth: Add test to meson.build] Message-ID: <20240830133841.142644-39-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/functional/qemu_test/utils.py')
-rw-r--r--tests/functional/qemu_test/utils.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/functional/qemu_test/utils.py b/tests/functional/qemu_test/utils.py
index 99eae5fc45..2a1cb60d38 100644
--- a/tests/functional/qemu_test/utils.py
+++ b/tests/functional/qemu_test/utils.py
@@ -12,6 +12,7 @@ import gzip
import lzma
import os
import shutil
+import subprocess
import tarfile
def archive_extract(archive, dest_dir, member=None):
@@ -45,3 +46,11 @@ def lzma_uncompress(xz_path, output_path):
except:
os.remove(output_path)
raise
+
+def cpio_extract(cpio_handle, output_path):
+ cwd = os.getcwd()
+ os.chdir(output_path)
+ subprocess.run(['cpio', '-i'],
+ input=cpio_handle.read(),
+ stderr=subprocess.DEVNULL)
+ os.chdir(cwd)