Skip to content

Commit

Permalink
add integration test for MT SampleServer
Browse files Browse the repository at this point in the history
  • Loading branch information
Kantiran91 committed Jul 19, 2023
1 parent 054625e commit 61e9dba
Show file tree
Hide file tree
Showing 9 changed files with 1,755 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,14 @@
tags: |
ghcr.io/${{ env.IMAGE_REPOSITORY }}:${{ env.IMAGE_TAG }}
provenance: false
- name: Run integration test mqtt
if: ${{env.IS_NOT_PR == 'true'}}
run : |
#! /bin/bash
python -m pip install --upgrade pip
cd ./UmatiDashboardOpcUaClient/Tests/integration/mqtt_test || exit
pip install -r requirements.txt
docker compose up -d
./waitForContainer.sh
python -m unittest discover test_mqtt_sampleserver
305 changes: 305 additions & 0 deletions Tests/integration/mqtt_test/configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,305 @@
{
"OpcUa": {
"Endpoint": "opc.tcp://opcuaserver:4840",
"Username": "",
"Password": "",
"Security": 1
},
"Mqtt": {
"Hostname": "mqtt_broker",
"Port": 1883,
"Username": "umati/mqtt_test",
"Password": "",
"Prefix": "umati/v2",
"ClientId": "umati/mqtt_test",
"Protocol": "tcp"
},
"MachineCacheFile": "MachineCache_datahub.json",
"MachinesFilter": [ ],
"ObjectTypeNamespaces": [
"http://opcfoundation.org/UA/",
"http://opcfoundation.org/UA/IA/",
"http://opcfoundation.org/UA/DI/",
"http://opcfoundation.org/UA/Dictionary/IRDI",
"http://opcfoundation.org/UA/Machinery/",
"http://opcfoundation.org/UA/Machinery/ProcessValues/",
"http://opcfoundation.org/UA/Machinery/Result/",
"http://opcfoundation.org/UA/MachineTool/",
"http://opcfoundation.org/UA/PADIM/",
"http://opcfoundation.org/UA/AdditiveManufacturing/NodeSet2/",
"http://opcfoundation.org/UA/Woodworking/",
"http://opcfoundation.org/UA/Robotics/",
"http://opcfoundation.org/UA/IJT/",
"http://opcfoundation.org/GMS/",
"http://opcfoundation.org/UA/PlasticsRubber/GeneralTypes/",
"http://opcfoundation.org/UA/PlasticsRubber/IMM2MES/",
"http://opcfoundation.org/UA/PlasticsRubber/TCD/",
"http://opcfoundation.org/UA/PlasticsRubber/HotRunner/",
"http://opcfoundation.org/UA/PlasticsRubber/LDS/",
"http://opcfoundation.org/UA/PlasticsRubber/Extrusion_v2/GeneralTypes/",
"http://opcfoundation.org/UA/PlasticsRubber/Extrusion_v2/HaulOff/",
"http://opcfoundation.org/UA/PlasticsRubber/Extrusion_v2/Corrugator/",
"http://opcfoundation.org/UA/PlasticsRubber/Extrusion_v2/Extruder/",
"http://opcfoundation.org/UA/PlasticsRubber/umati/generic/",
"http://opcfoundation.org/UA/PlasticsRubber/umati/OPC40079ForUmati/",
"http://opcfoundation.org/UA/PlasticsRubber/ImmToRobot/",
"http://opcfoundation.org/UA/Glass/Flat/",
"http://lenord.de/umati/MiniCODER/"
],
"NamespaceInformations": [
{
"Namespace": "http://opcfoundation.org/UA/Robotics/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/Robotics/",
"Id": "i=1004",
"BaseTypeLevel": 0,
"$comment": "MotionDeviceType"
},
{
"Uri": "http://opcfoundation.org/UA/Robotics/",
"Id": "i=1003",
"BaseTypeLevel": 0,
"$comment": "ControllerType"
},
{
"Uri": "http://opcfoundation.org/UA/Robotics/",
"Id": "i=1002",
"BaseTypeLevel": 0,
"$comment": "MotionDeviceSystemType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/Machinery/",
"Id": "i=1012",
"BaseTypeLevel": 0,
"$comment": "MachineIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/UA/IJT/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/IJT/",
"Id": "i=1005",
"$comment": "TighteningSystemType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/Machinery/",
"Id": "i=1012",
"$comment": "MachineIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/UA/MachineTool-Prototyping/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/MachineTool-Prototyping/",
"Id": "i=1014",
"$comment": "MachineToolType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/MachineTool-Prototyping/",
"Id": "i=1012",
"$comment": "MachineToolIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/UA/MachineTool/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/MachineTool/",
"Id": "i=13",
"$comment": "MachineToolType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/MachineTool/",
"Id": "i=11",
"$comment": "MachineToolIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/UA/Woodworking/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/Woodworking/",
"Id": "i=2",
"$comment": "WwMachineType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/Machinery/",
"Id": "i=1012",
"$comment": "MachineIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/GMS/",
"Types": [
{
"Uri": "http://opcfoundation.org/GMS/",
"Id": "i=1002",
"$comment": "GMSType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/GMS/",
"Id": "i=1011",
"$comment": "GMSIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/UA/PlasticsRubber/umati/generic/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/PlasticsRubber/umati/generic/",
"Id": "i=1002",
"$comment": "UmatiPlasticsRubberGenericType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/Machinery/",
"Id": "i=1012",
"$comment": "MachineIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/UA/PlasticsRubber/IMM2MES/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/PlasticsRubber/IMM2MES/",
"Id": "i=1007",
"$comment": "IMM_MES_InterfaceType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/Machinery/",
"Id": "i=1012",
"$comment": "MachineIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/UA/PlasticsRubber/Extrusion_v2/Extruder/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/PlasticsRubber/Extrusion_v2/Extruder/",
"Id": "i=1015",
"$comment": "Extruder_InterfaceType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/Machinery/",
"Id": "i=1012",
"$comment": "MachineIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/UA/PlasticsRubber/Extrusion_v2/Corrugator/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/PlasticsRubber/Extrusion_v2/Corrugator/",
"Id": "i=1003",
"$comment": "Corrugator_InterfaceType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/Machinery/",
"Id": "i=1012",
"$comment": "MachineIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/UA/PlasticsRubber/LDS/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/PlasticsRubber/LDS/",
"Id": "i=1007",
"$comment": "LDS_InterfaceType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/Machinery/",
"Id": "i=1012",
"$comment": "MachineIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/UA/PlasticsRubber/HotRunner/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/PlasticsRubber/HotRunner/",
"Id": "i=1010",
"$comment": "HRD_InterfaceType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/Machinery/",
"Id": "i=1012",
"$comment": "MachineIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/UA/PlasticsRubber/TCD/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/PlasticsRubber/TCD/",
"Id": "i=1012",
"$comment": "TCD_InterfaceType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/Machinery/",
"Id": "i=1012",
"$comment": "MachineIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/UA/PlasticsRubber/umati/OPC40079ForUmati/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/PlasticsRubber/umati/OPC40079ForUmati/",
"Id": "i=1003",
"$comment": "ImmRobotCellType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/Machinery/",
"Id": "i=1012",
"$comment": "MachineIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/UA/Glass/Flat/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/Glass/Flat/",
"Id": "i=1015",
"$comment": "GlassMachineType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/Glass/Flat/",
"Id": "i=1020",
"$comment": "GlassMachineIdentificationType"
}
},
{
"Namespace": "http://opcfoundation.org/UA/AdditiveManufacturing/NodeSet2/",
"Types": [
{
"Uri": "http://opcfoundation.org/UA/AdditiveManufacturing/NodeSet2/",
"Id": "i=1031",
"$comment": "AdditiveManufacturingType"
}
],
"IdentificationType": {
"Uri": "http://opcfoundation.org/UA/AdditiveManufacturing/NodeSet2/",
"Id": "i=1028",
"$comment": "MachineIdentificationAMType"
}
}
]
}
20 changes: 20 additions & 0 deletions Tests/integration/mqtt_test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
version: '3.1'
services:
mqtt_broker:
image: eclipse-mosquitto
volumes:
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf
ports:
- 1883:1883
opcuaserver:
image: ghcr.io/umati/sample-server:develop
ports:
- 4840:4840
gateway:
depends_on:
- mqtt_broker
- opcuaserver
image: ghcr.io/${IMAGE_REPOSITORY}:${IMAGE_TAG}
volumes:
- ./configuration.json:/app/configuration.json
7 changes: 7 additions & 0 deletions Tests/integration/mqtt_test/mosquitto.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
listener 1883
protocol mqtt

log_dest stdout
log_type all

allow_anonymous true
3 changes: 3 additions & 0 deletions Tests/integration/mqtt_test/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
jsonschema>=4.17.3
paho-mqtt>=1.6.1

Loading

0 comments on commit 61e9dba

Please sign in to comment.