mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
tests: change wifi tests expect timeout to 60
- wifi_router - wifi_ap - wifi_high_traffic
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
import datetime
|
||||
import logging
|
||||
from typing import Any
|
||||
from typing import Tuple
|
||||
|
||||
import pytest
|
||||
from common_test_methods import get_env_config_variable
|
||||
@@ -21,7 +20,7 @@ def test_get_time_from_sntp_server(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}')
|
||||
dut.expect('IPv4 address:')
|
||||
dut.expect('IPv4 address:', timeout=60)
|
||||
|
||||
dut.expect('Initializing and starting SNTP')
|
||||
dut.expect('Notification of a time synchronization event')
|
||||
@@ -32,11 +31,11 @@ def test_get_time_from_sntp_server(dut: Dut) -> None:
|
||||
NY_time = None
|
||||
SH_time = None
|
||||
|
||||
def check_time(prev_NY_time: Any, prev_SH_time: Any) -> Tuple[Any, Any]:
|
||||
NY_str = dut.expect(r'The current date/time in New York is: ({})'.format(TIME_FORMAT_REGEX))[1].decode()
|
||||
SH_str = dut.expect(r'The current date/time in Shanghai is: ({})'.format(TIME_FORMAT_REGEX))[1].decode()
|
||||
logging.info('New York: "{}"'.format(NY_str))
|
||||
logging.info('Shanghai: "{}"'.format(SH_str))
|
||||
def check_time(prev_NY_time: Any, prev_SH_time: Any) -> tuple[Any, Any]:
|
||||
NY_str = dut.expect(rf'The current date/time in New York is: ({TIME_FORMAT_REGEX})')[1].decode()
|
||||
SH_str = dut.expect(rf'The current date/time in Shanghai is: ({TIME_FORMAT_REGEX})')[1].decode()
|
||||
logging.info(f'New York: "{NY_str}"')
|
||||
logging.info(f'Shanghai: "{SH_str}"')
|
||||
dut.expect('Entering deep sleep for 10 seconds')
|
||||
logging.info('Sleeping...')
|
||||
new_NY_time = datetime.datetime.strptime(NY_str, TIME_FORMAT)
|
||||
@@ -50,5 +49,5 @@ def test_get_time_from_sntp_server(dut: Dut) -> None:
|
||||
|
||||
NY_time, SH_time = check_time(NY_time, SH_time)
|
||||
for i in range(2, 4):
|
||||
dut.expect('example: Boot count: {}'.format(i), timeout=30)
|
||||
dut.expect(f'example: Boot count: {i}', timeout=30)
|
||||
NY_time, SH_time = check_time(NY_time, SH_time)
|
||||
|
||||
Reference in New Issue
Block a user