error: 'CONFIG_NSH_LINELEN' undeclared (first use in this function);
did you mean 'CONFIG_NSH_PIPELINE'?
Signed-off-by: v-tangmeng <v-tangmeng@xiaomi.com>
Fix inverted loop condition: while (g_exit) should be while (!g_exit),
causing the daemon to exit immediately instead of running.
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
when pthread_join(), TCB still exists and detached is acceptable, the return value of pthread_join is EINVAL.
Signed-off-by: anpeiyun <anpeiyun@xiaomi.com>
In QEMU and SIM environments, if the CPU is under high load, the vCPU may not get a time slice to execute, potentially leading to arbitrarily large timer delays and test failures. We have relaxed the timer delay assertion to 1 second, referencing LTP.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
When NAME_MAX use default 32, the FOLDER_NAME previous length
36 will cause errno ENAMETOOLONG, use a shorter 22 bytes
should enough for test purpose.
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
During execution, ntpclient may attempt to synchronize the time, causing incorrect test results. Here, we use CLOCK_MONOTONIC to avoid this problem.
Once the smooth time correction has been implemented, this commit can be reverted.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
Fix format specifier mismatch where work.total_ticks is atomic_t (int)
but PRIu32 expects uint32_t on some platforms.
Add explicit cast to uint32_t and split long line for readability.
Signed-off-by: ligd <liguiding1@xiaomi.com>
Sleep duration may vary due to scheduling overhead. Add 5-retry
loop and pass if at least 3 attempts succeed.
Signed-off-by: v-liuchenxu3 <v-liuchenxu3@xiaomi.com>
This commit implements stderr redirection in HSN, support
Bash-like syntax for redirecting standard error output.
Support both foreground and background commands.
example:
- nsh> ls noexists 2> err.log
- nsh> ls noexists 2> err.log &
- nsh> ls noexists 2>> err.log
- nsh> sh < /dev/ttyS0 > /dev/ttyS0 2> /dev/ttyS1 &
- nsh> sh < /dev/ttyS0 > /dev/ttyS0 2>&1 &
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
RTC time may be overwritten by remote time sync service during
the test. Add 5-retry loop and pass if at least 3 attempts succeed.
Signed-off-by: v-liuchenxu3 <v-liuchenxu3@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>
During execution, ntpclient may attempt to synchronize the time, causing incorrect test results. Here, we use CLOCK_MONOTONIC to avoid this problem.
Once the smooth time correction has been implemented, this commit can be reverted.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
Use CLOCK_MONOTONIC as reference to compare time deltas instead of
comparing absolute gettimeofday values. This avoids false failures
when g_basetime is adjusted by NTP or other time sync services.
- Compare time deltas between gettimeofday and CLOCK_MONOTONIC
- Allow limited basetime adjustments (max 3) before failing
- Fail immediately if CLOCK_MONOTONIC goes backwards
- Fail if gettimeofday delta exceeds CLOCK_MONOTONIC delta
Signed-off-by: huojianchao <huojianchao@xiaomi.com>
This commit adds a systen utily 'stty' to NuttX, providing a standard
Unix-like interface for configuring terminal (TTY) device settings.
The command allows runtime configuration of termios attributes for
serial ports and other character devices.
Usage examples:
# Set raw mode on ttyS0 (for binary communication)
nsh> stty -F /dev/ttyS0 raw -echo
# Set console mode for interactive terminal
nsh> stty -F /dev/ttyS0 cooked
# Display current settings
nsh> stty -F /dev/ttyS0
# Configure stdin (if it's a TTY)
nsh> stty echo icanon
# Set baudrate (if driver support)
nsh> stty -F /dev/ttyS1 speed 115200
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
Background:
Previously, when CONFIG_READLINE_ECHO was enabled, it only handled
special cases like:
- Tab completion output
- Backspace character echo
- VT100 control sequences (e.g., erase to end of line)
Normal character echoing relied entirely on the hardware ECHO flag in
the underlying serial driver (termios).This caused issues when NSH
stdout was redirected to syslog via CONFIG_NSH_ALTSTDOUT="/dev/log":
now no more output interleaving when using syslog redirection.
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
Add a config which enables error strings, and default it to n.
This saves flash size of about 4K when enabling libarchive.
Signed-off-by: zhengyu16 <zhengyu16@xiaomi.com>
The check comparing argv[0] against CONFIG_TESTING_CMOCKA_PROGNAME
is redundant because:
1. Only one executable (cmocka) is built from this source file
2. The program always has the correct name when invoked properly
3. The check fails incorrectly when using absolute paths or renamed binaries
Signed-off-by: ganjing <ganjing@xiaomi.com>
for SMP, the pthread_cond_signal(&perf.cond); will execute before pthread_cond_wait(&perf->cond, &perf->lock);
So the case will block at pthread_join(tid, NULL);
Signed-off-by: anpeiyun <anpeiyun@xiaomi.com>