ci: Made socket tests more robust

Added common timeout
Added debug logs for both addr families
Renamed example tests to have different names
This commit is contained in:
David Cermak
2020-12-23 10:15:27 +01:00
committed by bot
parent 286f06b274
commit 25499115eb
4 changed files with 34 additions and 18 deletions

View File

@@ -27,6 +27,7 @@ def tcp_client(address, payload):
family_addr, socktype, proto, canonname, addr = res
try:
sock = socket.socket(family_addr, socket.SOCK_STREAM)
sock.settimeout(60.0)
except socket.error as msg:
print('Could not create socket: ' + str(msg[0]) + ': ' + msg[1])
raise
@@ -46,7 +47,7 @@ def tcp_client(address, payload):
@ttfw_idf.idf_example_test(env_tag="Example_WIFI")
def test_examples_protocol_socket(env, extra_data):
def test_examples_protocol_socket_tcpserver(env, extra_data):
MESSAGE = "Data to ESP"
"""
steps:
@@ -85,4 +86,4 @@ if __name__ == '__main__':
# Usage: example_test.py <server_address> <message_to_send_to_server>
tcp_client(sys.argv[1], sys.argv[2])
else: # otherwise run standard example test as in the CI
test_examples_protocol_socket()
test_examples_protocol_socket_tcpserver()