Skip to content

Integration Testing

Limitations of this document

This document aims to detail test scenarios for integrating applications using MiraMesh. The application is assumed to be running on Nordic Semiconductor's nRF52832 or nRF52840 chipsets with SoftDevice.

Definitions

Defintion Description
DUT Device Under Test. The hardware and software combination, plus extra test functionality, that is being tested.
Leaf/Mesh/Root node nRF52840-DK dev board running the Mira stack configured as leaf, mesh or root.
JOINED network state mira_net_get_state() returns MIRA_NET_STATE_JOINED.

Hardware requirements

  • A 32768 Hz crystal oscillator needs to be connected to the chip. The crystal should be stable within the target temperature range at +/- 250 ppm.

  • Two nRF52840-DK boards and an oscilloscope as testing equipment.

Software requirements

  • The application should not use peripherals used by MiraMesh or SoftDevice. See separate documentation.

Functional tests

Requirements for tests

The hardware under test needs to provide a GPIO pin that can be measured with an oscilloscope and another GPIO pin configured as an input.

When testing a mesh node it should be connected to a leaf node and a root node via a wired network. The network should prevent the leaf and root nodes from communicating directly.

The application under test needs to be modified to provide three test functions:

  • The application should use mira_net_time_schedule to toggle a GPIO port from its callback function at every 1.28 seconds. This should be implemented in a way that minimizes latency between the callback being called and the GPIO being toggled.

  • The application should listen to a UDP port and echo incoming packets back to the sender.

  • The application should send a message at a configurable interval to the root or leaf nodes.

  • The application should provide a measurable way to determine if the network has state JOINED, such as via a separate GPIO or a LED.

  • The application should re-initialize the Mira stack with a new PAN ID and encryption key when the GPIO input is toggled.

Before each test begins the DUT and accompanying nodes shall have joined the network for 30 minutes.

Clock stability tests

Hardware measurements

Measure the crystal with an oscilloscope when the system is running over the intended temperature range. The crystal should be running at 32768 Hz with a maximum deviation of 250 ppm.

Net synchronization tests for mesh and leaf nodes

With a MiraOS root node and the network_blink_server example measure the GPIO of the DUT and the MiraOS node. Measure at a minimum over 1000 pulses.

Expected result: The maximum time between the leading edge of the pulses shall be no larger than 50 uS.

Net synchronization tests for root nodes

With a MiraOS leaf node and the network_blink_client example measure the GPIO of the DUT and the MiraOS node. Measure at a minimum over 1000 pulses.

Expected result: The maximum time between the leading edge of the pulses shall be no larger than 50 uS.

Communication tests

Testing messages on leaf nodes

The DUT is connected to a root node running MiraOS. The root node should send a 50 byte UDP packet to the DUT every minute for 8 hours and count the number of packets echoed back.

Expected result: At most 1% of the packets should be lost. The DUT should never lose the JOINED network state.

Testing messages on mesh nodes

The DUT is connected to a root node running MiraOS. A leaf node running MiraOS has the DUT as a parent. The root node should send a 50 UDP packet to the leaf node every minute for 8 hours and count the number of packets echoed back.

Expected result: At most 1% of the packets should be lost. The DUT should never lose the JOINED network state.

Testing messages on root nodes

The DUT is running as a root node for the network with a leaf node running MiraOS connected to it. The leaf node should send a 50 byte UDP packet to the root node every minute for 8 hours and count the number of packets echoed back.

Expected result: At most 1% of the packets should be lost. The MiraOS leaf node should never lose the JOINED network state.

Other tests

Reinitializing MiraMesh

The DUT is connected to a root node running MiraOS, while a spearate root node with a separate PAN ID and encryption key is up and running. The DUT should reinitialize MiraMesh with the PAN ID and encryption key for the second root node when triggered via GPIO input. Trigger this GPIO after the DUT has been JOINED for 5 minutes.

Expected result: The DUT should be joined with the new root node within 5 minutes, without restarting the chip.

Back to top