Skip to content

Commit 0f96e51

Browse files
committed
ci(coredump): fix capture dram tests
1 parent 52b36a6 commit 0f96e51

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

components/espcoredump/src/core_dump_elf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ static int elf_write_tasks_data(core_dump_elf_t *self)
482482

483483
#if CONFIG_ESP_COREDUMP_CAPTURE_DRAM
484484
/* Only crashed task data will be saved here. The other task's data will be automatically saved within the sections */
485-
if (esp_core_dump_get_current_task_handle() != task_iter.pxTaskHandle)
485+
if (esp_core_dump_get_current_task_handle() == task_iter.pxTaskHandle)
486486
#endif
487487
{
488488
ret = elf_save_task(self, &task_hdr);

tools/test_apps/system/panic/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if(CONFIG_TEST_MEMPROT)
1717
endif()
1818
endif()
1919

20-
if(NOT CONFIG_TEST_MEMPROT)
20+
if(NOT CONFIG_TEST_MEMPROT AND NOT CONFIG_ESP_COREDUMP_CAPTURE_DRAM)
2121
# Enable UBSAN checks
2222
#
2323
# shift-base sanitizer is disabled due to the following pattern found in register header files:

tools/test_apps/system/panic/pytest_panic.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,10 +921,19 @@ def test_illegal_access(dut: PanicTestDut, config: str, test_func_name: str) ->
921921
@pytest.mark.generic
922922
def test_capture_dram(dut: PanicTestDut, config: str, test_func_name: str) -> None:
923923
dut.run_test_func(test_func_name)
924-
924+
regex_pattern = rb'assert failed:[\s\w()]*?\s[.\w/]*\.(?:c|cpp|h|hpp):\d.*$'
925+
dut.expect(re.compile(regex_pattern, re.MULTILINE))
926+
if dut.is_xtensa:
927+
dut.expect_backtrace()
928+
else:
929+
dut.expect_stack_dump()
925930
dut.expect_elf_sha256()
926931
dut.expect_none(['Guru Meditation', 'Re-entered core dump'])
927932

933+
dut.expect_exact('Save core dump to flash...')
934+
dut.expect_exact('Core dump has been saved to flash.')
935+
dut.expect('Rebooting...')
936+
928937
core_elf_file = dut.process_coredump_flash()
929938
dut.start_gdb_for_coredump(core_elf_file)
930939

tools/test_apps/system/panic/sdkconfig.ci.coredump_flash_capture_dram

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ CONFIG_ESP_COREDUMP_CHECKSUM_SHA256=y
44
CONFIG_ESP_COREDUMP_CAPTURE_DRAM=y
55
CONFIG_PARTITION_TABLE_CUSTOM=y
66
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_capture_dram.csv"
7+
CONFIG_LOG_DEFAULT_LEVEL_INFO=y

0 commit comments

Comments
 (0)