Testing an Edge Device¶
This document aims to provide an overview about how to prepare an End-to-End test environment to test your own Edge Device.
This document is organized as follows:
- Prerequisites: Section describes the necessary steps that needs to be followed before you prepare your own End-to-End (E2E) testing environment.
- Setting Up Testing Environment: Section describes the steps to prepare your testing environment for your own Edge Devices.
- Running E2E Tests: Section describes the steps to run your own E2E test suite for your own Edge Devices.
- IEDK Test Suite: Section describes the IEDK Test Suite, which assists in conducting the tests, and necessary steps to run IEDK Test Suite.
Prerequisites¶
Before preparing an E2E testing environment for your own Edge Device, make sure you have IE Hub access rights.
Setting Up Testing Environment¶
IEM Setup¶
The first step in preparing your E2E testing environment is installing and setting up an Industrial Edge Management in a local server in your local network. You should register your local IEM instance to a global IE Hub instance with your own account. Furthermore, at least one edge app should be available in the IEM to run the IEDK Test Suite. You can either create an app and transfer it to the IEM or copy an app from the IE Hub to the IEM. More information can be found on Running a Sample App and Copying an App to IEM Instances.
Edge Device Setup¶
The next step for preparing your E2E testing environment is setting up the Edge Device on which E2E tests will run. This involves installing a compatible GNU/Linux OS and installing the necessary Industrial Edge Device Kit software packages onto your Edge Device. After that you must activate your Edge Device with your local IEM.
Further details for setting up an Edge Device can be found on Onboarding the Edge Device to the IEM
Before running your test cases for your Edge Device, make sure your test environment matches the following:
- Edge Device, IEM and other test machines (if any) are in the same network
- Edge Device to be tested is running
- Local IEM which must be reachable from the Edge Device to be tested is running
- For application tests, related app needs to be installed on your Edge Device. More information can be found on Installing sample Edge App to Device
As a general overview, the following diagram depicts an E2E testing environment:
Running E2E Test Cases¶
With the aim of testing your Edge Device with a bunch of scenarios, below test cases can be used as a reference:
IEDK Test Suite¶
The purpose of the IEDK test suite is to simulate the end-to-end relationship between the IEM and Industrial Edge Devices. It is aimed to show the stages from onboarding an Edge Device to installing apps on the Edge Device. Furthermore, it is intended to show the basic settings that can be made on the Edge Device, also how to onboard it with different configurations.
There are 23 requests for this collection. If the deleteEdgeDevice step is not running, 22 test steps will appear in the HTML test report page.
The HTML report page is created automatically after running the IEDK test suite. In this way, it will be revealed at which steps the tested Edge Device needs improvement and the failed steps can also be examined. Before the Edge Device is being used, its errors will be detected. It will be tested not only on the device side, but also in the communication with the IEM.
Below the test requests heading, the test details can be viewed by clicking on the desired test step.
Running IEDK Test Suite¶
- This test environment should be run in another environment, not on the Edge Device.
- You need to run the runtest.sh script to execute the tests mentioned below, so you need to work on a Linux OS. If you want to work on Windows, you need to convert bash commands to batch commands.
Docker
must be installed in your Linux environment.-
Download the Industrial Edge Device Kit software package from the Industrial Edge Hub.
China Region
For users in China region please download from Industrial Edge Hub China.
-
Copy the
iedkTestSuite
folder to your workspace and fill in theenv.txt
file with the appropriate IED and IEM information. - Run
runtest.sh
- A
report
folder will be generated in your workspace and checkreport/IEDK_Report.html
for test reports in HTML.
The test steps in the collection are as follows.
getIEMToken¶
The access token when accessing the IEM is obtained at this step. With using the username and password, an environment variable named "iemtoken" is set to be used in next requests. iemtoken will be used in all requests made through the IEM.
createEdgeDevice¶
The configuration file required to onboard the Edge Device is created and saved at this step. There is no DHCP or static IP adjustment in this configuration file.
onboardEdgeDevice¶
The device-test file created in the previous step is used in this step and the Edge Device is onboarded.
deleteEdgeDevice¶
If onboardEdgeDevice fails, this request will run to delete the previously created Edge Device.
getAppID¶
This test step is run to get the ID of the application in the IEM catalog. This ID will be used in the following stages.
installApp¶
Last step required to transfer the application from the IEM to the IED. The deviceid value obtained while creating the Edge Device onboarding file is used in this step. After sending the request to Edge Device, the install process is expected to be completed within 90 seconds.
getIEDToken¶
For all requests to be made by the IED, the token access value should be obtained in this step.
getAppStatus¶
In the installApp step, the app was sent to the IED side. The status of the application should be questioned to the IED. It takes some time for the application to be transferred to the IED by the IEM completely.
setNtpServers¶
The request is sent with the Edge Device NTP server names 1.tr.pool.ntp.org and 0.tr.pool.ntp.org.
getNtpServers¶
The NTP server names set in the previous step are checked by making a request.
setProxy¶
A request is sent to the Edge Device for HTTP and HTTPS proxy settings with required IP settings.
getProxy¶
In the previous step, the IP value set in HTTP is checked.
deleteProxy¶
This step is used to delete the reserved proxy settings.
getSystemInfo¶
CpuCores and CpuPercentage values are checked.
getStorageInfo¶
DataSpaceFree, DataSpacePercentage , DataSpaceTotal , DataSpaceUsed values are checked.
getOperationQualityInfo¶
InstalledApplicationAvailable , InstalledApplicationCapacity, MemoryAvailable, MemoryCapicity, RunningApplicationAvailable, RunningApplicationCapicity values are checked.
setNetworkConfiguration¶
To set the 2 network infrastructures on the Edge Device, a request is made to set the necessary IP, Gateway and DNS information.
The network interface in which DHCP is activated on the Edge Device to be tested can be defined as the first network interface. If there is another network interface, you can define it as the second network interface. If there is no other network interface, no information about the second network interface should be entered.
getNetworkConfiguration¶
Network settings set in the previous step are checked.
hardReset¶
This step is run so that the Edge Device is ready for the next onboard scenario.
createEdgeDeviceWithNetworkAndNtp¶
An onboard file is created that supports 2 network interfaces, DHCP and static IP. There is a 120 seconds waiting process for the hard reset process started in the previous step.
onboardEdgeDeviceAgain¶
Using the configuration file created in the previous step, the Edge Device is onboarded. If the MAC value of the second interface is not entered, an onboard configuration file is created according to a single network interface.
getIEDTokenAgain¶
In order for the onboarded Edge Device to be ready for retesting after the test is completed, the IED token will be obtained and this token will be used in the hard reset step.
hardResetAgain¶
The Edge Device is hard reset and ready for all tests. There are no other tests after this step.