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
11 changes: 11 additions & 0 deletions .github/utest/netdev/netdev.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# dependencies
CONFIG_RT_CONSOLEBUF_SIZE=1024
CONFIG_RT_NAME_MAX=24
CONFIG_RT_USING_CI_ACTION=y
# CONFIG_RT_USING_LWIP203=y
CONFIG_RT_USING_LWIP212=y

CONFIG_RT_UTEST_TC_USING_NETDEV=y
CONFIG_RT_UTEST_DEFAULT_NETDEV_NAME="e0"

CONFIG_BSP_DRV_EMAC=y
3 changes: 3 additions & 0 deletions .github/workflows/utest_auto_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
- 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: "lwip/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: "netdev/netdev.cfg"

env:
TEST_QEMU_ARCH: ${{ matrix.platform.QEMU_ARCH }}
TEST_QEMU_MACHINE: ${{ matrix.platform.QEMU_MACHINE }}
Expand Down
30 changes: 30 additions & 0 deletions components/net/utest/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,33 @@ if RT_USING_LWIP
endif
endmenu
endif

if RT_USING_NETDEV
menu "Netdev Network Unit Testcase"

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
14 changes: 10 additions & 4 deletions components/net/utest/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@ cwd = GetCurrentDir()
src = []
CPPPATH = [cwd]

if GetDepend('RT_UTEST_TC_USING_LWIP'):
# Add lwIP test source if enabled
src += ['tc_lwip.c']
if GetDepend('RT_UTEST_USING_ALL_CASES') or 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_NETDEV'):
# Add netdev test source if enabled
src += ['tc_netdev.c']

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

Return('group')
Loading