Module: | SystemTests |
Name: | OpenSCADA system's tests |
Type: | Specials |
Source: | spec_SystemTests.so |
Version: | 1.5 |
Author: | Roman Savochenko |
Translated: | Maxim Lysenko |
Description: | Provides the group of tests to the OpenSCADA system. |
License: | GPL |
Special module SystemTests contains a set of tests designed to test various subsystems and components of the OpenSCADA system. Tests carried out in the form of user API functions. Hence the tests can be run as a one-time, in the "Execute" page of the function's object and from the procedures of the user as well, passing them the necessary arguments.
To address the functions of the library you can use static call address "Special.FLibComplex1.{Func}()" or dynamic "SYS.Special.FLibComplex1["{Func}"].call()", "SYS.Special.FLibComplex1.{Func}()". Where {Func} — function identifier in the library.
In addition to the usual mechanisms of user API execution an autonomous mechanism is provided. This mechanism is represented by the separate task, performed with the period of one second, which calls the functions of tests in accordance with the settings in the configuration file.
The configuration fields of the tests are placed in the section of the modulus SystemTests of subsystem "Special". The format of the configuration fields is: <prm id="Test Id" on="1" per="10" />
Where:
In addition to the basic attributes the reflection of the input parameters of tests' functions on the same name attributes of tag "prm" is made. For example, the attribute "name" of function "Param", you can specify in the tag "prm".
It is allowed to indicate the set of tags "prm" for the same or different tests with the same or different parameters, thus indicating the separate test execution with the specified parameters. Here is an example of description of all available tests:
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSCADA>
<station id="DemoStation">
<node id="sub_Special">
<node id="mod_SystemTests">
<prm id="Param" on="0" per="5" name="LogicLev.experiment.F3"/>
<prm id="XML" on="0" per="10" file="/etc/oscada.xml"/>
<prm id="Mess" on="0" per="10" categ="" arhtor="DBArch.test3" depth="10"/>
<prm id="SOAttach" on="0" per="20" name="../../lib/openscada/daq_LogicLev.so" mode="0" full="1"/>
<prm id="Val" on="0" per="1" name="LogicLev.experiment.F3.var" arch_len="5" arch_per="1000000"/>
<prm id="Val" on="0" per="1" name="System.AutoDA.CPULoad.load" arch_len="10" arch_per="1000000"/>
<prm id="DB" on="0" per="10" type="MySQL" addr="server.diya.org;roman;123456;oscadaTest" table="test" size="1000"/>
<prm id="DB" on="0" per="10" type="DBF" addr="./DATA/DBF" table="test.dbf" size="1000"/>
<prm id="DB" on="0" per="10" type="SQLite" addr="./DATA/test.db" table="test" size="1000"/>
<prm id="DB" on="0" per="10" type="FireBird" addr="server.diya.org:/var/tmp/test.fdb;roman;123456" table="test" size="1000"/>
<prm id="TrOut" on="0" per="1" addr="TCP:127.0.0.1:10001" type="Sockets" req="time"/>
<prm id="TrOut" on="0" per="1" addr="UDP:127.0.0.1:10001" type="Sockets" req="time"/>
<prm id="TrOut" on="0" per="1" addr="UNIX:./oscada" type="Sockets" req="time"/>
<prm id="TrOut" on="0" per="1" addr="UDP:127.0.0.1:daytime" type="Sockets" req="time"/>
<prm id="SysContrLang" on="0" per="10" path="/Archive/FSArch/mess_StatErrors/%2fprm%2fst"/>
<prm id="ValBuf" on="0" per="5"/>
<prm id="Archive" on="0" per="30" arch="test1" period="1000000"/>
<prm id="Base64Code" on="0" per="10"/>
</node>
</node>
</station>
</OpenSCADA>
Description: Test of the DAQ parameters. Reads the attributes and configuration fields of the parameter.
Parameters:
ID | Name | Type | Mode | By defaults |
rez | Result | String | Return | |
name | Address of the DAQ parameter | String | Input | System.AutoDA.CPULoad |
Description: Test of the XML file parsing. Parses and displays the structure of the file.
Parameters:
ID | Name | Type | Mode | By defaults |
rez | Result | String | Return | |
file | XML file | String | Input |
Description: Test of the messages archive. Periodically reads new messages from the archive for the specified archiver.
Parameters:
ID | Name | Type | Mode | By defaults |
rez | Result | String | Return | |
arhtor | Archiver | String | Input | FSArch.StatErrors |
categ | The template of the messages category | String | Input | |
depth | Message's depth (s) | Integer | Input | 10 |
Description: Test connection/disconnection of the modules.
Parameters:
ID | Name | Type | Mode | By defaults |
rez | Result | String | Return | |
name | Path to the module | String | Input | |
mode | Mode (1-connect;-1-disconnect;0-change) | Integer | Input | 0 |
full | Full connection(when start) | Bool | Input | 1 |
Description: Test the attribute values of the parameter. Performs periodic polling of the last value of the specified attribute, as well as a survey archive to the specified depth.
Parameters:
ID | Name | Type | Mode | By defaults |
rez | Result | String | Return | |
name | Path to the attribute of the parameter | String | Input | System.AutoDA.CPULoad.load |
arch_len | The depth of the query to the values' archive (s) | Integer | Input | 10 |
arch_per | Period of query to the values' archive (mcs) | Integer | Input | 1000000 |
Description: Complete database test. Includes:
Parameters:
ID | Name | Type | Mode | By defaults |
rez | Result | String | Return | |
type | DB type | String | Input | SQLite |
addr | DB address | String | Input | ./DATA/test.db |
table | DB table | String | Input | test |
size | Number of records | Integer | Input | 1000 |
Description: Test of the output and/or input transports. Performs testing of the output transport by sending the request to the specified input transport.
Parameters:
ID | Name | Type | Mode | By defaults |
rez | Result | String | Return | |
addr | Address | String | Input | TCP:127.0.0.1:10001 |
type | Transport's module | String | Input | Sockets |
req | Query text | String | Input |
Description: Test of the control system language. Performs the query of the language elements through the full path. Full path to the element of language is of the form of system control </Archive/%2fbd%2fm_per>. Full path consists of two sub-paths. The first one </d_Archive/> is the path to the node of the control tree. The second one </bd/m_per> is the path to a particular element of the node.
Parameters:
ID | Name | Type | Mode | By defaults |
rez | Result | String | Return | |
path | Path to the element of language | String | Input | /Archive/BaseArh/mess_StatErrors/%2fprm%2fst |
Description: Tests of the values' buffer. Contains 13 tests of the all aspects of the values' buffer (subsystem "Archives").
Parameters:
ID | Name | Type | Mode | By defaults |
rez | Result | String | Return |
Description: Tests of the placing of values in the archive. Contains 7 (8) tests of the values archiver to verify the correctness of the functioning of a coherent mechanism for packaging.
Parameters:
ID | Name | Type | Mode | By defaults |
rez | Result | String | Return | |
arch | Values archive | String | Input | |
period | Values period (mcs) | Integer | Input | 1000000 |
archtor | Archivator | String | Input |
Description: Tests of the Mime Base64 encoding algorithm.
Parameters:
ID | Name | Type | Mode | By defaults |
rez | Result | String | Return |