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

tests: gdbstub: simple test #63672

Merged
merged 6 commits into from
Oct 20, 2023

Conversation

golowanow
Copy link
Member

@golowanow golowanow commented Oct 8, 2023

Gdbstub test with Twister pytest plugin:

  • clone samples/subsys/debug/gdbstub to tests and convert it back to a build-only sample aligned with documentation.
  • some improvements with pytest fixtures, parametrization, and expected pattern matching on outputs from GDB and the test application.

as suggested at #63472 (review)
and follows #63061

Copy link
Member

@nashif nashif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good overall, just a few comments and clarifying questions.

samples/subsys/debug/gdbstub/sample.yaml Outdated Show resolved Hide resolved
tests/subsys/debug/gdbstub/testcase.yaml Outdated Show resolved Hide resolved
tests/subsys/debug/gdbstub/testcase.yaml Outdated Show resolved Hide resolved
tests/subsys/debug/gdbstub/prj.conf Show resolved Hide resolved
tests/subsys/debug/gdbstub/testcase.yaml Show resolved Hide resolved
@nashif
Copy link
Member

nashif commented Oct 12, 2023

@gchwier @gopiotr @PerMac please review

gchwier
gchwier previously approved these changes Oct 13, 2023
Clone samples/subsys/debug/gdbstub to tests and convert it back
to a build-only sample aligned with documentation.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Gdbstub test improvements: using pytest fixtures, parametrization, and
expected pattern matching on outputs from GDB and the test application.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Add QEMU_EXTRA_FLAGS as QEMU board config option.

This allows Twister tests to provide additional device setup
commands to QEMU in prj.conf or testcase.yaml configuration files.

Example use case: to setup TCP or UDP network interfaces
with non-conflicting port numbers in different test suites
to avoid conflicts when Twister run tests in parallel on the
same host.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Add `gdb_target_remote` test parameter for GDB `target remote`
command instead of its hardcoded value to allow different types
of gdbstub serial interfaces as well as different TCP ports in
gdbstub test suites possibly run in parallel on the same host.

Move all GDB log configuration parameters from GDB script to
the fixture code.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Add a testcase to run the same test application and GDB script
which we use for Zephyr GDB stub testing, but now with
the GDB stub enabled at QEMU itself using it as a reference
RDP backend implementation. This allows to check the Zephyr's
gdbstub implementation has similar behavior as the reference.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Remove gdbstub sample (samples/subsys/debug/gdbstub) as duplicated
by a test (tests/subsys/debug/gdbstub).

Update the GDB stub documentation.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
@golowanow
Copy link
Member Author

looks good overall, just a few comments and clarifying questions.

@nashif could you please look again after the changes done here.

@fabiobaltieri fabiobaltieri added this to the v3.6.0 milestone Oct 19, 2023
@carlescufi carlescufi merged commit c8d6a62 into zephyrproject-rtos:main Oct 20, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants