11# SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
22# SPDX-License-Identifier: Apache-2.0
3+ import re
34from enum import Enum
45from typing import Dict
56from typing import Tuple
2021
2122CONFIG_OTA = [
2223 # 'config, target, skip_autoflash, markers',
23- ('ota' , target , 'y' , (pytest .mark .generic ,))
24+ ('ota' , target , 'y' , (pytest .mark .host_test ,))
2425 for target in SUPPORTED_TARGETS
2526]
2627
@@ -198,8 +199,18 @@ def expect_panic_rsn(dut: IdfDut, expected_rsn: str) -> None:
198199
199200def run_multiple_stages (dut : IdfDut , test_case_num : int , stages : int , api : TeeFlashAccessApi ) -> None :
200201 expected_ops = {
201- TeeFlashAccessApi .ESP_PARTITION : ['read' , 'program_page' , 'program_page' , 'erase_sector' ],
202- TeeFlashAccessApi .ESP_FLASH : ['program_page' , 'read' , 'erase_sector' , 'program_page' ],
202+ TeeFlashAccessApi .ESP_PARTITION : [
203+ 'read' ,
204+ 'program_page|common_command' ,
205+ 'program_page|common_command' ,
206+ 'erase_sector|common_command' ,
207+ ],
208+ TeeFlashAccessApi .ESP_FLASH : [
209+ 'program_page|common_command' ,
210+ 'read' ,
211+ 'erase_sector|common_command' ,
212+ 'program_page|common_command' ,
213+ ],
203214 }
204215
205216 flash_enc_enabled = dut .app .sdkconfig .get ('SECURE_FLASH_ENC_ENABLED' , True )
@@ -225,7 +236,7 @@ def run_multiple_stages(dut: IdfDut, test_case_num: int, stages: int, api: TeeFl
225236 r'\[_ss_spi_flash_hal_(\w+)\] Illegal flash access at \s*(0x[0-9a-fA-F]+)' , timeout = 10
226237 )
227238 actual_op = match .group (1 ).decode ()
228- if actual_op != curr_op :
239+ if not re . fullmatch ( curr_op , actual_op ) :
229240 raise RuntimeError (f'Unexpected flash operation: { actual_op } (expected: { curr_op } )' )
230241 elif api == TeeFlashAccessApi .ESP_ROM_SPIFLASH :
231242 expect_panic_rsn (dut , 'APM - Authority exception' )
0 commit comments