Allow to automatically reserve an FSM test id
[anna.git] / example / diameter / launcher / resources / HELP.md
index fec3b72..8429ef4 100644 (file)
@@ -278,7 +278,7 @@ Burst mode only allows single interface interaction. For multiple interface (ori
 
 Adds a new step to the test case with provided identifier. If provided identifier is not registered yet, a new test case will be created with that value and the step will be added as the first. For a specific 'id', the steps are stored in order as they are programmed. Check possible runtime exceptions when adding a new step because those which fail, will be ignored/skipped during test case programming giving an incomplete sequence invalid for the testing purpose.
 
-<id>: integer number, normally monotonically increased for each test case. Some external script/procedure shall clone a test case template in order to build a collection of independent and coherent test cases (normally same type) with different context values (Session-Id, Subscriber-Id, etc.).
+<id>: integer number, normally monotonically increased for each test case. Some external script/procedure shall clone a test case template in order to build a collection of independent and coherent test cases (normally same type) with different context values (Session-Id, Subscriber-Id, etc.). If 0 provided, `id` will be calculated as the current number of test cases plus 1 (normally valid when identification started on value of 1 and no holes were created).
 
 <command>: commands to be executed for the test id provided. Each command programmed constitutes a test case 'step', numbered from 1 to N, with an exception for 'description' which is used to describe the test case:
 
@@ -539,7 +539,7 @@ Implemented status codes: *200* (ok), *400* (bad request) and *405* (method not
 
 > curl -v --request GET localhost:8000<uri>
 
-You could also expose the service as HTTP2 server through *nginx* working as reverse proxy (*adml-http* image is built in this way although internally provides HTTP operations script only for 1.1). Then you could use HTTP2 clients like *nghttp*:
+You could also expose the service as HTTP2 server through *nginx* working as reverse proxy (*anna-adml-http* image is built in this way although internally provides HTTP operations script only for 1.1). Then you could use HTTP2 clients like *nghttp*:
 
 > nghttp -v -H ":method: GET" "<uri>"
 
@@ -579,7 +579,7 @@ Retrieve statistics xml report (will be *base64-encoded* at response).
 
 > curl -v --request POST -H "Content-Type: application/json" localhost:8000<uri> -d@test.json
 
-You could also expose the service as HTTP2 server through *nginx* working as reverse proxy (*adml-http* image is built in this way although internally provides HTTP operations script only for 1.1). Then you could use HTTP2 clients like *nghttp*:
+You could also expose the service as HTTP2 server through *nginx* working as reverse proxy (*anna-adml-http* image is built in this way although internally provides HTTP operations script only for 1.1). Then you could use HTTP2 clients like *nghttp*:
 
 > nghttp -v -H ":method: POST" -d test.json "<uri>"
 
@@ -840,7 +840,7 @@ Selects a context working node by mean a registered name (origin-host). If empty
 }
 ```
 
-**Response body**: 
+**Response body**:
 
 ```
 {
@@ -960,7 +960,7 @@ Updates diameter server sessions to be accepted.
 
 ```
 {
-    "sessions":<integer value>
+    "sessions":<sessions (integer)>
 }
 ```
 
@@ -1004,7 +1004,7 @@ Updates ADML working directory.
 {
     "action":"<hide|show|hidden|shown>"
     [, "addressPort":"<address:port>"]
-    [, "socket":<socket>]
+    [, "socket":<socket id (integer)>]
 }
 ```
 
@@ -1036,13 +1036,13 @@ Reset statistics and counters.
 
 #### POST /context
 
-Dump ADML context at file path provided. If empty, default path is selected. Context information is not retrieved in the response, so, file is related to ADML execution context.
+Dump ADML context at file path provided. If empty (or field missing), default path is selected. Context information is not retrieved in the response, so, file is related to ADML execution context.
 
 **Request body**:
 
 ```
 {
-    "targetFile":"[file path]"
+    ["targetFile":"[file path]"]
 }
 ```
 
@@ -1078,7 +1078,7 @@ Set the statistics concepts to be logged. To know the concept indentifiers regis
 
 ```
 {
-    "list":"<comma-separated list|all|none>"
+    ["list":"<comma-separated list|[all]|none>"]
 }
 ```
 
@@ -1153,7 +1153,7 @@ or
 
 ```
 {
-    "action":"<action: list|dump|clear|exhaust|rotate>"
+    "action":"[action: <[list]|dump|clear|exhaust|rotate>]"
 }
 ```
 
@@ -1184,7 +1184,7 @@ or
 
 ```
 {
-    "action":"<action: list|dump|clear|exhaust|rotate>"
+    "action":"[action: <[list]|dump|clear|exhaust|rotate>]"
 }
 ```
 
@@ -1242,22 +1242,706 @@ Sends diameter expressed in hexadecimal string (no spaces, no colons, i.e.: `010
 ### FSM testing
 
 ADML implements a bulting *Finite State Machine* to plan testing flows with a great flexibility.
+Every operation will receive a response which  `json` content is as follows:
+
+```json
+{
+    "result":"true",
+    "response":"<test id>"
+}
+```
 
-#### POST /xxxxxxxx
+or
 
-Referred files (*dictionaries, cer, cea, etc.*) shall be accesible for ADML and are not provided in this operation.
+```json
+{
+    "result":"false",
+    "response":"<error hint>"
+}
+```
 
-**Request body**: { "servicesJson":<services json object>}
+In case of success operation, the value of the affected test identifier carried in `response` field is useful when zero value was provided to automatically reserve the next test case. In case of error, a brief error description will be carried in that field.
 
-**Response body**: { "result":"<true or false>", "response":"<response>"}
+#### POST /testid-description/{id}
 
-#### POST /xxxxxxxx
+**Request body**:
 
-Referred files (*dictionaries, cer, cea, etc.*) shall be accesible for ADML and are not provided in this operation.
+```
+{
+    "description":"<description (string)>"
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /testid-ip-limit/{id}
+
+In-Progress limit is the maximum number of tests which can be executed in parallel.
+This operation allows a specific test to set this global pool behaviour.
+
+Zero-value is equivalent to stop the clock (no tests will be executed).
+
+Value '-1' means 'no limit' (full parallel). Be careful with resources consumption.
+
+**Request body**:
+
+```
+{
+    "amount":[amount (integer, 1 by default: execution in sequence)]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /testid-timeout/{id}
+
+**Request body**:
+
+```
+{
+    "msecs":<milliseconds (integer)>
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /testid-sendmsg2e/{id}
+
+**Request body**:
+
+```
+{
+    "diameterJson":<diameter message json object>
+    [,"stepNumber":[amount (integer, -1 no step associated)]]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /testid-sendmsg2c/{id}
+
+**Request body**:
+
+```
+{
+    "diameterJson":<diameter message json object>
+    [,"stepNumber":[amount (integer, -1 no step associated)]]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /testid-delay/{id}
+
+**Request body**:
+
+```
+{
+    "msecs":<milliseconds (integer)>
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /testid-sh-command/{id}
+
+**Request body**:
+
+```
+{
+    "script":"<script>"
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /testid-waitfe-hex/{id}
+
+**Request body**:
+
+```
+{
+    "hex":"<hex string>"
+    [,"strict":"[<true|[false]>]"]]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /testid-waitfc-hex/{id}
+
+**Request body**:
+
+```
+{
+    "hex":"<hex string>"
+    [,"strict":"[<true|[false]>]"]]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /testid-waitfe-msg/{id}
+
+**Request body**:
+
+```
+{
+    "diameterJson":<diameter message json object>
+    [,"strict":"[<true|[false]>]"]]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /testid-waitfc-msg/{id}
+
+**Request body**:
+
+```
+{
+    "diameterJson":<diameter message json object>
+    [,"strict":"[<true|[false]>]"]]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /testid-waitfe/{id}
+
+**Request body**:
+
+```
+{
+    "condition": {
+      "code":"[(integer)]",
+      "bitR":"[(1|0)]",
+      "hopByHop":"[(integer)]",
+      "applicationId":"[(integer)]",
+      "sessionId":"[session id]",
+      "resultCode":"[(integer)]",
+      "msisdn":"[msisdn]",
+      "imsi":"[imsi]",
+      "serviceContextId":"[service context id]"
+    }
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /testid-waitfc/{id}
+
+**Request body**:
+
+```
+{
+    "condition": {
+      "code":"[(integer)]",
+      "bitR":"[(1|0)]",
+      "hopByHop":"[(integer)]",
+      "applicationId":"[(integer)]",
+      "sessionId":"[session id]",
+      "resultCode":"[(integer)]",
+      "msisdn":"[msisdn]",
+      "imsi":"[imsi]",
+      "serviceContextId":"[service context id]"
+    }
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+### FSM TESTING EXECUTION ACTIONS
+
+#### POST /test-ttps
+
+**Request body**:
 
-**Request body**: { "servicesJson":<services json object>}
+```
+{
+    "amount":<amount (integer)>
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
 
-**Response body**: { "result":"<true or false>", "response":"<response>"}
+#### POST /test-next
 
+**Request body**:
 
+```
+{
+    ["syncAmount":[amount (integer: 1 by default)]]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-ip-limit
+
+Global operation (also at test identifier level is accessible).
+
+Zero-value is equivalent to stop the clock (no tests will be executed).
+
+Value '-1' means 'no limit' (full parallel). Be careful with resources consumption.
+
+Defaults to '-2' (no '-1' which is default for *testid-ip-limit* version), which wil show the current pool *ip-limit* and also the number of test cases which are *in progress*.
+
+**Request body**:
+
+```
+{
+    ["amount":[amount (integer, shows current ip-limit and in-progress test cases amount, by default (-2))]]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-goto
+
+**Request body**:
+
+```
+{
+    "id":<test identifier>
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-run
+
+**Request body**:
+
+```
+{
+    "id":<test identifier>
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-look
+
+**Request body**:
+
+```
+{
+     ["id":[test identifier (integer: current by default (-1))]]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<base64-encoded output>"
+}
+```
+
+#### POST /test-state
+
+**Request body**:
+
+```
+{
+     ["id":[test identifier (integer: current by default (-1))]]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true: if state is 'Success' or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-interact
+
+Makes interactive a specific test case id. The amount of 0, implies no execution steps margin, which could be useful to 'freeze' a test in the middle of its execution. Value -1 makes it non-interactive resuming it from the current step.
+
+**Request body**:
+
+```
+{
+     "amount":<amount (integer)>
+     [,"id":[test identifier (integer: current by default (-1))]]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-reset
+
+**Request body**:
+
+```
+{
+     ["type":"<[soft]|hard>"]
+     [,"id":[test identifier (integer: apply to all the tests (-1))]]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-repeats
+
+**Request body**:
+
+```
+{
+     "amount":<amount (integer)>
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-auto-reset
+
+**Request body**:
+
+```
+{
+     "type":"<soft|hard>"
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-initialized
+
+**Request body**: none
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-finished
+
+**Request body**: none
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-clear
+
+**Request body**: none
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-junit
+
+As it could be very large, it will be dumped on provided target directory, '*/tmp/junit.xml*' by default.
+
+**Request body**:
+
+```
+{
+    ["targetFile":"<file path>"]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-summary-counts
+
+**Request body**: none
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<base64-encoded output>"
+}
+```
+
+#### POST /test-summary-states
+
+**Request body**: none
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<base64-encoded output>"
+}
+```
+
+#### POST /test-summary
+
+**Request body**: none
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<base64-encoded output>"
+}
+```
+
+#### POST /test-report
+
+**Request body**:
+
+```
+{
+    ["state":"[<initialized|in-progress|failed|success|[all]|none>]"]
+    [,"action":"[<[enable]|disable>]"]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-report-hex
+
+**Request body**:
+
+```
+{
+    ["action":"[<[enable]|disable>]"]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+#### POST /test-dump_stdout
+
+**Request body**:
+
+```
+{
+    ["action":"[<[enable]|disable>]"]
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```
+
+### DYNAMIC PROCEDURE
+
+Used for system test. Arguments are determined by the way in a specific dynamic library is designed/documented.
+
+#### POST /dynamic
+
+**Request body**:
+
+```
+{
+    "arguments": <diameter arguments json object>
+}
+```
+
+**Response body**:
+
+```
+{
+    "result":"<true or false>",
+    "response":"<response>"
+}
+```