Safe Data Fault-Reaction Test Application

All test cases of the tests/safe_data_fault test application, generated from the doxygen XML of its annotated sources (module group safe_data_fault_module). Each scenario selects one unrecoverable-fault reaction (return, handler, panic). The tests cause a fault or an ISR-context call on purpose, so they are kept out of the main test application.

Test Scenarios

Test Scenarios

Scenario

Tags

Extra config

safe_data.fault.return

safe_data

CONFIG_SAFE_DATA_FAULT_RETURN=y

safe_data.fault.handler

safe_data

CONFIG_SAFE_DATA_FAULT_HANDLER=y

safe_data.fault.panic

safe_data

CONFIG_SAFE_DATA_FAULT_PANIC=y

safe_data_fault

Test Case: fault reaction TC_SAFE_DATA_FAULT_REACTION
status: active
test_function: test_fault_reaction
test_module: tests/safe_data_fault
suite: safe_data_fault
suite_title: safe_data_fault
verifies: SD-REQ-011

Unrecoverable fault gets the configured reaction.

An unrecoverable corruption (no shadow copy) gets the reaction that CONFIG_SAFE_DATA_FAULT_* selects: RETURN gives -EILSEQ and calls no handler; HANDLER calls safe_data_fault_handler() with the affected payload and then gives -EILSEQ, and a registered callback takes precedence over that handler; PANIC halts the faulting thread with a kernel panic, and the faulting call does not return.

Source: main.c (line 130)

Test Case: lock from isr asserts TC_SAFE_DATA_LOCK_FROM_ISR_ASSERTS
status: active
test_function: test_lock_from_isr_asserts
test_module: tests/safe_data_fault
suite: safe_data_fault
suite_title: safe_data_fault
depends_on: CONFIG_ASSERT
verifies: SD-REQ-015

Locking call from an ISR is caught by an assertion.

A locked operation (SAFE_READ) runs in ISR context through irq_offload(). With CONFIG_ASSERT enabled, the first assertion that fires is the ISR check in the Safe Data API header, not a kernel assertion further down. The same call from thread context fires no assertion.

Depends on: CONFIG_ASSERT

Source: main.c (line 200)