Merge branch 'bugfix/improve_ota_test_success_rate' into 'master'

OTA examples: Reduce example test failure rate

See merge request espressif/esp-idf!15953
This commit is contained in:
Mahavir Jain
2021-11-22 04:49:46 +00:00
7 changed files with 63 additions and 34 deletions

View File

@@ -115,10 +115,9 @@ example_test_001D:
example_test_OTA: example_test_OTA:
extends: .example_test_esp32_template extends: .example_test_esp32_template
parallel: 2
tags: tags:
- ESP32 - ESP32
- Example_WIFI_OTA - EXAMPLE_ETH_OTA
example_test_protocols: example_test_protocols:
extends: .example_test_esp32_template extends: .example_test_esp32_template

View File

@@ -168,7 +168,7 @@ def start_redirect_server(ota_image_dir, server_ip, server_port, redirection_por
httpd.serve_forever() httpd.serve_forever()
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='EXAMPLE_ETH_OTA')
def test_examples_protocol_advanced_https_ota_example(env, extra_data): def test_examples_protocol_advanced_https_ota_example(env, extra_data):
""" """
This is a positive test case, which downloads complete binary file multiple number of times. This is a positive test case, which downloads complete binary file multiple number of times.
@@ -198,7 +198,7 @@ def test_examples_protocol_advanced_https_ota_example(env, extra_data):
for i in range(iterations): for i in range(iterations):
dut1.expect('Loaded app from partition at offset', timeout=30) dut1.expect('Loaded app from partition at offset', timeout=30)
try: try:
ip_address = dut1.expect(re.compile(r' sta ip: ([^,]+),'), timeout=30) ip_address = dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=30)
print('Connected to AP with IP: {}'.format(ip_address)) print('Connected to AP with IP: {}'.format(ip_address))
except DUT.ExpectTimeout: except DUT.ExpectTimeout:
raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP') raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP')
@@ -212,7 +212,7 @@ def test_examples_protocol_advanced_https_ota_example(env, extra_data):
dut1.reset() dut1.reset()
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='EXAMPLE_ETH_OTA')
def test_examples_protocol_advanced_https_ota_example_truncated_bin(env, extra_data): def test_examples_protocol_advanced_https_ota_example_truncated_bin(env, extra_data):
""" """
Working of OTA if binary file is truncated is validated in this test case. Working of OTA if binary file is truncated is validated in this test case.
@@ -251,7 +251,7 @@ def test_examples_protocol_advanced_https_ota_example_truncated_bin(env, extra_d
dut1.start_app() dut1.start_app()
dut1.expect('Loaded app from partition at offset', timeout=30) dut1.expect('Loaded app from partition at offset', timeout=30)
try: try:
ip_address = dut1.expect(re.compile(r' sta ip: ([^,]+),'), timeout=30) ip_address = dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=30)
print('Connected to AP with IP: {}'.format(ip_address)) print('Connected to AP with IP: {}'.format(ip_address))
except DUT.ExpectTimeout: except DUT.ExpectTimeout:
raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP') raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP')
@@ -263,7 +263,7 @@ def test_examples_protocol_advanced_https_ota_example_truncated_bin(env, extra_d
os.remove(binary_file) os.remove(binary_file)
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='EXAMPLE_ETH_OTA')
def test_examples_protocol_advanced_https_ota_example_truncated_header(env, extra_data): def test_examples_protocol_advanced_https_ota_example_truncated_header(env, extra_data):
""" """
Working of OTA if headers of binary file are truncated is vaildated in this test case. Working of OTA if headers of binary file are truncated is vaildated in this test case.
@@ -301,7 +301,7 @@ def test_examples_protocol_advanced_https_ota_example_truncated_header(env, extr
dut1.start_app() dut1.start_app()
dut1.expect('Loaded app from partition at offset', timeout=30) dut1.expect('Loaded app from partition at offset', timeout=30)
try: try:
ip_address = dut1.expect(re.compile(r' sta ip: ([^,]+),'), timeout=30) ip_address = dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=30)
print('Connected to AP with IP: {}'.format(ip_address)) print('Connected to AP with IP: {}'.format(ip_address))
except DUT.ExpectTimeout: except DUT.ExpectTimeout:
raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP') raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP')
@@ -313,7 +313,7 @@ def test_examples_protocol_advanced_https_ota_example_truncated_header(env, extr
os.remove(binary_file) os.remove(binary_file)
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='EXAMPLE_ETH_OTA')
def test_examples_protocol_advanced_https_ota_example_random(env, extra_data): def test_examples_protocol_advanced_https_ota_example_random(env, extra_data):
""" """
Working of OTA if random data is added in binary file are validated in this test case. Working of OTA if random data is added in binary file are validated in this test case.
@@ -350,7 +350,7 @@ def test_examples_protocol_advanced_https_ota_example_random(env, extra_data):
dut1.start_app() dut1.start_app()
dut1.expect('Loaded app from partition at offset', timeout=30) dut1.expect('Loaded app from partition at offset', timeout=30)
try: try:
ip_address = dut1.expect(re.compile(r' sta ip: ([^,]+),'), timeout=30) ip_address = dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=30)
print('Connected to AP with IP: {}'.format(ip_address)) print('Connected to AP with IP: {}'.format(ip_address))
except DUT.ExpectTimeout: except DUT.ExpectTimeout:
raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP') raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP')
@@ -362,7 +362,7 @@ def test_examples_protocol_advanced_https_ota_example_random(env, extra_data):
os.remove(binary_file) os.remove(binary_file)
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='EXAMPLE_ETH_OTA')
def test_examples_protocol_advanced_https_ota_example_chunked(env, extra_data): def test_examples_protocol_advanced_https_ota_example_chunked(env, extra_data):
""" """
This is a positive test case, which downloads complete binary file multiple number of times. This is a positive test case, which downloads complete binary file multiple number of times.
@@ -385,7 +385,7 @@ def test_examples_protocol_advanced_https_ota_example_chunked(env, extra_data):
dut1.start_app() dut1.start_app()
dut1.expect('Loaded app from partition at offset', timeout=30) dut1.expect('Loaded app from partition at offset', timeout=30)
try: try:
ip_address = dut1.expect(re.compile(r' sta ip: ([^,]+),'), timeout=30) ip_address = dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=30)
print('Connected to AP with IP: {}'.format(ip_address)) print('Connected to AP with IP: {}'.format(ip_address))
except DUT.ExpectTimeout: except DUT.ExpectTimeout:
raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP') raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP')
@@ -400,7 +400,7 @@ def test_examples_protocol_advanced_https_ota_example_chunked(env, extra_data):
os.remove(os.path.join(dut1.app.binary_path, 'server_key.pem')) os.remove(os.path.join(dut1.app.binary_path, 'server_key.pem'))
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='EXAMPLE_ETH_OTA')
def test_examples_protocol_advanced_https_ota_example_redirect_url(env, extra_data): def test_examples_protocol_advanced_https_ota_example_redirect_url(env, extra_data):
""" """
This is a positive test case, which starts a server and a redirection server. This is a positive test case, which starts a server and a redirection server.
@@ -433,7 +433,7 @@ def test_examples_protocol_advanced_https_ota_example_redirect_url(env, extra_da
dut1.start_app() dut1.start_app()
dut1.expect('Loaded app from partition at offset', timeout=30) dut1.expect('Loaded app from partition at offset', timeout=30)
try: try:
ip_address = dut1.expect(re.compile(r' sta ip: ([^,]+),'), timeout=30) ip_address = dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=30)
print('Connected to AP with IP: {}'.format(ip_address)) print('Connected to AP with IP: {}'.format(ip_address))
except DUT.ExpectTimeout: except DUT.ExpectTimeout:
raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP') raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP')
@@ -492,7 +492,7 @@ def test_examples_protocol_advanced_https_ota_example_anti_rollback(env, extra_d
# Positive Case # Positive Case
dut1.expect('Loaded app from partition at offset', timeout=30) dut1.expect('Loaded app from partition at offset', timeout=30)
try: try:
ip_address = dut1.expect(re.compile(r' eth ip: ([^,]+),'), timeout=30) ip_address = dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=30)
print('Connected to AP with IP: {}'.format(ip_address)) print('Connected to AP with IP: {}'.format(ip_address))
except DUT.ExpectTimeout: except DUT.ExpectTimeout:
raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP') raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP')
@@ -502,7 +502,7 @@ def test_examples_protocol_advanced_https_ota_example_anti_rollback(env, extra_d
print('writing to device: {}'.format('https://' + host_ip + ':' + str(server_port) + '/' + bin_name)) print('writing to device: {}'.format('https://' + host_ip + ':' + str(server_port) + '/' + bin_name))
dut1.write('https://' + host_ip + ':' + str(server_port) + '/' + bin_name) dut1.write('https://' + host_ip + ':' + str(server_port) + '/' + bin_name)
dut1.expect('Loaded app from partition at offset', timeout=60) dut1.expect('Loaded app from partition at offset', timeout=60)
dut1.expect(re.compile(r' eth ip: ([^,]+),'), timeout=30) dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=30)
dut1.expect('App is valid, rollback cancelled successfully', 30) dut1.expect('App is valid, rollback cancelled successfully', 30)
# Negative Case # Negative Case
@@ -514,7 +514,7 @@ def test_examples_protocol_advanced_https_ota_example_anti_rollback(env, extra_d
os.remove(anti_rollback_bin_name) os.remove(anti_rollback_bin_name)
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='EXAMPLE_ETH_OTA')
def test_examples_protocol_advanced_https_ota_example_partial_request(env, extra_data): def test_examples_protocol_advanced_https_ota_example_partial_request(env, extra_data):
""" """
This is a positive test case, to test OTA workflow with Range HTTP header. This is a positive test case, to test OTA workflow with Range HTTP header.
@@ -543,7 +543,7 @@ def test_examples_protocol_advanced_https_ota_example_partial_request(env, extra
dut1.start_app() dut1.start_app()
dut1.expect('Loaded app from partition at offset', timeout=30) dut1.expect('Loaded app from partition at offset', timeout=30)
try: try:
ip_address = dut1.expect(re.compile(r' sta ip: ([^,]+),'), timeout=30) ip_address = dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=30)
print('Connected to AP with IP: {}'.format(ip_address)) print('Connected to AP with IP: {}'.format(ip_address))
except DUT.ExpectTimeout: except DUT.ExpectTimeout:
Utility.console_log('ENV_TEST_FAILURE: Cannot connect to AP') Utility.console_log('ENV_TEST_FAILURE: Cannot connect to AP')
@@ -559,7 +559,7 @@ def test_examples_protocol_advanced_https_ota_example_partial_request(env, extra
dut1.reset() dut1.reset()
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA', nightly_run=True)
def test_examples_protocol_advanced_https_ota_example_nimble_gatts(env, extra_data): def test_examples_protocol_advanced_https_ota_example_nimble_gatts(env, extra_data):
""" """
Run an OTA image update while a BLE GATT Server is running in background. This GATT server will be using NimBLE Host stack. Run an OTA image update while a BLE GATT Server is running in background. This GATT server will be using NimBLE Host stack.
@@ -602,7 +602,7 @@ def test_examples_protocol_advanced_https_ota_example_nimble_gatts(env, extra_da
dut1.reset() dut1.reset()
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA', nightly_run=True)
def test_examples_protocol_advanced_https_ota_example_bluedroid_gatts(env, extra_data): def test_examples_protocol_advanced_https_ota_example_bluedroid_gatts(env, extra_data):
""" """
Run an OTA image update while a BLE GATT Server is running in background. This GATT server will be using Bluedroid Host stack. Run an OTA image update while a BLE GATT Server is running in background. This GATT server will be using Bluedroid Host stack.
@@ -645,7 +645,7 @@ def test_examples_protocol_advanced_https_ota_example_bluedroid_gatts(env, extra
dut1.reset() dut1.reset()
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='EXAMPLE_ETH_OTA')
def test_examples_protocol_advanced_https_ota_example_openssl_aligned_bin(env, extra_data): def test_examples_protocol_advanced_https_ota_example_openssl_aligned_bin(env, extra_data):
""" """
This is a test case for esp_http_client_read with binary size multiple of 289 bytes This is a test case for esp_http_client_read with binary size multiple of 289 bytes
@@ -678,7 +678,7 @@ def test_examples_protocol_advanced_https_ota_example_openssl_aligned_bin(env, e
dut1.start_app() dut1.start_app()
dut1.expect('Loaded app from partition at offset', timeout=30) dut1.expect('Loaded app from partition at offset', timeout=30)
try: try:
ip_address = dut1.expect(re.compile(r' sta ip: ([^,]+),'), timeout=30) ip_address = dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=30)
print('Connected to AP with IP: {}'.format(ip_address)) print('Connected to AP with IP: {}'.format(ip_address))
except DUT.ExpectTimeout: except DUT.ExpectTimeout:
raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP') raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP')

View File

@@ -2,3 +2,13 @@ CONFIG_EXAMPLE_FIRMWARE_UPGRADE_URL="FROM_STDIN"
CONFIG_EXAMPLE_SKIP_COMMON_NAME_CHECK=y CONFIG_EXAMPLE_SKIP_COMMON_NAME_CHECK=y
CONFIG_EXAMPLE_SKIP_VERSION_CHECK=y CONFIG_EXAMPLE_SKIP_VERSION_CHECK=y
CONFIG_EXAMPLE_OTA_RECV_TIMEOUT=3000 CONFIG_EXAMPLE_OTA_RECV_TIMEOUT=3000
CONFIG_EXAMPLE_CONNECT_ETHERNET=y
CONFIG_EXAMPLE_CONNECT_WIFI=n
CONFIG_EXAMPLE_USE_INTERNAL_ETHERNET=y
CONFIG_EXAMPLE_ETH_PHY_IP101=y
CONFIG_EXAMPLE_ETH_MDC_GPIO=23
CONFIG_EXAMPLE_ETH_MDIO_GPIO=18
CONFIG_EXAMPLE_ETH_PHY_RST_GPIO=5
CONFIG_EXAMPLE_ETH_PHY_ADDR=1
CONFIG_EXAMPLE_CONNECT_IPV6=y

View File

@@ -5,3 +5,13 @@ CONFIG_EXAMPLE_OTA_RECV_TIMEOUT=3000
CONFIG_EXAMPLE_ENABLE_PARTIAL_HTTP_DOWNLOAD=y CONFIG_EXAMPLE_ENABLE_PARTIAL_HTTP_DOWNLOAD=y
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y
CONFIG_EXAMPLE_CONNECT_ETHERNET=y
CONFIG_EXAMPLE_CONNECT_WIFI=n
CONFIG_EXAMPLE_USE_INTERNAL_ETHERNET=y
CONFIG_EXAMPLE_ETH_PHY_IP101=y
CONFIG_EXAMPLE_ETH_MDC_GPIO=23
CONFIG_EXAMPLE_ETH_MDIO_GPIO=18
CONFIG_EXAMPLE_ETH_PHY_RST_GPIO=5
CONFIG_EXAMPLE_ETH_PHY_ADDR=1
CONFIG_EXAMPLE_CONNECT_IPV6=y

View File

@@ -134,7 +134,7 @@ def start_chunked_server(ota_image_dir, server_port):
return chunked_server return chunked_server
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='EXAMPLE_ETH_OTA')
def test_examples_protocol_native_ota_example(env, extra_data): def test_examples_protocol_native_ota_example(env, extra_data):
""" """
This is a positive test case, which downloads complete binary file multiple number of times. This is a positive test case, which downloads complete binary file multiple number of times.
@@ -164,7 +164,7 @@ def test_examples_protocol_native_ota_example(env, extra_data):
for i in range(iterations): for i in range(iterations):
dut1.expect('Loaded app from partition at offset', timeout=30) dut1.expect('Loaded app from partition at offset', timeout=30)
try: try:
ip_address = dut1.expect(re.compile(r' sta ip: ([^,]+),'), timeout=30) ip_address = dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=30)
print('Connected to AP with IP: {}'.format(ip_address)) print('Connected to AP with IP: {}'.format(ip_address))
except DUT.ExpectTimeout: except DUT.ExpectTimeout:
raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP') raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP')
@@ -178,7 +178,7 @@ def test_examples_protocol_native_ota_example(env, extra_data):
dut1.reset() dut1.reset()
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='EXAMPLE_ETH_OTA')
def test_examples_protocol_native_ota_example_truncated_bin(env, extra_data): def test_examples_protocol_native_ota_example_truncated_bin(env, extra_data):
""" """
Working of OTA if binary file is truncated is validated in this test case. Working of OTA if binary file is truncated is validated in this test case.
@@ -217,7 +217,7 @@ def test_examples_protocol_native_ota_example_truncated_bin(env, extra_data):
dut1.start_app() dut1.start_app()
dut1.expect('Loaded app from partition at offset', timeout=30) dut1.expect('Loaded app from partition at offset', timeout=30)
try: try:
ip_address = dut1.expect(re.compile(r' sta ip: ([^,]+),'), timeout=60) ip_address = dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=60)
print('Connected to AP with IP: {}'.format(ip_address)) print('Connected to AP with IP: {}'.format(ip_address))
except DUT.ExpectTimeout: except DUT.ExpectTimeout:
raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP') raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP')
@@ -229,7 +229,7 @@ def test_examples_protocol_native_ota_example_truncated_bin(env, extra_data):
os.remove(binary_file) os.remove(binary_file)
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='EXAMPLE_ETH_OTA')
def test_examples_protocol_native_ota_example_truncated_header(env, extra_data): def test_examples_protocol_native_ota_example_truncated_header(env, extra_data):
""" """
Working of OTA if headers of binary file are truncated is vaildated in this test case. Working of OTA if headers of binary file are truncated is vaildated in this test case.
@@ -267,7 +267,7 @@ def test_examples_protocol_native_ota_example_truncated_header(env, extra_data):
dut1.start_app() dut1.start_app()
dut1.expect('Loaded app from partition at offset', timeout=30) dut1.expect('Loaded app from partition at offset', timeout=30)
try: try:
ip_address = dut1.expect(re.compile(r' sta ip: ([^,]+),'), timeout=60) ip_address = dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=60)
print('Connected to AP with IP: {}'.format(ip_address)) print('Connected to AP with IP: {}'.format(ip_address))
except DUT.ExpectTimeout: except DUT.ExpectTimeout:
raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP') raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP')
@@ -279,7 +279,7 @@ def test_examples_protocol_native_ota_example_truncated_header(env, extra_data):
os.remove(binary_file) os.remove(binary_file)
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='EXAMPLE_ETH_OTA')
def test_examples_protocol_native_ota_example_random(env, extra_data): def test_examples_protocol_native_ota_example_random(env, extra_data):
""" """
Working of OTA if random data is added in binary file are validated in this test case. Working of OTA if random data is added in binary file are validated in this test case.
@@ -316,7 +316,7 @@ def test_examples_protocol_native_ota_example_random(env, extra_data):
dut1.start_app() dut1.start_app()
dut1.expect('Loaded app from partition at offset', timeout=30) dut1.expect('Loaded app from partition at offset', timeout=30)
try: try:
ip_address = dut1.expect(re.compile(r' sta ip: ([^,]+),'), timeout=60) ip_address = dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=60)
print('Connected to AP with IP: {}'.format(ip_address)) print('Connected to AP with IP: {}'.format(ip_address))
except DUT.ExpectTimeout: except DUT.ExpectTimeout:
raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP') raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP')
@@ -328,7 +328,7 @@ def test_examples_protocol_native_ota_example_random(env, extra_data):
os.remove(binary_file) os.remove(binary_file)
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='EXAMPLE_ETH_OTA')
def test_examples_protocol_native_ota_example_chunked(env, extra_data): def test_examples_protocol_native_ota_example_chunked(env, extra_data):
""" """
This is a positive test case, which downloads complete binary file multiple number of times. This is a positive test case, which downloads complete binary file multiple number of times.
@@ -351,7 +351,7 @@ def test_examples_protocol_native_ota_example_chunked(env, extra_data):
dut1.start_app() dut1.start_app()
dut1.expect('Loaded app from partition at offset', timeout=30) dut1.expect('Loaded app from partition at offset', timeout=30)
try: try:
ip_address = dut1.expect(re.compile(r' sta ip: ([^,]+),'), timeout=30) ip_address = dut1.expect(re.compile(r' (sta|eth) ip: ([^,]+),'), timeout=30)
print('Connected to AP with IP: {}'.format(ip_address)) print('Connected to AP with IP: {}'.format(ip_address))
except DUT.ExpectTimeout: except DUT.ExpectTimeout:
raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP') raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP')

View File

@@ -2,3 +2,13 @@ CONFIG_EXAMPLE_FIRMWARE_UPG_URL="FROM_STDIN"
CONFIG_EXAMPLE_SKIP_COMMON_NAME_CHECK=y CONFIG_EXAMPLE_SKIP_COMMON_NAME_CHECK=y
CONFIG_EXAMPLE_SKIP_VERSION_CHECK=y CONFIG_EXAMPLE_SKIP_VERSION_CHECK=y
CONFIG_EXAMPLE_OTA_RECV_TIMEOUT=3000 CONFIG_EXAMPLE_OTA_RECV_TIMEOUT=3000
CONFIG_EXAMPLE_CONNECT_ETHERNET=y
CONFIG_EXAMPLE_CONNECT_WIFI=n
CONFIG_EXAMPLE_USE_INTERNAL_ETHERNET=y
CONFIG_EXAMPLE_ETH_PHY_IP101=y
CONFIG_EXAMPLE_ETH_MDC_GPIO=23
CONFIG_EXAMPLE_ETH_MDIO_GPIO=18
CONFIG_EXAMPLE_ETH_PHY_RST_GPIO=5
CONFIG_EXAMPLE_ETH_PHY_ADDR=1
CONFIG_EXAMPLE_CONNECT_IPV6=y

View File

@@ -114,7 +114,7 @@ def calc_all_sha256(dut):
return sha256_bootloader, sha256_app return sha256_bootloader, sha256_app
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA', nightly_run=True)
def test_examples_protocol_simple_ota_example(env, extra_data): def test_examples_protocol_simple_ota_example(env, extra_data):
""" """
steps: | steps: |
@@ -221,7 +221,7 @@ def test_examples_protocol_simple_ota_example_with_flash_encryption(env, extra_d
dut1.expect('Starting OTA example', timeout=30) dut1.expect('Starting OTA example', timeout=30)
@ttfw_idf.idf_example_test(env_tag='Example_Flash_Encryption_OTA_WiFi', target=['esp32c3']) @ttfw_idf.idf_example_test(env_tag='Example_Flash_Encryption_OTA_WiFi', target=['esp32c3'], nightly_run=True)
def test_examples_protocol_simple_ota_example_with_flash_encryption_wifi(env, extra_data): def test_examples_protocol_simple_ota_example_with_flash_encryption_wifi(env, extra_data):
""" """
steps: | steps: |