This test is already flaky, but becomes even flakier when
coverage is enabled.
Disable until we put a stake through the QEMU timing issues
being worked on in #14173.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The test_timer_periodicity waits for first timer expiration
in order to extract timer firing time. The wait is performed
using k_timer_status_sync() API call, which blocks thread
until timer expiration. However if the timer expired before
call the this function, it will return immediately, triggering
test failure.
This commit adds the second call to the k_timer_status_sync()
to ensure that the following part of the test will be executed
as soon as possible after timer expiration.
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
Per guidelines, all statements should have braces around them. We do not
have a CI check for this, so a few went in unnoticed.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
With pull request #16208 and #16404 hooks for calling user defined
code was implemented. These user extensions are gated by a number of
Kconfigs. The test in this pull request tests that code compiles when
these Kconfigs are enabled.
Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
The file descriptor was not closed after the test which caused
Coverity to complain about resource leak.
Coverity-CID: 198640
Fixes#16493
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Contrary to the comment in code, this test is NOT, in fact, compiled
with a traditional ticked kernel. Spinning won't work reliably
because interrupts won't necessarily be delivered when you expect.
This test case would fail spuriously as I moved things around when
debugging.
Doing it right (using a k_timer in this case) is actually less code
anyway.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
It's useful to be able to inspect the key returned from
z_arch_irq_unlock() to see if interrupts were enabled at the point
where z_arch_irq_lock() was called. Architectures tend to represent
this is a simple way that doesn't require platform assembly to
inspect.
Adds a simple test to kernel/common that validates this predicate with
a nested lock.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit changes zassert_mem_equal as a macro instead
of a function implementation.
In the previous implementation when an assertion fails
the location inside ztest_assert.h file was displayed.
This modification displays the location where zassert_mem_equal
was used.
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
Casting the tid variable from a void* into an u32_t just to cast it
back to a pointer is pointless. Let's make it a osThreadId variable
upfront and get rid of those casts around it. This also makes it
64-bit compatible.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Use a system clock tick of 0.1 sec when running on the NXP TWR-KE18F
development board.
Fixes#16234.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
On boards that have the arm or nxp mpu, configure the mpu to allow flash
writes. Otherwise this test will fail with an mpu fault.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
In the wake of moving the internal API header arm_core_mpu_dev.h
into arch/arm/cortex_m/mpu, we need to explicitly declare the
arm_core_mpu_disable() function in the userspace test. Note that
arm_core_mpu_disable() (as any other function in this internal
API) is not supposed to be called directly by kernel/application
functions; an exception is allowed in this test suite, so we are
able to test the MPU disabling functionality.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Shell history module reworked to use ring buffer for storing
commands. Dedicated buffer is used to story all command lineary.
History capacity is in bytes not in number of entries, e.g.
many short commands can be stored or few long (depending on
CONFIG_SHELL_HISTORY_BUFFER).
Removed implicit command null termination from shell_history and
added it to shell after fetching command line from the history.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
- Delete CONFIG_TEST_USERSPACE=n no-ops because it's the default
since commit 7b1ee5cf13
- Some tests have a "userspace" tag pretending to TEST_USERSPACE but
don't and vice versa: fix missing or spurious "userspace" tags in
testcase.yaml files.
Tests have a _spurious_ "userspace" tag when they PASS this command
cause none should pass:
./scripts/sanitycheck --tag=userspace -p qemu_x86 \
--extra-args=CONFIG_TEST_USERSPACE=n \
--extra-args=CONFIG_USERSPACE=n | tee userspace.log
All tests run by this command must either fail to build or fail to run
with some userspace related error. Shortcut to look at all test
failures:
zephyr_failure_logs() {
awk '/see.*log/ {print $2}' "$@"
}
Tests _missing_ "userspace" tag FAIL to either build or to run with some
userspace related error when running this:
./scripts/sanitycheck --exclude=userspace -p qemu_x86 \
--extra-args=CONFIG_TEST_USERSPACE=n \
--extra-args=CONFIG_USERSPACE=n | tee excludeuserspace.log
Note the detection methods above are not 100% perfect because some
flexible tests like tests/kernel/queue/src/main.c evade them with #ifdef
CONFIG_USERSPACE smarts. Considering they never break, it is purely the
test author's decision to include or not such flexible tests in the
"userspace" subset.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fix a bug in the latency_measure sample where, when the board was
specified through the environment, the wrong prj.conf file was
selected.
This change is not a pure refactoring, as it is believed that there
have been some copy-paste mistakes where prj_small_freq_divider.conf
and prj.conf have become out-of-sync over time. These assumed mistakes
are not carried over in the new organization.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Remove commented-out code in the latency_measure sample. Commented out
code should not be committed to version control.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Now length of the UDP header is checked, and obviously these test were
avoiding setting it properly.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The various ptp_clock_driver_api methods receive a struct ptp_context
not a struct eth_context, and the later must be obtained from a
reference stored in the former. Failing to do so by directly
interpreting driver_data as a struct eth_context instance does end up
corrupting memory past the actual struct ptp_context storage. The test
may still pass as ptp_clock_get() reads from the same out-of-bounds
memory as the previous ptp_clock_set() and therefore the content
matches, and with luck the corrupted memory is not essential to the
completion of the test. But that wasn't my case which allowed me to
find this issue.
Fix this by properly obtaining a reference to the struct eth_context
instance via the actual struct ptp_context, and adding a test like
the one found in eth_tx() to make sure we got the right memory.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit adds the default configuration to the flash_simualtor
to allow unaligned reads.
Disable this option when testing to increase test coverage.
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
Refactor device api test using standard placement for descriptor table
and configuration data.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Remove duplicated execution path for composite configuration, USB
device stack initialization is done inside stack for both cases.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
In order to unify the legacy and composite code, move the class and
vendor request handler buffer into the USB device code, just like in
composite mode. The option is renamed from USB_COMPOSITE_BUFFER_SIZE
into USB_REQUEST_BUFFER_SIZE and also replaces the USB_DFU_MAX_XFER_SIZE
and USB_HID_MAX_PAYLOAD_SIZE options.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add an explict test for the length of the receive event when
doing incremental receives. This was not tested anywhere in the
normal code path (only implicitly in the abort, which wasn't
exercised on the only current implementation, nrfx). So add an
explicit check for it during the chained reads, so that the
test can catch the case where multiple receive events do not set
the length correctly on events past the first.
Tested on nrf52840_pca10056.
Signed-off-by: Derek Hageman <hageman@inthat.cloud>
This reverts commit d09b91f5. I was incorrect in my interpretation
of the async API: the number of bytes received is relative
to the previous event, so it does "reset" between calls.
Signed-off-by: Derek Hageman <hageman@inthat.cloud>
Added a test case with corner case scenario, in which sector closing
operation is interrupted (e. g. due to power-down).
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
I2C_STM32_V1 and I2C_STM32_V2 are Kconfig symbols used to
select STM32 I2C driver variant based on I2C IP available on a
given STM32 SoC.
Being SoC dependent, they are automatically selected in soc/
if CONFIG_I2C is set. Then there is no need to define them at board
level, nor for a specific application like this is done in
some sample or test applications. Remove these definitions when
this is the case.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Added a test for testing full round GC on 3-sectors
configuration. In this case all kind off sector can
appeared so this test covers well more numerous
sectors configurations.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
The time measurement based on k_uptime_delta() might be not accurate
for some values of CONFIG_SYS_CLOCK_TICKS_PER_SEC. This commit
introduces measurement based on k_cycle_get_32(), which is more
precise.
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
The time measurement based on k_uptime_delta() might be not accurate
for some values of CONFIG_SYS_CLOCK_TICKS_PER_SEC. This commit
introduces measurement based on k_cycle_get_32(), which is more
precise.
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
This commit changes the timer_api test in order to take under account
fact that timeouts used in the test might not be aligned to tick
boundary.
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
As printf() is now used directly instead of printf proxy function,
there's warning-as-error that long long is passed where %lu
expected, so cast it explicitly.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
It exists only if MBEDTLS_PLATFORM_PRINTF_ALT is defined, whcih we
no longer do, but make the call condiitonal in case we'll need to
make it configurable later.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This tries to build gpio without any driver which fails at cmake time
like this:
CMake Error at ../../../cmake/extensions.cmake:378 (add_library):
No SOURCES given to target: drivers__gpio
Call Stack (most recent call first):
../../../cmake/extensions.cmake:355 (zephyr_library_named)
../../../drivers/gpio/CMakeLists.txt:3 (zephyr_library)
Remove TEST_USERSPACE workaround added in commit 3b53e69249 which
added gpio_handlers.c to the SOURCES.
Fixes#15232.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>