OpenTP1 Version 7 Tester and UAP Trace User's Guide

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

11.3.1 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:

Organization of this subsection
(1) Syntax
(2) Function
(3) Description
(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-ID tester-file-kind output-destination-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 in the box above correspond to the numbers under (3) Description below.

(2) Function

Allows the tester file creation command to create a tester file after the definition of test data needed for the tester file.

One line in the definition file can contain up to 512 bytes including a carriage return code.

(3) Description

  1. Comment statement
    Write a comment statement.
    • comment
      Write a comment in a line.
  2. start statement
    Declare the beginning of input data for a tester file. This statement is required for declaring input data in each tester file.
    When input data is created for multiple tester files in a test data definition file, the end statement shows the end of input data of one tester file.
    • tester-file-ID ~<up to 14 alphanumerics>
      Specify an ID for identifying input data in each tester file described in the test data definition file. The ID must be unique in a test data definition file.
    • tester-file-kind
      Specify a tester file kind. Available tester file kinds are:
      RRQ
      RPC request data file
      XRQ
      XATMI request data file
      TRQ
      TxRPC request data file
      RRT
      RPC response data file
      XRT
      XATMI response data file
      TRT
      TxRPC response data file
      XRV
      XATMI receive data file
      NRV
      MCF receive message file
      COM
      Operation command result data file
    • output-destination-file-name ~<pathname>
      Specify the name of a tester file made of input data.
      When a test data definition file specifies input data of multiple tester file kinds, specify different output destination file names for the file kinds.
      If the same output destination file name is used for input data with different tester file kinds, test data is appended to the specified file. Though this is not an error, the created tester file may be unavailable for testing. If the existing file name is specified, test data is appended to that file.
  3. sep statement
    Specify a data separator when creating a tester file that contains multiple data entries.
    If a file contains multiple data entries for the offline tester, however, only the first data entry takes effect, ignoring the second or later data.
    The sep statement is specifiable for creating the following tester files.
    • XATMI receive data file
    • Operation command result data file
  4. end statement
    Declare the end of input data in a tester file. This statement is required for every input data in each tester file.
  5. Input data definition statement
    Define input data in each tester file.
    Input data includes fixed information data and user data. The fixed information data provides predetermined information to be specified. The user data (with the keyword data) can contain anything the user specifies. In a set of test data, specify all fixed data prior to user data.
    Input data cannot duplicate in a set of test data. In the operation command result data file, however, specify user data twice for setting standard output character string data and standard error output character string data.
    • keyword
      Specify a keyword for identifying data specific to each tester file. Space characters or tab codes are ignored if specified before or after the keyword.
    • input-data
      Specify input data for the keyword. Space characters or tab codes are ignored if specified before or after the keyword.
      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

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

The following describes an input data format for specifying user data.

(a) Setting the user data length

Specify the length of the entire user data as fixed information data in the following format.

data_len=bytes

If the data specified as user data is larger than the data length, the system truncates the data and issues a message. If the data is smaller than the data length, nothing is appended to it.

Example:

[Figure]

(b) Initializing user data

Using the tester file creation command, initialize the user data for the specified user 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: Decimal 5
data=0x05 [Figure] Data: Hexadecimal 5

Data is set with the int type.

(e) Setting hexadecimal code format data

Set hexadecimal code data in the following format:

data=(code)0xdata

In data, write n bytes of 2n-digit data using hexadecimal code. The user can write as many number of bytes as required within the maximum length of a line.

Write a value of 0x00-0xff for one byte of data.

The data is assumed as binary data written in hexadecimal notation if (code) is not specified.

Example:

[Figure]

(f) Setting special characters

The system processes a carriage return code, tab code, null character, single quotation mark ('), and backslash (\) to be special characters in character data. Enter these characters as follows.

Character Notation
Carriage return \n
Tab code \t
Null character \0
' \'
\ \\
(g) Setting data to be read from the file

Use the following format when using data as user data read from the file.

data=(file) file-pathname

Example:
data=(file)/tmp/datafile [Figure] Use data in /tmp/datafile.
(h) Setting the beginning of data

Specify the beginning of data as follows.

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

Example:

[Figure]

(i) Setting a format for multiple data types
data=data
    =data
      :
      :

Example:
data=0x00000001 [Figure] First data
='ABCDEF' [Figure] Second data
(j) Adjusting the boundary

When multiple data types are described, adjacent data types may differ from each other. This time the tester file creation command sets data by automatically adjusting the boundary for the preceding data. However, no boundary adjustment takes place when:

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

The following tables list the keywords and the formats of the corresponding input data for each tester file. For the type of information to be specified, see the description of each tester file in Section 11.2 User-Created files.

Table 11-3 RPC request data file keywords and input data formats

Keyword Specified information Description
out_len Response area length Before data, specify the response area length in decimal or hexadecimal placed in the dc_rpc_call function.
data_len Data length Before data, specify the user data length in decimal or hexadecimal passed to the server UAP with the dc_rpc_call function.
data Data Specify the user data passed to the server UAP with the dc_rpc_call function.

Table 11-4 XATMI request data file keywords and corresponding input data formats

Keyword Specified information Description
call_kind Call kind Before data, specify one of the following character strings as a function type for service request.
  • call
  • acall
  • connect
buff_type Type Before data, specify one of the following character strings as a buffer type.
  • X_OCTET
  • X_COMMON
  • X_C_TYPE
sub_type Subtype Before data, specify a subtype within 16 characters.

Example:
sub_type=subtype01
flag Flag Before data, specify the following character string as a flag to be passed to the service function. Separate multiple flags with a vertical line (|).
  • 0
  • TPNOREPLY
  • TPNOTRAN
  • TONOCHANGE
  • TPSENDONLY
  • TPRECVONLY
data_len Data length Before data, specify the user data length in decimal or hexadecimal to be passed to the server UAP with the tpcall, tpacall, or tpconnect function.
data Data Specify user data to be passed to the server UAP with the tpcall, tpacall, or tpconnect function.

Table 11-5 TxRPC request data file keywords and corresponding input data format

Keyword Specified information Description
version Version number Before data, specify the version number in decimal or hexadecimal specified in the interface definition of the txidl command. This information is optional. If omitted, zero is assumed. The range of specification is 0-65535.

Example:
version = : The version is 0.0.
version = 2: The version is 2.0.
version = 3.2: The version is 3.2.
data_len Data length Before data, specify the user data length in decimal or hexadecimal to be passed to the server UAP.
data Data Specify user data to be passed to the server UAP.

Table 11-6 RPC response data file keywords and corresponding input data formats

Keyword Specified information Description
data_len Data length Before data, specify the user data length in decimal or hexadecimal to be passed to the client UAP on service termination.
data Data Specify user data returned to the client UAP on service termination.

Table 11-7 XATMI response data file keywords and corresponding input data formats

Keyword Specified information Description
buff_type Type Before data, specify one of the following character strings as a buffer type.
  • X_OCTET
  • X_COMMON
  • X_C_TYPE
sub_type Subtype Before data, specify a subtype within 16 characters.

Example:
sub_type=subtype01
rval Service termination code Before data, specify one of the following character strings as a service termination code.
  • TPSUCCESS
  • TPFAIL
rcode Return code Before data, specify the return code in decimal or hexadecimal.
data_len Data length Before data, specify the user data length in decimal or hexadecimal passed to the client UAP on service termination.
data Data Specify user data returned to the client UAP on service termination.

Table 11-8 TxRPC response data file keywords and corresponding input data format

Keyword Specified information Description
data_len Data length Before data, specify the user data length in decimal or hexadecimal to be passed to the client UAP.
svc_rtn Return value Before data, specify the return value in decimal or hexadecimal to be passed to the client UAP.
data Data Specify user data to be passed to the client UAP.

Table 11-9 XATMI receive data file keywords and input data formats

Keyword Specified information Description
buff_type Type Before data, specify one of the following character strings as a buffer type.
  • X_OCTET
  • X_COMMON
  • X_C_TYPE
sub_type Subtype Before data, specify a subtype within 16 characters.

Example:
sub_type=subtype01
event Event flag Before data, specify one of the following character strings as an event flag passed to the tprecv function.
  • 0
  • TPEV_DISCONIMM
  • TPEV_SVCERR
  • TPEV_SVCFAIL
  • TPEV_SVCSUCC
  • TPEV_SENDONLY
data_len Data length Before data, specify the user data length in decimal or hexadecimal passed to the tprecv function.
data Data Specify user data passed to the tprecv function.
sep sep statement When specifying data for multiple services, place a sep statement at the end of data for one service. Do not place this statement after the last data.

Note
When specifying data for multiple services, repeat buff_type and succeeding data.

Table 11-10 MCF receive message file keywords and corresponding input data formats

Keyword Specified information Description
termname I/O logical terminal name Before data, specify an I/O logical terminal name within 8 characters passed to the dc_mcf_receive function.
mapname Map name Before data, specify a map name within 8 characters passed to the dc_mcf_receive function.
seg_kind Segment type Before data, specify one of the following characters as a segment type passed to the dc_mcf_receive function.
  • F
  • M
  • L
  • O
  • H
Specify these characters in any of the following orders when there is data for multiple segments.
  • F...M...L
  • F...F...L
  • M...M...L
  • L
  • H
  • O
data_len Message length Before data, specify the user data length of the segment in decimal or hexadecimal passed to the dc_mcf_receive function.
data Message Specify user data of the segment passed to the dc_mcf_receive function.

Note
When specifying data for multiple segments, repeat seg_kind and succeeding data.

Table 11-11 Operation command result data file keywords and corresponding input data formats

Keyword Specified information Description
status_code Operation command result code Before data, specify a result code in decimal returned by the operation command.
outsize Standard output character string length Before data, specify the message length in decimal or hexadecimal the operation command outputs to standard output.
errsize Standard error output character string length Before data, specify the message length in decimal or hexadecimal the operation command outputs to standard output error.
data Standard output character string Specify a message with character data the operation command outputs to standard output.
data Standard error output character string Specify a message with character data the operation command outputs to standard output error.
sep sep statement When specifying data for multiple commands, place a sep statement at the end of data for one command. Do not place this statement after the last data.