
From: Simon Glass <sjg@chromium.org> Move setup_localboot_image() to a new module Signed-off-by: Simon Glass <sjg@chromium.org> Co-authored-by: Claude <noreply@anthropic.com> --- test/py/img/localboot.py | 27 +++++++++++++++++++++++++++ test/py/tests/test_ut.py | 22 +--------------------- 2 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 test/py/img/localboot.py diff --git a/test/py/img/localboot.py b/test/py/img/localboot.py new file mode 100644 index 00000000000..62a65f33cf0 --- /dev/null +++ b/test/py/img/localboot.py @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + +"""Create localboot test disk images""" + +from img.common import setup_extlinux_image + + +def setup_localboot_image(config, log): + """Create a 20MB disk image with a single FAT partition + + Args: + config (ArbitraryAttributeContainer): Configuration + log (multiplexed_log.Logfile): Log to write to + """ + mmc_dev = 9 + + script = '''DEFAULT local + +LABEL local + SAY Doing local boot... + LOCALBOOT 0 +''' + vmlinux = 'vmlinuz' + initrd = 'initrd.img' + setup_extlinux_image(config, log, mmc_dev, 'mmc', vmlinux, initrd, None, + script) \ No newline at end of file diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py index ec4ef1862ae..0acc40ae6aa 100644 --- a/test/py/tests/test_ut.py +++ b/test/py/tests/test_ut.py @@ -26,6 +26,7 @@ from img.chromeos import setup_cros_image from img.android import setup_android_image from img.efi import setup_efi_image from img.cedit import setup_cedit_file +from img.localboot import setup_localboot_image @pytest.mark.buildconfigspec('ut_dm') @@ -64,27 +65,6 @@ def test_ut_dm_init(ubman): fh.write(data) -def setup_localboot_image(config, log): - """Create a 20MB disk image with a single FAT partition - - Args: - config (ArbitraryAttributeContainer): Configuration - log (multiplexed_log.Logfile): Log to write to - """ - mmc_dev = 9 - - script = '''DEFAULT local - -LABEL local - SAY Doing local boot... - LOCALBOOT 0 -''' - vmlinux = 'vmlinuz' - initrd = 'initrd.img' - setup_extlinux_image(config, log, mmc_dev, 'mmc', vmlinux, initrd, None, - script) - - @pytest.mark.buildconfigspec('cmd_bootflow') @pytest.mark.buildconfigspec('sandbox') def test_ut_dm_init_bootstd(u_boot_config, u_boot_log): -- 2.43.0