Commit 7c1d1557 authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

Do not panic when upgrade info tells to hold

Before running tests, a sanity upgrade was run to gather the amount of
flash writes to be expected for the operation. This operation fails when
the dependencies hold an upgrade, so the checks were updated to avoid
aborting under those circumstances.

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent 019a81a4
Loading
Loading
Loading
Loading
+4 −2
Changes for sim/src/image.rs: 4 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -191,8 +191,10 @@ impl ImagesBuilder {
        // upgrades without fails, counts number of flash operations
        let total_count = match images.run_basic_upgrade(permanent) {
            Ok(v)  => v,
            Err(_) => {
                panic!("Unable to perform basic upgrade");
            Err(_) =>
                match deps.upgrades[0] {
                    UpgradeInfo::Held => 0,
                    UpgradeInfo::Upgraded => panic!("Unable to perform basic upgrade"),
                },
        };