mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
CI: use ssid password from stdin for pytest cases
This commit is contained in:
@@ -9,6 +9,7 @@ import os
|
||||
import ssl
|
||||
|
||||
import pytest
|
||||
from common_test_methods import get_env_config
|
||||
from pytest_embedded import Dut
|
||||
|
||||
server_cert_pem = '-----BEGIN CERTIFICATE-----\n'\
|
||||
@@ -106,11 +107,16 @@ def test_examples_protocol_https_server_simple(dut: Dut) -> None:
|
||||
bin_size = os.path.getsize(binary_file)
|
||||
logging.info('https_server_simple_bin_size : {}KB'.format(bin_size // 1024))
|
||||
# start test
|
||||
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]))
|
||||
# Parse IP address and port of the server
|
||||
dut.expect(r'Starting server')
|
||||
got_port = int(dut.expect(r'Server listening on port (\d+)', timeout=30)[1].decode())
|
||||
logging.info('Waiting to connect with AP')
|
||||
|
||||
got_ip = dut.expect(r'IPv4 address: (\d+\.\d+\.\d+\.\d+)', timeout=30)[1].decode()
|
||||
|
||||
# Expected logs
|
||||
@@ -174,11 +180,16 @@ def test_examples_protocol_https_server_simple_dynamic_buffers(dut: Dut) -> None
|
||||
# Test with mbedTLS dynamic buffer feature
|
||||
|
||||
# start test
|
||||
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]))
|
||||
# Parse IP address and port of the server
|
||||
dut.expect(r'Starting server')
|
||||
got_port = int(dut.expect(r'Server listening on port (\d+)', timeout=30)[1].decode())
|
||||
logging.info('Waiting to connect with AP')
|
||||
|
||||
got_ip = dut.expect(r'IPv4 address: (\d+\.\d+\.\d+\.\d+)', timeout=30)[1].decode()
|
||||
|
||||
# Expected logs
|
||||
|
@@ -1,2 +1,3 @@
|
||||
CONFIG_ESP_HTTPS_SERVER_ENABLE=y
|
||||
CONFIG_EXAMPLE_ENABLE_HTTPS_USER_CALLBACK=y
|
||||
CONFIG_EXAMPLE_WIFI_SSID_PWD_FROM_STDIN=y
|
||||
|
@@ -1,5 +1,6 @@
|
||||
CONFIG_ESP_HTTPS_SERVER_ENABLE=y
|
||||
CONFIG_EXAMPLE_ENABLE_HTTPS_USER_CALLBACK=y
|
||||
CONFIG_EXAMPLE_WIFI_SSID_PWD_FROM_STDIN=y
|
||||
CONFIG_MBEDTLS_DYNAMIC_BUFFER=y
|
||||
CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y
|
||||
CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT=y
|
||||
|
Reference in New Issue
Block a user