Commit Graph

2671 Commits

Author SHA1 Message Date
Anas Nashif 74f4891a8f requirements: add anytree
Needed now by both ram and rom report targets.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-14 18:49:26 -04:00
Anas Nashif 239d175eff scripts: size_report: fix path prepending
Fixes potential issue on windows.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-14 18:49:26 -04:00
Anas Nashif ac215a570c size_report: use anytree
Use anytree module to display tree and to allow easy exporting into
json.
Add option to export results into a json file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-14 18:49:26 -04:00
Øyvind Rønningstad 6cc7ea51e4 nrfjprog.py: Allow passing a glob to --snr
You can now do --snr 6*1* to achieve the same as --snr 683010000

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-08-14 13:32:36 +02:00
Øyvind Rønningstad 3b595ebd3e nrfjprog.py: Small refactor of get_board_snr()
Move some functionality out into separate functions for clarity.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-08-14 13:32:36 +02:00
Wayne Ren 938642cf7f scripts: add the support of DW_AT_count for array type
In DWARF 4, e.g. ARC Metaware toolchain, DW_AT_count is
used not DW_AT_upper_bound. We should consider this corner
case.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-08-14 13:30:41 +02:00
Anas Nashif d548a890b8 ci: do not run sanitycheck on MAINTAINERS.yml changes
Skip sanitycheck if we are only changing MAINTAINERS.yml

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-13 17:03:47 +02:00
Kumar Gala cfc54f38be sanitycheck: set selected_plaforms for --test-only
When running with --test-only we get:

Traceback (most recent call last):
  File "./scripts/sanitycheck", line 1168, in <module>
    main()
  File "./scripts/sanitycheck", line 1160, in main
    options.only_failed)
  File "scripts/sanity_chk/sanitylib.py", line 2543, in save_reports
    self.xunit_report(filename + ".xml", full_report=False, append=only_failed)
  File "scripts/sanity_chk/sanitylib.py", line 3220, in xunit_report
    return fails, passes, errors, skips
UnboundLocalError: local variable 'fails' referenced before assignment

This is due to the fact that selected_platforms was not set.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-08-13 07:45:17 -05:00
Christian Taedcke b2be804421 sanitycheck: Fix xml testsuite attribute skipped
In the junit output the attribute containing the number of skipped tests
must be named "skipped" instead of "skip".
See e.g. https://github.com/junit-team/junit5/blob/main/platform-tests/
src/test/resources/jenkins-junit.xsd#L95

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-08-13 11:51:19 +02:00
Wenbo Yang 999290278e hardening: Deal with empty lines in csv file
The extra empty line broke the "ninja hardenconfig" on my machine with
Python 3.7.5, it complains:

"
... ...
File "/home/zephyrproject/zephyr/scripts/kconfig/hardenconfig.py",
line 46, in compare_with_hardened_conf

name = row[0]
IndexError: list index out of range
FAILED: CMakeFiles/hardenconfig
"

The csv.reader reads this empty line and gets an empty list which will
not be successfully "de-referenced". Adding extra check to skip the
empty lines.

Signed-off-by: Wenbo Yang <wenbo.yangcn@gmail.com>
2020-08-12 16:43:18 -04:00
Peter Bigot 78f36fa534 python3: add check_compliance package requirements
Running check_compliance on a PR before submitting it can avert
embarrassing mistakes.  Ensure the packages needed to do so are
installed along with all the others.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-08-11 14:49:48 -04:00
Marcin Niestroj 2652dc71a3 sanitycheck: fix --coverage-tool gcovr
Currently '--coverage-tool gcovr' results in using lcov. Fix that to use
gcovr, as requested by user.

Fixes: f6462a3a8c ("sanitycheck: get rid of global VERBOSE")
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-08-11 08:36:39 -04:00
Maciej Perkowski e3ff4cfcd6 sanitycheck: tests: Fill results for skipped tests
Sanitycheck discards test instances if a set of given coditions
is not fulfilled. This leads to empty test results for these
instances. This can introduce ambiguity with results that are
missing due to some bugs in the framework. This commit fills
the results for skipped tests with 'skipped' states and provides
the reason for filtering them out in the msg field. The commit
also fixes the way sanitycheck counts and reports tests/test cases

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-08-06 11:49:39 +02:00
Torsten Rasmussen 25d57ba5af modules: adding support for ROOTs definitions in zephyr/module.yml
Fixes: #25215

This commit introduces the possibility of defining ROOTs in a Zephyr
module and have it automatically appended to list of other ROOTs.
Supported with this commit:
- BOARD_ROOT
- SOC_ROOT
- DTS_ROOT
- ARCH_ROOT

In order to support this in Zephyr module files, the detection of west
has been moved to dedicated west.cmake file and included immediately
after python.cmake.

Also the inclusion of zephyr_modules.cmake has moved before first use
of BOARD_ROOT.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-05 08:06:07 -04:00
Torsten Rasmussen 5f7cc8ded9 cmake: kconfig: support for multiple SOC_ROOT
This commit introduces support for multiple SOC_ROOT.

This means that additional SOC_ROOTs specified using -DSOC_ROOT as
argument to CMake will be forming a list together with ${ZEPHYR_BASE}.

This allows for greater flexibility, as developers can now specify
multiple out-of-tree SoCs and not worry about the SoC used for the
board they compile for.

Also it avoid code, such as:
if(BOARD STREQUAL my_board_using_out_of_tree_soc)
  set(SOC_ROOT some/out/of/tree/soc/path)
endif()
in application CMakeLists.txt.

Finally, allowing multiple SOC_ROOTs prepares for specifying SOC_ROOTs
in Zephyr modules.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-05 08:06:07 -04:00
Øyvind Rønningstad f72aef15d2 sanitycheck: Make --hardware-map and --west-flash together
When passing a using --hardware-map, sanitycheck would ignore extra
args passed via --west-flash, such as --west-flash="--erase".

This is because the command with the extra args was overwritten by the
command with the runner info from the hardware map.

This patch merges those code paths so they are aware of each other and
of --west-runner.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-08-03 20:40:50 -04:00
Maciej Perkowski e7f4074799 sanitycheck: Modify expected_subcases
Before sanitycehck was removing all `test_` chars in test cases'
names. This test has to be modify to work with the improved behavior

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-08-03 19:46:15 -04:00
Maciej Perkowski 034d4f2156 sanitycheck: Fix test cases names
This commit limits the removal of `test_` from test case name
to only the first occurance. There are test cases with `test_`
also in the middle of their names and removing it couses mismatches
between extracted testcases and the names obtained when passing

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-08-03 19:46:15 -04:00
Andrei Emeltchenko fb44188ebb west: sign: Move imgtool specific docs to appropriate place
Move documentation specific to imgtool to appropriate place.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-08-03 13:49:17 +02:00
Andrei Emeltchenko 51182ab881 west: sign: Add rimage signing tool documentation
Add documentation specific to rimage signing tool.

Fixes #26596

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-08-03 13:49:17 +02:00
Andrew Boie 8ce260d8df kernel: introduce supervisor-only stacks
These stacks are appropriate for threads that run purely in
supervisor mode, and also as stacks for interrupt and exception
handling.

Two new arch defines are introduced:

- ARCH_KERNEL_STACK_GUARD_SIZE
- ARCH_KERNEL_STACK_OBJ_ALIGN

New public declaration macros:

- K_KERNEL_STACK_RESERVED
- K_KERNEL_STACK_EXTERN
- K_KERNEL_STACK_DEFINE
- K_KERNEL_STACK_ARRAY_DEFINE
- K_KERNEL_STACK_MEMBER
- K_KERNEL_STACK_SIZEOF

If user mode is not enabled, K_KERNEL_STACK_* and K_THREAD_STACK_*
are equivalent.

Separately generated privilege elevation stacks are now declared
like kernel stacks, removing the need for K_PRIVILEGE_STACK_ALIGN.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-07-30 21:11:14 -04:00
Kumar Gala 33056e48c5 ci: make test_file.txt a build artifact for debug
Rather that echo'ng the test_file.txt to the console, lets just upload
it as a buildkite artifact.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-07-30 11:25:25 -04:00
Maciej Perkowski 732ab5311d doc: Fix path to requirements
Fix path to requirements

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-07-30 16:40:29 +02:00
Anas Nashif 555fc6dbd5 sanitycheck: fix only_tags usage
We have been doing an AND comparison instead of an OR. AND does exclude
way to many testcases where multiple tags are being used.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-30 10:30:23 -04:00
Anas Nashif 314b8af797 ci: enable sanitycheck for integration
Enable sample for integration.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-30 08:00:03 -04:00
Anas Nashif 1636c316d9 sanitycheck: introduce integration testing
Use --integration testing for CI to limit execution and builds on
platforms that actually provide most of the coverage instead of blindly
building/running on all available platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-30 08:00:03 -04:00
Anas Nashif 1bf1d19a42 sanitycheck: realign schema
Just a cleanup and alignment of the yaml file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-30 08:00:03 -04:00
Simon Guinot 2dad0b4500 scripts/requirements: add lpc_checksum script
On some NXP LPC MCUs (such as LPC11U6x), a valid firmware image must
include a checksum in the 7th entry of the ARM Cortex-M0 exception
vector table. This checksum is verified by the bootloader.

The lpc_checksum.py python script allows to insert this checksum into
the firmware images (BIN and HEX formats).

Project page: https://github.com/basilfx/lpc_checksum

Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
2020-07-29 20:12:24 +02:00
Jukka Rissanen bfa08cd04d userspace: Make network interface a kernel object
Make net_if a kernel object with type K_OBJ_NET_IF so that we
can restrict access to it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-07-29 08:13:22 -04:00
Anas Nashif f8c024a22f sanitycheck: remove verbose log message
This was added for debugging and was left in the script by mistake.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-27 19:03:10 +02:00
Anas Nashif 1c2f127e3f sanitycheck: do not duplicate code in tests
Fixed tests to use library code instead of duplicating logic in the test
itself.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-27 11:58:32 +02:00
Anas Nashif 9e1be4c05e sanitycheck: do not expect results from build_only instances
instances that do not run will have no results (beside the fact they
built successfully), so log those as such.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-27 11:58:32 +02:00
Martí Bolívar 469f53c210 scripts: sanitycheck: import edtlib
This is a cargo-culted attempt to make an error observed in poorly
understood CI circumstances go away when loading edt.pickle, by making
edtlib visible in sys.modules before loading the pickle file.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-24 17:58:03 -04:00
Wentong Wu 517633c101 scripts: sanitylib.py: add exception check for psutil
Add exception check for psutil when running CI with QEMU.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-07-24 14:26:33 -04:00
Anas Nashif 8d8875b752 scripts: add maintainer script
Adding the get_maintainer.py script

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-07-24 17:07:48 +02:00
Kumar Gala feeda05323 ci: Add a debug out of what tests we are going to build
Add a cat of the test_file.txt so we can see exactly what tests are
expected to be built and run.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-07-24 12:10:15 +02:00
Martí Bolívar 9861e5d22a sanitylib: log test exception tracebacks
This aids in debugging.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-23 13:36:22 -05:00
Martí Bolívar 9c92baa73f devicetree: use edt.pickle more
Consolidate creation of edtlib.EDT objects from a build directory's
devicetree into one place by loading it from build/zephyr/edt.pickle
everywhere. A previous commit creates edt.pickle from gen_defines.py.

In addition to probably speeding things up slightly by not reparsing
the devicetree, the main benefit of this approach is creating a single
point of truth for the bindings directories and warnings
configuration, meaning we don't have to worry about them getting out
of sync while being passed around between devicetree creation and
usage time.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-23 09:19:45 -05:00
Jan Van Winkel 716eea0b65 scripts: Increased minimal pyelftools version
Increased minimal pyelftools version to 0.26 else
scripts/footprint/size_report will fail to import LocationExpr from
elftools.dwarf.locationlists

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-07-23 07:49:35 -04:00
Martí Bolívar 006319f043 scripts: kconfigfunctions: add a comment
I can never remember what the contents of the kconfigfunctions dict is
and have to look it up every time. I suspect I'm not alone, and not
everyone who uses these will know how to look up the answer. Add a
comment explaining the value.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-23 11:00:39 +02:00
Martí Bolívar 24677f93bc kconfig: add dt_path_enabled, dt_alias_enabled
There is already a way to check if a node is enabled based on its node
label, but we don't have an equivalent way to do that for a path or an
alias. Add them. These rely on the same underlying edtlib machinery to
get their jobs done, but are being treated differently within Kconfig
in order to match distinctions between paths and aliases made in the
devicetree.h API.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-23 11:00:39 +02:00
Luiz Augusto von Dentz 75f47a56b5 Bluetooth: Add config option to disable security checks
This adds CONFIG_BT_CONN_DISABLE_SECURITY which can be used to disable
security checks for incoming requests enabling to test accessing GATT
attributes and L2CAP channels that would otherwise require
encryption/authentication in order to be accessed.

It depends on BT_TESTING to indicate to the users that this is a
testing feature which shall not be used in production.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-07-23 11:00:04 +02:00
Maureen Helm 8c7cef6da0 runners: Implement --erase option in pyocd runner
Implements the common runner option to mass erase before flashing in the
pyocd runner.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-23 10:30:47 +02:00
Anas Nashif e47866c530 sanitycheck: fix --device-testing without serial-pty
serial-pty is an extension that is not supported in the hardware map, so
we need to work around the fact that it is not part of the map when
dealing with normal serial.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-22 16:57:14 -05:00
Andrei Emeltchenko d8b845be4e sanitycheck: Add serial_pty script command line option
Add option to provide to sanitycheck argument for creating
pseudoterminal. Used with hardware without serial console connected.
A pseudoterminal is used to make a sanitycheck believe that it
interacts with a terminal although it actually interacts with the
script.

E.g "sanitycheck --device-testing --device-serial-pty <script>"

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-07-21 20:19:33 -04:00
Anas Nashif e8e367ada4 sanitycheck: support only_tags for boards
Support running/building only specific tags and ignoring everything
else.

Adding this to a platform yaml file will enable tests with one of of
tags listed to be executed on the platform.

This is useful for special platform configurations used for testing
specific features for example.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-20 17:44:16 -04:00
Ruslan Mstoi 6f26ca0b60 scripts: tests: Add tests for subfolder_list.py
This commit implements tests of subfolder_list.py

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-07-20 17:31:53 -04:00
Ruslan Mstoi ab20641054 scripts: subfolder_list.py: refactor the code
Refactor subfolder_list.py to enable unit testing. This means split the
implementation into separate logical functions. Additionally, modify the
code to improve PEP 8 compatibility and pylint result.

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-07-20 17:31:53 -04:00
Carles Cufi 02dea9279b scripts: modules: Fix initialization of variable
The projects variable needs to be initialized with the list of modules
provided via cmd-line arguments.

This is a regression introduced by
ef3c5e5516.

Fixes #26948.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-07-20 22:39:09 +02:00
Anas Nashif 5092541e2b sanitycheck: disable erroring on warnings
--warnings-as-errors was basically doing nothing, it is the default.
Replace this with an option to disable erroring on warning:

 -W, --disable-warnings-as-errors

Fixes #26910

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-17 13:03:36 -05:00