mcuboot/sim
David Brown 61a540dd4e sim: Remove cfg on `verify_image`
Remove the final conditional compilation in the simulator.  The
simulator is now always built the same way, and bases the tests it runs
on the capability queries made to the MCUboot code.  This simplifies the
simulator code a bit, and, importantly, removes the ability to have
mismatches between the configuration as compiled into the MCUboot code
and how the simulator is compiled.

Signed-off-by: David Brown <david.brown@linaro.org>
2019-01-12 14:35:54 -07:00
..
mcuboot-sys boot: zephyr: migrate to new log subystem 2019-01-10 19:11:15 +01:00
simflash Update simulator dependencies 2019-01-11 10:24:09 -07:00
src sim: Remove cfg on `verify_image` 2019-01-12 14:35:54 -07:00
tests
.gitignore
Cargo.lock Update simulator dependencies 2019-01-11 10:24:09 -07:00
Cargo.toml Update simulator dependencies 2019-01-11 10:24:09 -07:00
README.rst

README.rst

MCUboot Simulator
#################

This is a small simulator designed to exercise the mcuboot upgrade
code, specifically testing untimely reset scenarios to make sure the
code is robust.

Prerequisites
=============

The simulator is written in Rust_, and you will need to install it to
build it.  The installation_ page describes this process.  The
simulator can be built with the stable release of Rust.

.. _Rust: https://www.rust-lang.org/

.. _installation: https://www.rust-lang.org/en-US/install.html

Dependent code
--------------

The simulator depends on some external modules.  These are stored as
submodules within git.  To fetch these dependencies the first time::

  $ git submodule update --init

will clone and check out these trees in the appropriate place.

Testing
=======

The tests are written as unit tests in Rust, and can be built and run
automatically::

  $ cargo test

this should download and compile the necessary dependencies, compile
the relevant modules from mcuboot, build the simulator, and run the
tests.

There are several different features you can test. For example,
testing RSA signatures can be done with::

  $ cargo test --features sig-rsa

For a complete list of features, see Cargo.toml.

Debugging
=========

If the simulator indicates a failure, you can turn on additional
logging by setting ``RUST_LOG=warn`` or ``RUST_LOG=error`` in the
environment::

  $ RUST_LOG=warn ./target/release/bootsim run ...

It is also possible to run specific tests, for example::

  $ cargo test -- basic_revert

which will run only the `basic_revert` test.