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 🔒