Commit graph

764 commits

Author SHA1 Message Date
fangpeina
f9dc9bc21e testing: Fix cmocka_syscall_test crash when CONFIG_FDCHECK enable
Fix cmocka_syscall_test crash when CONFIG_FDCHECK is enabled.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-02-03 17:36:49 +08:00
hujun5
b2d4ad67b1 testing/ostest: Add performance event time counter test
Integrate up_perf_gettime() test into ostest suite with comprehensive
test coverage including monotonicity verification, interval statistics,
and frequency validation. The test verifies performance event counter
functionality across 5 independent test cases with proper error handling.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-02-02 14:01:00 +08:00
zhaoxingyu1
eda1309745 mtdconfig: modify config names for mtdconfig testcases 2
change nvs module testcase name TESTING_MTD_CONFIG_FAIL_SAFE
to TESTING_MTD_CONFIG_NVS and modify the configuration names
related to mtdconfig testing.

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-02-02 11:01:19 +08:00
zhaoxingyu1
102c078834 mtd/nvs: modify config name to MTD_CONFIG_NVS part1
Because the MTD_CONFIG configuration item in
drivers/mtd/Kconfig has changed

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-02-02 11:01:19 +08:00
makejian
367e9dca01 testing: move nist-sts into drivers/rng directory
Move NIST Statistical Test Suite (nist-sts) testing module from testing/drivers/
into testing/drivers/rng/ directory to better organize RNG (random number generator)
related tests that utilize /dev/random device.

Changes:
- Create testing/drivers/rng/ directory structure
- Move nist-sts from testing/drivers/ to testing/drivers/rng/nist-sts
- Update build configuration file paths:
  - CMakeLists.txt
  - Makefile
  - Make.defs
- Maintain all test patches and Kconfig settings

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-29 12:08:50 +08:00
wangxingxing
42e3566147 testing/fs:reduce the test time of fs test
Reduce TEST_NUM from 1000 to 100 in fs_opendir_test.c
Reduce loop count from 100 to 30 in fs_stream_test.c

Signed-off-by: wangxingxing <wangxingxing@xiaomi.com>
2026-01-28 10:37:52 -03:00
wangxingxing
f2ba4883fa testing/fs:remove the usleep of evend_fd read to solve the questiong of sem wait
Remove unnecessary usleep(1000) in the read thread of eventfd test.
The eventfd read operation will block and wait for data naturally via semaphore, no additional delay is needed.

Signed-off-by: wangxingxing <wangxingxing@xiaomi.com>
2026-01-28 10:37:52 -03:00
ligd
050fb406c2 testing/eventfd_test: avoid the orphan Thread
Replace sleep() with pthread_join() to properly wait for the child thread to finish, avoiding orphan threads.
Change sleep(1) to usleep(1000) to reduce test time while maintaining synchronization.
Fix loop iteration count mismatch between reader thread (6 iterations) and writer (5 iterations).

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-28 10:37:52 -03:00
guohao15
4ac3732734 testing/fdcheck: fix fd close in other thread
Fix file descriptor leak issue where fd was stored in test_state for deferred close, but could fail when CONFIG_FDCHECK is enabled because fd cannot be closed in a different thread.

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2026-01-28 10:37:52 -03:00
wangchengdong
ebe2dd57dd ostest/hrtimer: sync hrtimer ostest with latest hritmer update
sync hrtimer ostest with latest hritmer update

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-27 23:11:48 +08:00
ouyangxiangzhen
71561d2979 testing/ostest: run spinlock_test only in flat mode.
Since the kernel spinlocks can only work in flat mode, this commit
allowed spinlock_test only in flat mode.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
06d07b1522 testing/ostest: Fix Coverity for spinlock test.
This commit fixed coverity for spinlock test.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
5eef7f324f testing/ostest: refactor the spinlock test.
This commit refactored the spinlock test for better accuracy and
minimized jitters introduced by scheduling.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
anpeiyun
52c2a8909b ostest/spinlock: Check the return value.
This commit added checking for the return value.

Signed-off-by: anpeiyun <anpeiyun@xiaomi.com>
2026-01-27 22:59:36 +08:00
anpeiyun
f86246f7c6 ostest/spinlock: fix the operations does not affect the result.
When expanding the macro VERIY, (0 == pthread_barrier_wait(&param->pub->barrier)) < 0 always false.
Regardless of the value of its operands.

Signed-off-by: anpeiyun <anpeiyun@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
36e701448c ostest/spinlock: Check the return value.
This commit added checking for the return value.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
7fb71aa57a testing/drivers: Fix posix timer assertions.
On QEMU, if vcpus are preempted by other threads, the deviation of the
timer might be very large, causing assertion failure. This commit
addressed the problem.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
jiangtao16
1b8c90c12d ostest: Add spinlock/rspinlock.
This commit added spinlock/rspinlock test.

Signed-off-by: jiangtao16 <jiangtao16@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
35cf746025 testing/drivers: Fix wrong test-cases.
This commit fixed totally wrong test-cases for the periodical timers.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
b9bf7f5c4f testing/drivers: Change uint32_t time to uint64_t.
This commmit fixed the time multiplication overflow issue.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
62fe1a3ac5 ostest/wdog: Fix a synchronizing bug.
If we updated `callback_cnt` before the `triggered_tick` in the wdog timer callback, the `wdtest_rand` might failed randomly. This commit fixed the synchronizing bug by swapping the execution order of updating.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
69bfda8736 apps/ostest: Fix wqueue_test in flat mode.
This commit re-enabled wqueue_test in flat mode.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
429a65901f apps/testing: Fix timerjitter iteration
This commit used the interval to calculate the timejitter iteration.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
f687088453 apps/testing: Fix timerjitter interval
This commit increased the default interval of the timerjitter to avoid errors with large USEC_PER_TICK setting.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
e0e9f3d7e5 apps/testing: Fix Coverity.
This commit is to make Coverity happy.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
a16c545134 testing/drivers: Fixed the wrong test-case.
This commit fixed the wrong-test case where the time is acquired after
the timer being set, leading to the assertion failure.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
ae7a0d81e9 testing/drivers: Fix posix timer assertions.
On QEMU, if vcpus are preempted by other threads, the deviation of the
timer might be very large, causing assertion failure. This commit
addressed the problem.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
01e5e50619 testing/time: Relax the timing constraints.
On SIM and QEMU, it is inevitable that the simulating vCPU got preempted
by other threads, causing large timing delay. This commit relax the timing
constraints to reduce the CT error.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
a4b43521f4 testing/drivers: Fix posix timer assertions.
On QEMU, if vcpus are preempted by other threads, the deviation of the
timer might be very large, causing assertion failure. This commit
addressed the problem.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
ouyangxiangzhen
0faaed99a5 testing/drivertest: Fix timing issues on QEMU and sims.
Since sim and qemu are not cycle accurate simulators, if the vCPU thread is preempted by other high priority tasks, it may cause timing issues. This is easy to happen when the test machine is busy. This commit modifies the condition of timing error and prints out the latency as a warning.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-27 22:59:36 +08:00
hujun5
80c2b43197 testing/ostest: fix uninitialized variable warning in wdog test
Initialize the flags variable to 0 to fix compiler warning about
potential use of uninitialized variable. The flags variable is
conditionally assigned in wdtest_rand() based on callback count.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-27 03:09:24 +08:00
wangxingxing
9c022949e4 fs/test:Fix formatting check issues
fix the typo error of fs cases

Signed-off-by: wangxingxing <wangxingxing@xiaomi.com>
2026-01-26 22:09:19 +08:00
wangxingxing
2d2394201c fs/bugfix: fix the fd error of fs test
remove test_state of fs test cases

Removes unnecessary test_state structure usage for tracking file descriptors
Adds missing close(newfd) call in fs_dup_test.c to prevent file descriptor leaks
Simplifies test code by eliminating redundant fd tracking that could lead to incorrect resource management

Signed-off-by: wangxingxing <wangxingxing@xiaomi.com>
2026-01-26 22:09:19 +08:00
hongfengchen
c69df55cd0 rexecd: fix type change
Fix cast from pointer to integer of different size to ensure
proper type conversion and avoid compilation warnings.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-01-26 19:32:27 +08:00
tengshuangshuang
34e4d7eacd testing: add unistd.h for drivertest_touchpanel.c
Add unistd.h header file to drivertest_touchpanel.c to fix missing
sleep/usleep function declarations in touchpanel driver tests.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-26 19:32:27 +08:00
hongfengchen
d0e949cb24 testing: add unistd.h and pthread.h headers
Add unistd.h and pthread.h for memorystress_main.c, unistd.h for
dhm.c and cachetest_main.c, and pthread.h for kv_test_019.c to fix
missing declarations.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-01-26 19:32:27 +08:00
hongfengchen
9a3778cb91 testing: add malloc.h for fstest.h
Add malloc.h header file to fstest.h to fix missing malloc/free
function declarations in filesystem test suites.

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-01-26 19:32:27 +08:00
hujun5
d1de009bc2 sched: inline enter_critical_section
Inline enter_critical_section function calls in performance-critical
paths to reduce function call overhead while maintaining consistent
semantics, improving overall system latency and responsiveness in
real-time scenarios.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 16:39:15 +08:00
Vlad Pruteanu
c883c3f6dd testing/drivers/crypto/hmac.c: Add long keys
This adds 2 tests, which include keys that are
longer than the SHA's block size.

Signed-off-by: Vlad Pruteanu <pruteanuvlad1611@yahoo.com>
2026-01-26 10:58:22 +08:00
Bartosz Wawrzynek
f09d0b2e09 apps: Fix minor issues for latest toolchains
- crypto/mbedtls: Add -Wno-cpp flag to suppress warnings
- interpreters/quickjs: Add flags to suppress warnings
- lte/alt1250: Fix spelling issues in comments
- system/dd: Add missing includes for modern compilers
- system/zlib: Add -Wno-cpp flag
- testing/cxx: Include missing algorithm header

Signed-off-by: Bartosz <bartol2205@gmail.com>
2026-01-23 10:00:52 +08:00
wangzhi16
5c6d646d76 testing/fs: add testcase to test the stability of memfd.
Supplement ostest test cases.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-22 19:53:39 +08:00
wangzhi16
094b0f235a test/mutex: fix mutex testcases.
Multiple threads should use the same lock for resource protection.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-22 19:53:39 +08:00
yukangzhi
3c99bad310 crctest: Test the CRC library that the E2E depends on.
Test the CRC Library defined in the AUTOSAR specification

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-22 19:51:51 +08:00
tengshuangshuang
b6203955f9 syscall: fix listen case bug
Skip UDP listen test when CONFIG_NET_UDP is disabled to prevent
test failures on configurations without UDP support.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
338301de76 timerjitter: fix signal-cause error
Handle timer-delivered signals correctly to prevent assertions when
signal-related events occur during timing measurements.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
be26d79633 syscall: fix badfd test for fdcheck compatibility
Handle fdcheck path for badfd test to prevent unexpected dumps when
fdcheck is enabled, allowing proper testing of bad file descriptor
error cases.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
b86457dfcb apps/testing: fix syscall cases for fdcheck compatibility
Guard fdcheck-sensitive paths in setsocketopt, dup2, and fsync tests
to avoid assertion failures when fdcheck is enabled, ensuring tests
can properly verify error handling behavior.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
8afe3c0645 test: clean driver_audio_test (void *) cast
Drop unnecessary casts in driver_audio_test to silence compiler
warnings and improve code clarity.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
4df2ce98aa testing: fix net case bug
Adjust net socket test expectations for correct behavior to prevent
false test failures in network socket test cases.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00
tengshuangshuang
df48348fca test: fix timerjitter data style error
Fix timerjitter output formatting for date/time fields to match
expected format and improve test result readability.

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-22 19:48:57 +08:00