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

[RFC] Run bsim tests with twister #85610

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

ardo-nordic
Copy link
Contributor

Bsim harness in twister has been modified to be able to run tests. The main changes it entailed are as following:

  • For bsim tests, compile/build stage needs to be done before tests are run, that requires rearranging tasks in twister pipeline
  • Several bsim harness parameters added (optional), as well as option to specify common part of the harness config
  • To avoid unnecessary recompiling of tests, in some test suites there are build-only tests that prepare required binaries, and test only ('no_build' option) tests which rely on other build tests to prepare binaries
  • All shell scripts that were used to run the tests are no longer needed

Atm, only host is extensively using bsim harness, and thus is the only one affected.

@aescolar
Copy link
Member

aescolar commented Feb 11, 2025

I'm quite surprised by this PR. Not just because it appeared quite out of the blue for me, but also because there has been quite related work by others (CC @gchwier ) in these area this overlaps with:

We have had this want for very long, but so far we have not succeeded. So instead of doing the same we have done in previous PRs where we discussed some details and ended up spending time polishing something which was rejected on principal issues, I would suggest we have a talk about it between the more involved and relevant people, try to reach an agreement on the principal, and if we do, then look at the particular details.

@ardo-nordic ardo-nordic force-pushed the run_bsim_with_twister branch 2 times, most recently from 87f98dd to 8f1a143 Compare February 14, 2025 10:01
@aescolar aescolar added this to the v4.2.0 milestone Feb 14, 2025
@aescolar
Copy link
Member

I just added the 4.2 milestone, as freeze for 4.1 is today, and this is neither ready not urgent. So to make it clear this is not trying to get into this release.

@Thalley
Copy link
Collaborator

Thalley commented Feb 14, 2025

@ardo-nordic next time consider opening such PRs as draft until they pass CI to avoid unnecessary noise for reviewers :)

@ardo-nordic ardo-nordic marked this pull request as draft February 14, 2025 10:46
@ardo-nordic ardo-nordic force-pushed the run_bsim_with_twister branch 2 times, most recently from f747a95 to dcd499b Compare February 18, 2025 13:12
@ardo-nordic ardo-nordic force-pushed the run_bsim_with_twister branch from dcd499b to 7c288b6 Compare February 18, 2025 13:35
Bsim harness now can also be used to run tests.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
BSIM tests might be reusing the same binary files, so it makes
sense to be able to split tests into build-only, which will
only build and copy executable files, and run only, which will
run them whenever needed. This requires more sequential pipeline
to avoid race conitions.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
Adding functionality to split harness_config into common and test-case
specific part, which are joined together for any given test.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
Adding Bsim phy-specific options to harness config. Clean up leftover log
files. Adding option to expand extra args with individual values for
different simulated devices. Adding random seed value to every sim device.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
Changing bsim_exe_name values to a list due to respective schema changes.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
Adding necessary changes to testcase.yaml files in all Bsim host tests
to make them directly runnable by twister's bsim harness.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
Shell scripts are no longer needed since twister can be used to build
and run host bsim tests.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
Increasing test timeouts for better margins. Removing missed obsolete
shell running files.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
Chaning timeouts in testcase.yaml files to be the same as they were
in the shell running scripts.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
Fixing minor compliance errors and issues popping up after rebase.
Fixing unit tests.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
@ardo-nordic ardo-nordic force-pushed the run_bsim_with_twister branch 3 times, most recently from ed01c65 to 2b022cb Compare February 19, 2025 13:46
With added support of running bsim tests with Twister, separate
building command is no longer need as tests can be build and
run with single command.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
@ardo-nordic ardo-nordic force-pushed the run_bsim_with_twister branch from 2b022cb to b1be69e Compare February 19, 2025 13:59
@ardo-nordic ardo-nordic marked this pull request as ready for review February 19, 2025 16:56
@ardo-nordic ardo-nordic changed the title Run bsim tests with twister [RFC] Run bsim tests with twister Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Controller area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth area: Twister Twister platform: nRF BSIM Nordic Semiconductors, nRF BabbleSim
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants