Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/utest_auto_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ jobs:
config_file: "components/lwip.cfg"
- platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" }
config_file: "components/netdev.cfg"
- platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" }
config_file: "components/sal.cfg"
- platform: { UTEST: "A9", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", SD_FILE: "sd.bin", KERNEL: "standard", "SMP_RUN":"" }
config_file: "components/dfs.cfg"

Expand Down
73 changes: 38 additions & 35 deletions components/net/utest/Kconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,41 @@
if RT_USING_LWIP
menu "LwIP"
menu "Network"

config RT_UTEST_TC_USING_LWIP
bool "lwIP API Test"
config RT_UTEST_TC_USING_SAL
select RT_USING_SAL
bool "SAL Unit Testcase"
default n

menuconfig RT_UTEST_TC_USING_NETDEV
select RT_USING_NETDEV
bool "Netdev API Test"
help
Enable netdev network device framework unit tests.

Test coverage includes:
* Network connectivity (ping operations)
* DHCP functionality (enable/disable/restore)
* DNS configuration and hostname resolution
* Interface configuration (IP/gateway/netmask)
* IP address conversion functions
* Device retrieval and management
* Status control and callback mechanisms

if RT_UTEST_TC_USING_NETDEV

config RT_UTEST_DEFAULT_NETDEV_NAME
string "Default Netdev Name"
default "e0"
help
Network interface name for tests. Common values:
"e0" (Ethernet), "w0" (Wireless).
Ensure the device exists in your environment.
endif

menuconfig RT_UTEST_TC_USING_LWIP
select RT_USING_LWIP
select RT_LWIP_NETIF_LOOPBACK
bool "lwIP Unit Testcase"
default n
help
Enable lwIP network stack unit tests including DNS resolution,
TCP/UDP socket operations, and network interface tests
Expand Down Expand Up @@ -103,35 +136,5 @@ if RT_USING_LWIP
This should match the actual IP of the test domain

endif
endmenu
endif

if RT_USING_NETDEV
menu "Netdev"

config RT_UTEST_TC_USING_NETDEV
bool "Netdev API Test"
help
Enable netdev network device framework unit tests.

Test coverage includes:
* Network connectivity (ping operations)
* DHCP functionality (enable/disable/restore)
* DNS configuration and hostname resolution
* Interface configuration (IP/gateway/netmask)
* IP address conversion functions
* Device retrieval and management
* Status control and callback mechanisms

if RT_UTEST_TC_USING_NETDEV

config RT_UTEST_DEFAULT_NETDEV_NAME
string "Default Netdev Name"
default "e0"
help
Network interface name for tests. Common values:
"e0" (Ethernet), "w0" (Wireless).
Ensure the device exists in your environment.
endif
endmenu
endif
endmenu
18 changes: 10 additions & 8 deletions components/net/utest/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ cwd = GetCurrentDir()
src = []
CPPPATH = [cwd]

if GetDepend('RT_UTEST_TC_USING_LWIP') or GetDepend('RT_UTEST_TC_USING_NETDEV'):
if GetDepend('RT_UTEST_TC_USING_LWIP'):
# Add lwIP test source if enabled
src += ['tc_lwip.c']

if GetDepend('RT_UTEST_TC_USING_LWIP'):
# Add lwIP test source if enabled
src += ['tc_lwip.c']
if GetDepend('RT_UTEST_TC_USING_NETDEV'):
# Add netdev test source if enabled
src += ['tc_netdev.c']

if GetDepend('RT_UTEST_TC_USING_NETDEV'):
# Add netdev test source if enabled
src += ['tc_netdev.c']
if GetDepend('RT_UTEST_TC_USING_SAL'):
# Add sal test source if enabled
src += ['tc_sal_socket.c']

# Define the test group with proper dependencies
group = DefineGroup('utestcases', src, depend = ['RT_USING_UTESTCASES'], CPPPATH = CPPPATH)
group = DefineGroup('utestcases', src, depend = [''], CPPPATH = CPPPATH)

Return('group')
Loading
Loading