API - JSON ExecuteTest

Overview

The ExecuteTest method supports the primary function of the N2SVCD Tester Application. Strictly speaking, this method should perhaps be called “ExecuteTestRun”.

A “Test Run” is a single “Test Definition” being executed once (for a single test) or multiple times (for a load test). When a Test Definition is performed more than once within a Test Run, only the results of the first Test Instance in the Test Run is reported in detail.

Note: The term “Test Instance” is used to refer to a complete execution of the operations described in the Test Definition. In theory a Test Run might use the “inap.ssp_to_scp.InitialDP” operation more than once within its Test Definition. This would mean that a single Test Instance would actually initiate multiple “Telephony Calls” across multiple TCAP dialogs.

Request Parameters

Control and Tracing

The ExecuteTest basic run control and tracing parameters are:

Parameter Type Description
run_id String [Required] A unique identifier for this Test Run.
operations Array [Required] List of Test Operations to perform.
Test Operations are detailed separately, in the "Test Internals" section of the "IN Tester User Guide".
vars Object Pre-declare and initialise variables at the start of the call.
Variables are detailed separately, in the "Test Internals" section of the "IN Tester User Guide".
locks Array of Objects List of Locks which the Test Run must obtain before it can run.
See subsequent details.
trace_level Integer 0 (no), 1 (debug), 2 (dump) or 3 (spam).
Should this Test Run document internal "debug" tracing for the first Test Instance?
(Default = 0, No Internal Tracing)

Gateway Selection

The parameters related to the selection of outbound protocol gateways are:

Attribute Type Description
sigtran String Name of the OCNCC SIGTRAN Application Instance to use for TCAP delivery (if relevant to this Test Definition).
pi String Name of the OCNCC PI Application Instance to use for PI requests (if relevant to this Test Definition).
osd String Name of the OCNCC OSD Application Instance to use for OSD requests (if relevant to this Test Definition).
diameter String Name of the Diameter Application Instance to use for Diameter requests (if relevant to this Test Definition).
db String Name of the default DB Application Instance to use for DB requests (if relevant to this Test Definition).
db_<label> String Name of the default labeled DB Application Instance to use for labeled DB requests (if relevant to this Test Definition).
For example, db_smf defined the DB application to use for any DB request matching db.smf.<method>
rest String Name of the default REST Application Instance to use for REST requests (if relevant to this Test Definition).
rest_<label> String Name of the default labeled REST Application Instance to use for labeled REST requests (if relevant to this Test Definition).
For example, rest_pcrf defines the REST application to use for any REST request matching rest.pcrf.<method>

Load Testing

The parameters related to load testing are:

Attribute Type Description
distribution Object Structure describing the Test Instance load distribution to execute.
.type String single (one instance), load (bounded by backlog) or linear (bounded by rate and backlog).
.total Integer Total number of Test Instances to execute.
Not used for type = single.
.backlog Integer Maximum backlog of Test Instances in progress.
Not used for type = single.
.cps Object Target rate of Test Instances started per second.
Used only for type = linear.

SSF and SRF Functions

The parameters related to INAP SSF and SRF functions are:

Attribute Type Description
ssp_ac String Identifies the Application Context (if any) to include in an outbound InitialDP.
Must be a well-known TCAP alias or a free-form hex string, e.g 04000101010003.
(Default = none, No Application Context)
hlr_ac String Identifies the Application Context (if any) to include in any outbound MAP-OPEN.
For supported values, see description of the ssp_ac parameter.
(Default = [none], No Application Context)
scp Object Structure describing test target SCP address (if relevant to this Test Definition).
.dri Integer The SCCP "Destination Routing Indicator" for TCAP BEGIN messages to the SCP.
(Default = 1 if dpc and dssn are specified, otherwise 0)
.dssn Integer The SCCP "Destination Sub-System Number" for TCAP BEGIN messages to the SCP.
(Range = 1-255).
.dpc Integer The SCCP "Destination Point Code" for TCAP BEGIN messages to the SCP.
(Range = 24-bits or 14-bits).
.dgt_digits String The SCCP "Destination Global Title Digits" for TCAP BEGIN messages to the SCP.
.dgt_noa Integer The SCCP "Destination Global Title Nature of Address" for TCAP BEGIN messages to the SCP.
(Range = 0-127).
.dgt_np Integer The SCCP "Destination Global Title Numbering Plan" for TCAP BEGIN messages to the SCP.
(Range = 0-7).
.dgt_tt Integer The SCCP "Destination Global Title Translation Type" for TCAP BEGIN messages to the SCP.
(Range = 0-255).
.tcap_timeout Integer Override the default timeout in seconds which we allow for an SCP TCAP inbound operation to arrive before we abort the test instance.

Test Run Locks

The locks parameter in an ExecuteTest request must be an Array of Objects where each Object represents an exclusive lock which must be obtained before the test can run.

Attribute Type Description
key String [Required] A unique string which provides the key for this lock.
This may be an expression which is evaluated with the Test Run initial vars as $v.

Note: The ExecuteTest method at this time will not wait to acquire locks. The ExecuteTest method will fail immediately if it is not able to immediately acquire all of the needed lock keys.

Note: A Test Run lock is released as soon as the Test Run is completed (i.e. as soon as ever Test Instance in the Test Run has completed either by aborting or by completing the last operation in the operations list).

Note: The Test Run locks are tracked only within a single Tester Application instance. If you have configured two TesterApp instances within your n2svcd configuration, then each Application instance will maintain their own private lock list.

Example Request

Here is an example ExecuteTest request which represents a simple INAP call scenarios:

{
    "jsonrpc" : "2.0",
    "id" : 1,
    "method" : "ExecuteTest",
    "params" : {
        "run_id" : "tr_9538",
        "trace_level" : "1",
        "distribution" : {
            "type" : "single"
        },
        "vars": {
            "sn": "998707"
        },
        "locks": [
            {
                "key": "{ '0800' . $v->{sn} }"
            }
        ],
        "operations" : [
            {
                "type" : "inap.ssp_to_scp.InitialDP",
                "arguments" : {
                    "serviceKey" : 45,
                    "eventTypeBCSM" : 3,
                    "callingPartyNumber_digits" : "414511860",
                    "callingPartyNumber_noa" : 3,
                    "calledPartyNumber_noa" : 2,
                    "calledPartyNumber_digits" : "{ '0800' . $v->{sn} }",
                    "callingPartysCategory_hex" : "f7"
                }
            },
            {
                "type": "inap.ssp_from_scp.ReleaseCall",
                "arguments" : {
                    "initialCallSegment_cause": "31"
                }
            },
        ],
        "pi" : "PI-MML",
        "sigtran" : "SIGTRAN-Model",
        "ssp_ac" : "camel3",
        "scp" : {
            "dssn" : 106,
            "dpc" : 4114
        }
    }
}

Successful Response

The ExecuteTest result is always a string ok in the success case.

Example Successful Response

Here is a possible successful ExecuteTest response.

{
    "jsonrpc" : "2.0",
    "id" : "1",
    "result" : "ok"
}