diff --git a/examples/protocols/mqtt/ssl/mqtt_ssl_example_test.py b/examples/protocols/mqtt/ssl/mqtt_ssl_example_test.py index dc879d1..0bdd6d3 100644 --- a/examples/protocols/mqtt/ssl/mqtt_ssl_example_test.py +++ b/examples/protocols/mqtt/ssl/mqtt_ssl_example_test.py @@ -58,7 +58,7 @@ def on_message(client, userdata, msg): message_log += 'Received data:' + msg.topic + ' ' + payload + '\n' -@ttfw_idf.idf_example_test(env_tag='Example_EthKitV1') +@ttfw_idf.idf_example_test(env_tag='ethernet_router') def test_examples_protocol_mqtt_ssl(env, extra_data): broker_url = '' broker_port = 0 @@ -110,7 +110,7 @@ def test_examples_protocol_mqtt_ssl(env, extra_data): raise ValueError('ENV_TEST_FAILURE: Test script cannot connect to broker: {}'.format(broker_url)) dut1.start_app() try: - ip_address = dut1.expect(re.compile(r'IPv4 address: ([^,]+),'), timeout=30) + ip_address = dut1.expect(re.compile(r'IPv4 address: (\d+\.\d+\.\d+\.\d+)'), timeout=30)[0] print('Connected to AP with IP: {}'.format(ip_address)) except DUT.ExpectTimeout: print('ENV_TEST_FAILURE: Cannot connect to AP') diff --git a/examples/protocols/mqtt/tcp/mqtt_tcp_example_test.py b/examples/protocols/mqtt/tcp/mqtt_tcp_example_test.py index 06c5691..735c6ad 100644 --- a/examples/protocols/mqtt/tcp/mqtt_tcp_example_test.py +++ b/examples/protocols/mqtt/tcp/mqtt_tcp_example_test.py @@ -7,7 +7,7 @@ import time from threading import Thread import ttfw_idf -from common_test_methods import get_my_ip4_by_dest_ip +from common_test_methods import get_host_ip4_by_dest_ip from tiny_test_fw import DUT msgid = -1 @@ -46,7 +46,7 @@ def mqqt_server_sketch(my_ip, port): print('server closed') -@ttfw_idf.idf_example_test(env_tag='Example_EthKitV1') +@ttfw_idf.idf_example_test(env_tag='ethernet_router') def test_examples_protocol_mqtt_qos1(env, extra_data): global msgid """ @@ -65,13 +65,13 @@ def test_examples_protocol_mqtt_qos1(env, extra_data): dut1.start_app() # waiting for getting the IP address try: - ip_address = dut1.expect(re.compile(r'IPv4 address: ([^,]+),'), timeout=30)[0] + ip_address = dut1.expect(re.compile(r'IPv4 address: (\d+\.\d+\.\d+\.\d+)'), timeout=30)[0] print('Connected to AP/Ethernet with IP: {}'.format(ip_address)) except DUT.ExpectTimeout: raise ValueError('ENV_TEST_FAILURE: Cannot connect to AP/Ethernet') # 2. start mqtt broker sketch - host_ip = get_my_ip4_by_dest_ip(ip_address) + host_ip = get_host_ip4_by_dest_ip(ip_address) thread1 = Thread(target=mqqt_server_sketch, args=(host_ip,1883)) thread1.start() diff --git a/examples/protocols/mqtt/ws/mqtt_ws_example_test.py b/examples/protocols/mqtt/ws/mqtt_ws_example_test.py index b4fc2fa..f8d87d9 100644 --- a/examples/protocols/mqtt/ws/mqtt_ws_example_test.py +++ b/examples/protocols/mqtt/ws/mqtt_ws_example_test.py @@ -39,7 +39,7 @@ def on_message(client, userdata, msg): message_log += 'Received data:' + msg.topic + ' ' + payload + '\n' -@ttfw_idf.idf_example_test(env_tag='Example_EthKitV1') +@ttfw_idf.idf_example_test(env_tag='ethernet_router') def test_examples_protocol_mqtt_ws(env, extra_data): broker_url = '' broker_port = 0 @@ -83,7 +83,7 @@ def test_examples_protocol_mqtt_ws(env, extra_data): raise ValueError('ENV_TEST_FAILURE: Test script cannot connect to broker: {}'.format(broker_url)) dut1.start_app() try: - ip_address = dut1.expect(re.compile(r'IPv4 address: ([^,]+),'), timeout=30) + ip_address = dut1.expect(re.compile(r'IPv4 address: (\d+\.\d+\.\d+\.\d+)'), timeout=30)[0] print('Connected to AP with IP: {}'.format(ip_address)) except DUT.ExpectTimeout: print('ENV_TEST_FAILURE: Cannot connect to AP') diff --git a/examples/protocols/mqtt/wss/mqtt_wss_example_test.py b/examples/protocols/mqtt/wss/mqtt_wss_example_test.py index b00a154..4d204d6 100644 --- a/examples/protocols/mqtt/wss/mqtt_wss_example_test.py +++ b/examples/protocols/mqtt/wss/mqtt_wss_example_test.py @@ -40,7 +40,7 @@ def on_message(client, userdata, msg): message_log += 'Received data:' + msg.topic + ' ' + payload + '\n' -@ttfw_idf.idf_example_test(env_tag='Example_EthKitV1') +@ttfw_idf.idf_example_test(env_tag='ethernet_router') def test_examples_protocol_mqtt_wss(env, extra_data): broker_url = '' broker_port = 0 @@ -87,7 +87,7 @@ def test_examples_protocol_mqtt_wss(env, extra_data): raise ValueError('ENV_TEST_FAILURE: Test script cannot connect to broker: {}'.format(broker_url)) dut1.start_app() try: - ip_address = dut1.expect(re.compile(r'IPv4 address: ([^,]+),'), timeout=30) + ip_address = dut1.expect(re.compile(r'IPv4 address: (\d+\.\d+\.\d+\.\d+)'), timeout=30)[0] print('Connected to AP with IP: {}'.format(ip_address)) except DUT.ExpectTimeout: print('ENV_TEST_FAILURE: Cannot connect to AP') diff --git a/tools/test_apps/protocols/mqtt/publish_connect_test/app_test.py b/tools/test_apps/protocols/mqtt/publish_connect_test/app_test.py index 2e99d02..0b30d06 100644 --- a/tools/test_apps/protocols/mqtt/publish_connect_test/app_test.py +++ b/tools/test_apps/protocols/mqtt/publish_connect_test/app_test.py @@ -15,7 +15,7 @@ from threading import Event, Lock, Thread import paho.mqtt.client as mqtt import ttfw_idf -from common_test_methods import get_my_ip4_by_dest_ip +from common_test_methods import get_host_ip4_by_dest_ip DEFAULT_MSG_SIZE = 16 @@ -236,7 +236,7 @@ class TlsServer: def connection_tests(dut, cases, dut_ip): - ip = get_my_ip4_by_dest_ip(dut_ip) + ip = get_host_ip4_by_dest_ip(dut_ip) set_server_cert_cn(ip) server_port = 2222 @@ -336,7 +336,7 @@ def test_app_protocol_mqtt_publish_connect(env, extra_data): raise dut1.start_app() - esp_ip = dut1.expect(re.compile(r' IPv4 address: ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)'), timeout=30)[0] + esp_ip = dut1.expect(re.compile(r'IPv4 address: (\d+\.\d+\.\d+\.\d+)'), timeout=30)[0] print('Got IP={}'.format(esp_ip)) if not os.getenv('MQTT_SKIP_CONNECT_TEST'):