Monitoring script files: Edits and updates

When you monitor an application in HCL DevOps Test Embedded (Test Embedded), multiple files are created. You can find important information about each file, its use, its format and the parameters that you can use to update the editable files.

Files description
When you monitor an application in Test Embedded, the following files are created and saved in the project build folder:
  • <filename>.mnt: This file is used to describe all the global variables that can be monitored. It is automatically generated during the code instrumentation. You must open the file as a text file to modify.
  • envTestRTcc.pl: This file is used to transmit all the Eclipse settings to the compilation tools. It is automatically generated when the project settings are modified. You must open the file as a text file to modify.
  • <filename>.xtp: This file contains the list of resources that are used when reports are created. It is automatically generated during the generation of reports. Do not modify this file.
  • <filename>.test_mnt: This file contains the recording of all events in a script. It can be displayed as a graph or as a set of data in Test Embedded for Eclipse IDE. You can edit the file in the Data tab of the .mnt editor or in a text file editor.
  • <filename>.replay.[numeric date].rtx: This file is created when a monitoring script runs. It contains data from the script that is used as expected values and output data that is received from application. All variables are duplicated. That is for each script variable, another “ref” (reference, expected value) is created. It is mainly used for display purposes. Do not modify this file, it is overwritten when a new monitoring script runs.

  • <filename>.test_mntcfg: This file contains the graphical configuration that is used to display <filename>.test_mnt as a graph. It is automatically generated during the script recording process. Do not modify this file. It contains the list of displayed curves.

    Note: If you rename this file, do not forget to also rename the test_mntcfg file.
Files formats
Rtx file format: The file format is “csv”. Spaces (or tabs) are used as data separator.
The first line of code in the file contains a list of all tested variable names, the first variable is TIME. All other variables are formatted as <compilation unit name>:<variable name> and they are case sensitive.
Important: Do not modify this first line.
Example:
TIME  ENGINE.C:gear     ENGINE.C:internalState ENGINE.C:rpm     
      ENGINE.C:speed     ENGINE.C:speedAdapter ENGINE.C:userAction

All the other lines in the file have the same format. If a line begins with a hash key “#”, it is a meta command. Otherwise, the line contains the data.

Data or meta-command parameters are separated by spaces, tabs, or either.
Data:

Data is just a set of values, one value for each variable. Thus, the first value is always TIME, and fourth value is the value for fourth variable defined in first script line.

The types of values that the lines of codes can include are as follows:
  • Integer value.

    Example: 0 1245 -248

  • Float value: 0.0 -25.4 0.123456e+07
  • No value: NaN
Example: 42351.0 NaN NaN 1980.0001 0.0 NaN 3.0
Note: Time is defined in milliseconds, and is initiated when the script run starts.
Metacommand

The metacommand lines begin with a hash key ‘#’ and are followed by a keyword. If ‘#’ is followed by a space or an unknown keyword, it is considered as a being a ‘comment’ and is ignored. Metacommand keywords are case insensitive, they are generated in upper-cases.

The following table contains the list of available metacommands:

Metacommand name Description Example Note
Comment

It is used to make the script easy to read. It is ignored during test execution.

# hello world
#unknown command

It is recommended to add a space after ‘#’

Frequency

Frequency has only one float parameter.

The application streams the variable values according to the defined frequency after this point in the script. Variables can be used several times in the script.

#FREQUENCY	2.0
# from this point, frequency used is 2.0
3.0	NaN	NaN	0.0	0.0	NaN	0.0
462.0	NaN	NaN	0.0	0.0	NaN	0.0
470.0	NaN	NaN	0.0	0.0	NaN	0.0
479.0	NaN	NaN	0.0	0.0	NaN	0.0
493.0	NaN	NaN	0.0	0.0	NaN	0.0
#FREQUENCY	10.0
# from this point, frequency used is 10.0
508.0	NaN	NaN	0.0	0.0	NaN	0.0
Select

The number of parameters matches the number of variables.

The Select parameter is ‘0’ or ‘1’.

‘0’ means that the variable is not updated for each cycle.

‘1’ means that variable is updated for each cycle.

The ‘TIME’ variable must be updated, so the first parameter must be ‘1’.

#SELECT     1    0     0     1     1     0    1

The preceding row means that the following values must be updated:

. TIME ENGINE.C:rpm ENGINE.C:speed ENGINE.C:userAction

But the following ones should not be updated:

. ENGINE.C:gear ENGINE.C:internalState ENGINE.C:speedAdapter

You are free to change your selection at any time in your script.

#SELECT	1	0	0	1	1	0	1
# from this point, 'TIME' 'ENGINE.C:rpm' 'ENGINE.C:speed' and 'ENGINE.C:userAction' will be requested to application
3.0	NaN	NaN	0.0	0.0	NaN	0.0
462.0	NaN	NaN	0.0	0.0	NaN	0.0
470.0	NaN	NaN	0.0	0.0	NaN	0.0
#SELECT	1	0	1	1	0	0	1
Read

Directs the application to read of one or several values

The first parameter is always the time variable, so it must be set.

The other parameters are related to all other variables:
  • NaN means that there is no read request for this value.

  • A float or an integer value means that a read request is set for the variable, and the expected value is passed to read metacommand

#READ8105 NaN NaN 0 0.010000E+00 NaN NaN NaN

The preceding line means that at time “8105”, the ENGINE.C:rpm and ENGINE.C:speed must be read at time “8105”, and the expected value for ENGINE.C:rpm is 0 and the expected value for ENGINE.C:speed variables is 0.010000E+00
write

A request is sent to the application to write one or several values.

The first parameter is always the time variable and must be set.

The other parameters are related to all the other variables.

  • NaN means that there is no write request for this value.
  • A float or an integer value means that a write request is set for this variable value.
#WRITE	8105	NaN	NaN	0	0.010000E+00	NaN	NaN	NaN

This example means that a request to write '0' in the ENGINE.C:rpm variable at time “8105” write 0.010000E+00 in the ENGINE.C:speed variable.

An implicit “read” request is issued immediately after the “write” request to verify whether the write request was successful.
Delta

Requests that each value is compared with the expected values and must be checked.

The check result can be true or false depending on whether the testing criteria are met and the “expected” values are not “NaN”.

The testing criteria can be set with the delta metacommand.

The first parameter is either ABSOLUT or PERCENT.

Other parameters are float values or “NaN”, for each variable, except for the “Time” value.

#DELTA ABSOLUTE	NaN	NaN	10.0	5.0	NaN	NaN	1.0

This example means that test fails if the absolute values that come out from the difference between the expected value and the obtained value is lower than the variable value.

In the following example, all these conditions must be met, if only one condition is not met, the test fails:

| obtained(ENGINE.C:rpm) – expected(ENGINE.C:rpm) | < 10.0
| obtained(ENGINE.C:speed) – expected(ENGINE.C:speed) | < 5.0
| obtained(ENGINE.C: UserAction) – expected(ENGINE.C:UserAction) | < 11.0
#DELTA PERCENT	NaN	NaN	10.0	5.0	NaN	NaN	1.0

The example means that the test fails if value that comes from the difference between the expected and the obtained value is lower than the percent value of the variable.

 | obtained(ENGINE.C:rpm) – expected(ENGINE.C:rpm) | / max(|obtained(ENGINE.C:rpm)|,| expected(ENGINE.C:rpm)|) < 10.0
	. | obtained(ENGINE.C: speed) – expected(ENGINE.C: speed) | / max(|obtained(ENGINE.C: speed)|,| expected(ENGINE.C: speed)|) < 5.0
	. | obtained(ENGINE.C: UserAction) – expected(ENGINE.C: UserAction) | / max(|obtained(ENGINE.C: UserAction)|,| expected(ENGINE.C: UserAction)|) < 1.0

You can change delta value at any time, and mix, both versions.

The last delta value that is defined for a given variable is used.

See the following example where with the a, b, c, dand e variables, you want to test a and c variables with '10' and '5' as absolute value, and b and d variables with '20' and '30' in percent, and you don't want to test the e variable:

# variables 	 a     b    c     d    e
#DELTA ABSOLUTE	10.0 	NaN 	5.0 	NaN 	NaN
#DELTA PERCENT	NaN	20.0	NaN	30.0	NaN