|
| 1 | +# Automated Tests - MCU Manager |
| 2 | + |
| 3 | +This folder contains files for testing MCU Manager feature in nRF Connect for Android. |
| 4 | + |
| 5 | +MCU Manager allows updating supported devices over-the-air using Bluetooth Low Energy as transport. |
| 6 | +nRF Connect is using the [Device Manager](https://github.com/NordicSemiconductor/Android-nRF-Connect-Device-Manager) |
| 7 | +library under the hood. |
| 8 | + |
| 9 | +## Content |
| 10 | + |
| 11 | +1. 3 sets of test files: |
| 12 | + - *merged_peripheral_lbs_[type]_[version].hex - initial firmware for nRF52840 DK to be flashed on (using *nrfjprog* or the Programmer app in nRF Connect for Desktop) |
| 13 | + - *dfu_application_peripheral_lbs_[type]_[version].zip - 2 sets of update packages with increasing version numbers. |
| 14 | +2. *sample_test_lbs_osinfo.xml* - a test file for Automated Tests. |
| 15 | + |
| 16 | +### Firmware types |
| 17 | + |
| 18 | +- *osinfo* - firmware with App Info command supported in the OS group. |
| 19 | +- *w_revert* - MCUBoot in Direct XIP mode with revert. |
| 20 | +- *wo_revert* - MCUBoot in Direct XIP mode without revert. |
| 21 | + |
| 22 | +## Tests preparations |
| 23 | + |
| 24 | +The sample test suite is verifying LBS (LED Button Service) feature on a first device advertising LBS Service UUID. |
| 25 | +The second part of the test reads the slot information on the device, performs an update and verifies the update by reading slot information again. |
| 26 | +As the slot information is different for each firmware, you may need to modify the XML and copy the correct bytes. |
| 27 | + |
| 28 | +The attached XML file tests the *osinfo* type. |
| 29 | + |
| 30 | +> [!NOTE] |
| 31 | +> The ZIP file for an update must be transferred onto the phone before the test is started. |
| 32 | +
|
| 33 | +1. Make sure nRF Connect for Android and nRF Logger are installed on the phone. |
| 34 | +2. Connect the Android phone with the PC for debugging (USB or Wi-Fi) and make sure ADB (Android Debug Bridge) app is in the PATH. |
| 35 | +3. Flash the *merged_peripheral_lbs_osinfo_v100.hex* file onto nRF52840 DK. |
| 36 | +4. Copy the *dfu_application_peripheral_lbs_osinfo_v200.zip* file with version 2.0.x to *sdcard/Android/data/no.nordicsemi.android.mcp/files/Test/*. |
| 37 | +5. Start the test using: |
| 38 | + |
| 39 | + ```sh |
| 40 | + ./test.sh -e FILE /sdcard/Android/data/no.nordicsemi.android.mcp/files/Test/dfu_application_peripheral_lbs_osinfo_v200.zip sample_test_mcu.xml |
| 41 | + ``` |
| 42 | +6. The console should display: |
| 43 | + ```sh |
| 44 | + ================================================= |
| 45 | + Nordic Semiconductor Automated Tests shell script |
| 46 | + ================================================= |
| 47 | + Removing old result file...OK |
| 48 | + Copying "sample_test_mcu.xml" to /sdcard/Android/data/no.nordicsemi.android.mcp/files/Test...OK |
| 49 | + Starting test service...OK |
| 50 | + Test started...OK |
| 51 | + Waiting for the result... |
| 52 | + ``` |
| 53 | +7. When the test is complete the result file should be downloaded to the PC. |
| 54 | + |
| 55 | +### Other firmware |
| 56 | + |
| 57 | +To test other types than *osinfo* do the following: |
| 58 | +1. Copy other ZIP files to the same location on the phone. |
| 59 | +2. Run the *test.sh* or *test.bat* giving the correct file name. |
| 60 | +3. The test will finish with a warning and an error, as Image List will produce different bytes. |
| 61 | +4. Copy the received bytes to the XML file to **assert-notification** command. |
| 62 | +5. Reflash the device with firmware version 1.0.x. |
| 63 | +6. Repeat the test. |
0 commit comments