This document provides guidelines for test engineers to execute and manage tests for the Device Library
. It covers Docker-based testing environments to ensure consistency and reliability across platforms. The tested features include:
- Platform Information (Motherboard name, DMI info, etc.)
- Onboard Sensors (Temperature, Voltage, Fan speed)
- GPIO (Get/Set direction, Get/Set level)
- Library Name:
Device Library
- Implementation:C# / Python
- Unit Test Frameworks:
- C#:
xUnit
- Python:
unittest
- C#:
- Test Types:
- Unit Tests
- Integration Tests
- Containerized Tests (Docker)
- Operating System : Linux
- Docker Engine : v20.10.x or later
- docker-compose : v1.28.x or later
- Install SUSI or PlatformSDK on host device.
- For EIoT products : SUSI API
- For IIoT products : PlatformSDK (EAPI)
- Install Docker & docker-compose on host device.
# Remove old version
sudo apt remove docker docker-engine docker.io containerd runc
# Install essential packages
sudo apt update
sudo apt install \
ca-certificates \
curl \
gnupg \
lsb-release
# Add Docker official GPG key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# Add package source of Docker
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Update package index and install Docker Engine
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io
# Make current user be able to run Docker without sudo
sudo usermod -aG docker $USER
newgrp docker
# Verify installation of Docker
docker version
# Download docker-compose version 2.39.2 and change its permission.
ARCH=$(uname -m)
OS=$(uname -s)
DOCKER_COMPOSE_VERSION=v2.39.2
curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-${OS}-${ARCH}" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
sudo ln -sf /usr/local/bin/docker-compose /usr/bin/docker-compose
# Verify installation of docker-compose
docker-compose version
-
Create Github account & assign account roles in project Advantech-EdgeSync-Device-Library-TestingTool.
- Request the repo administrator to assign access permissions for pulling repo.
-
Create Harbor account & assign account roles in project edgesync-container.
-
Create Harbor account
-
Request the project administrator to assign appropriate permissions and verify that the access level for the edgesync-container project is set above 'Guest'.
-
docker login harbor.edgesync.cloud
git clone https://github.com/Advantech-EdgeSync-Containers/Advantech-EdgeSync-Device-Library-TestingTool
cd Advantech-EdgeSync-Device-Library-TestingTool
./run_test.sh
-
After running the script
run_test.sh
, test reports for each programming language implementation of the Device Library will be generated. -
Each file content in the test report is summarized below:
-
edgesync_device_lib_test_{device_model}.log : System information of device.
Item Description Motherboard Name Model name of motherboard ( Ex : EPC-R7300 ) SUSI Version Library version of SUSI -
edgesync_device_lib_test_summary_{device_model}_{test_date}.csv : Result summary generated by test tool running on device.
-
edgesync_device_lib_test_{device_model}_{test_date}.csv : Detailed result generated by test tool running on device for each test items.
-
Issue Description | Possible Cause | Solution | Notes |
---|---|---|---|
Error message : Test fail : Advantech API not installed | Not installed SUSI API or PlatformSDK yet. | Install SUSI API or PlatformSDK before running script. | |
Error message : unauthorized to access repository | Not logged in to Harbor yet. | Login to Harbor before running script. | Confirm that the account is granted Guest or higher access rights. |