2025-02-24 10:18:03 +08:00
|
|
|
# SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
2024-11-12 17:03:54 +05:30
|
|
|
# SPDX-License-Identifier: Unlicense OR CC0-1.0
|
|
|
|
|
import logging
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
from pytest_embedded import Dut
|
2025-02-24 10:18:03 +08:00
|
|
|
from pytest_embedded_idf.utils import idf_parametrize
|
2024-11-12 17:03:54 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.generic
|
2025-10-07 17:36:45 +05:30
|
|
|
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
2024-11-12 17:03:54 +05:30
|
|
|
def test_example_tee_basic(dut: Dut) -> None:
|
|
|
|
|
# Logging example binary details
|
|
|
|
|
binary_files = [
|
|
|
|
|
('tee_basic.bin', '[REE] tee_basic_bin_size'),
|
|
|
|
|
('esp_tee/esp_tee.bin', '[TEE] tee_basic_bin_size'),
|
|
|
|
|
]
|
|
|
|
|
for file_name, log_label in binary_files:
|
|
|
|
|
binary_file = os.path.join(dut.app.binary_path, file_name)
|
|
|
|
|
bin_size = os.path.getsize(binary_file)
|
2025-10-07 17:36:45 +05:30
|
|
|
logging.info(f'{log_label}: {bin_size // 1024}KB')
|
2024-11-12 17:03:54 +05:30
|
|
|
|
|
|
|
|
# Start test
|
2025-11-07 17:25:02 +05:30
|
|
|
dut.expect('AES-256-GCM operations in TEE', timeout=10)
|
|
|
|
|
dut.expect('Secure service call: PROTECTED M-mode', timeout=10)
|
|
|
|
|
dut.expect('AES-256-GCM encryption', timeout=10)
|
|
|
|
|
dut.expect('Secure service call: PROTECTED M-mode', timeout=10)
|
|
|
|
|
dut.expect('AES-256-GCM decryption', timeout=10)
|
|
|
|
|
dut.expect('Returned from app_main()', timeout=10)
|