ci: limit example test to ESP32s

This commit is contained in:
Michael (XIAO Xufeng) 2019-08-29 17:54:14 +08:00 committed by Angus Gratton
parent 7f270d4299
commit 63329b169b
41 changed files with 87 additions and 46 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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")

View file

@ -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")

View file

@ -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")

View file

@ -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))

View file

@ -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:

View file

@ -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()

View file

@ -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:

View file

@ -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

View file

@ -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...")

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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")

View file

@ -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")

View file

@ -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")

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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")

View file

@ -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")

View file

@ -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")

View file

@ -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

View file

@ -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')

View file

@ -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',

View file

@ -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)

View file

@ -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()

View file

@ -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)

View file

@ -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):

View file

@ -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

View file

@ -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()

View file

@ -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)

View file

@ -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>")

View file

@ -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")