Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nrf5340bsim bsim tests: Use hwmv2 board names #70564

Merged
merged 21 commits into from
Mar 25, 2024

Conversation

aescolar
Copy link
Member

@aescolar aescolar commented Mar 21, 2024

As continuation to #70435
Switch to using the hwmv2 board names in the bsim tests,
both in the scripts themselves and from the CI workflow which invokes them.

As to be able to do this, it was necessary to ensure the test scripts could use the appropriate variables instead of having set their own board targets, some cleanup was necessary in quite many of them.
This includes (for the scripts I needed to modify anyhow):

  • Removal of lots of duplicate/old crud and some cleanup in the test and build scripts
  • Fixing of bitrotten _compile/_build scripts which were left by some developers for their convenience.
  • Many timeouts which were just matching the default, or unnecessarily too small, were removed
  • A couple of test scripts which were running tests in series without need have been split, so the batcher can parallelize them.
  • Tests scripts are now in test[s]_scripts/ folders (which is the convention)

As a bonus:

  • The common sh scripts now handle a bit more of the common needs which was spread as boilerplate
  • => The amount of boilerplate in the compile.sh scripts has been reduced to a minimum.
  • The tests/bsim/bluetooth/host/l2cap/stress test is more silent now
  • 3 tests real time timeouts have been increased as they were a bit too short for the current CI runners

Note: This will be followed up with a PR removing support for the nrf5340bsim old hwmv1 board names

This test was way too verbose (produced a log over 65000 lines
long).
Let's mute it a bit. If the test fails, developers
can raise the log level as needed.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
As now, with hwmv2, boards can have "/" in their name,
and the board name is not anymore the complete target
name, let's set a new variable with the
whole board target name, but converted into the format
which can be used in paths.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Some developers want to programmatically get the
test name instead of hardcoding it.
So let's have a common function for this.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Ensure we call the common source script before using
the BOARD variable;
Use the common scripts to perform common functions
and do a cleanup.
Do not set variables to their defaults, set things
closer to were they are needed;
Do not perform unnecesary checks;
And in general avoid unnecessary complexity.

Also, remove all timeouts which were unnecessarily too short

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the common scripts so we have a consitent way of
running the tests, report failures in the same way,
can stop them with ctrl+C, properly wait for
all processes to exit..
Let's also place the test scripts in the test_scripts/
folder as it is convention.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>

(f) ests/bsim bt att:  Use common s
Ensure we call the common source script before using
the BOARD variable, and let's not set things
which are already set to the same by default

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the common scripts and do a minor cleanup

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the common scripts to perform common functions
and do a cleanup.
Do not set variables to their defaults, set things
closer to were they are needed;
Do not perform unnecesary checks;
And in general avoid unnecessary complexity.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Ensure we call the common source script before using
the BOARD variable;
Use the common scripts to perform common functions
and do a cleanup.
Do not set variables to their defaults, set things
closer to were they are needed;
Do not perform unnecesary checks;
And in general avoid unnecessary complexity.

And return !=0 on error.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Ensure we call the common source script before using
the BOARD variable;
Use the common scripts to perform common functions
and do a cleanup.
Do not set variables to their defaults, set things
closer to were they are needed;
Do not perform unnecesary checks;
And in general avoid unnecessary complexity.

And for the 2 parts of the peripheral rpa sharing
test, use different sim_ids, so the traces for each
part can be checked.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the common scripts to perform common functions
and do a cleanup.
Do not set variables to their defaults, set things
closer to were they are needed;
Do not perform unnecesary checks;
And in general avoid unnecessary complexity.

Some of the _compile scripts were rotten => Fix them.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the common scripts to perform common functions
and do a cleanup.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the common scripts to perform common functions
and do a cleanup.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the common functions instead of
replicating functionality and do a minor cleanup

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the common functions instead of
replicating functionality and do a minor cleanup

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the common functions instead of replicating functionality

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
In all scripts, where we were using the BOARD variable
let's use BOARD_TS which is the full BOARD target string
with "/" replaced with "_"
This is neccessary to support hwmv2 board names

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the hwmv2 board names instead of the hwmv1 ones.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Provide a common check for BSIM_COMPONENTS_PATH
and a default WORK_DIR
So we avoid boilerplate in other scripts

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Remove the boilerplate which is not necessary beacuse
it is already provided by the common scripts

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Refer to the nrf5340 bsim boards by their hwmv2 name.
As a bonus remove a few variable settings
which match the defaults from the scripts.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
@aescolar aescolar changed the title nrf5340bsim bsim tests: Use to hwmv2 board names nrf5340bsim bsim tests: Use hwmv2 board names Mar 21, 2024
aescolar added a commit to aescolar/zephyr that referenced this pull request Mar 21, 2024
After zephyrproject-rtos#70438
got merged simultaneously with
zephyrproject-rtos#70564
all these tests stopped building properly due to the
change of avaliable variables in Kconfig & cmake.
Let's fix them.
As a bonus, as for kconfig the BOARD_TARGET_STRING is the
same for the hwmv1 backwards compatible name, let's
just remove the check for the old names.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
aescolar added a commit to aescolar/zephyr that referenced this pull request Mar 21, 2024
After zephyrproject-rtos#70438
got merged simultaneously with
zephyrproject-rtos#70564
all these tests stopped building properly due to the
change of avaliable variables in Kconfig & cmake.
Let's fix them.
As a bonus, as for kconfig the BOARD_TARGET_STRING is the
same for the hwmv1 backwards compatible name, let's
just remove the check for the old names.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
aescolar added a commit that referenced this pull request Mar 21, 2024
After #70438
got merged simultaneously with
#70564
all these tests stopped building properly due to the
change of avaliable variables in Kconfig & cmake.
Let's fix them.
As a bonus, as for kconfig the BOARD_TARGET_STRING is the
same for the hwmv1 backwards compatible name, let's
just remove the check for the old names.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
selescop pushed a commit to selescop/zephyr that referenced this pull request Mar 22, 2024
After zephyrproject-rtos#70438
got merged simultaneously with
zephyrproject-rtos#70564
all these tests stopped building properly due to the
change of avaliable variables in Kconfig & cmake.
Let's fix them.
As a bonus, as for kconfig the BOARD_TARGET_STRING is the
same for the hwmv1 backwards compatible name, let's
just remove the check for the old names.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
@aescolar aescolar merged commit 5ab2635 into zephyrproject-rtos:main Mar 25, 2024
39 checks passed
@aescolar aescolar deleted the nrf53bsim_tests_bsim branch March 25, 2024 15:19
coreboot-org-bot pushed a commit to coreboot/zephyr-cros that referenced this pull request Mar 29, 2024
After zephyrproject-rtos/zephyr#70438
got merged simultaneously with
zephyrproject-rtos/zephyr#70564
all these tests stopped building properly due to the
change of avaliable variables in Kconfig & cmake.
Let's fix them.
As a bonus, as for kconfig the BOARD_TARGET_STRING is the
same for the hwmv1 backwards compatible name, let's
just remove the check for the old names.

(cherry picked from commit f336026)

Original-Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
GitOrigin-RevId: f336026
Change-Id: Iba45a96a3f1ee7dce257f719eb5c7f74b597f314
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5387784
Tested-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants