diff --git a/components/lwip/weekend_test/net_suite_test.py b/components/lwip/weekend_test/net_suite_test.py index ce6340a2da..59e763b44c 100644 --- a/components/lwip/weekend_test/net_suite_test.py +++ b/components/lwip/weekend_test/net_suite_test.py @@ -9,6 +9,7 @@ from shutil import copyfile try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -83,7 +84,7 @@ def lwip_test_suite(env, extra_data): 3. Execute ttcn3 test suite 4. Collect result from ttcn3 """ - dut1 = env.get_dut("net_suite", "examples/system/network_tests") + dut1 = env.get_dut("net_suite", "examples/system/network_tests", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "net_suite.bin") bin_size = os.path.getsize(binary_file) diff --git a/components/mqtt/weekend_test/mqtt_publish_test.py b/components/mqtt/weekend_test/mqtt_publish_test.py index 9263f3ada7..f3d081b4cf 100644 --- a/components/mqtt/weekend_test/mqtt_publish_test.py +++ b/components/mqtt/weekend_test/mqtt_publish_test.py @@ -13,6 +13,7 @@ import random try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -138,7 +139,7 @@ def test_weekend_mqtt_publish(env, extra_data): 3. Test evaluates python client received correct qos0 message 4. Test ESP32 client received correct qos0 message """ - dut1 = env.get_dut("mqtt_publish", "examples/protocols/mqtt/publish_test") + dut1 = env.get_dut("mqtt_publish", "examples/protocols/mqtt/publish_test", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "mqtt_publish.bin") bin_size = os.path.getsize(binary_file) diff --git a/examples/bluetooth/nimble/blecent/blecent_test_noci.py b/examples/bluetooth/nimble/blecent/blecent_test_noci.py index d1d79298c4..a305797355 100644 --- a/examples/bluetooth/nimble/blecent/blecent_test_noci.py +++ b/examples/bluetooth/nimble/blecent/blecent_test_noci.py @@ -27,6 +27,7 @@ try: if test_fw_path and test_fw_path not in sys.path: sys.path.insert(0, test_fw_path) import IDF + from IDF.IDFDUT import ESP32DUT except ImportError as e: print(e) print("\nCheck your IDF_PATH\nOR") @@ -65,7 +66,7 @@ def test_example_app_ble_central(env, extra_data): adv_uuid = '1811' # Acquire DUT - dut = env.get_dut("blecent", "examples/bluetooth/nimble/blecent") + dut = env.get_dut("blecent", "examples/bluetooth/nimble/blecent", dut_class=ESP32DUT) # Get binary file binary_file = os.path.join(dut.app.binary_path, "blecent.bin") diff --git a/examples/bluetooth/nimble/blehr/blehr_test_noci.py b/examples/bluetooth/nimble/blehr/blehr_test_noci.py index 81f21ee92b..76cf2d4020 100644 --- a/examples/bluetooth/nimble/blehr/blehr_test_noci.py +++ b/examples/bluetooth/nimble/blehr/blehr_test_noci.py @@ -27,6 +27,7 @@ try: if test_fw_path and test_fw_path not in sys.path: sys.path.insert(0, test_fw_path) import IDF + from IDF.IDFDUT import ESP32DUT except ImportError as e: print(e) print("\nCheck your IDF_PATH\nOR") @@ -113,7 +114,7 @@ def test_example_app_ble_hr(env, extra_data): """ try: # Acquire DUT - dut = env.get_dut("blehr", "examples/bluetooth/nimble/blehr") + dut = env.get_dut("blehr", "examples/bluetooth/nimble/blehr", dut_class=ESP32DUT) # Get binary file binary_file = os.path.join(dut.app.binary_path, "blehr.bin") diff --git a/examples/bluetooth/nimble/bleprph/bleprph_test_noci.py b/examples/bluetooth/nimble/bleprph/bleprph_test_noci.py index 3e29f668c2..0a1a1aa62d 100644 --- a/examples/bluetooth/nimble/bleprph/bleprph_test_noci.py +++ b/examples/bluetooth/nimble/bleprph/bleprph_test_noci.py @@ -27,6 +27,7 @@ try: if test_fw_path and test_fw_path not in sys.path: sys.path.insert(0, test_fw_path) import IDF + from IDF.IDFDUT import ESP32DUT except ImportError as e: print(e) print("Try `export TEST_FW_PATH=$IDF_PATH/tools/tiny-test-fw` for resolving the issue") @@ -136,7 +137,7 @@ def test_example_app_ble_peripheral(env, extra_data): try: # Acquire DUT - dut = env.get_dut("bleprph", "examples/bluetooth/nimble/bleprph") + dut = env.get_dut("bleprph", "examples/bluetooth/nimble/bleprph", dut_class=ESP32DUT) # Get binary file binary_file = os.path.join(dut.app.binary_path, "bleprph.bin") diff --git a/examples/get-started/blink/example_test.py b/examples/get-started/blink/example_test.py index 91b0f9bc0e..fbe274beab 100644 --- a/examples/get-started/blink/example_test.py +++ b/examples/get-started/blink/example_test.py @@ -10,6 +10,7 @@ import hashlib try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # This environment variable is expected on the host machine test_fw_path = os.getenv("TEST_FW_PATH") @@ -40,7 +41,7 @@ def verify_elf_sha256_embedding(dut): @IDF.idf_example_test(env_tag="Example_WIFI") def test_examples_blink(env, extra_data): - dut = env.get_dut("blink", "examples/get-started/blink") + dut = env.get_dut("blink", "examples/get-started/blink", dut_class=ESP32DUT) binary_file = os.path.join(dut.app.binary_path, "blink.bin") bin_size = os.path.getsize(binary_file) IDF.log_performance("blink_bin_size", "{}KB".format(bin_size // 1024)) diff --git a/examples/peripherals/can/can_alert_and_recovery/example_test.py b/examples/peripherals/can/can_alert_and_recovery/example_test.py index 21341ed4c1..47b5ef7a8f 100644 --- a/examples/peripherals/can/can_alert_and_recovery/example_test.py +++ b/examples/peripherals/can/can_alert_and_recovery/example_test.py @@ -6,6 +6,7 @@ import sys try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # The test cause is dependent on the Tiny Test Framework. Ensure the # `TEST_FW_PATH` environment variable is set to `$IDF_PATH/tools/tiny-test-fw` @@ -22,7 +23,7 @@ EXPECT_TIMEOUT = 20 @IDF.idf_example_test(env_tag='Example_CAN') def test_can_alert_and_recovery_example(env, extra_data): # Get device under test, flash and start example. "dut4" must be defined in EnvConfig - dut = env.get_dut('dut4', 'examples/peripherals/can/can_alert_and_recovery') + dut = env.get_dut('dut4', 'examples/peripherals/can/can_alert_and_recovery', dut_class=ESP32DUT) dut.start_app() for string in STR_EXPECT: diff --git a/examples/peripherals/can/can_network/example_test.py b/examples/peripherals/can/can_network/example_test.py index d8f249bc5f..2be9b6648f 100644 --- a/examples/peripherals/can/can_network/example_test.py +++ b/examples/peripherals/can/can_network/example_test.py @@ -6,6 +6,7 @@ import sys from threading import Thread try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # The test cause is dependent on the Tiny Test Framework. Ensure the # `TEST_FW_PATH` environment variable is set to `$IDF_PATH/tools/tiny-test-fw` @@ -40,9 +41,9 @@ def dut_thread_callback(**kwargs): def test_can_network_example(env, extra_data): # Get device under test. "dut1", "dut2", and "dut3" must be properly defined in EnvConfig - dut_master = env.get_dut("dut1", "examples/peripherals/can/can_network/can_network_master") - dut_slave = env.get_dut("dut2", "examples/peripherals/can/can_network/can_network_slave") - dut_listen_only = env.get_dut("dut3", "examples/peripherals/can/can_network/can_network_listen_only") + dut_master = env.get_dut("dut1", "examples/peripherals/can/can_network/can_network_master", dut_class=ESP32DUT) + dut_slave = env.get_dut("dut2", "examples/peripherals/can/can_network/can_network_slave", dut_class=ESP32DUT) + dut_listen_only = env.get_dut("dut3", "examples/peripherals/can/can_network/can_network_listen_only", dut_class=ESP32DUT) # Flash app onto each DUT, each DUT is reset again at the start of each thread dut_master.start_app() diff --git a/examples/peripherals/can/can_self_test/example_test.py b/examples/peripherals/can/can_self_test/example_test.py index 28b1f4eb8b..cea1b881ee 100644 --- a/examples/peripherals/can/can_self_test/example_test.py +++ b/examples/peripherals/can/can_self_test/example_test.py @@ -5,6 +5,7 @@ import os import sys try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # The test cause is dependent on the Tiny Test Framework. Ensure the # `TEST_FW_PATH` environment variable is set to `$IDF_PATH/tools/tiny-test-fw` @@ -22,7 +23,7 @@ EXPECT_TIMEOUT = 20 @IDF.idf_example_test(env_tag='Example_CAN') def test_can_self_test_example(env, extra_data): # Get device under test, flash and start example. "dut4" must be defined in EnvConfig - dut = env.get_dut('dut4', 'examples/peripherals/can/can_self_test') + dut = env.get_dut('dut4', 'examples/peripherals/can/can_self_test', dut_class=ESP32DUT) dut.start_app() for string in STR_EXPECT: diff --git a/examples/peripherals/i2c/i2c_tools/example_test.py b/examples/peripherals/i2c/i2c_tools/example_test.py index a42a0f0740..0f0c2271d5 100644 --- a/examples/peripherals/i2c/i2c_tools/example_test.py +++ b/examples/peripherals/i2c/i2c_tools/example_test.py @@ -6,6 +6,7 @@ EXPECT_TIMEOUT = 20 try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: test_fw_path = os.getenv("TEST_FW_PATH") if test_fw_path and test_fw_path not in sys.path: @@ -16,7 +17,7 @@ except ImportError: @IDF.idf_example_test(env_tag='Example_I2C_CCS811_SENSOR') def test_i2ctools_example(env, extra_data): # Get device under test, flash and start example. "i2ctool" must be defined in EnvConfig - dut = env.get_dut('i2ctools', 'examples/peripherals/i2c/i2c_tools') + dut = env.get_dut('i2ctools', 'examples/peripherals/i2c/i2c_tools', dut_class=ESP32DUT) dut.start_app() dut.expect("esp32>", timeout=EXPECT_TIMEOUT) # Get i2c address diff --git a/examples/peripherals/sdio/sdio_test.py b/examples/peripherals/sdio/sdio_test.py index 8361dc3c86..0fa8b2979f 100644 --- a/examples/peripherals/sdio/sdio_test.py +++ b/examples/peripherals/sdio/sdio_test.py @@ -27,6 +27,7 @@ except ImportError: import TinyFW import IDF +from IDF.IDFDUT import ESP32DUT @IDF.idf_example_test(env_tag="Example_SDIO", ignore=True) @@ -49,8 +50,8 @@ def test_example_sdio_communication(env, extra_data): or use sdio test board, which has two wrover modules connect to a same FT3232 Assume that first dut is host and second is slave """ - dut1 = env.get_dut("sdio_host", "examples/peripherals/sdio/host") - dut2 = env.get_dut("sdio_slave", "examples/peripherals/sdio/slave") + dut1 = env.get_dut("sdio_host", "examples/peripherals/sdio/host", dut_class=ESP32DUT) + dut2 = env.get_dut("sdio_slave", "examples/peripherals/sdio/slave", dut_class=ESP32DUT) dut1.start_app() # wait until the master is ready to setup the slave dut1.expect("host ready, start initializing slave...") diff --git a/examples/protocols/asio/chat_client/asio_chat_client_test.py b/examples/protocols/asio/chat_client/asio_chat_client_test.py index 3b141c7d17..f5581796d1 100644 --- a/examples/protocols/asio/chat_client/asio_chat_client_test.py +++ b/examples/protocols/asio/chat_client/asio_chat_client_test.py @@ -7,6 +7,7 @@ import time try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -69,7 +70,7 @@ def test_examples_protocol_asio_chat_client(env, extra_data): global g_client_response global g_msg_to_client test_msg = "ABC" - dut1 = env.get_dut("chat_client", "examples/protocols/asio/chat_client") + dut1 = env.get_dut("chat_client", "examples/protocols/asio/chat_client", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "asio_chat_client.bin") bin_size = os.path.getsize(binary_file) diff --git a/examples/protocols/asio/chat_server/asio_chat_server_test.py b/examples/protocols/asio/chat_server/asio_chat_server_test.py index ea4702c4e8..5d53a89467 100644 --- a/examples/protocols/asio/chat_server/asio_chat_server_test.py +++ b/examples/protocols/asio/chat_server/asio_chat_server_test.py @@ -6,6 +6,7 @@ import socket try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -27,7 +28,7 @@ def test_examples_protocol_asio_chat_server(env, extra_data): 4. Test evaluates received test message from server """ test_msg = b" 4ABC\n" - dut1 = env.get_dut("chat_server", "examples/protocols/asio/chat_server") + dut1 = env.get_dut("chat_server", "examples/protocols/asio/chat_server", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "asio_chat_server.bin") bin_size = os.path.getsize(binary_file) diff --git a/examples/protocols/asio/tcp_echo_server/asio_tcp_server_test.py b/examples/protocols/asio/tcp_echo_server/asio_tcp_server_test.py index 2cdfd45aee..aeb7faced5 100644 --- a/examples/protocols/asio/tcp_echo_server/asio_tcp_server_test.py +++ b/examples/protocols/asio/tcp_echo_server/asio_tcp_server_test.py @@ -6,6 +6,7 @@ import socket try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -29,7 +30,7 @@ def test_examples_protocol_asio_tcp_server(env, extra_data): 5. Test evaluates received test message on server stdout """ test_msg = b"echo message from client to server" - dut1 = env.get_dut("tcp_echo_server", "examples/protocols/asio/tcp_echo_server") + dut1 = env.get_dut("tcp_echo_server", "examples/protocols/asio/tcp_echo_server", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "asio_tcp_echo_server.bin") bin_size = os.path.getsize(binary_file) diff --git a/examples/protocols/asio/udp_echo_server/asio_udp_server_test.py b/examples/protocols/asio/udp_echo_server/asio_udp_server_test.py index dc2cc78a80..dac320068f 100644 --- a/examples/protocols/asio/udp_echo_server/asio_udp_server_test.py +++ b/examples/protocols/asio/udp_echo_server/asio_udp_server_test.py @@ -6,6 +6,7 @@ import socket try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -29,7 +30,7 @@ def test_examples_protocol_asio_udp_server(env, extra_data): 5. Test evaluates received test message on server stdout """ test_msg = b"echo message from client to server" - dut1 = env.get_dut("udp_echo_server", "examples/protocols/asio/udp_echo_server") + dut1 = env.get_dut("udp_echo_server", "examples/protocols/asio/udp_echo_server", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "asio_udp_echo_server.bin") bin_size = os.path.getsize(binary_file) diff --git a/examples/protocols/esp_http_client/esp_http_client_test.py b/examples/protocols/esp_http_client/esp_http_client_test.py index 1c9c1d5701..cdd0888c47 100644 --- a/examples/protocols/esp_http_client/esp_http_client_test.py +++ b/examples/protocols/esp_http_client/esp_http_client_test.py @@ -4,6 +4,7 @@ import sys try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -23,7 +24,7 @@ def test_examples_protocol_esp_http_client(env, extra_data): 1. join AP 2. Send HTTP request to httpbin.org """ - dut1 = env.get_dut("esp_http_client", "examples/protocols/esp_http_client") + dut1 = env.get_dut("esp_http_client", "examples/protocols/esp_http_client", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "esp-http-client-example.bin") bin_size = os.path.getsize(binary_file) diff --git a/examples/protocols/http_server/advanced_tests/http_server_advanced_test.py b/examples/protocols/http_server/advanced_tests/http_server_advanced_test.py index a27ad5ee02..6e053a9984 100644 --- a/examples/protocols/http_server/advanced_tests/http_server_advanced_test.py +++ b/examples/protocols/http_server/advanced_tests/http_server_advanced_test.py @@ -23,6 +23,7 @@ import sys try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # This environment variable is expected on the host machine test_fw_path = os.getenv("TEST_FW_PATH") @@ -52,7 +53,7 @@ client = Utility.load_source("client", expath + "/scripts/test.py") @IDF.idf_example_test(env_tag="Example_WIFI") def test_examples_protocol_http_server_advanced(env, extra_data): # Acquire DUT - dut1 = env.get_dut("http_server", "examples/protocols/http_server/advanced_tests") + dut1 = env.get_dut("http_server", "examples/protocols/http_server/advanced_tests", dut_class=ESP32DUT) # Get binary file binary_file = os.path.join(dut1.app.binary_path, "tests.bin") diff --git a/examples/protocols/http_server/persistent_sockets/http_server_persistence_test.py b/examples/protocols/http_server/persistent_sockets/http_server_persistence_test.py index 43174bc52c..f10a984857 100644 --- a/examples/protocols/http_server/persistent_sockets/http_server_persistence_test.py +++ b/examples/protocols/http_server/persistent_sockets/http_server_persistence_test.py @@ -26,6 +26,7 @@ import random try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # This environment variable is expected on the host machine test_fw_path = os.getenv("TEST_FW_PATH") @@ -48,7 +49,7 @@ client = Utility.load_source("client", expath + "/scripts/adder.py") @IDF.idf_example_test(env_tag="Example_WIFI") def test_examples_protocol_http_server_persistence(env, extra_data): # 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", dut_class=ESP32DUT) # Get binary file binary_file = os.path.join(dut1.app.binary_path, "persistent_sockets.bin") diff --git a/examples/protocols/http_server/simple/http_server_simple_test.py b/examples/protocols/http_server/simple/http_server_simple_test.py index 4cd344db83..75f5f4f262 100644 --- a/examples/protocols/http_server/simple/http_server_simple_test.py +++ b/examples/protocols/http_server/simple/http_server_simple_test.py @@ -26,6 +26,7 @@ import random try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # This environment variable is expected on the host machine test_fw_path = os.getenv("TEST_FW_PATH") @@ -49,7 +50,7 @@ client = Utility.load_source("client", expath + "/scripts/client.py") @IDF.idf_example_test(env_tag="Example_WIFI") def test_examples_protocol_http_server_simple(env, extra_data): # Acquire DUT - dut1 = env.get_dut("http_server", "examples/protocols/http_server/simple") + dut1 = env.get_dut("http_server", "examples/protocols/http_server/simple", dut_class=ESP32DUT) # Get binary file binary_file = os.path.join(dut1.app.binary_path, "simple.bin") diff --git a/examples/protocols/https_request/example_test.py b/examples/protocols/https_request/example_test.py index ce8453edb4..543edc3da2 100644 --- a/examples/protocols/https_request/example_test.py +++ b/examples/protocols/https_request/example_test.py @@ -4,6 +4,7 @@ import sys try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -23,7 +24,7 @@ def test_examples_protocol_https_request(env, extra_data): 2. connect to www.howsmyssl.com:443 3. send http request """ - dut1 = env.get_dut("https_request", "examples/protocols/https_request") + dut1 = env.get_dut("https_request", "examples/protocols/https_request", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "https_request.bin") bin_size = os.path.getsize(binary_file) diff --git a/examples/protocols/mdns/mdns_example_test.py b/examples/protocols/mdns/mdns_example_test.py index cb527989a5..4f5aa5f441 100644 --- a/examples/protocols/mdns/mdns_example_test.py +++ b/examples/protocols/mdns/mdns_example_test.py @@ -16,6 +16,7 @@ from threading import Thread try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: test_fw_path = os.getenv("TEST_FW_PATH") if test_fw_path and test_fw_path not in sys.path: @@ -86,7 +87,7 @@ def test_examples_protocol_mdns(env, extra_data): 3. check the mdns name is accessible 4. check DUT output if mdns advertized host is resolved """ - dut1 = env.get_dut("mdns-test", "examples/protocols/mdns") + dut1 = env.get_dut("mdns-test", "examples/protocols/mdns", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "mdns-test.bin") bin_size = os.path.getsize(binary_file) diff --git a/examples/protocols/mqtt/ssl/mqtt_ssl_example_test.py b/examples/protocols/mqtt/ssl/mqtt_ssl_example_test.py index 7e66482533..87931e83d1 100644 --- a/examples/protocols/mqtt/ssl/mqtt_ssl_example_test.py +++ b/examples/protocols/mqtt/ssl/mqtt_ssl_example_test.py @@ -11,6 +11,7 @@ from threading import Thread, Event try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -64,7 +65,7 @@ def test_examples_protocol_mqtt_ssl(env, extra_data): 3. Test evaluates python client received correct qos0 message 4. Test ESP32 client received correct qos0 message """ - dut1 = env.get_dut("mqtt_ssl", "examples/protocols/mqtt/ssl") + dut1 = env.get_dut("mqtt_ssl", "examples/protocols/mqtt/ssl", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "mqtt_ssl.bin") bin_size = os.path.getsize(binary_file) diff --git a/examples/protocols/mqtt/tcp/mqtt_tcp_example_test.py b/examples/protocols/mqtt/tcp/mqtt_tcp_example_test.py index 05e51420ed..4e39705643 100644 --- a/examples/protocols/mqtt/tcp/mqtt_tcp_example_test.py +++ b/examples/protocols/mqtt/tcp/mqtt_tcp_example_test.py @@ -9,6 +9,7 @@ import time try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -75,7 +76,7 @@ def test_examples_protocol_mqtt_qos1(env, extra_data): 3. Test evaluates that qos1 message is queued and removed from queued after ACK received 4. Test the broker received the same message id evaluated in step 3 """ - dut1 = env.get_dut("mqtt_tcp", "examples/protocols/mqtt/tcp") + dut1 = env.get_dut("mqtt_tcp", "examples/protocols/mqtt/tcp", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "mqtt_tcp.bin") bin_size = os.path.getsize(binary_file) diff --git a/examples/protocols/mqtt/ws/mqtt_ws_example_test.py b/examples/protocols/mqtt/ws/mqtt_ws_example_test.py index 0578876e2c..85074c2441 100644 --- a/examples/protocols/mqtt/ws/mqtt_ws_example_test.py +++ b/examples/protocols/mqtt/ws/mqtt_ws_example_test.py @@ -10,6 +10,7 @@ from threading import Thread, Event try: import IDF + from IDF.IDFDUT import ESP32DUT except Exception: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -62,7 +63,7 @@ def test_examples_protocol_mqtt_ws(env, extra_data): 3. Test evaluates it received correct qos0 message 4. Test ESP32 client received correct qos0 message """ - dut1 = env.get_dut("mqtt_websocket", "examples/protocols/mqtt/ws") + dut1 = env.get_dut("mqtt_websocket", "examples/protocols/mqtt/ws", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "mqtt_websocket.bin") bin_size = os.path.getsize(binary_file) diff --git a/examples/protocols/mqtt/wss/mqtt_wss_example_test.py b/examples/protocols/mqtt/wss/mqtt_wss_example_test.py index 58ce56036d..5e0e143651 100644 --- a/examples/protocols/mqtt/wss/mqtt_wss_example_test.py +++ b/examples/protocols/mqtt/wss/mqtt_wss_example_test.py @@ -11,6 +11,7 @@ from threading import Thread, Event try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -63,7 +64,7 @@ def test_examples_protocol_mqtt_wss(env, extra_data): 3. Test evaluates it received correct qos0 message 4. Test ESP32 client received correct qos0 message """ - dut1 = env.get_dut("mqtt_websocket_secure", "examples/protocols/mqtt/wss") + dut1 = env.get_dut("mqtt_websocket_secure", "examples/protocols/mqtt/wss", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "mqtt_websocket_secure.bin") bin_size = os.path.getsize(binary_file) diff --git a/examples/protocols/websocket/example_test.py b/examples/protocols/websocket/example_test.py index ef0c3b2f2b..4ca10b2043 100644 --- a/examples/protocols/websocket/example_test.py +++ b/examples/protocols/websocket/example_test.py @@ -2,6 +2,7 @@ import re import os import sys import IDF +from IDF.IDFDUT import ESP32DUT # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -20,7 +21,7 @@ def test_examples_protocol_websocket(env, extra_data): 2. connect to ws://echo.websocket.org 3. send and receive data """ - dut1 = env.get_dut("websocket", "examples/protocols/websocket") + dut1 = env.get_dut("websocket", "examples/protocols/websocket", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "websocket-example.bin") bin_size = os.path.getsize(binary_file) diff --git a/examples/provisioning/ble_prov/ble_prov_test.py b/examples/provisioning/ble_prov/ble_prov_test.py index 01277117ed..760756a439 100644 --- a/examples/provisioning/ble_prov/ble_prov_test.py +++ b/examples/provisioning/ble_prov/ble_prov_test.py @@ -22,6 +22,7 @@ import time try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: test_fw_path = os.getenv("TEST_FW_PATH") if test_fw_path and test_fw_path not in sys.path: @@ -43,7 +44,7 @@ esp_prov.config_throw_except = True @IDF.idf_example_test(env_tag="Example_WIFI_BT") def test_examples_provisioning_ble(env, extra_data): # Acquire DUT - dut1 = env.get_dut("ble_prov", "examples/provisioning/ble_prov") + dut1 = env.get_dut("ble_prov", "examples/provisioning/ble_prov", dut_class=ESP32DUT) # Get binary file binary_file = os.path.join(dut1.app.binary_path, "ble_prov.bin") diff --git a/examples/provisioning/manager/wifi_prov_mgr_test.py b/examples/provisioning/manager/wifi_prov_mgr_test.py index ea7172dc4d..600bb66d0c 100644 --- a/examples/provisioning/manager/wifi_prov_mgr_test.py +++ b/examples/provisioning/manager/wifi_prov_mgr_test.py @@ -22,6 +22,7 @@ import time try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: test_fw_path = os.getenv("TEST_FW_PATH") if test_fw_path and test_fw_path not in sys.path: @@ -43,7 +44,7 @@ esp_prov.config_throw_except = True @IDF.idf_example_test(env_tag="Example_WIFI_BT") def test_examples_wifi_prov_mgr(env, extra_data): # Acquire DUT - dut1 = env.get_dut("wifi_prov_mgr", "examples/provisioning/manager") + dut1 = env.get_dut("wifi_prov_mgr", "examples/provisioning/manager", dut_class=ESP32DUT) # Get binary file binary_file = os.path.join(dut1.app.binary_path, "wifi_prov_mgr.bin") diff --git a/examples/provisioning/softap_prov/softap_prov_test.py b/examples/provisioning/softap_prov/softap_prov_test.py index 6f67f47c8e..73d3a51815 100644 --- a/examples/provisioning/softap_prov/softap_prov_test.py +++ b/examples/provisioning/softap_prov/softap_prov_test.py @@ -22,6 +22,7 @@ import time try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: test_fw_path = os.getenv("TEST_FW_PATH") if test_fw_path and test_fw_path not in sys.path: @@ -51,7 +52,7 @@ esp_prov.config_throw_except = True @IDF.idf_example_test(env_tag="Example_WIFI_BT") def test_examples_provisioning_softap(env, extra_data): # Acquire DUT - dut1 = env.get_dut("softap_prov", "examples/provisioning/softap_prov") + dut1 = env.get_dut("softap_prov", "examples/provisioning/softap_prov", dut_class=ESP32DUT) # Get binary file binary_file = os.path.join(dut1.app.binary_path, "softap_prov.bin") diff --git a/examples/storage/parttool/example_test.py b/examples/storage/parttool/example_test.py index 6ba90c1756..8b9d37775b 100644 --- a/examples/storage/parttool/example_test.py +++ b/examples/storage/parttool/example_test.py @@ -5,6 +5,7 @@ import subprocess try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: test_fw_path = os.getenv('TEST_FW_PATH') if test_fw_path and test_fw_path not in sys.path: @@ -14,7 +15,7 @@ except ImportError: @IDF.idf_example_test(env_tag='Example_WIFI') def test_examples_parttool(env, extra_data): - dut = env.get_dut('parttool', 'examples/storage/parttool') + dut = env.get_dut('parttool', 'examples/storage/parttool', dut_class=ESP32DUT) dut.start_app(False) # Verify factory firmware diff --git a/examples/storage/spiffsgen/example_test.py b/examples/storage/spiffsgen/example_test.py index 636d69c7db..a2ad4304a4 100644 --- a/examples/storage/spiffsgen/example_test.py +++ b/examples/storage/spiffsgen/example_test.py @@ -5,6 +5,7 @@ import hashlib try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: test_fw_path = os.getenv('TEST_FW_PATH') if test_fw_path and test_fw_path not in sys.path: @@ -15,7 +16,7 @@ except ImportError: @IDF.idf_example_test(env_tag='Example_WIFI') def test_examples_spiffsgen(env, extra_data): # Test with default build configurations - dut = env.get_dut('spiffsgen', 'examples/storage/spiffsgen') + dut = env.get_dut('spiffsgen', 'examples/storage/spiffsgen', dut_class=ESP32DUT) dut.start_app() base_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'spiffs_image') diff --git a/examples/system/cpp_exceptions/example_test.py b/examples/system/cpp_exceptions/example_test.py index 7b4c004ec5..2101458361 100644 --- a/examples/system/cpp_exceptions/example_test.py +++ b/examples/system/cpp_exceptions/example_test.py @@ -4,6 +4,7 @@ import sys try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: test_fw_path = os.getenv('TEST_FW_PATH') if test_fw_path and test_fw_path not in sys.path: @@ -13,7 +14,7 @@ except ImportError: @IDF.idf_example_test(env_tag='Example_WIFI') def test_examples_system_cpp_exceptions(env, extra_data): - dut = env.get_dut('cpp_exceptions_example', 'examples/system/cpp_exceptions') + dut = env.get_dut('cpp_exceptions_example', 'examples/system/cpp_exceptions', dut_class=ESP32DUT) # start test dut.start_app() lines = ['app_main starting', diff --git a/examples/system/esp_event/default_event_loop/example_test.py b/examples/system/esp_event/default_event_loop/example_test.py index 002c35eddf..0befaecc9e 100644 --- a/examples/system/esp_event/default_event_loop/example_test.py +++ b/examples/system/esp_event/default_event_loop/example_test.py @@ -4,6 +4,7 @@ import sys try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -93,7 +94,7 @@ def _test_iteration_events(dut): @IDF.idf_example_test(env_tag='Example_WIFI') def test_default_event_loop_example(env, extra_data): - dut = env.get_dut('default_event_loop', 'examples/system/esp_event/default_event_loop') + dut = env.get_dut('default_event_loop', 'examples/system/esp_event/default_event_loop', dut_class=ESP32DUT) _test_iteration_events(dut) _test_timer_events(dut) diff --git a/examples/system/esp_event/user_event_loops/example_test.py b/examples/system/esp_event/user_event_loops/example_test.py index ccd8eeab95..212597d42c 100644 --- a/examples/system/esp_event/user_event_loops/example_test.py +++ b/examples/system/esp_event/user_event_loops/example_test.py @@ -4,6 +4,7 @@ import sys try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -22,7 +23,7 @@ TASK_ITERATION_HANDLING = "handling TASK_EVENTS:TASK_ITERATION_EVENT from {}, it @IDF.idf_example_test(env_tag='Example_WIFI') def test_user_event_loops_example(env, extra_data): - dut = env.get_dut('user_event_loops', 'examples/system/esp_event/user_event_loops') + dut = env.get_dut('user_event_loops', 'examples/system/esp_event/user_event_loops', dut_class=ESP32DUT) dut.start_app() diff --git a/examples/system/esp_timer/example_test.py b/examples/system/esp_timer/example_test.py index 474df5e0fa..325088abea 100644 --- a/examples/system/esp_timer/example_test.py +++ b/examples/system/esp_timer/example_test.py @@ -5,6 +5,7 @@ import sys try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -39,7 +40,7 @@ ONE_SHOT_TIMER_PERIOD = 5000000 @IDF.idf_example_test(env_tag='Example_WIFI') def test_examples_system_esp_timer(env, extra_data): - dut = env.get_dut('esp_timer_example', 'examples/system/esp_timer') + dut = env.get_dut('esp_timer_example', 'examples/system/esp_timer', dut_class=ESP32DUT) # start test dut.start_app() groups = dut.expect(STARTING_TIMERS_REGEX, timeout=30) diff --git a/examples/system/freertos/real_time_stats/example_test.py b/examples/system/freertos/real_time_stats/example_test.py index f5ae64c3e4..2d2d2cc0bc 100644 --- a/examples/system/freertos/real_time_stats/example_test.py +++ b/examples/system/freertos/real_time_stats/example_test.py @@ -4,6 +4,7 @@ import sys try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -20,7 +21,7 @@ STATS_TASK_EXPECT = "Real time stats obtained" @IDF.idf_example_test(env_tag='Example_WIFI') def test_real_time_stats_example(env, extra_data): - dut = env.get_dut('real_time_stats', 'examples/system/freertos/real_time_stats') + dut = env.get_dut('real_time_stats', 'examples/system/freertos/real_time_stats', dut_class=ESP32DUT) dut.start_app() for iteration in range(0, STATS_TASK_ITERS): diff --git a/examples/system/light_sleep/example_test.py b/examples/system/light_sleep/example_test.py index a3ddd97a16..a29b5dcc8b 100644 --- a/examples/system/light_sleep/example_test.py +++ b/examples/system/light_sleep/example_test.py @@ -6,6 +6,7 @@ import time try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: test_fw_path = os.getenv('TEST_FW_PATH') if test_fw_path and test_fw_path not in sys.path: @@ -21,7 +22,7 @@ WAKEUP_INTERVAL_MS = 2000 @IDF.idf_example_test(env_tag='Example_WIFI') def test_examples_system_light_sleep(env, extra_data): - dut = env.get_dut('light_sleep_example', 'examples/system/light_sleep') + dut = env.get_dut('light_sleep_example', 'examples/system/light_sleep', dut_class=ESP32DUT) dut.start_app() # Ensure DTR and RTS are de-asserted for proper control of GPIO0 diff --git a/examples/system/ota/otatool/example_test.py b/examples/system/ota/otatool/example_test.py index a22ebf5a89..cfbf06450d 100644 --- a/examples/system/ota/otatool/example_test.py +++ b/examples/system/ota/otatool/example_test.py @@ -5,6 +5,7 @@ import subprocess try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -18,7 +19,7 @@ except ImportError: @IDF.idf_example_test(env_tag='Example_WIFI') def test_otatool_example(env, extra_data): - dut = env.get_dut('otatool', 'examples/system/ota/otatool') + dut = env.get_dut('otatool', 'examples/system/ota/otatool', dut_class=ESP32DUT) # Verify factory firmware dut.start_app() diff --git a/examples/system/ota/simple_ota_example/example_test.py b/examples/system/ota/simple_ota_example/example_test.py index 7c732a5425..0b79b68b59 100644 --- a/examples/system/ota/simple_ota_example/example_test.py +++ b/examples/system/ota/simple_ota_example/example_test.py @@ -9,6 +9,7 @@ import ssl try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -115,7 +116,7 @@ def test_examples_protocol_simple_ota_example(env, extra_data): 2. Fetch OTA image over HTTPS 3. Reboot with the new OTA image """ - dut1 = env.get_dut("simple_ota_example", "examples/system/ota/simple_ota_example") + dut1 = env.get_dut("simple_ota_example", "examples/system/ota/simple_ota_example", dut_class=ESP32DUT) # check and log bin size binary_file = os.path.join(dut1.app.binary_path, "simple_ota.bin") bin_size = os.path.getsize(binary_file) diff --git a/examples/wifi/iperf/iperf_test.py b/examples/wifi/iperf/iperf_test.py index 35538cae7c..bc67e240fe 100644 --- a/examples/wifi/iperf/iperf_test.py +++ b/examples/wifi/iperf/iperf_test.py @@ -32,6 +32,7 @@ import subprocess try: import IDF + from IDF.IDFDUT import ESP32DUT except ImportError: # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, @@ -517,7 +518,7 @@ def test_wifi_throughput_with_different_configs(env, extra_data): "sdkconfig.{}".format(config_name)) # 2. get DUT and download - dut = env.get_dut("iperf", "examples/wifi/iperf") + dut = env.get_dut("iperf", "examples/wifi/iperf", dut_class=ESP32DUT) dut.start_app() dut.expect("esp32>") @@ -575,7 +576,7 @@ def test_wifi_throughput_vs_rssi(env, extra_data): build_iperf_with_config(BEST_PERFORMANCE_CONFIG) # 2. get DUT and download - dut = env.get_dut("iperf", "examples/wifi/iperf") + dut = env.get_dut("iperf", "examples/wifi/iperf", dut_class=ESP32DUT) dut.start_app() dut.expect("esp32>") @@ -624,7 +625,7 @@ def test_wifi_throughput_basic(env, extra_data): build_iperf_with_config(BEST_PERFORMANCE_CONFIG) # 2. get DUT - dut = env.get_dut("iperf", "examples/wifi/iperf") + dut = env.get_dut("iperf", "examples/wifi/iperf", dut_class=ESP32DUT) dut.start_app() dut.expect("esp32>") diff --git a/tools/tiny-test-fw/example.py b/tools/tiny-test-fw/example.py index 2cdd04b403..c4348bf346 100644 --- a/tools/tiny-test-fw/example.py +++ b/tools/tiny-test-fw/example.py @@ -28,6 +28,7 @@ except ImportError: import TinyFW import IDF +from IDF.IDFDUT import ESP32DUT @IDF.idf_example_test(env_tag="Example_WIFI") @@ -38,7 +39,7 @@ def test_examples_protocol_https_request(env, extra_data): 2. connect to www.howsmyssl.com:443 3. send http request """ - dut1 = env.get_dut("https_request", "examples/protocols/https_request") + dut1 = env.get_dut("https_request", "examples/protocols/https_request", dut_class=ESP32DUT) dut1.start_app() dut1.expect(re.compile(r"Connecting to www.howsmyssl.com:443"), timeout=30) dut1.expect("Performing the SSL/TLS handshake")