diff options
author | Thomas Huth <thuth@redhat.com> | 2024-10-29 10:24:39 +0100 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2024-11-04 14:16:12 +0100 |
commit | f7d6b772200273eac3e5613435e2b4fe977470c3 (patch) | |
tree | c44b2ff203694837368ba1f84d813d40c284ea14 /tests/functional/qemu_test/utils.py | |
parent | 3abc545e66b95bcd6388cc2b1d006c9ebd763c27 (diff) |
tests/functional: Convert BananaPi tests to the functional framework
Move the BananaPi tests from tests/avocado/boot_linux_console.py into
a new file dedicated for Banana Pi tests in the functional framework.
Update the hash sums of the assets to sha256 along the way and fix the
broken link for the buildroot image from storage.kernelci.org.
(Note: The test_arm_bpim2u_openwrt_22_03_3 test is currently broken
due to a regression in commit 4c2c047469 ("target/arm: Fix usage of MMU
indexes when EL3 is AArch32") - it works if that commit gets reverted)
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20241029092440.25021-2-thuth@redhat.com>
Diffstat (limited to 'tests/functional/qemu_test/utils.py')
-rw-r--r-- | tests/functional/qemu_test/utils.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/functional/qemu_test/utils.py b/tests/functional/qemu_test/utils.py index 2a1cb60d38..1bf1c410d5 100644 --- a/tests/functional/qemu_test/utils.py +++ b/tests/functional/qemu_test/utils.py @@ -15,6 +15,27 @@ import shutil import subprocess import tarfile +""" +Round up to next power of 2 +""" +def pow2ceil(x): + return 1 if x == 0 else 2**(x - 1).bit_length() + +def file_truncate(path, size): + if size != os.path.getsize(path): + with open(path, 'ab+') as fd: + fd.truncate(size) + +""" +Expand file size to next power of 2 +""" +def image_pow2ceil_expand(path): + size = os.path.getsize(path) + size_aligned = pow2ceil(size) + if size != size_aligned: + with open(path, 'ab+') as fd: + fd.truncate(size_aligned) + def archive_extract(archive, dest_dir, member=None): with tarfile.open(archive) as tf: if hasattr(tarfile, 'data_filter'): |