Commit b841f0a0 authored by Fabio Utzig's avatar Fabio Utzig Committed by David Brown
Browse files

Add simple status write test without interruption

This test marks the status write regions as a bad region,
causing errors, but it is allowed to complete the swap. On
restart the firmware in slot0 should be validated and work.

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent a0e1cce5
Loading
Loading
Loading
Loading
+3
Changes for sim/src/lib.rs: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@ impl Run {
        assert_eq!(slot1_base, slot0_base + slot0_len);
        assert_eq!(scratch_base, slot1_base + slot1_len);

        // NOTE: not accounting "swap_size" because it is not used by sim...
        let offset_from_end = c::boot_magic_sz() + c::boot_max_align() * 2;

        // Construct a primary image.
@@ -295,6 +296,8 @@ impl RunStatus {
        failed |= images.run_perm_with_random_fails(5);
        failed |= images.run_norevert();

        failed |= images.run_with_status_fails_complete();

        //show_flash(&flash);

        if failed {
+1
Changes for sim/tests/core.rs: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -27,3 +27,4 @@ sim_test!(revert_with_fails, make_image, run_revert_with_fails);
sim_test!(perm_with_fails, make_image, run_perm_with_fails);
sim_test!(perm_with_random_fails, make_image, run_perm_with_random_fails_5);
sim_test!(norevert, make_image, run_norevert);
sim_test!(status_write_fails_complete, make_image, run_with_status_fails_complete);