TC_START is used to evaluate output of tests and is used internally by
ztest when a test starts, no need to call this manually here.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
TC_START is used to evaluate output of tests and is used internally by
ztest when a test starts, no need to call this manually here.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
TC_START is used to evaluate output of tests and is used internally by
ztest when a test starts, no need to call this manually here.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This is a follow-up to commit 9951971aee.
Align names of "zephyr,psa-crypto-rng" compatible nodes used in tests
(crypto/rand32 and drivers/entropy/api) with those introduced by the
above commit into SoC definitions (nRF5340/nRF9160). This way the test
overlays will overwrite the already existing nodes instead of adding
second instances of them, what leads to build failures at the linking
stage as the related driver supports only single instance (and creates
it for the first node found).
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Use namespacing with extra_configs in some tests and remove duplicated
scenarios the were made arch or platform specifc.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The old random timer test was not random-looking
enough on some platforms.
Replace with new test which is psuedo-xoshiro.
The generator is still deterministic
and does not depend on entropy at all,
but should look more random for testing.
Change name of generator tree-wide also.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Fix all line-length errors detected by yamllint:
yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
grep '(line-length)'
Using a limit is set to 100 columns, not touching the commandlines in
GitHub workflows (at least for now).
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This adds an overlay DT & config to enable the PSA Crypto Random entropy
driver to get random bytes from TFM.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.
The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.
NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
It takes more than 300 seconds to finish the test,
so enlarge the timeout value from 300 to 500(seconds)
Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
Whenever MBEDTLS_BUILTIN is selected then
CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h" is set as a default value.
It is even impossible to change it, as without CUSTOM_MBEDTLS_CFG_FILE it
is just a hidden (not configurable by user) Kconfig option.
Remove explicit configuration from prj.conf.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Whenever MBEDTLS_BUILTIN is selected then
CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h" is set as a default value.
Remove explicit configuration from prj.conf.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This commit introduces a new configuration called
`CONFIG_MINIMAL_LIBC_NON_REENTRANT_FUNCTIONS`, which enables the
traditional non-reentrant (i.e. not thread-safe) version of the C
standard library functions such as rand() and gmtime() when the
respective configs are enabled.
The non-reentrant functions make use of the globals and require an
additional memory partition (MPU region), which is scarce on low-end
devices, when CONFIG_USERSPACE=y.
The purpose of this option is to classify the MPU resource intensive
functions as a separate category and only enable them when there is a
demand for such.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This onse single test with multiple dataset was pretending to be
multiple tests with output that is missing and causing confusion when
results get evaluated for example by twister.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Fix errors like:
inlined from ‘test_mbedtls’ at
zephyrproject/zephyr/tests/crypto/mbedtls/src/mbedtls.c:172:6:
zephyrproject/zephyr/tests/crypto/mbedtls/src/mbedtls.c:96:17: error:
‘test_snprintf’ reading 10 bytes from a region of size 1
[-Werror=stringop-overread]
96 | test_snprintf(1, "", -1) != 0 ||
| ^~~~~~~~~~~~~~~~~~~~~~~~
In GCC >= 11 because `ret_buf` in some calls are shorter literals
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
XCC (based on GCC 4.2) doesn't support some asm constraints used by
tinycrypt, so let's not test tinycrypt under XCC.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
For functions returning nothing, there is no need to document
with @return, as Doxgen complains about "documented empty
return type of ...".
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This platform is slow on some tests and times out on non-hardware
related tests, so exclude it or increase timeout for some of the tests
to avoid false negatives in the test results due to timeouts.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This changes both k_mem_domain_add_partition() and
k_mem_domain_remove_partition() to return errors instead of
asserting when errors are encountered. This gives the application
chance to recover.
The arch_mem_domain_parition_add()/_remove() will be modified
later together with all the other arch_mem_domain_*() changes
since the architecture code for partition addition and removal
functions usually cannot be separately changed.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Apply the modifications required by the newer library version.
These modifications came from the original file in the mbedTLS
repository.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Move to CMake 3.20.0.
At the Toolchain WG it was decided to move to CMake 3.20.0.
The main reason for increasing CMake version is better toolchain
support.
Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Deprecate the xoroshiro128+ PRNG algorithm in favour of xoshiro128++.
xoshiro128++ is a drop-in replacement which is invisible from the user
perspective.
xoroshiro128+ is unsuitable because it is explicitly a floating-point
PRNG, not a general-purpose PRNG. This means that the lower 4 bits of
the output are actually linear, not random (from the designers,
https://prng.di.unimi.it/). This means 1/8th of the generated data is
not random.
Additionally, xoroshiro128+ is not a 32bit algorithm, it operates on
64bit numbers. For the vast majority of Zephyr devices, this makes the
PRNG slower than it needs to be. The replacement (xoshiro128++) is
32bit, with no loss in state space (still 128 bit).
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
When MBEDTLS_RSA_C is defined, mbedtls define its local version of
rand() function. Since we already have rand() in our minimal libc, we
can safely remove this.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
For z_early_boot_rand_get(), give a length less than uint32 to be input
value, ensure the API can work normally with error condition to improve
code coverage.
Signed-off-by: Jian Kang <jianx.kang@intel.com>
This platform has a tiny handful of remaining tests that fail. We
will track them as issues, but let's exclude them from integration
testing to allow full runs to complete. Often a hung device in one
test will break an entire twister run.
Tests with known (and tracked) failures:
samples/application_development/external_lib
samples/posix/eventfd
samples/userspace/hello_world_user
tests/kernel/fatal/message_capture
tests/net/socket/socketpair
tests/portability/cmsis_rtos_v2
These tests never fail in isolated testing, but are reliable timeouts
when run in sequence in a big twister run. It's possible that the bug
here may be in twister or the flash/serial scripts:
tests/crypto/tinycrypt
tests/subsys/logging/log_immediate
tests/subsys/logging/log_output
See: #32836
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Even though ARC QEMU has received advanced multiplication
instructions support recently the ARC QEMU in the latest
Zephyr SDK still misses them, so tinycrypt may execute
too long and reach timeout in case of execution on
slow host.
Disable tinycrypt for ARC QEMU platforms till we update
ARC QEMU in Zephyr SDK.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
The testcase allocates lots of stack space, many KiB, for RISC-V
64-bit in the mbedtls bignum functions.
Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
MEC1501 SoC has 256KB of SRAM, but it is split into 224/32KB
for code and data, as each partition is optimized for
the access pattern. There the DTS only specifies 32KB as
data ram. The tinycrypt_hmac_prng test requires 40KB for
ztest stack. This obviously won't fit so exclude the boards
based on MEC1501 from the test.
Fixes#27572
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Unit tests were failing to build because random header was included by
kernel_includes.h. The problem is that rand32.h includes a generated
file that is either not generated or not included when building unit
tests. Also, it is better to limit the scope of this file to where it is
used.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
... because it is (required).
This makes a difference when building with CMake and forgetting
ZEPHYR_BASE or not registering Zephyr in the CMake package registry.
In this particular case, REQUIRED turns this harmless looking log
statement:
-- Could NOT find Zephyr (missing: Zephyr_DIR)
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- ...
-- ...
-- ...
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:8 (target_sources):
Cannot specify sources for target "app" which is not built by
this project.
... into this louder, clearer, faster and (last but not least) final
error:
CMake Error at CMakeLists.txt:5 (find_package):
Could not find a package configuration file provided by "Zephyr" with
any of the following names:
ZephyrConfig.cmake
zephyr-config.cmake
Add the installation prefix of "Zephyr" to CMAKE_PREFIX_PATH or set
"Zephyr_DIR" to a directory containing one of the above files. If
"Zephyr" provides a separate development package or SDK, be sure it
has been installed.
-- Configuring incomplete, errors occurred!
Signed-off-by: Marc Herbert <marc.herbert@intel.com>