mcuboot/sim
Andrzej Puzdrowski f1d189c486 zephyr: switch to recent defines and include headers
In zephyr code-base some generic include patches
and defines had been deprecated since a while.
This condition was maintained until zephyr v2.1.0 inclusive.

Recently these deprecated items were removed completely from
the zephyr master branch. Zephyr current SHA of this patch is
e124c1cd34938f02bbe879533c6bd29b5ff53707

This patch switch mcuboot to using most recent items.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-12-12 11:54:44 +01:00
..
mcuboot-sys zephyr: switch to recent defines and include headers 2019-12-12 11:54:44 +01:00
simflash Fix up typos 2019-10-30 06:24:10 -03:00
src sim: Fix ecdsa padding 2019-12-10 07:40:47 -07:00
tests sim: Test variants of single upgrade with multi-image 2019-09-09 10:00:09 -03:00
.gitignore sim: Add simulator code 2017-01-09 12:28:10 -07:00
Cargo.lock sim: cargo: update dependencies 2019-11-06 06:55:25 -03:00
Cargo.toml sim: add feature for swap move strategy 2019-12-09 14:21:09 -03:00
README.rst sim: update README.rst with information on features 2018-04-25 18:44:03 -03:00

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.