mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
ci: apply common-scripts CI refactor
Squashes these original commits for release/v5.4 backport traceability: - 9b289dc5ad6 ci: apply idf-ci 1.x - 381df980d57 ci: remove pip-cache and other unused jobs - 32375a0a15e ci: apply common-scripts CI refactor
This commit is contained in:
@@ -10,7 +10,6 @@ PROMPT = 'test_intr_dump>'
|
||||
|
||||
|
||||
@pytest.mark.qemu
|
||||
@pytest.mark.host_test
|
||||
@idf_parametrize('target', ['esp32'], indirect=['target'])
|
||||
def test_esp_intr_dump_nonshared(dut: Dut) -> None:
|
||||
dut.expect_exact(PROMPT, timeout=30)
|
||||
@@ -24,7 +23,6 @@ def test_esp_intr_dump_nonshared(dut: Dut) -> None:
|
||||
|
||||
|
||||
@pytest.mark.qemu
|
||||
@pytest.mark.host_test
|
||||
@idf_parametrize('target', ['esp32'], indirect=['target'])
|
||||
def test_esp_intr_dump_shared(dut: Dut) -> None:
|
||||
dut.expect_exact(PROMPT, timeout=30)
|
||||
@@ -54,5 +52,5 @@ def test_esp_intr_dump_expected_output(dut: Dut) -> None:
|
||||
dut.expect_exact(PROMPT, timeout=30)
|
||||
dut.write('intr_dump\n')
|
||||
exp_out_file = os.path.join(os.path.dirname(__file__), 'expected_output', f'{dut.target}.txt')
|
||||
for line in open(exp_out_file, 'r').readlines():
|
||||
for line in open(exp_out_file).readlines():
|
||||
dut.expect_exact(line.strip())
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
# SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
import os
|
||||
import typing as t
|
||||
|
||||
import pytest
|
||||
from artifacts_handler import ArtifactType
|
||||
from idf_ci_utils import IDF_PATH
|
||||
from pytest_embedded import Dut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
|
||||
@@ -12,19 +11,17 @@ from pytest_embedded_idf.utils import idf_parametrize
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize('config', ['32K'], indirect=True)
|
||||
@idf_parametrize('target', ['esp32c6', 'esp32h2'], indirect=['target'])
|
||||
def test_app_mmu_page_size_32k_and_bootloader_mmu_page_size_64k(dut: Dut, app_downloader, config) -> None: # type: ignore
|
||||
def test_app_mmu_page_size_32k_and_bootloader_mmu_page_size_64k(dut: Dut, app_downloader: t.Any, config: str) -> None:
|
||||
dut.expect('App is running')
|
||||
|
||||
assert '32K' in config
|
||||
app_config = config.replace('32K', '64K')
|
||||
|
||||
path_to_mmu_page_size_64k_build = os.path.join(dut.app.app_path, f'build_{dut.target}_{app_config}')
|
||||
build_dir = f'build_{dut.target}_{app_config}'
|
||||
if app_downloader:
|
||||
app_downloader.download_app(
|
||||
os.path.relpath(path_to_mmu_page_size_64k_build, IDF_PATH), ArtifactType.BUILD_DIR_WITHOUT_MAP_AND_ELF_FILES
|
||||
)
|
||||
app_downloader.download_app(dut.app.app_path, build_dir, 'flash')
|
||||
|
||||
dut.serial.bootloader_flash(path_to_mmu_page_size_64k_build)
|
||||
dut.serial.bootloader_flash(os.path.join(dut.app.app_path, build_dir))
|
||||
dut.expect('MMU page size mismatch')
|
||||
dut.expect('App is running')
|
||||
dut.expect('Partition test done')
|
||||
@@ -34,19 +31,17 @@ def test_app_mmu_page_size_32k_and_bootloader_mmu_page_size_64k(dut: Dut, app_do
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize('config', ['64K'], indirect=True)
|
||||
@idf_parametrize('target', ['esp32c6', 'esp32h2'], indirect=['target'])
|
||||
def test_app_mmu_page_size_64k_and_bootloader_mmu_page_size_32k(dut: Dut, app_downloader, config) -> None: # type: ignore
|
||||
def test_app_mmu_page_size_64k_and_bootloader_mmu_page_size_32k(dut: Dut, app_downloader: t.Any, config: str) -> None:
|
||||
dut.expect('App is running')
|
||||
|
||||
assert '64K' in config
|
||||
app_config = config.replace('64K', '32K')
|
||||
|
||||
path_to_mmu_page_size_32k_build = os.path.join(dut.app.app_path, f'build_{dut.target}_{app_config}')
|
||||
build_dir = f'build_{dut.target}_{app_config}'
|
||||
if app_downloader:
|
||||
app_downloader.download_app(
|
||||
os.path.relpath(path_to_mmu_page_size_32k_build, IDF_PATH), ArtifactType.BUILD_DIR_WITHOUT_MAP_AND_ELF_FILES
|
||||
)
|
||||
app_downloader.download_app(dut.app.app_path, build_dir, 'flash')
|
||||
|
||||
dut.serial.bootloader_flash(path_to_mmu_page_size_32k_build)
|
||||
dut.serial.bootloader_flash(os.path.join(dut.app.app_path, build_dir))
|
||||
dut.expect('MMU page size mismatch')
|
||||
dut.expect('App is running')
|
||||
dut.expect('Partition test done')
|
||||
|
||||
@@ -13,104 +13,9 @@ import pytest
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
from test_panic_util import PanicTestDut
|
||||
|
||||
TARGETS_XTENSA_SINGLE_CORE = [
|
||||
pytest.mark.esp32s2,
|
||||
]
|
||||
|
||||
TARGETS_XTENSA_DUAL_CORE = [
|
||||
pytest.mark.esp32,
|
||||
pytest.mark.esp32s3,
|
||||
]
|
||||
|
||||
TARGETS_XTENSA = TARGETS_XTENSA_SINGLE_CORE + TARGETS_XTENSA_DUAL_CORE
|
||||
|
||||
TARGETS_RISCV_SINGLE_CORE = [
|
||||
pytest.mark.esp32c2,
|
||||
pytest.mark.esp32c3,
|
||||
pytest.mark.esp32c5,
|
||||
pytest.mark.esp32c6,
|
||||
pytest.mark.esp32h2,
|
||||
pytest.mark.esp32c61,
|
||||
]
|
||||
|
||||
TARGETS_RISCV_DUAL_CORE = [
|
||||
pytest.mark.esp32p4,
|
||||
]
|
||||
|
||||
TARGETS_RISCV = TARGETS_RISCV_SINGLE_CORE + TARGETS_RISCV_DUAL_CORE
|
||||
|
||||
# Markers for all the targets this test currently runs on
|
||||
TARGETS_ALL = TARGETS_XTENSA + TARGETS_RISCV
|
||||
|
||||
# Some tests only run on dual-core targets, they use the config below.
|
||||
TARGETS_DUAL_CORE = TARGETS_XTENSA_DUAL_CORE + TARGETS_RISCV_DUAL_CORE
|
||||
|
||||
# Most tests run on all targets and with all configs.
|
||||
# This list is passed to @pytest.mark.parametrize for each of the test cases.
|
||||
# It creates an outer product of the sets: [configs] x [targets],
|
||||
# with some exceptions.
|
||||
CONFIGS = [
|
||||
pytest.param('coredump_flash_bin_crc', marks=TARGETS_ALL),
|
||||
pytest.param('coredump_flash_elf_sha', marks=TARGETS_ALL),
|
||||
pytest.param('coredump_flash_elf_soft_sha', marks=TARGETS_ALL),
|
||||
pytest.param('coredump_uart_bin_crc', marks=TARGETS_ALL),
|
||||
pytest.param('coredump_uart_elf_crc', marks=TARGETS_ALL),
|
||||
pytest.param('coredump_flash_custom_stack', marks=TARGETS_ALL),
|
||||
pytest.param('gdbstub', marks=TARGETS_ALL),
|
||||
pytest.param('panic', marks=TARGETS_ALL),
|
||||
]
|
||||
|
||||
CONFIGS_UBSAN = [
|
||||
pytest.param('gdbstub', marks=TARGETS_ALL),
|
||||
pytest.param('panic', marks=TARGETS_ALL),
|
||||
]
|
||||
|
||||
CONFIGS_DUAL_CORE = [
|
||||
pytest.param('coredump_flash_bin_crc', marks=TARGETS_DUAL_CORE),
|
||||
pytest.param('coredump_flash_elf_sha', marks=TARGETS_DUAL_CORE),
|
||||
pytest.param('coredump_uart_bin_crc', marks=TARGETS_DUAL_CORE),
|
||||
pytest.param('coredump_uart_elf_crc', marks=TARGETS_DUAL_CORE),
|
||||
pytest.param('gdbstub', marks=TARGETS_DUAL_CORE),
|
||||
pytest.param('panic', marks=TARGETS_DUAL_CORE),
|
||||
]
|
||||
|
||||
# Some tests run on all targets but need to behave differently on the dual-core ones.
|
||||
# This list is used to check if the target is a dual-core one.
|
||||
TARGETS_DUAL_CORE_NAMES = [x.mark.name for x in TARGETS_DUAL_CORE]
|
||||
|
||||
CONFIGS_EXTRAM_STACK = [
|
||||
pytest.param('coredump_flash_extram_stack_heap_esp32', marks=[pytest.mark.esp32, pytest.mark.psram]),
|
||||
pytest.param('coredump_flash_extram_stack_heap_esp32s2', marks=[pytest.mark.esp32s2, pytest.mark.generic]),
|
||||
pytest.param('coredump_flash_extram_stack_heap_esp32s3', marks=[pytest.mark.esp32s3, pytest.mark.quad_psram]),
|
||||
pytest.param('coredump_flash_extram_stack_bss_esp32', marks=[pytest.mark.esp32, pytest.mark.psram]),
|
||||
pytest.param('coredump_flash_extram_stack_bss_esp32s2', marks=[pytest.mark.esp32s2, pytest.mark.generic]),
|
||||
pytest.param('coredump_flash_extram_stack_bss_esp32s3', marks=[pytest.mark.esp32s3, pytest.mark.quad_psram]),
|
||||
]
|
||||
|
||||
CONFIGS_HW_STACK_GUARD = [
|
||||
pytest.param('coredump_flash_bin_crc', marks=TARGETS_RISCV),
|
||||
pytest.param('coredump_uart_bin_crc', marks=TARGETS_RISCV),
|
||||
pytest.param('coredump_uart_elf_crc', marks=TARGETS_RISCV),
|
||||
pytest.param('gdbstub', marks=TARGETS_RISCV),
|
||||
pytest.param('panic', marks=TARGETS_RISCV),
|
||||
]
|
||||
|
||||
CONFIGS_HW_STACK_GUARD_DUAL_CORE = [
|
||||
pytest.param('coredump_flash_bin_crc', marks=TARGETS_RISCV_DUAL_CORE),
|
||||
pytest.param('coredump_uart_bin_crc', marks=TARGETS_RISCV_DUAL_CORE),
|
||||
pytest.param('coredump_uart_elf_crc', marks=TARGETS_RISCV_DUAL_CORE),
|
||||
pytest.param('gdbstub', marks=TARGETS_RISCV_DUAL_CORE),
|
||||
pytest.param('panic', marks=TARGETS_RISCV_DUAL_CORE),
|
||||
]
|
||||
|
||||
CONFIG_CAPTURE_DRAM = [pytest.param('coredump_flash_capture_dram', marks=TARGETS_ALL)]
|
||||
|
||||
CONFIG_COREDUMP_SUMMARY = [pytest.param('coredump_flash_elf_sha', marks=TARGETS_ALL)]
|
||||
|
||||
CONFIG_COREDUMP_SUMMARY_FLASH_ENCRYPTED = [
|
||||
pytest.param('coredump_flash_encrypted', marks=[pytest.mark.esp32, pytest.mark.esp32c3]),
|
||||
pytest.param('coredump_flash_encrypted_coredump_plain', marks=[pytest.mark.esp32, pytest.mark.esp32c3]),
|
||||
]
|
||||
TARGETS_DUAL_CORE_NAMES = ['esp32', 'esp32s3', 'esp32p4']
|
||||
|
||||
# Panic abort information will start with this string.
|
||||
PANIC_ABORT_PREFIX = 'Panic reason: '
|
||||
@@ -1707,70 +1612,6 @@ def test_panic_handler_crash1(dut: PanicTestDut, config: str, test_func_name: st
|
||||
dut.expect_cpu_reset()
|
||||
|
||||
|
||||
#########################
|
||||
# for memprot test only #
|
||||
#########################
|
||||
|
||||
# Memprot-related tests are supported only on targets with PMS/PMA peripheral;
|
||||
# currently ESP32-S2, ESP32-C3, ESP32-C2, ESP32-H2, ESP32-C6, ESP32-P4, ESP32-C5 and ESP32-C61 are supported
|
||||
CONFIGS_MEMPROT_IDRAM = [
|
||||
pytest.param('memprot_esp32s2', marks=[pytest.mark.esp32s2]),
|
||||
pytest.param('memprot_esp32c3', marks=[pytest.mark.esp32c3]),
|
||||
pytest.param('memprot_esp32c2', marks=[pytest.mark.esp32c2]),
|
||||
pytest.param('memprot_esp32c5', marks=[pytest.mark.esp32c5]),
|
||||
pytest.param('memprot_esp32c6', marks=[pytest.mark.esp32c6]),
|
||||
pytest.param('memprot_esp32c61', marks=[pytest.mark.esp32c61]),
|
||||
pytest.param('memprot_esp32h2', marks=[pytest.mark.esp32h2]),
|
||||
pytest.param('memprot_esp32p4', marks=[pytest.mark.esp32p4]),
|
||||
]
|
||||
|
||||
CONFIGS_MEMPROT_DCACHE = [
|
||||
pytest.param('memprot_esp32s2', marks=pytest.mark.esp32s2),
|
||||
]
|
||||
|
||||
CONFIGS_MEMPROT_RTC_FAST_MEM = [
|
||||
pytest.param('memprot_esp32s2', marks=[pytest.mark.esp32s2]),
|
||||
pytest.param('memprot_esp32c3', marks=[pytest.mark.esp32c3]),
|
||||
pytest.param('memprot_esp32c5', marks=[pytest.mark.esp32c5]),
|
||||
pytest.param('memprot_esp32c6', marks=[pytest.mark.esp32c6]),
|
||||
pytest.param('memprot_esp32h2', marks=[pytest.mark.esp32h2]),
|
||||
pytest.param('memprot_esp32p4', marks=[pytest.mark.esp32p4]),
|
||||
]
|
||||
|
||||
CONFIGS_MEMPROT_RTC_SLOW_MEM = [
|
||||
pytest.param('memprot_esp32s2', marks=[pytest.mark.esp32s2]),
|
||||
]
|
||||
|
||||
CONFIGS_MEMPROT_FLASH_IDROM = [
|
||||
pytest.param('memprot_esp32c5', marks=[pytest.mark.esp32c5]),
|
||||
pytest.param('memprot_esp32c6', marks=[pytest.mark.esp32c6]),
|
||||
pytest.param('memprot_esp32c61', marks=[pytest.mark.esp32c61]),
|
||||
pytest.param('memprot_esp32h2', marks=[pytest.mark.esp32h2]),
|
||||
pytest.param('memprot_esp32p4', marks=[pytest.mark.esp32p4]),
|
||||
]
|
||||
|
||||
CONFIGS_MEMPROT_SPIRAM_XIP_IROM_ALIGNMENT_HEAP = [
|
||||
pytest.param('memprot_spiram_xip_esp32c5', marks=[pytest.mark.esp32c5]),
|
||||
pytest.param('memprot_spiram_xip_esp32c61', marks=[pytest.mark.esp32c61]),
|
||||
pytest.param('memprot_spiram_xip_esp32p4', marks=[pytest.mark.esp32p4]),
|
||||
]
|
||||
|
||||
CONFIGS_MEMPROT_SPIRAM_XIP_DROM_ALIGNMENT_HEAP = [
|
||||
pytest.param('memprot_spiram_xip_esp32s3', marks=[pytest.mark.esp32s3]),
|
||||
pytest.param('memprot_spiram_xip_esp32c5', marks=[pytest.mark.esp32c5]),
|
||||
pytest.param('memprot_spiram_xip_esp32c61', marks=[pytest.mark.esp32c61]),
|
||||
pytest.param('memprot_spiram_xip_esp32p4', marks=[pytest.mark.esp32p4]),
|
||||
]
|
||||
|
||||
CONFIGS_MEMPROT_INVALID_REGION_PROTECTION_USING_PMA = [
|
||||
pytest.param('memprot_esp32c5', marks=[pytest.mark.esp32c5]),
|
||||
pytest.param('memprot_esp32c6', marks=[pytest.mark.esp32c6]),
|
||||
pytest.param('memprot_esp32c61', marks=[pytest.mark.esp32c61]),
|
||||
pytest.param('memprot_esp32h2', marks=[pytest.mark.esp32h2]),
|
||||
pytest.param('memprot_esp32p4', marks=[pytest.mark.esp32p4]),
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@idf_parametrize('config', ['memprot_esp32s2'], indirect=['config'])
|
||||
@idf_parametrize('target', ['esp32s2'], indirect=['target'])
|
||||
|
||||
@@ -4,8 +4,6 @@ import os
|
||||
import re
|
||||
|
||||
import pytest
|
||||
from artifacts_handler import ArtifactType
|
||||
from idf_ci_utils import IDF_PATH
|
||||
from pytest_embedded import Dut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
|
||||
@@ -21,13 +19,11 @@ def test_multicore_app_and_unicore_bootloader(dut: Dut, app_downloader, config)
|
||||
assert 'multicore' in config
|
||||
app_config = config.replace('multicore', 'unicore')
|
||||
|
||||
path_to_unicore_build = os.path.join(dut.app.app_path, f'build_{dut.target}_{app_config}')
|
||||
build_dir = f'build_{dut.target}_{app_config}'
|
||||
if app_downloader:
|
||||
app_downloader.download_app(
|
||||
os.path.relpath(path_to_unicore_build, IDF_PATH), ArtifactType.BUILD_DIR_WITHOUT_MAP_AND_ELF_FILES
|
||||
)
|
||||
app_downloader.download_app(dut.app.app_path, build_dir, 'flash')
|
||||
|
||||
dut.serial.bootloader_flash(path_to_unicore_build)
|
||||
dut.serial.bootloader_flash(os.path.join(dut.app.app_path, build_dir))
|
||||
dut.expect('Unicore bootloader')
|
||||
dut.expect('Multicore app')
|
||||
if 'psram' in config:
|
||||
@@ -47,13 +43,11 @@ def test_unicore_app_and_multicore_bootloader(dut: Dut, app_downloader, config)
|
||||
assert 'unicore' in config
|
||||
app_config = config.replace('unicore', 'multicore')
|
||||
|
||||
path_to_multicore_build = os.path.join(dut.app.app_path, f'build_{dut.target}_{app_config}')
|
||||
build_dir = f'build_{dut.target}_{app_config}'
|
||||
if app_downloader:
|
||||
app_downloader.download_app(
|
||||
os.path.relpath(path_to_multicore_build, IDF_PATH), ArtifactType.BUILD_DIR_WITHOUT_MAP_AND_ELF_FILES
|
||||
)
|
||||
app_downloader.download_app(dut.app.app_path, build_dir, 'flash')
|
||||
|
||||
dut.serial.bootloader_flash(path_to_multicore_build)
|
||||
dut.serial.bootloader_flash(os.path.join(dut.app.app_path, build_dir))
|
||||
dut.expect('Multicore bootloader')
|
||||
dut.expect('Unicore app')
|
||||
if 'psram' in config:
|
||||
|
||||
Reference in New Issue
Block a user