Stress Test Suite

The stress test is used for verifying long-term stability and robustness of a system. By exercising different subsystems parallelly under different conditions, we can explore the behavior of a system under heavy loading, and design applications according to those characteristics.

MediaTek provides a stress test suite to allow customers for evaluating MediaTek AIoT platforms. The suite is maintained as a Yocto layer which consists of:

  • Recipes for installing needed tools not included by default AIoT Yocto configuration.

  • Python3 scripts for launching tools to stress the system.

Currently the stress test suite is only supported on i1200 Demo Board. More board support will be added in later updates.

The following sections will describe how to build and run the stress suite.

Testing setup

The testing setup is depicted in following diagram (Genio 1200 demo board in this case):

../_images/stress_test_topology.jpg
  • The testing board is connected to a log server via GiB ethernet connection. The switch used in the test should also support GiB ethernet.

  • The board has following peripherals connected to it:

    • A monitor connected via HDMI

    • 2 USB disks

    • 1 MicroSD card

  • The log server also acts as a iperf3 server for sending/receiving network traffic.

Note

The testing setup is based on Genio 1200 demo board. It might vary depending on different development boards.

Building stress test suite

Note

Before downloading the Yocto layer, make sure you already have a populated Yocto building environment. Please refer to Build from Source Code for more information.

Please run following command to download the Yocto layer:

git clone https://gitlab.com/mediatek/aiot/rity/meta-stress-test.git $PROJ_ROOT/src/meta-stress-test
cd $PROJ_ROOT/src/meta-stress-test
git checkout origin/dunfell

Note

The branch (dunfell) used in this example might not be the same for your Yocto building environment. Please use correct branch for checking out.

And then setup Yocto building environment as described in Build from Source Code:

cd $PROJ_ROOT
export TEMPLATECONF=${PWD}/src/meta-rity/meta/conf/
source src/poky/oe-init-build-env
export BUILD_DIR=`pwd`

And run following command to add the layer we just downloaded to the environment:

bitbake-layers add-layer ../src/meta-stress-test

Finally rebuild the image:

DISTRO=rity-demo MACHINE=i1200-demo bitbake rity-demo-image

Please refer to Flash Image to Boards to flash the target board with the built image.

Host system setup

To receive log sending from target board, the host system needs to have NFS server installed. To install a NFS service, run following command (take Ubuntu as an example):

$ sudo apt install nfs-kernel-server
# Edit /etc/exports to add filesystems to be exported.
$ sudo vi /etc/exports
$ sudo systemctl restart nfs-kernel-server

Note

For details on NFS configuration, please visit Ubuntu document.

The host system also needs to have iperf3 server running:

$ sudo apt install iperf3
$ iperf3 -s

Note

On Ubuntu system, the iperf3 server needs to be run manually, thus it’s recommended to open another terminal to do the task.

Running stress test suite

Before running the stress suite, please connect following peripherals to the board:

  • USB disks

  • HDMI monitor

  • MicroSD card

  • Ethernet

Note

Which peripherals are needs depends on different board configurations. Please consult related documents for more information.

Before running the test, please edit the script start.py:

# cd ~/stress_scripts
# vi start.py

to update global variables according to your testing setup. Here are several settings worth being mentioned:

  • NFS_SERVER: This variable specifies the path of NFS server in your environment.

  • IPERF_SERVER: The IP address of iperf3 server for receiving/sending network traffic.

  • IPERF_BANDWIDTH: The default bandwidth used in test is 20MB/s. The value can be increased if the environment can afford larger bandwidth.

  • MEM_SIZE: The total memory used for memory stress test. Please note that other stress tools also occupy large amount of memory, so you can experiment with different values and find an appropriate one.

  • DISK_RATIO: The ratio of portion of disk spaces are used for running stress test. The larger the ratio, the longer it might take to populate test files before starting stressing.

After finishing editing, in the command prompt of target board, run following commands:

# cd ~/stress_scripts
# ./start.py

The output should look like following:

[05-05 07:38:30] Mounting NFS folder...
emmc mounted
Mounting usb1 (/dev/sda1 => /mnt/disk1)
Mounting usb2 (/dev/sdb1 => /mnt/disk2)
Mounting sd (/dev/mmcblk1p1 => /mnt/sd)
[05-05 07:38:31] Test starting...
[05-05 07:38:31] Start collecting data...

Removing stress test suite

To remove the suite, please run following commands and rebuild the image:

bitbake-layers remove-layer ../src/meta-stress-test
DISTRO=rity-demo MACHINE=i1200-demo bitbake rity-demo-image