|
2 | 2 |
|
3 | 3 | ## Run test locally
|
4 | 4 |
|
| 5 | +NOTE: The tests have been tested on Ubuntu 22.04. For details on how to install Docker please refer to the Docker documentation https://docs.docker.com/engine/install/ubuntu/ |
| 6 | + |
5 | 7 | ### Setup docker
|
6 | 8 | ```shell
|
7 | 9 | docker pull ghcr.io/hello-nrfcloud/firmware:docker-v1.0.3
|
8 | 10 | cd <path_to_oob_dir>
|
9 |
| -west build -p -b thingy91x/nrf9151/ns app |
10 |
| -cp build/merged.hex tests/on_target/artifacts/hello.nrfcloud.com-aaa000-thingy91x-nrf91.hex |
11 | 11 | docker run --rm -it \
|
12 | 12 | --privileged \
|
13 | 13 | -v /dev:/dev:rw \
|
14 | 14 | -v /run/udev:/run/udev \
|
15 | 15 | -v .:/work/thingy91x-oob \
|
16 |
| - -v /opt/setup-jlink:/opt/setup-jlink \ |
17 | 16 | ghcr.io/hello-nrfcloud/firmware:docker-v1.0.3 \
|
18 | 17 | /bin/bash
|
| 18 | +cd thingy91x-oob/tests/on_target |
19 | 19 | ```
|
20 | 20 |
|
21 |
| -NOTE: The tests have been tested on Ubuntu 22.04. For details on how to install Docker please refer to the Docker documentation https://docs.docker.com/engine/install/ubuntu/ |
22 |
| - |
23 | 21 | ### Verify nrfutil/jlink works
|
24 | 22 | ```shell
|
25 | 23 | JLinkExe -V
|
26 | 24 | nrfutil -V
|
27 | 25 | ```
|
28 | 26 |
|
29 |
| -### Install requirements |
30 |
| -```shell |
31 |
| -cd thingy91x-oob/tests/on_target |
32 |
| -pip install -r requirements.txt --break-system-packages |
33 |
| -``` |
| 27 | +### NRF91 tests |
| 28 | +Precondition: thingy91x with segger fw on 53 |
34 | 29 |
|
35 |
| -### Get SEGGER ID |
| 30 | +Get device id |
36 | 31 | ```shell
|
37 | 32 | nrfutil device list
|
38 | 33 | ```
|
39 | 34 |
|
40 |
| -### Run UART tests |
41 |
| - |
42 |
| -Precondition: thingy91x with segger fw on 53 |
43 |
| - |
| 35 | +Set env |
44 | 36 | ```shell
|
45 | 37 | export SEGGER=<your_segger>
|
46 |
| -pytest -s -v -m "dut1 and uart" tests |
47 | 38 | ```
|
48 | 39 |
|
49 |
| -### Run FOTA tests |
50 |
| - |
51 |
| -Precondition: thingy91x with segger fw on 53 |
52 |
| - |
| 40 | +Additional fota and memfault envs |
53 | 41 | ```shell
|
54 |
| -export SEGGER=<your_segger> |
55 | 42 | export IMEI=<your_imei>
|
56 | 43 | export FINGERPRINT=<your_fingerprint>
|
57 |
| -pytest -s -v -m "dut1 and fota" tests |
58 | 44 | ```
|
59 | 45 |
|
60 |
| -### Run DFU tests |
| 46 | +Run desired tests, example commands |
| 47 | +```shell |
| 48 | +pytest -s -v -m "not slow" tests |
| 49 | +pytest -s -v -m "not slow" tests/test_functional/test_uart_output.py |
| 50 | +pytest -s -v -m "not slow" tests/test_functional/test_location.py::test_wifi_location |
| 51 | +pytest -s -v -m "slow" tests/test_functional/test_fota.py::test_full_mfw_fota |
| 52 | +``` |
| 53 | + |
| 54 | +### NRF53 tests |
61 | 55 |
|
62 | 56 | Precondition: thingy91x with external debugger attached
|
63 | 57 |
|
64 | 58 | IMPORTANT: switch must be on nrf53.
|
65 | 59 |
|
66 |
| -Set all this bunch of env variables appropriately (see worflow for details): |
67 |
| -SEGGER_NRF53, SEGGER_NRF91, UART_ID, NRF53_HEX_FILE, NRF53_APP_UPDATE_ZIP, |
68 |
| -NRF53_BL_UPDATE_ZIP, NRF91_HEX_FILE, NRF91_APP_UPDATE_ZIP, NRF91_BL_UPDATE_ZIP |
| 60 | +Set env |
| 61 | +```shell |
| 62 | +export SEGGER_NRF53=<your_segger_ext_deb> |
| 63 | +export SEGGER_NRF91=<your_segger_onboard_deb> |
| 64 | +export UART_ID_DUT_2=<your_dut_uart_id> |
| 65 | +``` |
69 | 66 |
|
70 | 67 | ```
|
71 |
| -pytest -s -v -m dut2 tests |
| 68 | +pytest -s -v -m "slow" tests/test_bridge/test_serial_dfu.py::test_dfu |
| 69 | +pytest -s -v -m "slow" tests/test_bridge/test_conn_bridge.py::test_conn_bridge |
| 70 | +``` |
| 71 | + |
| 72 | +### PPK test |
| 73 | + |
| 74 | +Precondition: thingy91x with segger fw on 53 and PPK setup |
| 75 | + |
| 76 | +Set env |
| 77 | +```shell |
| 78 | +export SEGGER_PPK=<your_segger> |
| 79 | +pytest -s -v -m "slow" tests/test_ppk/test_power.py::test_power |
72 | 80 | ```
|
73 | 81 |
|
74 | 82 | ## Test docker image version control
|
|
0 commit comments