Merge branch 'feature/split_example_tests' into 'master'

Split example_tests with Example_WIFI tag group into Example_OTA and Example_Protocols

See merge request espressif/esp-idf!12973
This commit is contained in:
Mahavir Jain 2021-04-15 06:27:52 +00:00
commit ab831ee9bf
30 changed files with 53 additions and 41 deletions

View File

@ -89,7 +89,6 @@ test_weekend_network:
example_test_001A: example_test_001A:
extends: .example_test_esp32_template extends: .example_test_esp32_template
parallel: 4
tags: tags:
- ESP32 - ESP32
- Example_WIFI - Example_WIFI
@ -119,6 +118,19 @@ example_test_001D:
- ESP32 - ESP32
- Example_8Mflash_Ethernet - Example_8Mflash_Ethernet
example_test_OTA:
extends: .example_test_esp32_template
tags:
- ESP32
- Example_WIFI_OTA
example_test_protocols:
extends: .example_test_esp32_template
parallel: 2
tags:
- ESP32
- Example_WIFI_Protocols
example_test_002: example_test_002:
extends: .example_test_esp32_template extends: .example_test_esp32_template
image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG image: $CI_DOCKER_REGISTRY/ubuntu-test-env$BOT_DOCKER_IMAGE_TAG

View File

@ -44,7 +44,7 @@ def chat_server_sketch(my_ip):
print('server closed') print('server closed')
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_asio_chat_client(env, extra_data): def test_examples_protocol_asio_chat_client(env, extra_data):
""" """
steps: | steps: |

View File

@ -5,7 +5,7 @@ import socket
import ttfw_idf import ttfw_idf
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_asio_chat_server(env, extra_data): def test_examples_protocol_asio_chat_server(env, extra_data):
""" """
steps: | steps: |

View File

@ -5,7 +5,7 @@ import socket
import ttfw_idf import ttfw_idf
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_asio_tcp_server(env, extra_data): def test_examples_protocol_asio_tcp_server(env, extra_data):
""" """
steps: | steps: |

View File

@ -5,7 +5,7 @@ import socket
import ttfw_idf import ttfw_idf
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_asio_udp_server(env, extra_data): def test_examples_protocol_asio_udp_server(env, extra_data):
""" """
steps: | steps: |

View File

@ -6,7 +6,7 @@ import textwrap
import ttfw_idf import ttfw_idf
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_cbor(env, extra_data): def test_examples_cbor(env, extra_data):
dut = env.get_dut('cbor', 'examples/protocols/cbor') dut = env.get_dut('cbor', 'examples/protocols/cbor')

View File

@ -7,7 +7,7 @@ import sys
import ttfw_idf import ttfw_idf
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_esp_local_ctrl(env, extra_data): def test_examples_esp_local_ctrl(env, extra_data):
rel_project_path = os.path.join('examples', 'protocols', 'esp_local_ctrl') rel_project_path = os.path.join('examples', 'protocols', 'esp_local_ctrl')

View File

@ -35,7 +35,7 @@ from tiny_test_fw import Utility
# features to this component. # features to this component.
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_http_server_advanced(env, extra_data): def test_examples_protocol_http_server_advanced(env, extra_data):
# Acquire DUT # Acquire DUT
dut1 = env.get_dut('http_server', 'examples/protocols/http_server/advanced_tests', dut_class=ttfw_idf.ESP32DUT) dut1 = env.get_dut('http_server', 'examples/protocols/http_server/advanced_tests', dut_class=ttfw_idf.ESP32DUT)

View File

@ -25,7 +25,7 @@ from idf_http_server_test import adder as client
from tiny_test_fw import Utility from tiny_test_fw import Utility
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_http_server_file_serving(env, extra_data): # type: (tiny_test_fw.Env.Env, None) -> None # pylint: disable=unused-argument def test_examples_protocol_http_server_file_serving(env, extra_data): # type: (tiny_test_fw.Env.Env, None) -> None # pylint: disable=unused-argument
# Acquire DUT # Acquire DUT
dut1 = env.get_dut('http file_serving', 'examples/protocols/http_server/file_serving', dut_class=ttfw_idf.ESP32DUT) dut1 = env.get_dut('http file_serving', 'examples/protocols/http_server/file_serving', dut_class=ttfw_idf.ESP32DUT)

View File

@ -30,7 +30,7 @@ from tiny_test_fw import Utility
# > make print_flash_cmd | tail -n 1 > build/download.config # > make print_flash_cmd | tail -n 1 > build/download.config
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_http_server_persistence(env, extra_data): def test_examples_protocol_http_server_persistence(env, extra_data):
# Acquire DUT # Acquire DUT
dut1 = env.get_dut('http_server', 'examples/protocols/http_server/persistent_sockets', dut1 = env.get_dut('http_server', 'examples/protocols/http_server/persistent_sockets',

View File

@ -62,7 +62,7 @@ class http_client_thread(threading.Thread):
# > make print_flash_cmd | tail -n 1 > build/download.config # > make print_flash_cmd | tail -n 1 > build/download.config
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_http_server_simple(env, extra_data): def test_examples_protocol_http_server_simple(env, extra_data):
# Acquire DUT # Acquire DUT
dut1 = env.get_dut('http_server', 'examples/protocols/http_server/simple', dut_class=ttfw_idf.ESP32DUT) dut1 = env.get_dut('http_server', 'examples/protocols/http_server/simple', dut_class=ttfw_idf.ESP32DUT)
@ -129,7 +129,7 @@ def test_examples_protocol_http_server_simple(env, extra_data):
dut1.expect('Found URL query => ' + query, timeout=30) dut1.expect('Found URL query => ' + query, timeout=30)
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_http_server_lru_purge_enable(env, extra_data): def test_examples_protocol_http_server_lru_purge_enable(env, extra_data):
# Acquire DUT # Acquire DUT
dut1 = env.get_dut('http_server', 'examples/protocols/http_server/simple', dut_class=ttfw_idf.ESP32DUT) dut1 = env.get_dut('http_server', 'examples/protocols/http_server/simple', dut_class=ttfw_idf.ESP32DUT)

View File

@ -53,7 +53,7 @@ class WsClient:
return self.ws.send(data) return self.ws.send(data)
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_http_ws_echo_server(env, extra_data): def test_examples_protocol_http_ws_echo_server(env, extra_data):
# Acquire DUT # Acquire DUT
dut1 = env.get_dut('http_server', 'examples/protocols/http_server/ws_echo_server', dut_class=ttfw_idf.ESP32DUT) dut1 = env.get_dut('http_server', 'examples/protocols/http_server/ws_echo_server', dut_class=ttfw_idf.ESP32DUT)

View File

@ -46,7 +46,7 @@ server_cert_pem = '-----BEGIN CERTIFICATE-----\n'\
success_response = '<h1>Hello Secure World!</h1>' success_response = '<h1>Hello Secure World!</h1>'
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_https_server_simple(env, extra_data): # type: (tiny_test_fw.Env.Env, None) -> None # pylint: disable=unused-argument def test_examples_protocol_https_server_simple(env, extra_data): # type: (tiny_test_fw.Env.Env, None) -> None # pylint: disable=unused-argument
""" """
steps: | steps: |

View File

@ -117,7 +117,7 @@ def test_multiple_client_keep_alive_and_async_response(ip, port, ca_file): # ty
t.join() t.join()
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_https_wss_server(env, extra_data): # type: (tiny_test_fw.Env.Env, None) -> None # pylint: disable=unused-argument def test_examples_protocol_https_wss_server(env, extra_data): # type: (tiny_test_fw.Env.Env, None) -> None # pylint: disable=unused-argument
# Acquire DUT # Acquire DUT

View File

@ -4,7 +4,7 @@ import re
import ttfw_idf import ttfw_idf
@ttfw_idf.idf_example_test(env_tag='Example_WIFI', ignore=True) @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols', ignore=True)
def test_examples_protocol_https_x509_bundle(env, extra_data): def test_examples_protocol_https_x509_bundle(env, extra_data):
""" """
steps: | steps: |

View File

@ -6,7 +6,7 @@ import re
import ttfw_idf import ttfw_idf
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_icmp_echo(env, extra_data): def test_examples_icmp_echo(env, extra_data):
dut = env.get_dut('icmp_echo', 'examples/protocols/icmp_echo') dut = env.get_dut('icmp_echo', 'examples/protocols/icmp_echo')

View File

@ -87,7 +87,7 @@ def mdns_server(esp_host):
continue continue
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_mdns(env, extra_data): def test_examples_protocol_mdns(env, extra_data):
global stop_mdns_server global stop_mdns_server
""" """

View File

@ -58,7 +58,7 @@ def on_message(client, userdata, msg):
message_log += 'Received data:' + msg.topic + ' ' + payload + '\n' message_log += 'Received data:' + msg.topic + ' ' + payload + '\n'
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_mqtt_ssl(env, extra_data): def test_examples_protocol_mqtt_ssl(env, extra_data):
broker_url = '' broker_url = ''
broker_port = 0 broker_port = 0

View File

@ -53,7 +53,7 @@ def mqqt_server_sketch(my_ip, port):
print('server closed') print('server closed')
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_mqtt_qos1(env, extra_data): def test_examples_protocol_mqtt_qos1(env, extra_data):
global msgid global msgid
""" """

View File

@ -39,7 +39,7 @@ def on_message(client, userdata, msg):
message_log += 'Received data:' + msg.topic + ' ' + payload + '\n' message_log += 'Received data:' + msg.topic + ' ' + payload + '\n'
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_mqtt_ws(env, extra_data): def test_examples_protocol_mqtt_ws(env, extra_data):
broker_url = '' broker_url = ''
broker_port = 0 broker_port = 0

View File

@ -40,7 +40,7 @@ def on_message(client, userdata, msg):
message_log += 'Received data:' + msg.topic + ' ' + payload + '\n' message_log += 'Received data:' + msg.topic + ' ' + payload + '\n'
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_mqtt_wss(env, extra_data): def test_examples_protocol_mqtt_wss(env, extra_data):
broker_url = '' broker_url = ''
broker_port = 0 broker_port = 0

View File

@ -7,7 +7,7 @@ import ttfw_idf
from tiny_test_fw import Utility from tiny_test_fw import Utility
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_sntp(env, extra_data): def test_examples_sntp(env, extra_data):
dut = env.get_dut('sntp', 'examples/protocols/sntp') dut = env.get_dut('sntp', 'examples/protocols/sntp')

View File

@ -85,7 +85,7 @@ class TcpServer:
break break
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_socket_tcpclient(env, extra_data): def test_examples_protocol_socket_tcpclient(env, extra_data):
""" """
steps: steps:

View File

@ -46,7 +46,7 @@ def tcp_client(address, payload):
return data.decode() return data.decode()
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_socket_tcpserver(env, extra_data): def test_examples_protocol_socket_tcpserver(env, extra_data):
MESSAGE = 'Data to ESP' MESSAGE = 'Data to ESP'
""" """

View File

@ -78,7 +78,7 @@ class UdpServer:
break break
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_socket_udpclient(env, extra_data): def test_examples_protocol_socket_udpclient(env, extra_data):
""" """
steps: steps:

View File

@ -44,7 +44,7 @@ def udp_client(address, payload):
return reply.decode() return reply.decode()
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_socket_udpserver(env, extra_data): def test_examples_protocol_socket_udpserver(env, extra_data):
MESSAGE = 'Data to ESP' MESSAGE = 'Data to ESP'
""" """

View File

@ -97,7 +97,7 @@ def test_recv_long_msg(dut, websocket, msg_len, repeats):
\nreceived: {}\nwith length {}'.format(send_msg, len(send_msg), recv_msg, len(recv_msg))) \nreceived: {}\nwith length {}'.format(send_msg, len(send_msg), recv_msg, len(recv_msg)))
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_websocket(env, extra_data): def test_examples_protocol_websocket(env, extra_data):
""" """
steps: steps:

View File

@ -169,7 +169,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') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_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.
@ -213,7 +213,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') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_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.
@ -264,7 +264,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') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_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.
@ -314,7 +314,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') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_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.
@ -363,7 +363,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') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_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.
@ -401,7 +401,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') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_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.
@ -512,7 +512,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') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_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.

View File

@ -135,7 +135,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') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_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.
@ -179,7 +179,7 @@ def test_examples_protocol_native_ota_example(env, extra_data):
dut1.reset() dut1.reset()
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_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.
@ -230,7 +230,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') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_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.
@ -280,7 +280,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') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_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.
@ -329,7 +329,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') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_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.

View File

@ -92,7 +92,7 @@ def start_https_server(ota_image_dir, server_ip, server_port, server_file=None,
httpd.serve_forever() httpd.serve_forever()
@ttfw_idf.idf_example_test(env_tag='Example_WIFI') @ttfw_idf.idf_example_test(env_tag='Example_WIFI_OTA')
def test_examples_protocol_simple_ota_example(env, extra_data): def test_examples_protocol_simple_ota_example(env, extra_data):
""" """
steps: | steps: |