ci(esp_tee): Re-enable the TEE test-apps for ESP32-C5

This commit is contained in:
Laukik Hase
2025-09-25 11:04:16 +05:30
parent ce65a06cc2
commit 052f380262
3 changed files with 10 additions and 5 deletions
@@ -21,8 +21,7 @@ from ecdsa.util import sigdecode_der
from pytest_embedded import Dut
from pytest_embedded_idf.utils import idf_parametrize
# TODO: Enable for ESP32-C5 once support is stable
SUPPORTED_TARGETS = ['esp32c6', 'esp32h2']
SUPPORTED_TARGETS = ['esp32c6', 'esp32c5']
TEST_MSG = 'hello world'
@@ -44,6 +44,7 @@ __attribute__((unused)) static const uint32_t mmu_op_fail_seq[8] = {[0 ... 7] =
#define CHECK_MMU_OP_FAIL(ptr_) \
do { \
TEST_ASSERT_EQUAL_HEX8_ARRAY(mmu_op_fail_seq, (ptr_), 0x20); \
printf("Failed MMU operation, rebooting!\n"); \
esp_restart(); \
} while (0)
#endif
@@ -256,6 +257,7 @@ TEST_CASE("Test REE-TEE isolation: MMU-spillover", "[exception]")
spi_flash_mmap_handle_t handle;
const size_t len = 0x100000; // 1MB
TEST_ESP_OK(spi_flash_mmap(0x00, len, SPI_FLASH_MMAP_DATA, &ptr, &handle));
CHECK_MMU_OP_FAIL(ptr);
ESP_LOG_BUFFER_HEXDUMP(TAG, ptr, 32, ESP_LOG_INFO);
TEST_FAIL_MESSAGE("Exception should have been generated!");
}
@@ -9,8 +9,7 @@ from pytest_embedded_idf.utils import idf_parametrize
# ---------------- Pytest build parameters ----------------
# TODO: Enable for ESP32-C5 once support is stable
SUPPORTED_TARGETS = ['esp32c6', 'esp32h2']
SUPPORTED_TARGETS = ['esp32c6', 'esp32h2', 'esp32c5']
CONFIG_DEFAULT = [
# 'config, target, markers',
@@ -167,7 +166,12 @@ def test_esp_tee_isolation_checks(dut: IdfDut) -> None:
continue
dut.expect_exact('Press ENTER to see the list of tests')
dut.write(f'"Test REE-TEE isolation: {test}"')
actual_exc = dut.expect(r'Core ([01]) panic\'ed \(([^)]+)\)', timeout=30).group(2).decode()
# NOTE: For ESP32-C5, the MMU-spillover test fails gracefully without raising panic
if dut.target == 'esp32c5' and test == 'MMU-spillover':
dut.expect_exact('Failed MMU operation, rebooting!')
continue
else:
actual_exc = dut.expect(r'Core ([01]) panic\'ed \(([^)]+)\)', timeout=30).group(2).decode()
if actual_exc != expected_exc:
raise RuntimeError('Incorrect exception received!')
dut.expect('Origin: U-mode')