tests: change wifi tests expect timeout to 60

- wifi_router
- wifi_ap
- wifi_high_traffic
This commit is contained in:
Fu Hanxi
2026-03-13 10:05:15 +08:00
parent 29788f302c
commit 06ca1805fd
17 changed files with 188 additions and 172 deletions
@@ -1,12 +1,13 @@
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import logging
import socket
import pytest
from common_test_methods import (get_env_config_variable, get_host_ip4_by_dest_ip, get_host_ip6_by_dest_ip,
get_my_interface_by_dest_ip)
from common_test_methods import get_env_config_variable
from common_test_methods import get_host_ip4_by_dest_ip
from common_test_methods import get_host_ip6_by_dest_ip
from common_test_methods import get_my_interface_by_dest_ip
from pytest_embedded import Dut
try:
@@ -37,13 +38,13 @@ def test_examples_tcp_client_ipv4(dut: Dut) -> None:
ap_ssid = get_env_config_variable(env_name, 'ap_ssid')
ap_password = get_env_config_variable(env_name, 'ap_password')
dut.write(f'{ap_ssid} {ap_password}')
ipv4 = dut.expect(r'IPv4 address: (\d+\.\d+\.\d+\.\d+)[^\d]', timeout=30)[1].decode()
ipv4 = dut.expect(r'IPv4 address: (\d+\.\d+\.\d+\.\d+)[^\d]', timeout=60)[1].decode()
print(f'Connected with IPv4={ipv4}')
# test IPv4
with TcpServer(PORT, socket.AF_INET):
server_ip = get_host_ip4_by_dest_ip(ipv4)
print('Connect tcp client to server IP={}'.format(server_ip))
print(f'Connect tcp client to server IP={server_ip}')
dut.write(server_ip)
dut.expect('OK: Message from ESP32')
@@ -64,16 +65,16 @@ def test_examples_tcp_client_ipv6(dut: Dut) -> None:
ap_ssid = get_env_config_variable(env_name, 'ap_ssid')
ap_password = get_env_config_variable(env_name, 'ap_password')
dut.write(f'{ap_ssid} {ap_password}')
ipv4 = dut.expect(r'IPv4 address: (\d+\.\d+\.\d+\.\d+)[^\d]', timeout=30)[1].decode()
ipv4 = dut.expect(r'IPv4 address: (\d+\.\d+\.\d+\.\d+)[^\d]', timeout=60)[1].decode()
# expect all 8 octets from IPv6 (assumes it's printed in the long form)
ipv6_r = r':'.join((r'[0-9a-fA-F]{4}',) * 8)
ipv6 = dut.expect(ipv6_r, timeout=30)[0].decode()
print('Connected with IPv4={} and IPv6={}'.format(ipv4, ipv6))
ipv6 = dut.expect(ipv6_r, timeout=60)[0].decode()
print(f'Connected with IPv4={ipv4} and IPv6={ipv6}')
# test IPv6
my_interface = get_my_interface_by_dest_ip(ipv4)
with TcpServer(PORT, socket.AF_INET6):
server_ip = get_host_ip6_by_dest_ip(ipv6, my_interface)
print('Connect tcp client to server IP={}'.format(server_ip))
print(f'Connect tcp client to server IP={server_ip}')
dut.write(server_ip)
dut.expect('OK: Message from ESP32')