zephyr/tests/boot/with_mcumgr
Grzegorz Chwierut ae336f69c3 tests: mcuboot: pytest: Add image swap test with mcumgr
Added application based on SMP Server Sample. Application is built together
with MCUboot using sysbuild and is flashed onto device in one step.
Tests are automated with pytest - new harness of Twister.
The image for upgrade is prepared using west sign command
then is uploaded by mcumgr into device and tested.
Automated scenarios to test upgrade (image upload, test, revert, confirm),
to test downgrade prevention mechanism and to test upgrade with image,
that is signed with an invalid key.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2023-09-27 15:43:56 +02:00
..
pytest
src
sysbuild
CMakeLists.txt
README.rst
prj.conf
sysbuild.conf
testcase.yaml

README.rst

Upgrade testing with MCUmgr
###########################

This application is based on :ref:`smp_svr_sample`. It is built
using **sysbuild**. Tests are automated with pytest, a new harness of Twister
(more information can be found here :ref:`integration-with-pytest`)

.. note::
   Pytest uses the MCUmgr fixture which requires the ``mcumgr`` available
   in the system PATH.
   More information about MCUmgr can be found here :ref:`mcu_mgr`.

To run tests with Twister on ``nrf52840dk_nrf52840`` platform,
use following command:

.. code-block:: console

    ./zephyr/scripts/twister -vv --west-flash --enable-slow -T zephyr/tests/boot/with_mcumgr \
    -p nrf52840dk_nrf52840 --device-testing --device-serial /dev/ttyACM0

.. note::
   Twister requires ``--west-flash`` flag enabled (without additional parameters
   like ``erase``) to use sysbuild.

Test scripts can be found in ``pytest`` directory. To list available
scenarios with described procedures, one can use a pytest command:

.. code-block:: console

    pytest zephyr/tests/boot/with_mcumgr/pytest --collect-only -v