CI: use ssid password from stdin for pytest cases
This commit is contained in:
@@ -9,6 +9,7 @@ import logging
|
||||
import os
|
||||
|
||||
import pytest
|
||||
from common_test_methods import get_env_config
|
||||
from pytest_embedded import Dut
|
||||
|
||||
try:
|
||||
@@ -62,6 +63,12 @@ def test_examples_protocol_http_ws_echo_server(dut: Dut) -> None:
|
||||
|
||||
# Parse IP address of STA
|
||||
logging.info('Waiting to connect with AP')
|
||||
if dut.app.sdkconfig.get('EXAMPLE_WIFI_SSID_PWD_FROM_STDIN') is True:
|
||||
env_config = get_env_config('wifi_router')
|
||||
ap_ssid = env_config['ap_ssid']
|
||||
ap_password = env_config['ap_password']
|
||||
dut.expect('Please input ssid password:')
|
||||
dut.write(' '.join([ap_ssid, ap_password]))
|
||||
got_ip = dut.expect(r'IPv4 address: (\d+\.\d+\.\d+\.\d+)', timeout=30)[1].decode()
|
||||
got_port = dut.expect(r"Starting server on port: '(\d+)'", timeout=30)[1].decode()
|
||||
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y
|
||||
CONFIG_EXAMPLE_WIFI_SSID_PWD_FROM_STDIN=y
|
||||
|
||||
Reference in New Issue
Block a user