Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: wifi: esp32: Functional tests for CI #78765

Merged
merged 2 commits into from
Sep 30, 2024
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
3 changes: 3 additions & 0 deletions drivers/wifi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ zephyr_library_property(ALLOW_EMPTY TRUE)

add_subdirectory_ifdef(CONFIG_WIFI_ESP_AT esp_at)
add_subdirectory_ifdef(CONFIG_WIFI_ESP32 esp32)
if(CONFIG_DT_HAS_ESPRESSIF_ESP32_WIFI_ENABLED)
zephyr_blobs_verify(MODULE hal_espressif REQUIRED)
endif()
add_subdirectory_ifdef(CONFIG_WIFI_ESWIFI eswifi)
add_subdirectory_ifdef(CONFIG_WIFI_SIMPLELINK simplelink)
add_subdirectory_ifdef(CONFIG_WIFI_WINC1500 winc1500)
Expand Down
1 change: 1 addition & 0 deletions drivers/wifi/esp32/Kconfig.esp32
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ menuconfig WIFI_ESP32
bool "ESP32 SoC WiFi support"
default y
depends on DT_HAS_ESPRESSIF_ESP32_WIFI_ENABLED
depends on ZEPHYR_HAL_ESPRESSIF_MODULE_BLOBS
depends on !SMP
select THREAD_CUSTOM_DATA
select NET_L2_WIFI_MGMT
Expand Down
9 changes: 9 additions & 0 deletions tests/boards/espressif/wifi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(wifi_test)

target_include_directories(app PRIVATE ${ZEPHYR_BASE}/subsys/net/ip)
FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
74 changes: 74 additions & 0 deletions tests/boards/espressif/wifi/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

mainmenu "Wi-Fi Test"

source "Kconfig.zephyr"

config WIFI_TEST_ENABLE
bool "Enable Wi-Fi test"
default y
select WIFI
select WIFI_USE_NATIVE_NETWORKING

config WIFI_TEST_SSID
string "Wi-Fi Test SSID"
default "TestSSID"
help
This option sets the SSID of the Wi-Fi network for testing.
It allows you to specify the Wi-Fi SSID that the device will
use during test scenarios.

config WIFI_TEST_PSK
string "Wi-Fi Test PSK"
default "TestPSK"
help
This option sets the Pre-Shared Key (PSK) for the Wi-Fi network
during test scenarios. The device will use this password to authenticate
with the specified test SSID.

config WIFI_TEST_AUTH_MODE_WPA2
bool "WPA2 Security"
help
Option to use WPA2 Security for Wi-Fi connections.

config WIFI_TEST_AUTH_MODE_WPA3
bool "WPA3 Security"
select ESP_WIFI_ENABLE_WPA3_SAE
help
Option to use WPA3 Security for Wi-Fi connections.

config WIFI_CONNECT_ATTEMPTS
int "Wi-Fi Connect Attempts"
default 5
help
Number of attempts when connecting to a Wi-Fi network.
If connection is not successful after all attempts, test will fail.

config WIFI_SCAN_TIMEOUT
int "Wi-Fi Scan Timeout (in seconds)"
default 30
help
Timeout duration for Wi-Fi scanning.
If scan doesn't complete within this time, test will fail.

config WIFI_CONNECT_TIMEOUT
int "Wi-Fi Connect Timeout (in seconds)"
default 60
help
Timeout duration for connecting to Wi-Fi network.
If connection is not established within this time, test will fail.

config WIFI_DISCONNECT_TIMEOUT
int "Wi-Fi Disconnect Timeout (in seconds)"
default 5
help
Timeout duration for disconnecting from Wi-Fi network.
If disconnect doesn't complete within this time, test will fail.

config WIFI_PING_TIMEOUT
int "Gateway Ping Timeout (in seconds)"
default 10
help
Timeout duration for pinging the network gateway.
If no reply is received within this time, test will fail.
15 changes: 15 additions & 0 deletions tests/boards/espressif/wifi/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CONFIG_ZTEST=y

CONFIG_NETWORKING=y
CONFIG_NET_TEST=y
CONFIG_NET_IPV6=n
CONFIG_NET_IPV4=y
CONFIG_NET_DHCPV4=y

CONFIG_NET_LOG=y
CONFIG_NET_MGMT=y
CONFIG_NET_MAX_CONTEXTS=4
CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_L2_WIFI_MGMT=y
CONFIG_ETH_DRIVER=n
CONFIG_WIFI_NM=y
9 changes: 9 additions & 0 deletions tests/boards/espressif/wifi/socs/esp32_procpu.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

&wifi {
status = "okay";
};
9 changes: 9 additions & 0 deletions tests/boards/espressif/wifi/socs/esp32c2.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

&wifi {
status = "okay";
};
9 changes: 9 additions & 0 deletions tests/boards/espressif/wifi/socs/esp32c3.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

&wifi {
status = "okay";
};
9 changes: 9 additions & 0 deletions tests/boards/espressif/wifi/socs/esp32c6.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

&wifi {
status = "okay";
};
9 changes: 9 additions & 0 deletions tests/boards/espressif/wifi/socs/esp32s2.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

&wifi {
status = "okay";
};
9 changes: 9 additions & 0 deletions tests/boards/espressif/wifi/socs/esp32s3_procpu.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

&wifi {
status = "okay";
};
Loading
Loading