MQTT: add test projects, to be later included in automated testing.
authorEdouard Tisserant <edouard@beremiz.fr>
Thu, 22 Aug 2024 12:16:45 +0200
changeset 4006 e16c8443e877
parent 4005 482452574fb4
child 4007 76dede1e3403
MQTT: add test projects, to be later included in automated testing.
tests/projects/mqtt_client/beremiz.xml
tests/projects/mqtt_client/mqtt_0@mqtt/baseconfnode.xml
tests/projects/mqtt_client/mqtt_0@mqtt/confnode.xml
tests/projects/mqtt_client/mqtt_0@mqtt/selected.csv
tests/projects/mqtt_client/plc.xml
tests/projects/mqtt_ssl/beremiz.xml
tests/projects/mqtt_ssl/mqtt_0@mqtt/baseconfnode.xml
tests/projects/mqtt_ssl/mqtt_0@mqtt/confnode.xml
tests/projects/mqtt_ssl/mqtt_0@mqtt/selected.csv
tests/projects/mqtt_ssl/plc.xml
tests/projects/mqtt_ssl/project_files/test-root-ca.crt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/projects/mqtt_client/beremiz.xml	Thu Aug 22 12:16:45 2024 +0200
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='utf-8'?>
+<BeremizRoot xmlns:xsd="http://www.w3.org/2001/XMLSchema" URI_location="PYRO://localhost:61131" Disable_Extensions="false">
+  <TargetType/>
+  <Libraries Enable_Python_Library="false"/>
+</BeremizRoot>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/projects/mqtt_client/mqtt_0@mqtt/baseconfnode.xml	Thu Aug 22 12:16:45 2024 +0200
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<BaseParams xmlns:xsd="http://www.w3.org/2001/XMLSchema" IEC_Channel="0" Name="mqtt_0"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/projects/mqtt_client/mqtt_0@mqtt/confnode.xml	Thu Aug 22 12:16:45 2024 +0200
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<MQTTClient xmlns:xsd="http://www.w3.org/2001/XMLSchema" Broker_URI="ws://172.17.0.1:1883" Use_MQTT_5="true"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/projects/mqtt_client/mqtt_0@mqtt/selected.csv	Thu Aug 22 12:16:45 2024 +0200
@@ -0,0 +1,10 @@
+input,smta,1,DINT,0
+input,smtb,1,DINT,1
+input,smtc,1,DINT,2
+input,smtd,1,DINT,3
+input,smte,1,DINT,4
+output,smtf,1,False,DINT,0
+output,smtg,1,False,DINT,1
+output,smth,1,False,DINT,2
+output,smti,1,False,DINT,3
+output,smtj,1,False,DINT,4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/projects/mqtt_client/plc.xml	Thu Aug 22 12:16:45 2024 +0200
@@ -0,0 +1,296 @@
+<?xml version='1.0' encoding='utf-8'?>
+<project xmlns:ns1="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.plcopen.org/xml/tc6_0201">
+  <fileHeader companyName="Beremiz" productName="Beremiz" productVersion="1" creationDateTime="2016-10-24T18:09:22"/>
+  <contentHeader name="First Steps" modificationDateTime="2024-07-25T16:55:27">
+    <coordinateInfo>
+      <fbd>
+        <scaling x="0" y="0"/>
+      </fbd>
+      <ld>
+        <scaling x="0" y="0"/>
+      </ld>
+      <sfc>
+        <scaling x="0" y="0"/>
+      </sfc>
+    </coordinateInfo>
+  </contentHeader>
+  <types>
+    <dataTypes/>
+    <pous>
+      <pou name="plc_prg" pouType="program">
+        <interface>
+          <localVars>
+            <variable name="LocalVar0">
+              <type>
+                <DINT/>
+              </type>
+              <initialValue>
+                <simpleValue value="0"/>
+              </initialValue>
+            </variable>
+          </localVars>
+          <localVars>
+            <variable name="LocalVar1" address="%QD0.2">
+              <type>
+                <DINT/>
+              </type>
+            </variable>
+            <variable name="LocalVar2" address="%ID0.2">
+              <type>
+                <DINT/>
+              </type>
+            </variable>
+          </localVars>
+        </interface>
+        <body>
+          <FBD>
+            <inVariable localId="1" executionOrderId="0" height="27" width="82" negated="false">
+              <position x="421" y="83"/>
+              <connectionPointOut>
+                <relPosition x="82" y="13"/>
+              </connectionPointOut>
+              <expression>LocalVar0</expression>
+            </inVariable>
+            <inVariable localId="3" executionOrderId="0" height="27" width="82" negated="false">
+              <position x="126" y="224"/>
+              <connectionPointOut>
+                <relPosition x="82" y="13"/>
+              </connectionPointOut>
+              <expression>LocalVar2</expression>
+            </inVariable>
+            <block localId="4" typeName="ADD" executionOrderId="0" height="60" width="63">
+              <position x="112" y="48"/>
+              <inputVariables>
+                <variable formalParameter="IN1">
+                  <connectionPointIn>
+                    <relPosition x="0" y="30"/>
+                    <connection refLocalId="2">
+                      <position x="112" y="78"/>
+                      <position x="102" y="78"/>
+                      <position x="102" y="33"/>
+                      <position x="314" y="33"/>
+                      <position x="314" y="78"/>
+                      <position x="291" y="78"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN2">
+                  <connectionPointIn>
+                    <relPosition x="0" y="50"/>
+                    <connection refLocalId="5">
+                      <position x="112" y="98"/>
+                      <position x="64" y="98"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition x="63" y="30"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inOutVariable localId="2" executionOrderId="0" height="27" width="82" negatedOut="false" negatedIn="false">
+              <position x="209" y="65"/>
+              <connectionPointIn>
+                <relPosition x="0" y="13"/>
+                <connection refLocalId="4" formalParameter="OUT">
+                  <position x="209" y="78"/>
+                  <position x="175" y="78"/>
+                </connection>
+              </connectionPointIn>
+              <connectionPointOut>
+                <relPosition x="82" y="13"/>
+              </connectionPointOut>
+              <expression>LocalVar0</expression>
+            </inOutVariable>
+            <inVariable localId="5" executionOrderId="0" height="27" width="18" negated="false">
+              <position x="46" y="85"/>
+              <connectionPointOut>
+                <relPosition x="18" y="13"/>
+              </connectionPointOut>
+              <expression>1</expression>
+            </inVariable>
+            <block localId="6" typeName="MOD" executionOrderId="0" height="60" width="63">
+              <position x="588" y="66"/>
+              <inputVariables>
+                <variable formalParameter="IN1">
+                  <connectionPointIn>
+                    <relPosition x="0" y="30"/>
+                    <connection refLocalId="1">
+                      <position x="588" y="96"/>
+                      <position x="503" y="96"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN2">
+                  <connectionPointIn>
+                    <relPosition x="0" y="50"/>
+                    <connection refLocalId="7">
+                      <position x="588" y="116"/>
+                      <position x="548" y="116"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition x="63" y="30"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inVariable localId="7" executionOrderId="0" height="27" width="26" negated="false">
+              <position x="522" y="103"/>
+              <connectionPointOut>
+                <relPosition x="26" y="13"/>
+              </connectionPointOut>
+              <expression>50</expression>
+            </inVariable>
+            <block localId="8" typeName="GT" executionOrderId="0" height="60" width="63">
+              <position x="721" y="65"/>
+              <inputVariables>
+                <variable formalParameter="IN1">
+                  <connectionPointIn>
+                    <relPosition x="0" y="30"/>
+                    <connection refLocalId="6" formalParameter="OUT">
+                      <position x="721" y="95"/>
+                      <position x="704" y="95"/>
+                      <position x="704" y="96"/>
+                      <position x="651" y="96"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN2">
+                  <connectionPointIn>
+                    <relPosition x="0" y="50"/>
+                    <connection refLocalId="9">
+                      <position x="721" y="115"/>
+                      <position x="709" y="115"/>
+                      <position x="709" y="117"/>
+                      <position x="697" y="117"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition x="63" y="30"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inVariable localId="9" executionOrderId="0" height="27" width="26" negated="false">
+              <position x="671" y="104"/>
+              <connectionPointOut>
+                <relPosition x="26" y="13"/>
+              </connectionPointOut>
+              <expression>24</expression>
+            </inVariable>
+            <outVariable localId="10" executionOrderId="0" height="27" width="82" negated="false">
+              <position x="1112" y="106"/>
+              <connectionPointIn>
+                <relPosition x="0" y="13"/>
+                <connection refLocalId="11" formalParameter="OUT">
+                  <position x="1112" y="119"/>
+                  <position x="1065" y="119"/>
+                  <position x="1065" y="83"/>
+                  <position x="1019" y="83"/>
+                </connection>
+              </connectionPointIn>
+              <expression>LocalVar1</expression>
+            </outVariable>
+            <block localId="11" typeName="SEL" executionOrderId="0" height="80" width="63">
+              <position x="956" y="53"/>
+              <inputVariables>
+                <variable formalParameter="G">
+                  <connectionPointIn>
+                    <relPosition x="0" y="30"/>
+                    <connection refLocalId="8" formalParameter="OUT">
+                      <position x="956" y="83"/>
+                      <position x="870" y="83"/>
+                      <position x="870" y="95"/>
+                      <position x="784" y="95"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN0">
+                  <connectionPointIn>
+                    <relPosition x="0" y="50"/>
+                    <connection refLocalId="12">
+                      <position x="956" y="103"/>
+                      <position x="927" y="103"/>
+                      <position x="927" y="115"/>
+                      <position x="898" y="115"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN1">
+                  <connectionPointIn>
+                    <relPosition x="0" y="70"/>
+                    <connection refLocalId="13">
+                      <position x="956" y="123"/>
+                      <position x="933" y="123"/>
+                      <position x="933" y="171"/>
+                      <position x="910" y="171"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition x="63" y="30"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inVariable localId="12" executionOrderId="0" height="27" width="34" negated="false">
+              <position x="872" y="102"/>
+              <connectionPointOut>
+                <relPosition x="34" y="13"/>
+              </connectionPointOut>
+              <expression>666</expression>
+            </inVariable>
+            <inVariable localId="13" executionOrderId="0" height="27" width="34" negated="false">
+              <position x="876" y="158"/>
+              <connectionPointOut>
+                <relPosition x="34" y="13"/>
+              </connectionPointOut>
+              <expression>666</expression>
+            </inVariable>
+          </FBD>
+        </body>
+      </pou>
+    </pous>
+  </types>
+  <instances>
+    <configurations>
+      <configuration name="config">
+        <resource name="resource1">
+          <task name="plc_task" priority="1" interval="T#100ms">
+            <pouInstance name="plc_task_instance" typeName="plc_prg"/>
+          </task>
+        </resource>
+        <globalVars constant="true">
+          <variable name="ResetCounterValue">
+            <type>
+              <INT/>
+            </type>
+            <initialValue>
+              <simpleValue value="17"/>
+            </initialValue>
+          </variable>
+        </globalVars>
+      </configuration>
+    </configurations>
+  </instances>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/projects/mqtt_ssl/beremiz.xml	Thu Aug 22 12:16:45 2024 +0200
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<BeremizRoot xmlns:xsd="http://www.w3.org/2001/XMLSchema" URI_location="PYRO://192.168.45.1:3000">
+  <TargetType>
+    <LHC2_GOT_012/>
+  </TargetType>
+  <Libraries Enable_SVGHMI_Library="false"/>
+</BeremizRoot>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/projects/mqtt_ssl/mqtt_0@mqtt/baseconfnode.xml	Thu Aug 22 12:16:45 2024 +0200
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='utf-8'?>
+<BaseParams xmlns:xsd="http://www.w3.org/2001/XMLSchema" IEC_Channel="3" Name="mqtt_0"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/projects/mqtt_ssl/mqtt_0@mqtt/confnode.xml	Thu Aug 22 12:16:45 2024 +0200
@@ -0,0 +1,6 @@
+<?xml version='1.0' encoding='utf-8'?>
+<MQTTClient xmlns:xsd="http://www.w3.org/2001/XMLSchema" Broker_URI="wss://192.168.19.25:18885">
+  <AuthType>
+    <x509 Client_certificate="" Broker_certificate="test-root-ca.crt" Verify_hostname="false"/>
+  </AuthType>
+</MQTTClient>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/projects/mqtt_ssl/mqtt_0@mqtt/selected.csv	Thu Aug 22 12:16:45 2024 +0200
@@ -0,0 +1,2 @@
+input,in_topic1,1,DINT,0

+output,out_topic1,1,False,DINT,0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/projects/mqtt_ssl/plc.xml	Thu Aug 22 12:16:45 2024 +0200
@@ -0,0 +1,107 @@
+<?xml version='1.0' encoding='utf-8'?>
+<project xmlns:ns1="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.plcopen.org/xml/tc6_0201">
+  <fileHeader companyName="SMARTEH d.o.o." productName="LHC2_GOT_012" productVersion="1.1.359" creationDateTime="2024-07-25T15:43:22"/>
+  <contentHeader name="mqtt" modificationDateTime="2024-08-21T17:05:30">
+    <coordinateInfo>
+      <fbd>
+        <scaling x="0" y="0"/>
+      </fbd>
+      <ld>
+        <scaling x="0" y="0"/>
+      </ld>
+      <sfc>
+        <scaling x="0" y="0"/>
+      </sfc>
+    </coordinateInfo>
+  </contentHeader>
+  <types>
+    <dataTypes/>
+    <pous>
+      <pou name="program0" pouType="program">
+        <interface>
+          <localVars>
+            <variable name="LocalVar0" address="%ID3.0">
+              <type>
+                <DINT/>
+              </type>
+            </variable>
+          </localVars>
+          <localVars>
+            <variable name="LocalVar1">
+              <type>
+                <DINT/>
+              </type>
+            </variable>
+          </localVars>
+          <localVars>
+            <variable name="LocalVar2" address="%QD3.0">
+              <type>
+                <DINT/>
+              </type>
+            </variable>
+          </localVars>
+          <localVars>
+            <variable name="LocalVar3">
+              <type>
+                <DINT/>
+              </type>
+            </variable>
+          </localVars>
+        </interface>
+        <body>
+          <FBD>
+            <inVariable localId="1" executionOrderId="0" height="26" width="82" negated="false">
+              <position x="173" y="47"/>
+              <connectionPointOut>
+                <relPosition x="82" y="13"/>
+              </connectionPointOut>
+              <expression>LocalVar0</expression>
+            </inVariable>
+            <outVariable localId="2" executionOrderId="0" height="26" width="82" negated="false">
+              <position x="482" y="47"/>
+              <connectionPointIn>
+                <relPosition x="0" y="13"/>
+                <connection refLocalId="1">
+                  <position x="482" y="60"/>
+                  <position x="255" y="60"/>
+                </connection>
+              </connectionPointIn>
+              <expression>LocalVar1</expression>
+            </outVariable>
+            <outVariable localId="3" executionOrderId="0" height="26" width="82" negated="false">
+              <position x="479" y="140"/>
+              <connectionPointIn>
+                <relPosition x="0" y="13"/>
+                <connection refLocalId="4">
+                  <position x="479" y="153"/>
+                  <position x="365" y="153"/>
+                  <position x="365" y="168"/>
+                  <position x="252" y="168"/>
+                </connection>
+              </connectionPointIn>
+              <expression>LocalVar2</expression>
+            </outVariable>
+            <inVariable localId="4" executionOrderId="0" height="26" width="82" negated="false">
+              <position x="170" y="155"/>
+              <connectionPointOut>
+                <relPosition x="82" y="13"/>
+              </connectionPointOut>
+              <expression>LocalVar3</expression>
+            </inVariable>
+          </FBD>
+        </body>
+      </pou>
+    </pous>
+  </types>
+  <instances>
+    <configurations>
+      <configuration name="config">
+        <resource name="resource1">
+          <task name="main_task" priority="0" interval="T#1000ms">
+            <pouInstance name="instance0" typeName="program0"/>
+          </task>
+        </resource>
+      </configuration>
+    </configurations>
+  </instances>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/projects/mqtt_ssl/project_files/test-root-ca.crt	Thu Aug 22 12:16:45 2024 +0200
@@ -0,0 +1,23 @@
+-----BEGIN CERTIFICATE-----
+MIIDwDCCAqigAwIBAgIUP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