Commit Graph

6735 Commits

Author SHA1 Message Date
Zhe Weng
412505d286 ostest: Introduce basic work queue test
The test consists of two parts:
- A tester that tries to trigger wrong states of work queue
- A verifier that checks whether the wqueue is still working properly

The tester is trying to queue and cancel work several times with
priority lower/same/higher than the work queue.

Most wrong cases are likely to happen with high priority like:
- If `cancel` never decreases semcount, the count may keep growing
  and finally overflow
- If `cancel` is decreasing semcount too much, the `work_thread` may
  be waken up less times than expected

The lower/same priority testers are just added for covering other
unexpected situations.

The verifier is trying to queue some works and check they are called as
expected:
- Frist queue a 'sleep' worker, to let a work queue thread be in busy
  status and not waiting on sem, while other work queue thread(s) (if
  any) still waiting for sem. If sem is in wrong state, it may cause
  wrong behavior in either thread waiting/not waiting on the sem.
- Then queue a few count works, if the work queue(s) are still working
  properly, these works should finally be all called once.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-03-22 12:56:01 +02:00
Huang Qi
8ae5a1b148 Fix some hard coded buffer len of snprintf
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-21 20:57:56 -03:00
Zhe Weng
86d084fe21 netutils/ftpc: Cancel wdog on error state in ftpc_reconnect.
The timer is for connect timeout, but is not cancelled on connect error,
then it may be triggered after ftpc quit and cause heap-use-after-free.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-03-21 20:40:38 -03:00
Xu Xingliang
f32aa2df59 lua: download tarball from github release tag
The tarball from github has same file layout as git repo while the tarball from ftp doesn't.
Update Makefile to accommodate this change.

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2023-03-21 20:38:29 -03:00
simbit18
48928e1c68 apps/system/dumpstack/Makefile: fix style
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
simbit18
0e04cd75f8 apps/system/dumpstack/Make.defs: fix style
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
simbit18
d65c51b0c6 apps/platform/bin/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
simbit18
04c31b820c apps/testing/crypto/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
simbit18
ab675c5b7d apps/testing/crypto/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
Tiago Medicci Serrano
3a1893ba7e nxplayer: read file completely until 0 bytes are returned
Previously, if the read bytes were less than the requested, the
file was closed immediately. This behavior, however, does not
consider the fact that the read operation may be blocking when
no bytes are available at the moment. That is true for a named pipe
(FIFO), for instance. Thus, reading it again lets to the underlying
file system the decision of 1) blocking until bytes become
available or 2) return 0 immediately (the case for actual files) or
3) read available bytes.
2023-03-21 07:51:18 +09:00
simbit18
d3c3a6ebe0 apps/netutils/xmlrpc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
7560a5e80d apps/netutils/webserver/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
79b72c0302 apps/netutils/webclient/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
b2f1ab31c7 apps/netutils/thttpd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
b2d24f7688 apps/netutils/tftpc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
98a1618202 apps/netutils/telnetd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
4b401d95b1 apps/netutils/telnetc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
17103a6b3d apps/netutils/smtp/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
27a17df69d apps/netutils/rexecd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
19d6f40767 apps/netutils/rexec/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
af4e177722 apps/netutils/pppd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
257719d65a apps/netutils/ntpclient/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
804762c72d apps/netutils/netlib/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
e1357fa6c9 apps/netutils/netinit/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
6529e74326 apps/netutils/libcurl4nx/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
2c2577fc75 apps/netutils/ftpd/Make.defs: nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
8bc93e07ce apps/netutils/ftpc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
a75dd4be40 apps/netutils/esp8266/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
cf0ee4354c apps/netutils/discover/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
585d0e083b apps/netutils/dhcpd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
5137e6f3db apps/netutils/dhcpc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
5736d2adfd apps/netutils/dhcp6c/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
6978a65293 apps/netutils/codecs/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
Xiang Xiao
f3c104b99a Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-19 14:53:44 -06:00
Xiang Xiao
86080a110e apps: Remove the check of CONFIG_SERIAL_TERMIOS
If the code only change c_oflag, c_iflag and c_lflag, not c_cflag in termios.
Follow up the change from kernel: https://github.com/apache/nuttx/pull/8843

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-19 14:53:44 -06:00
anjiahao
369c354dc7 support ymodem protocal and sb rb application
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-03-17 12:17:14 -03:00
yinshengkai
fb0ab1b4c6 nshlib: one-time output uname
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-17 12:10:00 -03:00
Huang Qi
0af64dc045 system/cle: Remove cle_getcursor()
Fix https://github.com/apache/nuttx/issues/8731, don't rely on the vt100 to report
the cursor position.

This avoid the implicit input (response of get cursor command) during the user inputs.

Notice: This assume that the nsh prompt is always shown at line start.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-17 12:08:04 -03:00
YAMAMOTO Takashi
04a156e0d0 toywasm: regen config-dependent files
With the regen script:

```
REF=7c6ff3925d0b0f4d5122df9b1b5761bc2954e014 ./regen.sh
```
2023-03-17 12:07:02 -03:00
YAMAMOTO Takashi
b962c02c05 toywasm: add a script to regenerate config-dependent files
This is a manual step mainly because it involves extra
tools including cmake.
2023-03-17 12:07:02 -03:00
Huang Qi
4b1d59d40d bas: Don't ECHO input in repl
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-17 12:00:55 -03:00
Xiang Xiao
503b4ccf82 Fix the indent issue found in build script
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-17 12:00:17 -03:00
Ville Juven
5d9811a03d nshlib/nsh_vars.c: Add missing stdio.h
nsh_vars.c: In function 'nsh_setvar':
nsh_vars.c:285:3: error: incompatible implicit declaration of built-in function 'sprintf' [-Werror]
  285 |   sprintf(pair, "%s=%s", name, value);
2023-03-17 11:59:37 -03:00
XinStellaris
7ab1f2a957 Add Arch-specific libc test case.
Signed-off-by: XinStellaris <tianxin7@xiaomi.com>
2023-03-17 11:59:13 -03:00
zhangyuan21
4454c8d02f apps: remove unnecessary sem_setprotocol code
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-03-17 11:58:03 -03:00
simbit18
0d34e55d9e apps/graphics/nxglyphs/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
d8dd8ff61e apps/graphics/nxglyphs/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
da6998434b apps/fsutils/mkmbr/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
a37267e644 apps/examples/xbc_test/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00
simbit18
3a912b8778 apps/examples/watcher/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-17 03:23:12 +01:00