ci(coredump): fix capture dram tests

This commit is contained in:
Erhan Kurubas 2024-05-06 15:41:25 +02:00
parent 52b36a60f4
commit 0f96e51146
4 changed files with 13 additions and 3 deletions

View File

@ -482,7 +482,7 @@ static int elf_write_tasks_data(core_dump_elf_t *self)
#if CONFIG_ESP_COREDUMP_CAPTURE_DRAM #if CONFIG_ESP_COREDUMP_CAPTURE_DRAM
/* Only crashed task data will be saved here. The other task's data will be automatically saved within the sections */ /* Only crashed task data will be saved here. The other task's data will be automatically saved within the sections */
if (esp_core_dump_get_current_task_handle() != task_iter.pxTaskHandle) if (esp_core_dump_get_current_task_handle() == task_iter.pxTaskHandle)
#endif #endif
{ {
ret = elf_save_task(self, &task_hdr); ret = elf_save_task(self, &task_hdr);

View File

@ -17,7 +17,7 @@ if(CONFIG_TEST_MEMPROT)
endif() endif()
endif() endif()
if(NOT CONFIG_TEST_MEMPROT) if(NOT CONFIG_TEST_MEMPROT AND NOT CONFIG_ESP_COREDUMP_CAPTURE_DRAM)
# Enable UBSAN checks # Enable UBSAN checks
# #
# shift-base sanitizer is disabled due to the following pattern found in register header files: # shift-base sanitizer is disabled due to the following pattern found in register header files:

View File

@ -921,10 +921,19 @@ def test_illegal_access(dut: PanicTestDut, config: str, test_func_name: str) ->
@pytest.mark.generic @pytest.mark.generic
def test_capture_dram(dut: PanicTestDut, config: str, test_func_name: str) -> None: def test_capture_dram(dut: PanicTestDut, config: str, test_func_name: str) -> None:
dut.run_test_func(test_func_name) dut.run_test_func(test_func_name)
regex_pattern = rb'assert failed:[\s\w()]*?\s[.\w/]*\.(?:c|cpp|h|hpp):\d.*$'
dut.expect(re.compile(regex_pattern, re.MULTILINE))
if dut.is_xtensa:
dut.expect_backtrace()
else:
dut.expect_stack_dump()
dut.expect_elf_sha256() dut.expect_elf_sha256()
dut.expect_none(['Guru Meditation', 'Re-entered core dump']) dut.expect_none(['Guru Meditation', 'Re-entered core dump'])
dut.expect_exact('Save core dump to flash...')
dut.expect_exact('Core dump has been saved to flash.')
dut.expect('Rebooting...')
core_elf_file = dut.process_coredump_flash() core_elf_file = dut.process_coredump_flash()
dut.start_gdb_for_coredump(core_elf_file) dut.start_gdb_for_coredump(core_elf_file)

View File

@ -4,3 +4,4 @@ CONFIG_ESP_COREDUMP_CHECKSUM_SHA256=y
CONFIG_ESP_COREDUMP_CAPTURE_DRAM=y CONFIG_ESP_COREDUMP_CAPTURE_DRAM=y
CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_capture_dram.csv" CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_capture_dram.csv"
CONFIG_LOG_DEFAULT_LEVEL_INFO=y