Align with the upstream nuttx change that drops the sclock_t alias now
that clock_t is itself a signed 64-bit type (int64_t). Beyond the pure
sclock_t -> clock_t rename, this commit also removes the
now-unnecessary (time_t)-1 / (time_t)0 / (off_t)-1 casts that were
papering over the previously-unsigned time_t.
Files touched:
- examples/alarm/alarm_main.c: sclock_t -> clock_t
- netutils/dhcpd/dhcpd.c: sclock_t -> clock_t
- netutils/ftpd/ftpd.c: sclock_t -> clock_t
- netutils/thttpd/libhttpd.c,
netutils/thttpd/tdate_parse.c: drop (time_t)-1 / (time_t)0 /
(off_t)-1 sentinel casts
- system/resmonitor/filldisk.c,
system/zmodem/zm_receive.c: sclock_t -> clock_t
- testing/ostest/wdog.c: sclock_t -> clock_t (the bulk
of the rename, 30 sites)
- testing/testsuites/kernel/syscall/cases/{clock_nanosleep_test,
fsync_test,time_test}.c: drop (time_t)-1 casts in the
new signed-time_t world
No behavioural change.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
NuttX always uses a 64-bit system clock now (time_t/clock_t are
always 64-bit). Remove the obsolete CONFIG_SYSTEM_TIME64 #ifdef
branches and Kconfig dependency.
- examples/dronecan: drop SYSTEM_TIME64 dependency
- examples/netlink_route: always use PRIx64
- netutils/netinit: always use the 1-hour LONG_TIME_SEC
- netutils/ptpd: always pack the 48-bit seconds field and apply
the 64-bit overflow guard in timespec_delta_ns()
- testing/ostest/semtimed: always validate tv_sec >= 0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
The matching nuttx commit removes CONFIG_HAVE_LONG_LONG; clean up the
remaining users in nuttx-apps so that "long long" is always assumed:
- examples/noteprintf, examples/nxscope:
unconditionally exercise the %lld / long long branch.
- fsutils/mkfatfs/configfat.c:
drop the 32-bit fall-back paths in mkfatfs_nfatsect12/16/32;
always use uint64_t for the FAT-size arithmetic.
- logging/nxscope/nxscope_chan.c:
drop the CONFIG_HAVE_LONG_LONG guard around the 64-bit
sample helpers.
- netutils/ftpd, netutils/ntpclient:
always emit the 64-bit format strings.
- testing/fs/fstest/fstest_main.c:
drop the parallel 32-bit verification path; keep only the
64-bit (long long) random pattern generator.
- system/zmodem/host/nuttx/compiler.h:
remove the host-side CONFIG_HAVE_LONG_LONG stub macro.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Replace app-side includes of <debug.h> with <nuttx/debug.h> to use the
header from the NuttX tree explicitly after the header move.
Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
This adds support for testing PBKDF2 implementation. Test
vectors for SHA1 are taken from RFC6070. SHA256 vectors
were extrapolated using an online PBKDF2 generator which
was checked against RFC6070.
Signed-off-by: Vlad Pruteanu <pruteanuvlad1611@yahoo.com>
This commit refactored the hrtimer_test and provided significantly
improved test-cases for both SMP and non-SMP.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
For QEMU, virtual CPUs can be preempted by any high priority thread in
test environments. This can cause the timer to be triggered later than
expected. This commit increased the tolerant latency to avoid the test
failures.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit fixed the hrtimer test.
In a QEMU environment, the hrtimer latency can be arbitrary because vCPUs can be preempted. We can not assert the latency. we can only issue alerts for excessively high latency.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
In an effort to avoid unexpected behaviour from users not calibrating
BOARD_LOOPSPERMSEC, a compilation error occurs when it is undefined. On
some systems, this is allowed (those that use timer implementations
instead of busy-looping for delays). In these cases, we should busy-loop
using the clock time instead of relying on a possibly
undefined/uncalibrated macro.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
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>
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>
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>
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>
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>
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>
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>
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>
This commit refactored the spinlock test for better accuracy and
minimized jitters introduced by scheduling.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
When expanding the macro VERIY, (0 == pthread_barrier_wait(¶m->pub->barrier)) < 0 always false.
Regardless of the value of its operands.
Signed-off-by: anpeiyun <anpeiyun@xiaomi.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>