README.rst
1MCUboot simulator
2#################
3
4This is a small simulator designed to exercise the mcuboot upgrade
5code, specifically testing untimely reset scenarios to make sure the
6code is robust.
7
8Prerequisites
9=============
10
11The simulator is written in Rust_, and you will need to install it to
12build it. The installation_ page describes this process. The
13simulator can be built with the stable release of Rust.
14
15.. _Rust: https://www.rust-lang.org/
16
17.. _installation: https://www.rust-lang.org/en-US/install.html
18
19Dependent code
20--------------
21
22The simulator depends on some external modules. These are stored as
23submodules within git. To fetch these dependencies the first time::
24
25 $ git submodule update --init --recursive
26
27will clone and check out these trees in the appropriate place.
28
29Testing
30=======
31
32The tests are written as unit tests in Rust, and can be built and run
33automatically::
34
35 $ cargo test
36
37this should download and compile the necessary dependencies, compile
38the relevant modules from mcuboot, build the simulator, and run the
39tests.
40
41There are several different features you can test. For example,
42testing RSA signatures can be done with::
43
44 $ cargo test --features sig-rsa
45
46For a complete list of features, see Cargo.toml.
47
48Debugging
49=========
50
51If the simulator indicates a failure, you can turn on additional
52logging by setting ``RUST_LOG=warn`` or ``RUST_LOG=error`` in the
53environment::
54
55 $ RUST_LOG=warn ./target/release/bootsim run ...
56
57It is also possible to run specific tests, for example::
58
59 $ cargo test -- basic_revert
60
61which will run only the `basic_revert` test.
62