Module log_test

Source
Expand description

Tests the log storage interface in circular mode. For testing in linear mode, see linear_log_test.rs.

This testing framework creates a circular log storage interface in flash and runs a series of operations upon it. The tests check to make sure that the correct values are read and written after each operation, that errors are properly detected and handled, and that the log generally behaves as expected. The tests perform both valid and invalid operations to fully test the logโ€™s behavior.

Pressing the USER button on the imix at any time during the test will erase the log and reset the test state. Pressing the RESET button will reboot the imix without erasing the log, allowing for testing logs across reboots.

In order to fully test the log, the tester should try a variety of erases and reboots to ensure that the log works correctly across these operations. The tester can also modify the testing operations and parameters defined below to test logs in different configurations. Different configurations should be tested in order to exercise the log under a greater number of scenarios (e.g. saturating/not saturating log pages with data, always/not always ending operations at page boundaries, etc.).

To run the test, add the following line to the imix boot sequence:

    test::log_test::run(mux_alarm, &peripherals.flash_controller);

and use the USER and RESET buttons to manually erase the log and reboot the imix, respectively.

Structsยง

LogTest ๐Ÿ”’

Enumsยง

TestOp ๐Ÿ”’
TestState ๐Ÿ”’

Constantsยง

BUFFER_LEN ๐Ÿ”’
ENTRIES_PER_WRITE ๐Ÿ”’
MAGIC ๐Ÿ”’
VALUE_SHIFT ๐Ÿ”’
WAIT_MS ๐Ÿ”’

Staticsยง

BUFFER ๐Ÿ”’
DUMMY_BUFFER ๐Ÿ”’
TEST_LOG
TEST_OPS ๐Ÿ”’

Functionsยง

entry_id_to_test_value ๐Ÿ”’
runโš 

Type Aliasesยง

Log ๐Ÿ”’