OpenTP1 Version 7 Tester and UAP Trace User's Guide

[Contents][Index][Back][Next]

3.4.2 Test data definition file

By creating a test data definition file, the user can easily create tester files using the tester file creation facility.

A test data definition file can have any name. The following tester files can be created from a test data definition file:

To create a test data definition file:

  1. Use a text editor to create a test data definition file.
  2. Check the contents of the file and close the file.
  3. Specify the created test data definition file in the utofilcre command and execute the command.
    A tester file is created.
Organization of this subsection
(1) Syntax
(2) Function
(3) Explanation
(4) Required settings for specifying user data as input data
(5) Formats for the input data corresponding to the keywords of tester files

(1) Syntax

 
# comment       ...........1.
start tester-file-identifier tester-file-type output-file-name       ...........2.
keyword = input-data       ...........5.
keyword = input-data
sep       ...........3.
keyword = input-data
  :  :
  :  :
keyword = input-data
end       ...........4.
 

Note that the italicized numbers above correspond to the numbers under (3) Explanation below.

(2) Function

Enables tester files to be created by tester file creation command from the test data defined in the definition file.

One line in the definition file can be up to 512 bytes in length, including the line feed code.

(3) Explanation

  1. Comment statement
    comment
    Write a one-line comment beginning with #.
  2. start statement
    Declares the start of the input data for one tester file. Write a start statement before the input data for each tester file.
    When a test data definition file contains input data for two or more tester files, write an end statement at the end of input data in each tester file.
    • tester-file-identifier ~<up to 14 alphanumerics>
      Specify an identifier for each set of the tester file data created in the test data definition file. The identifiers must be unique within a definition file. Use alphanumerics a-z, A-Z, and 0-9 for an identifier.
    • tester-file-kind
      Specify the tester file kind as one of the following:
      RRQ
      RPC request data file
      XRQ
      XATMI request data file
      RRT
      RPC response data file
      XRT
      XATMI response data file
      XRV
      XATMI receive data file
      NRV
      Asynchronous receive message file
      SRV
      Synchronous receive message file
      COM
      Operating command result data file
    • output-file-name ~<pathname>
      Specify the name of the tester file to be created from the input data.
      When creating input data for two or more tester file kinds in one definition file, specify different output file names for each file kind.
      If the same output file name is specified for input data items for different tester file kinds, the test data is added to the specified file when the file is created. No error occurs, but the tester file created from the data may not be usable for a test.
      When an existing file name is specified, the test data is added to the specified file when the file is created.
  3. sep statement
    Delimits input data items when a tester file is to contain multiple data items. sep statements can be specified when creating the following tester files:
    • XATMI receive data file
    • Synchronous receive message file
    • Operating command result data file
  4. end statement
    Declares the end of the input data for one tester file. Write an end statement after the input data for each tester file.
  5. Input data definition statement
    Defines the input data for each tester file.
    Input data can consist of fixed-information data which can be set in advance and user data (data keyword) which can be any information set by the user. Write all the fixed-information data before the user data for a tester file.
    Input data cannot be duplicated within the test data for a tester file. The exception is an operating command result data file, for which user data must be specified twice (character string data for standard output and for standard error output).
    For details about the input data formats for specifying fixed information data, see the tables in (5) Formats for the input data corresponding to the keywords of tester files, below.
    • keyword
      Specify keywords to identify the data specific to each tester file. Space characters and tab codes before or after a keyword are ignored.
    • input-data
      Specify the input data for each keyword. Space characters and tab codes before or after the input data are ignored.

(4) Required settings for specifying user data as input data

The formats of user input data are described below.

(a) Setting user data length

Set the data length of user data as fixed-information data in the following format:

data_len=bytes

If the user data exceeds the value set in data_len, the message is truncated at output. If the user data is less than the value set in data_len, no further data can be set.

Example:

[Figure]

(b) Initializing user data

Use the tester file creation command to initialize the user data in the specified data length.

(c) Setting character data

Set character data in the following format:

data='data'

Do not add a null character to the end of character data.

Example:

[Figure]

(d) Setting binary data

Set binary data in the following format:

data=data

Data can be written in decimal and hexadecimal notation, as follows:

Example:
data=5 [Figure] Data: 5 in decimal notation
data=0x05 [Figure] Data: 5 in hexadecimal notation

Binary data is set as the int datatype.

(e) Setting special characters

Line feed codes, tab codes, null characters, apostrophes ('), and the \ symbol are handled as special characters in character data. Specify these characters as follows:

Special character Coding format
Line feed code \n
Tab code \t
Null character \0
' \'
\ \\
(f) Loading user data from a file

To load user data from a file, set the data in the following format:

data=(file) file-pathname

Example:
data=(file)/tmp/datafile [Figure] Data in /tmp/datafile is set.
(g) Setting the starting position of user data

User data can be set from any position, using the following format:

data=[offset-from-start-of-user-data] data

Example:

[Figure]

(h) Setting multiple data types

When using two or more data types, set the user data in the following format:

data=data
    =data
      :
      :

Example:
data=0x00000001 [Figure] Data: First
='ABCDEF' [Figure] Data: Second
(i) Aligning boundaries

When different data types are specified, the tester file creation command automatically sets the second data at the boundary of the first data. However, boundary alignment is not performed when:

Example:

[Figure]

(5) Formats for the input data corresponding to the keywords of tester files

The following tables list the keywords and formats of the corresponding input data for each tester file.

For details about the type of information to be specified, see the description of each tester file in Section 3.3 User-created files.

Table 3-5 Keywords and input data formats for RPC request data files

Keyword Information Explanation
out_len Response area length Length of the response area for the dc_rpc_call function. Specify a decimal or hexadecimal. Set before data.
data_len Data length Length of the user data to be passed to the server UAP by the dc_rpc_call function. Specify a decimal or hexadecimal. Set before data.
data Data User data to be passed to the server UAP by the dc_rpc_call function.

Table 3-6 Keywords and input data formats for XATMI request data files

Keyword Information Explanation
call_kind Call type Type of service request function. Set one of the following character strings:
  • call
  • acall
  • connect
Set before data.
buff_type Buffer type Set one of the following character strings:
  • X_OCTET
  • X_COMMON
  • X_C_TYPE
Set before data.
sub_type Buffer subtype Specify a string of up to 16 characters.

Example:
sub_type=subtype01
Set before data.
flag Flags One or more flags to be passed to the service function. Set any of the following character strings and delimit with vertical lines (|):
  • 0
  • TPNOREPLY
  • TPNOTRAN
  • TPNOCHANGE
  • TPSENDONLY
  • TPRECVONLY
Set before data.
data_len Data length Length of the user data to be passed to the server UAP by the tpcall, tpacall, or tpconnect function. Specify a decimal or hexadecimal. Set before data.
data Data User data to be passed to the server UAP by the tpcall, tpacall, or tpconnect function.

Table 3-7 Keywords and input data formats for RPC response data files

Keyword Information Explanation
data_len Data length Length of the user data to be returned to the client UAP at completion of a service. Specify a decimal or hexadecimal. Set before data.
data Data User data to be returned to the client UAP at completion of a service.

Table 3-8 Keywords and input data formats for XATMI response data files

Keyword Information Explanation
buff_type Buffer type Set one of the following character strings:
  • X_OCTET
  • X_COMMON
  • X_C_TYPE
Set before data.
sub_type Buffer subtype Specify a string of up to 16 characters.

Example:
sub_type=subtype01
Set before data.
rval Service termination code Specify one of the following character strings:
  • TPSUCCESS
  • TPFAIL
Set before data.
rcode Return code Specify a decimal or hexadecimal. Set before data.
data_len Data length Length of the user data to be returned to the client UAP at completion of a service. Specify a decimal or hexadecimal.
Set before data.
data Data User data to be returned to the client UAP at completion of a service.

Table 3-9 Keywords and input data formats for XATMI receive data files

Keyword Information Explanation
buff_type Buffer type Set one of the following character strings:
  • X_OCTET
  • X_COMMON
  • X_C_TYPE
Set before data.
sub_type Buffer subtype Specify a string of up to 16 characters.

Example:
sub_type=subtype01
Set before data.
event Event flag Event flag to be passed to the tprecv function.
Specify one of the following character strings:
  • 0
  • TPEV_DISCONIMM
  • TPEV_SVCERR
  • TPEV_SVCFAIL
  • TPEV_SVCSUCC
  • TPEV_SENDONLY
Set before data.
data_len Data length Length of the user data to be passed to the tprecv function. Specify a decimal or hexadecimal. Set before data.
data Data User data to be passed to the tprecv function.
sep sep statement Write at the end of the data for one service when coding data for a number of services.
Do not set at the end of the final data.

Note
When coding data for a number of services, repeat the data specifications from buff_type onwards.

Table 3-10 Keywords and input data formats for asynchronous receive message files

Keyword Information Explanation
termname Input/output logical terminal name Name of the I/O logical terminal to be passed to the dc_mcf_receive function.
Specify a string of up to 8 characters. Set before data.
mapname Map name Map name to be passed to the dc_mcf_receive function. Specify a string of up to 8 characters. Set before data.
seg_kind Segment type Segment type to be passed to the dc_mcf_receive function.
Specify one of the following characters:
  • F
  • M
  • L
  • O
  • H
To set data for multiple segments, use any of the following sequences:
  • F...M...L
  • F...F...L
  • M...M...L
  • L
  • H
  • O
Set before data.
data_len Message length Length of the user data in the segment to be passed to the dc_mcf_receive function.
Specify a decimal or hexadecimal. Set before data.
data Message User data in the segment to be passed to the dc_mcf_receive function.

Note
When setting data for a number of segments, repeat the data specifications from seg_kind onwards.

Table 3-11 Keywords and input data formats for synchronous receive message files

Keyword Information Explanation
termname Input/output logical terminal name Name of the I/O logical terminal to be passed to the dc_mcf_recvsync and dc_mcf_sendrecv functions. Specify a string of up to 8 characters. Set before data.
mapname Map name Map name to be passed to the dc_mcf_recvsync and dc_mcf_sendrecv functions. Specify a string of up to 8 characters. Set before data.
seg_kind Segment type Segment type to be passed to the dc_mcf_recvsync and dc_mcf_sendrecv functions.Specify one of the following characters:
  • F
  • M
  • L
  • O
  • H
To set data for multiple segments, use any of the following sequences:
  • F...M...L
  • F...F...L
  • M...M...L
  • F...M...L...F...M...L
  • F...F...L...M...M...L
  • M...M...L...M...M...L
  • L
  • H
  • O
  • L...L...F...M...L...L
  • O...O...F...M...L...O
  • H...H...H
Set before data.
data_len Message length Length of the user data in the segment to be passed to the dc_mcf_recvsync or dc_mcf_sendrecv function. Specify a decimal or hexadecimal. Set before data.
data Message User data in the segment to be passed to the dc_mcf_recvsync or dc_mcf_sendrecv function.
sep sep statement Write at the end of the data for one message when coding data for a number of messages. Do not set at the end of the final data.

Notes
1. When setting data for a number of messages, repeat the data specifications from termname onwards.
2. When setting data for a number of segments, repeat the data specifications from seg_kind to data.

Table 3-12 Keywords and input data formats for operating command result data file

Keyword Information Explanation
status_code Operating command result code Specify a result code returned from the operating command in decimal or hexadecimal.
Set before data.
outsize Message length for standard output Length of the message output by operating command to standard output.
Specify a decimal or hexadecimal.
Set before data.
errsize Message length for standard error output Length of the message output by operating command to standard error output.
Specify a decimal or hexadecimal.
Set before data.
data Character string for standard output Message output by operating command to standard output. Set character data.
data Character string for standard error output Message output by operating command to standard error output. Set character data.
sep sep statement Write at the end of the data for one command when coding data for a number of commands.
Do not set at the end of the final data.

Note
When coding data for a number of commands, repeat the data keywords and items from status_code onwards.