From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>
Subject: [PATCH v6 18/19] test: Support testing with two board-builds
Date: Fri, 20 Sep 2024 08:01:53 +0200 [thread overview]
Message-ID: <20240920060158.106612-19-sjg@chromium.org> (raw)
In-Reply-To: <20240920060158.106612-1-sjg@chromium.org>
The Beagleplay board uses two entirely separate builds to produce an
image, rather than using an SPL build for this purpose.
Handle this in test.py by adding more parameters.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
(no changes since v5)
Changes in v5:
- Add a patch to support testing with two board-builds
test/py/conftest.py | 36 +++++++++++++++++++++++++++++++-----
1 file changed, 31 insertions(+), 5 deletions(-)
diff --git a/test/py/conftest.py b/test/py/conftest.py
index 9eea65b5929..542c0d53e46 100644
--- a/test/py/conftest.py
+++ b/test/py/conftest.py
@@ -66,12 +66,16 @@ def pytest_addoption(parser):
parser.addoption('--build-dir', default=None,
help='U-Boot build directory (O=)')
+ parser.addoption('--build-dir-extra', default=None,
+ help='U-Boot build directory for extra build (O=)')
parser.addoption('--result-dir', default=None,
help='U-Boot test result/tmp directory')
parser.addoption('--persistent-data-dir', default=None,
help='U-Boot test persistent generated data directory')
parser.addoption('--board-type', '--bd', '-B', default='sandbox',
help='U-Boot board type')
+ parser.addoption('--board-type-extra', '--bde', default='sandbox',
+ help='U-Boot extra board type')
parser.addoption('--board-identity', '--id', default='na',
help='U-Boot board identity/instance')
parser.addoption('--build', default=False, action='store_true',
@@ -129,14 +133,17 @@ def get_details(config):
Returns:
tuple:
str: Board type (U-Boot build name)
+ str: Extra board type (where two U-Boot builds are needed)
str: Identity for the lab board
str: Build directory
+ str: Extra build directory (where two U-Boot builds are needed)
str: Source directory
"""
role = config.getoption('role')
# Get a few provided parameters
build_dir = config.getoption('build_dir')
+ build_dir_extra = config.getoption('build_dir_extra')
if role:
# When using a role, build_dir and build_dir_extra are normally not set,
# since they are picked up from Labgrid via the u-boot-test-getrole
@@ -146,6 +153,8 @@ def get_details(config):
env = os.environ.copy()
if build_dir:
env['U_BOOT_BUILD_DIR'] = build_dir
+ if build_dir_extra:
+ env['U_BOOT_BUILD_DIR_EXTRA'] = build_dir_extra
proc = subprocess.run(cmd, capture_output=True, encoding='utf-8',
env=env)
if proc.returncode:
@@ -159,24 +168,36 @@ def get_details(config):
vals[k] = value
# For debugging
# print('conftest: lab info:', vals)
- board_type, default_build_dir, source_dir = (vals['board'],
- vals['build_dir'], vals['source_dir'])
+
+ # Read the build directories here, in case none were provided in the
+ # command-line arguments
+ (board_type, board_type_extra, default_build_dir,
+ default_build_dir_extra, source_dir) = (vals['board'],
+ vals['board_extra'], vals['build_dir'], vals['build_dir_extra'],
+ vals['source_dir'])
else:
board_type = config.getoption('board_type')
+ board_type_extra = config.getoption('board_type_extra')
board_identity = config.getoption('board_identity')
source_dir = os.path.dirname(os.path.dirname(TEST_PY_DIR))
default_build_dir = source_dir + '/build-' + board_type
+ default_build_dir_extra = source_dir + '/build-' + board_type_extra
+
+ # Use the provided command-line arguments if present, else fall back to
if not build_dir:
build_dir = default_build_dir
+ if not build_dir_extra:
+ build_dir_extra = default_build_dir_extra
- return board_type, board_identity, build_dir, source_dir
+ return (board_type, board_type_extra, board_identity, build_dir,
+ build_dir_extra, source_dir)
def pytest_xdist_setupnodes(config, specs):
"""Clear out any 'done' file from a previous build"""
global build_done_file
- build_dir = get_details(config)[2]
+ build_dir = get_details(config)[3]
build_done_file = Path(build_dir) / 'build.done'
if build_done_file.exists():
@@ -216,7 +237,8 @@ def pytest_configure(config):
global console
global ubconfig
- board_type, board_identity, build_dir, source_dir = get_details(config)
+ (board_type, board_type_extra, board_identity, build_dir, build_dir_extra,
+ source_dir) = get_details(config)
board_type_filename = board_type.replace('-', '_')
board_identity_filename = board_identity.replace('-', '_')
@@ -281,9 +303,11 @@ def pytest_configure(config):
ubconfig.test_py_dir = TEST_PY_DIR
ubconfig.source_dir = source_dir
ubconfig.build_dir = build_dir
+ ubconfig.build_dir_extra = build_dir_extra
ubconfig.result_dir = result_dir
ubconfig.persistent_data_dir = persistent_data_dir
ubconfig.board_type = board_type
+ ubconfig.board_type_extra = board_type_extra
ubconfig.board_identity = board_identity
ubconfig.gdbserver = gdbserver
ubconfig.no_prompt_wait = config.getoption('no_prompt_wait')
@@ -292,10 +316,12 @@ def pytest_configure(config):
env_vars = (
'board_type',
+ 'board_type_extra',
'board_identity',
'source_dir',
'test_py_dir',
'build_dir',
+ 'build_dir_extra',
'result_dir',
'persistent_data_dir',
)
--
2.43.0
next prev parent reply other threads:[~2024-09-20 6:06 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 6:01 [PATCH v6 00/19] labgrid: Provide an integration with Labgrid Simon Glass
2024-09-20 6:01 ` [PATCH v6 01/19] test: Allow signaling that U-Boot is ready Simon Glass
2024-09-23 20:35 ` Tom Rini
2024-09-25 12:49 ` Simon Glass
2024-09-25 17:26 ` Tom Rini
2024-09-26 21:36 ` Simon Glass
2024-09-27 2:51 ` Tom Rini
2024-10-31 18:03 ` Simon Glass
2024-10-31 18:28 ` Tom Rini
2024-11-01 15:33 ` Simon Glass
2024-11-01 19:02 ` Tom Rini
2024-11-02 16:32 ` Simon Glass
2024-11-02 21:39 ` Tom Rini
2024-09-20 6:01 ` [PATCH v6 02/19] test: Use a constant for the test timeout Simon Glass
2024-09-23 20:35 ` Tom Rini
2024-09-20 6:01 ` [PATCH v6 03/19] test: Release board after tests complete Simon Glass
2024-09-20 6:01 ` [PATCH v6 04/19] test: Allow connecting to a running board Simon Glass
2024-09-23 20:35 ` Tom Rini
2024-09-25 12:50 ` Simon Glass
2024-09-20 6:01 ` [PATCH v6 05/19] test: Avoid failing skipped tests Simon Glass
2024-09-20 6:01 ` [PATCH v6 06/19] test: Create a common function to get the config Simon Glass
2024-09-20 6:01 ` [PATCH v6 07/19] test: Introduce the concept of a role Simon Glass
2024-09-20 6:01 ` [PATCH v6 08/19] test: Move the receive code into a function Simon Glass
2024-09-20 6:01 ` [PATCH v6 09/19] test: Separate out the exception handling Simon Glass
2024-09-20 6:01 ` [PATCH v6 10/19] test: Detect dead connections Simon Glass
2024-09-20 6:01 ` [PATCH v6 11/19] test: Tidy up remaining exceptions Simon Glass
2024-09-20 6:01 ` [PATCH v6 12/19] test: Introduce lab mode Simon Glass
2024-09-20 6:01 ` [PATCH v6 13/19] test: Improve handling of sending commands Simon Glass
2024-09-20 6:01 ` [PATCH v6 14/19] test: Fix mulptiplex_log typo Simon Glass
2024-09-20 6:01 ` [PATCH v6 15/19] test: Avoid double echo when starting up Simon Glass
2024-09-20 6:01 ` [PATCH v6 16/19] test: Try to shut down the lab console gracefully Simon Glass
2024-09-20 6:01 ` [PATCH v6 17/19] test: Add a section for closing the connection Simon Glass
2024-09-20 6:01 ` Simon Glass [this message]
2024-09-20 6:01 ` [PATCH v6 19/19] CI: Allow running tests on sjg lab Simon Glass
2024-09-23 20:36 ` [PATCH v6 00/19] labgrid: Provide an integration with Labgrid Tom Rini
2024-09-25 12:50 ` Simon Glass
2024-09-25 17:26 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240920060158.106612-19-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.