Skip to content

Commit

Permalink
tests: net: dhcpv6: Add tests
Browse files Browse the repository at this point in the history
Add tests for the DHCPv6 library. The tests verify that:
* message format is valid for the outgoing messages
* incoming messages are only processed in respective states
* processing through standard DHCPv6 transactions is correct
  (Solicit/Confirm/Renew/Rebind)

Signed-off-by: Robert Lubos <[email protected]>
  • Loading branch information
rlubos authored and carlescufi committed Sep 28, 2023
1 parent 6fb19bc commit d9f4c1c
Show file tree
Hide file tree
Showing 4 changed files with 1,307 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/net/dhcpv6/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(dhcpv6)

target_include_directories(app PRIVATE ${ZEPHYR_BASE}/subsys/net/ip)
target_sources(app PRIVATE src/main.c)

zephyr_compile_definitions(CONFIG_NET_DHCPV6)
zephyr_compile_definitions(CONFIG_NET_DHCPV6_LOG_LEVEL=LOG_LEVEL_ERR)
18 changes: 18 additions & 0 deletions tests/net/dhcpv6/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CONFIG_NET_TEST=y
CONFIG_ZTEST=y
CONFIG_ZTEST_NEW_API=y

CONFIG_ENTROPY_GENERATOR=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_NETWORKING=y
CONFIG_NET_L2_DUMMY=y
CONFIG_NET_IPV6=y
CONFIG_NET_IPV6_ND=n
CONFIG_NET_IPV6_DAD=n
CONFIG_NET_IPV6_MLD=n
CONFIG_NET_UDP=y
CONFIG_NET_TC_TX_COUNT=1

CONFIG_NET_MGMT=y
CONFIG_NET_MGMT_EVENT=y
CONFIG_NET_MGMT_EVENT_INFO=y
Loading

0 comments on commit d9f4c1c

Please sign in to comment.