Mistake on this page? Email us

End-to-end Edge Test Suite

You can perform end-to-end tests using the Python test suite for Pelion Edge end-to-end tests. The library is designed to be used with the pytest test framework.


Before you can use the end-to-end test suite, you must have:

  • Python 3.6 or later.
  • pip.
  • venv (recommended).
sudo apt install python3-pip
sudo apt install python3-venv
  • kubectl.


    snap install kubectl --classic
    kubectl version --client

Set up

  1. Clone repository.
  2. Create virtual environment.
  3. Upgrade pip.
  4. Install requirements.
git clone https://github.com/PelionIoT/e2e-edge-test-suite.git
cd e2e-edge-test-suite
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt


  1. Start Edge device.

  2. Create a configuration file based on the environment config template:

  3. Log in to the Pelion Device Management portal:

  4. Create an access key in the portal.

  5. Set the key in the configuration file.

  6. Set the edge device ID in the configuration file.

Example configuration file (EU):

  "api_gw": "https://api.eu-west-1.mbedcloud.com",
  "api_key": "",
  "connection_type": "cloud",
  "edge_k8s_url": "https://edge-k8s.eu-west-1.mbedcloud.com",
  "gateways_url": "https://gateways.eu-west-1.mbedcloud.com",
  "device_id": "",
  "has_remote_terminal": true


Run all tests:

pytest  --config_path=tests/config.json  --html=results.html


There are many ways to configure the test runs. Refer to the full pytest documentation for more information.



Device attribute tests use Pelion Device Management device directory APIs to get device information and device attributes, such as registration status.

Test name Main functions Notes
test_device_registered Verify the device is registered.


Kubernetes tests use the Kubernetes command-line tool, kubectl, to run commands against Kubernetes clusters. You must enable Edge Kubernetes in your Pelion Device Management account to run these tests successfully.

Test name Main functions Notes
test_node Verify the device is registered in Kubernetes.
test_pod Verify the test Pod can be launched.
test_pod_state Verify the test Pod state is running.


LwM2M resource tests use the Pelion Device Management connect API to read and write resource values to and from the device.

Test name Main functions Notes
test_put_lifetime Verify the write-to-device resource works. Resource '1/0/1'
test_get_lifetime Verify the read-from-device resource works. Resource '1/0/1'


These tests verify the device remote terminal is functional.

Note: Not all edge gateway devices have remote terminal supported. Use the configuration file parameter has_remote_terminal to define whether this test is part of the set.

Test name Main functions Notes
test_remote_terminal Verify communication via remote terminal works.


This test file uses the Pelion Device Management notifications API to register a websocket notification channel to receive notifications such as registration, registration update and resource notifications from the device.

Test name Main functions Notes
test_registration_update_notification Verify the registration update notification is received.
test_registration_notification Verify the registration notification is received after reboot.
test_notification_device_cpu_usage Verify the notification from the device is received. Resource: '/3/0/3320', supported by Snap-Pelion-Edge


For licensing details, please see the license agreement.