
From: Simon Glass <sjg@chromium.org> Move setup_cedit_file() to its own module. Signed-off-by: Simon Glass <sjg@chromium.org> Co-authored-by: Claude <noreply@anthropic.com> --- test/py/img/cedit.py | 25 +++++++++++++++++++++++++ test/py/tests/test_ut.py | 17 +---------------- 2 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 test/py/img/cedit.py diff --git a/test/py/img/cedit.py b/test/py/img/cedit.py new file mode 100644 index 00000000000..dd6c5de44bb --- /dev/null +++ b/test/py/img/cedit.py @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + +"""Create configuration editor test files""" + +import os + +import utils + + +def setup_cedit_file(config, log): + """Set up a .dtb file for use with testing expo and configuration editor + + Args: + config (ArbitraryAttributeContainer): Configuration + log (multiplexed_log.Logfile): Log to write to + """ + infname = os.path.join(config.source_dir, + 'test/boot/files/expo_layout.dts') + inhname = os.path.join(config.source_dir, + 'test/boot/files/expo_ids.h') + expo_tool = os.path.join(config.source_dir, 'tools/expo.py') + outfname = 'cedit.dtb' + utils.run_and_log_no_ubman( + log, f'{expo_tool} -e {inhname} -l {infname} -o {outfname}') \ No newline at end of file diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py index bb3417ad761..ec4ef1862ae 100644 --- a/test/py/tests/test_ut.py +++ b/test/py/tests/test_ut.py @@ -25,24 +25,9 @@ from img.armbian import setup_bootmenu_image 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 -def setup_cedit_file(config, log): - """Set up a .dtb file for use with testing expo and configuration editor - - Args: - config (ArbitraryAttributeContainer): Configuration - log (multiplexed_log.Logfile): Log to write to - """ - infname = os.path.join(config.source_dir, - 'test/boot/files/expo_layout.dts') - inhname = os.path.join(config.source_dir, - 'test/boot/files/expo_ids.h') - expo_tool = os.path.join(config.source_dir, 'tools/expo.py') - outfname = 'cedit.dtb' - utils.run_and_log_no_ubman( - log, f'{expo_tool} -e {inhname} -l {infname} -o {outfname}') - @pytest.mark.buildconfigspec('ut_dm') def test_ut_dm_init(ubman): """Initialize data for ut dm tests.""" -- 2.43.0