The module <SystemTests> of the subsystem "Specials"
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
Introduction
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:
id - test ID;
on - sign "Test is enabled";
per - repetition period of the test (seconds).
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:
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
2. XML parsing (XML)
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
3. Messages (Mess)
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
4. SO attaching (SOAttach)
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
5. Attribute of the parameter (Val)
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
6. DB test (DB)
Description: Complete database test. Includes:
creating/opening of the DB;
creating/opening of the table;
creation of set of records (rows) of the predetermined structure;
modification of the set of records;
receiving and verifying the values of the set of records;
modifying the structure of records and table;
delete of the records;
closing/deleting of the table;
closing/deleting of the database.
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
7. Transport (TrOut)
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
8. Control system language (SysContrLang)
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
9. Values buffer (ValBuf)
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
10. Values archive (Archive)
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
11. Base64 code (Base64Code)
Description: Tests of the Mime Base64 encoding algorithm. Parameters: