From OpenSCADAWiki
Jump to: navigation, search

Other languages:
Module Name Version License Source Languages Platforms Type Author Description
SystemTests OpenSCADA and its modules' tests 1.8 GPL2 spec_SystemTests.so en,uk,ru,de x86,x86_64,ARM Special Roman Savochenko
Maxim Lysenko (2010) — the page initial translation
Provides the group of tests to OpenSCADA and its modules.

The module contains a set of tests designed to test various subsystems and components of OpenSCADA. The tests are performed as functions of the user API, so they can run as a single time, in the "Execute" tab of the page object function, and from the user procedures, passing the necessary arguments to them.

To address the functions of the library you can use the static call address Special.FLibComplex1.{Func}() or dynamic SYS.Special.FLibComplex1["{Func}"].call(), SYS.Special.FLibComplex1.{Func}(). Where Func — identifier of the function in the library.

In addition to the usual mechanisms of user API execution, an autonomous mechanism is provided. This mechanism is represented by a separate task, performed with the period of one second, and which calls the functions of tests accordingly to the settings in the configuration file.

Configuration fields of the tests are placed in the module "SystemTests" section of the subsystem "Special". Format of the configuration fields is <prm id="Test Id" on="1" per="10" />
Where:

  • id — test identifier;
  • 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 attributes name of the tag "prm" is performed. For example, the attribute "name" of the function "Param" you can specify in the tag "prm".

It is possible to define many "prm" tags for one or several tests with the same or different parameters, thus specifying for a separate run of the test with the specified parameters. Here is an example of a 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>

1 Parameter (Param)

Description: Test of the DAQ parameters. Reads the attributes and configuration fields of the parameter.
Parameters:

Identifier 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 for XML file parsing. Disassembles and displays the structure of the specified file.
Parameters:

Identifier Name Type Mode By defaults
rez Result String Return
file XML file String Input

3 Messages (Mess)

Description: Test the archive of messages. Periodically reads new messages from the archive for the specified archiver.
Parameters:

Identifier Name Type Mode By defaults
rez Result String Return
arhtor Archiver String Input FSArch.StatErrors
categ Template of the messages category String Input
depth Messages depth, seconds Integer Input 10

4 Attaching SO (SOAttach)

Description: Test the module to attach/detach.
Parameters:

Identifier Name Type Mode By defaults
rez Result String Return
name Path to the module String Input
mode Mode (1-attach;-1-detach;0-change) Integer Input 0
full Complete attach (when start) Bool Input 1

5 Parameter attribute (Val)

Description: Test for values of the parameter attribute. Performs the periodic acquisition of the last value of the specified attribute, as well as the archive questioning to the required depth.
Parameters:

Identifier Name Type Mode By defaults
rez Result String Return
name Path to the parameter attribute String Input System.AutoDA.CPULoad.load
arch_len Depth of getting of archive values, seconds Integer Input 10
arch_per Period of getting of archive values, microseconds Integer Input 1000000

6 DB test (DB)

Description: Complete database test. Performs:

  • create/open DB;
  • create/open table;
  • create multiple records for the determined structure;
  • update multiple records;
  • update multiple records by a request key;
  • get and check values for multiple records;
  • seek records;
  • seek records in preload;
  • modify a record and the table structure;
  • remove multiple records;
  • close/remove table;
  • close/remove DB.

Parameters:

Identifier 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 Records number Integer Input 1000

7 Transport (TrOut)

Description: Test of the output and/or input transports. Performs testing of the original transport sending a request to the specified input transport.
Parameters:

Identifier Name Type Mode By defaults
rez Result String Return
addr Address String Input TCP:127.0.0.1:10001
type Transport module String Input Sockets
req Text of the request String Input

8 Control language of the program (SysContrLang)

Description: Test of the control language of the program. Performs query of language elements through a complete path. The full path to the language element looks like "/Archive/%2fbd%2fm_per". The complete path consists of two nested paths. The first "/Archive/" is the path to the node of the control tree. The second "/bd/m_per" is the path to the specific node element.
Parameters:

Identifier Name Type Mode By defaults
rez Result String Return
path Path to the language element String Input /Archive/BaseArh/mess_StatErrors/%2fprm%2fst

9 Value buffer (ValBuf)

Description: Tests of the value buffer. Contains 13 tests of all aspects of the value buffer (the subsystem "Archives-History").
Parameters:

Identifier Name Type Mode By defaults
rez Result String Return

10 Value archive (Archive)

Description: Test of location in the value archives. Contains 7(8) tests of the value archiver to verify the correct functioning of the sequential packing mechanism.
Parameters:

Identifier Name Type Mode By defaults
rez Result String Return
arch Value archive String Input
period Period of the values, microseconds Integer Input 1000000
archtor Archiver String Input

11 Base64 encoding (Base64Code)

Description: Mime Base64 algorithm encoding tests.
Parameters:

Identifier Name Type Mode By defaults
rez Result String Return