Merge "Make logging in Mediator Producer managed by REST"
[nonrtric.git] / test / common / README.md
1 # Introduction #
2
3 This dir contains most scripts needed for the auto-test environment. There are scripts with functions to adapt to the apis of the components of the Non-RT RIC; Policy Agent, A1 Controller and Ric (A1) simulator. The test environment supports both test with docker and kubernetes(still experimental)
4 Some of the scripts can also be used for other kinds of tests, for example basic tests.
5
6 ## Overview for common test scripts and files ##
7
8 `agent_api_functions.sh` \
9 Contains functions for adapting towards the Policy Management Service (PMS) API, also via dmaap (using a message-router stub interface)
10
11 `api_curl.sh` \
12 A common curl based function for the agent and ecs apis. Also partly used for the Callback receiver and RAPP Catalogue apis.
13
14 `clean-kube.sh` \
15 Cleans all services, deployments, pods, replica set etc started by the test environment in kubernetes.
16
17 `compare_json.py` \
18 A python script to compare two json obects for equality. Note that the comparsion always sort json-arrays before comparing (that is, it does not care about the order of items within the array). In addition, the target json object may specify individual parameter values where equality is 'dont care'.
19
20 `consul_cbs_function.sh` \
21 Contains functions for managing Consul and CBS as well as create the configuration for the PMS.
22
23 `control_panel_api_function.sh` \
24 Contains functions for managing Control Panel.
25
26 `controller_api_functions.sh` \
27 Contains functions for adaping towards the A1-controller API.
28
29 `count_json_elements.py` \
30 A python script returning the number of items in a json array.
31
32 `cr_api_functions.sh` \
33 Contains functions for adapting towards the Callback receiver for checking received callback event.
34
35 `create_policies_process.py` \
36 A python script to create a batch of policies. The script is intended to run in a number of processes to create policies in parallel.
37
38 `create_rics_json.py` \
39 A python script to create a json file from a formatted string of ric info. Helper for the test enviroment.
40
41 `delete_policies_process.py` \
42 A python script to delete a batch of policies. The script is intended to run in a number of processes to delete policies in parallel.
43
44 `do_curl_function.sh`
45 A script for executing a curl call with a specific url and optional payload. It also compare the response with an expected result in terms of response code and optional returned payload. Intended to be used by test script (for example basic test scripts of other components)
46
47 `ecs_api_functions.sh` \
48 Contains functions for adapting towards the ECS API
49
50 `extract_sdnc_reply.py` \
51 A python script to extract the information from an sdnc (A1 Controller) reply json. Helper for the test environment.
52
53 `gateway_api_functions.sh` \
54 Contains functions for managing the Non-RT RIC Gateway
55
56 `http_proxy_api_functions.sh` \
57 Contains functions for managing the Http Proxy
58
59 `kube_proxy_api_functions.sh` \
60 Contains functions for managing the Kube Proxy - to gain access to all services pod inside a kube cluster.
61
62 `mr_api_functions.sh` \
63 Contains functions for managing the MR Stub and the Dmaap Message Router
64
65 `prodstub_api_functions.sh` \
66 Contains functions for adapting towards the Producer stub interface - simulates a producer.
67
68 `rapp_catalogue_api_functions.sh` \
69 Contains functions for adapting towards the RAPP Catalogue.
70
71 `ricsimulator_api_functions.sh` \
72 Contains functions for adapting towards the RIC (A1) simulator admin API.
73
74 `test_env*.sh` \
75 Common env variables for test in the auto-test dir. All configuration of port numbers, image names and version etc shall be made in this file.
76 Used by the auto test scripts/suites but could be used for other test script as well. The test cases shall be started with the file for the intended target using command line argument '--env-file'.
77
78 `testcase_common.sh` \
79 Common functions for auto test cases in the auto-test dir. This script is the foundation of test auto environment which sets up images and enviroment variables needed by this script as well as the script adapting to the APIs.
80 The included functions are described in detail further below.
81
82 `testsuite_common.sh` \
83 Common functions for running two or more auto test scripts as a suite.
84
85 ## Integration of a new applicaton ##
86
87 Integration a new application to the test environment involves the following steps.
88
89 * Choose a short name for the application. Should be a uppcase name. For example, the NonRTRIC Gateway has NGW as short name.
90 This short name shall be added to the testengine_config.sh. See that file for detailed instructions.
91
92 * Create a file in this directory using the pattern `<application-name>_api_functions.sh`.
93 This file must implement the following functions used by the test engine. Note that functions must include the application short name in the function name. If the application does not run in kubernetes, then the last three functions in the list can be omitted.
94
95 | Function |
96 |--|
97 | __<app-short_name>_imagesetup |
98 | __<app-short_name>_imagepull |
99 | __<app-short_name>_imagebuild |
100 | __<app-short_name>_image_data |
101 | __<app-short_name>_kube_scale_zero |
102 | __<app-short_name>_kube_scale_zero_and_wait |
103 | __<app-short_name>_kube_delete_all |
104
105 In addition, all other functions used for testing of the application shall also be added to the file. For example functions to start the application, setting interface parameters as well as functions to send rest call towards the api of the application and validating the result.
106
107 * Add the application variables to api_curl.sh. This file contains a generic function to make rest calls to an api. It also supports switching betweeen direct rest calls or rest calls via messsage router.
108
109 * Create a directory beneath in the simulator-group dir. This new directory shall contain docker-compose files, config files (with or without variable substitutions) and kubernetes resource files.
110
111 All docker-compose files and all kubernetes resource files need to defined special lables. These lables are used by the test enginge to identify containers and resources started and used by the test engine.
112
113 | Label for docker compose | Description |
114 |--|--|
115 | nrttest_app | shall contain the application short name |
116 | nrttest_dp  | shall be set by a variable containing the display name, a short textual description of the applicaion |
117
118 | Label for kubernetes resource | Description |
119 |--|--|
120 | autotest | shall contain the application short name |
121
122 * Add mandatory image(s) and image tag(s) to the appropriate environment files for each release in the file(s) `test_env_<system>-<release-name>`.
123 In addition, all other needed environment shall also be defined in these file.
124
125 # Description of functions in testcase_common.sh #
126
127 ## Script args ##
128
129 The script can be started with these arguments
130
131 | arg list |
132 |--|
133 | `remote\|remote-remove docker\|kube --env-file <environment-filename> [release] [auto-clean] [--stop-at-error] [--ricsim-prefix <prefix> ] [--use-local-image <app-nam>+]  [--use-snapshot-image <app-nam>+] [--use-staging-image <app-nam>+] [--use-release-image <app-nam>+] [--image-repo <repo-address>] [--repo-policy local\|remote] [--cluster-timeout <timeout-in-seconds>]  [--print-stats]` |
134
135 | parameter | description |
136 |-|-|
137 | `remote` | Use images from remote repositories. Can be overridden for individual images using the '--use_xxx' flags |
138 | `remote-remove` | Same as 'remote' but will also try to pull fresh images from remote repositories |
139 | `docker` | Use docker environment for test |
140 | `kuber` | Use kubernetes environment for test. Requires a kubernetes minikube installation |
141 | `--env-file` | The script will use the supplied file to read environment variables from |
142 | `release` | If this flag is given the script will use release version of the images |
143 | `auto-clean` | If the function 'auto_clean_containers' is present in the end of the test script then all containers will be stopped and removed. If 'auto-clean' is not given then the function has no effect |
144 | `--stop-at-error` | The script will stop when the first failed test or configuration |
145 | `--ricsim-prefix <prefix>` | The a1 simulator will use the supplied string as container prefix instead of 'ricsim'. Note that the testscript has to read and use the env var `$RIC_SIM_PREFIX` instead of a hardcoded name of the ric(s). |
146 | `--use-local-image` | The script will use local images for the supplied apps, space separated list of app short names |
147 | `--use-snapshot-image` | The script will use images from the nexus snapshot repo for the supplied apps, space separated list of app short names |
148 | `--use-staging-image` | The script will use images from the nexus staging repo for the supplied apps, space separated list of app short names |
149 | `--use-release-image` | The script will use images from the nexus release repo for the supplied apps, space separated list of app short names |
150 | `--image-repo` |  Url to optional image repo. Only locally built images will be re-tagged and pushed to this repo |
151 | `-repo-policy` |  Policy controlling which images to re-tag and push to image repo in param --image-repo. Can be set to 'local' (push on locally built images) or 'remote' (push locally built images and images from nexus repo). Default is 'local' |
152 | `--cluster-timeout` |  Optional timeout for cluster where it takes time to obtain external ip/host-name. Timeout in seconds |
153 | `--print-stats` |  Prints the number of tests, failed tests, failed configuration and deviations after each individual test or config |
154 | `--override <file>` |  Override setting from the file supplied by --env-file |
155 | `--pre-clean` |  Clean kube resouces when running docker and vice versa |
156 | `--gen-stats`  | Collect container/pod runtime statistics |
157 | `help` | Print this info along with the test script description and the list of app short names supported |
158
159 ## Function: setup_testenvironment ##
160
161 Main function to setup the test environment before any tests are started.
162 Must be called right after sourcing all component scripts.
163 | arg list |
164 |--|
165 | None |
166
167 ## Function: indent1 ##
168
169 Indent every line of a command output with one space char.
170 | arg list |
171 |--|
172 | None |
173
174 ## Function: indent2 ##
175
176 Indent every line of a command output with two space chars.
177 | arg list |
178 |--|
179 | None |
180
181 ## Function: print_result ##
182
183 Print a test report of an auto-test script.
184 | arg list |
185 |--|
186 | None |
187
188 ## Function: start_timer ##
189
190 Start a timer for time measurement. Only one timer can be running.
191 | arg list |
192 |--|
193 | None - but any args will be printed (It is good practice to use same args for this function as for the `print_timer`) |
194
195 ## Function: print_timer ##
196
197 Print the value of the timer (in seconds) previously started by 'start_timer'. (Note that timer is still running after this function). The result of the timer as well as the args to the function will also be printed in the test report.
198 | arg list |
199 |--|
200 | `<timer-message-to-print>` |
201
202 | parameter | description |
203 | --------- | ----------- |
204 | `<timer-message-to-print>` | Any text message to be printed along with the timer result.(It is good practice to use same args for this function as for the `start_timer`) |
205
206 ## Function: deviation ##
207
208 Mark a test as a deviation from the requirements. The list of deviations will be printed in the test report.
209 | arg list |
210 |--|
211 | `<deviation-message-to-print>` |
212
213 | parameter | description |
214 | --------- | ----------- |
215 | `<deviation-message-to-print>` | Any text message describing the deviation. The text will also be printed in the test report. The intention is to mark known deviations, compared to required functionality |
216
217 ## Function: clean_environment ##
218
219 Stop and remove all containers (docker) or resources (kubernetes). Containers not part of the test are not affected (docker only). Removes all resources started by previous kube tests (kube only).
220 | arg list |
221 |--|
222 | None |
223
224 ## Function: auto_clean_containers ##
225
226 Same function as 'clean_environment'. This function has effect only if the test script is started with arg `auto-clean`. This intention is to use this function as the last step in an auto-test script.
227 | arg list |
228 |--|
229 | None |
230
231 ## Function: sleep_wait ##
232
233 Make the script sleep for a number of seconds.
234 | arg list |
235 |--|
236 | `<sleep-time-in-sec> [<any-text-in-quotes-to-be-printed>]` |
237
238 | parameter | description |
239 | --------- | ----------- |
240 | `<sleep-time-in-sec>` | Number of seconds to sleep |
241 | `<any-text-in-quotes-to-be-printed>` | Optional. The text will be printed, if present |
242
243 ## Function: check_control_panel_logs ##
244
245 Check the Control Panel log for any warnings and errors and print the count of each.
246 | arg list |
247 |--|
248 | None |
249
250 ## Function: store_logs ##
251
252 Take a snap-shot of all logs for all running containers and stores them in `./logs/<ATC-id>`. All logs will get the specified prefix in the file name. In general, one of the last steps in an auto-test script shall be to call this function. If logs shall be taken several times during a test script, different prefixes shall be used each time.
253 | arg list |
254 |--|
255 | `<logfile-prefix>` |
256
257 | parameter | description |
258 | --------- | ----------- |
259 | `<logfile-prefix>` | Log file prefix  |
260
261 # Description of functions in testsuite_common.sh #
262
263 ## Function: suite_setup ##
264
265 Sets up the test suite and prints out a heading.
266 | arg list |
267 |--|
268 | None |
269
270 ## suite_complete ##
271
272 Print out the overall result of the executed test cases.
273 | arg list |
274 |--|
275 | None |
276
277 # Description of functions in agent_api_functions.sh #
278
279 ## General ##
280
281 Both PMS version 1 and 2 are supported. The version is controlled by the env variable `$PMS_VERSION` set in the test env file.
282 For api function in version 2, an url prefix is added if configured.
283
284 ## Function: use_agent_rest_http ##
285
286 Use http for all API calls to the Policy Agent. This is the default.
287 | arg list |
288 |--|
289 | None |
290
291 ## Function: use_agent_rest_https ##
292
293 Use https for all API calls to the Policy Agent.
294 | arg list |
295 |--|
296 | None |
297
298 ## Function: use_agent_dmaap_http ##
299
300 Send and recieve all API calls to the Policy Agent over Dmaap via the MR over http.
301 | arg list |
302 |--|
303 | None |
304
305 ## Function: use_agent_dmaap_https ##
306
307 Send and recieve all API calls to the Policy Agent over Dmaap via the MR over https.
308 | arg list |
309 |--|
310 | None |
311
312 ## Function: start_policy_agent ##
313
314 Start the Policy Agent container or corresponding kube resources depending on docker/kube mode.
315 | arg list |
316 |--|
317 | `<logfile-prefix>` |
318 | (docker) `PROXY\|NOPROXY <config-file>` |
319 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
320
321 | parameter | description |
322 | --------- | ----------- |
323 | `PROXY` | Configure with http proxy, if proxy is started  |
324 | `NOPROXY` | Configure without http proxy  |
325 | `<config-file>`| Path to application.yaml  |
326 | `<data-file>` | Optional path to application_configuration.json  |
327
328 ## Function: agent_load_config ##
329
330 Load the config into a config map (kubernetes only).
331 | arg list |
332 |--|
333 |  `<data-file>` |
334
335 | parameter | description |
336 | --------- | ----------- |
337 |  `<data-file>` | Path to application_configuration.json  |
338
339 ## Function: set_agent_debug ##
340
341 Configure the Policy Agent log on debug level. The Policy Agent must be running.
342 | arg list |
343 |--|
344 | None |
345
346 ## Function: set_agent_trace ##
347
348 Configure the Policy Agent log on trace level. The Policy Agent must be running.
349 | arg list |
350 |--|
351 | None |
352
353 ## Function: use_agent_retries ##
354
355 Configure the Policy Agent to make upto 5 retries if an API calls return any of the specified http return codes.
356 | arg list |
357 |--|
358 | `[<response-code>]*` |
359
360 ## Function: check_policy_agent_logs ##
361
362 Check the Policy Agent log for any warnings and errors and print the count of each.
363 | arg list |
364 |--|
365 | None |
366
367 ## Function: api_equal() ##
368
369 Tests if the array length of a json array in the Policy Agent simulator is equal to a target value.
370 Without the timeout, the test sets pass or fail immediately depending on if the array length is equal to the target or not.
371 With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the array length becomes equal to the target value or not.
372 See the 'cr' dir for more details.
373
374 | arg list |
375 |--|
376 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
377
378 | parameter | description |
379 | --------- | ----------- |
380 | `<variable-name>` | Relative url. Example 'json:policy_types' - checks the json array length of the url /policy_types  |
381 | `<target-value>` | Target value for the length  |
382 | `<timeout-in-sec>` | Max time to wait for the length to reach the target value  |
383
384 ## Function: api_get_policies() ##
385
386 Test of GET '/policies' or V2 GET '/v2/policy-instances' and optional check of the array of returned policies.
387 To test the response code only, provide the response code parameter as well as the following three parameters.
388 To also test the response payload add the 'NOID' for an expected empty array or repeat the last five/seven parameters for each expected policy.
389
390 | arg list |
391 |--|
392 | `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <policy-type-id>\|NOTYPE [ NOID \| [<policy-id> <ric-id> <service-id> EMPTY\|<policy-type-id> <template-file>]*]` |
393
394 | arg list V2 |
395 |--|
396 | `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <policy-type-id>\|NOTYPE [ NOID \| [<policy-id> <ric-id> <service-id> EMPTY\|<policy-type-id> <transient> <notification-url> <template-file>]*]` |
397
398 | parameter | description |
399 | --------- | ----------- |
400 | `<response-code>` | Expected http response code |
401 | `<ric-id>` | Id of the ric  |
402 | `NORIC` | Indicator that no ric is provided  |
403 | `<service-id>` | Id of the service  |
404 | `NOSERVICE` | Indicator that no service id is provided  |
405 | `<policy-type-id>` |  Id of the policy type |
406 | `NOTYPE` | Indicator that no type id is provided  |
407 | `NOID` |  Indicator that no policy id is provided - indicate empty list of policies|
408 | `<policy-id>` |  Id of the policy |
409 | `EMPTY` |  Indicate for the special empty policy type |
410 | `transient` |  Transient, true or false |
411 | `notification-url` |  Url for notifications |
412 | `<template-file>` |  Path to the template file for the policy (same template used when creating the policy) |
413
414 ## Function: api_get_policy() ##
415
416 Test of GET '/policy' or V2 GET '/v2/policies/{policy_id}' and optional check of the returned json payload.
417 To test the the response code only, provide the expected response code and policy id.
418 To test the contents of the returned json payload, add a path to the template file used when creating the policy.
419
420 | arg list |
421 |--|
422 | `<response-code>  <policy-id> [<template-file>]` |
423
424 | arg list V2|
425 |--|
426 | `<response-code> <policy-id> [ <template-file> <service-name> <ric-id> <policytype-id>\|NOTYPE <transient> <notification-url>\|NOURL ]` |
427
428 | parameter | description |
429 | --------- | ----------- |
430 | `<response-code>` | Expected http response code |
431 | `<policy-id>` |  Id of the policy |
432 | `<template-file>` |  Path to the template file for the policy (same template used when creating the policy) |
433 | `<service-id>` | Id of the service  |
434 | `<ric-id>` | Id of the ric  |
435 | `<policy-type-id>` |  Id of the policy type |
436 | `NOTYPE` | Indicator that no type id is provided  |
437 | `transient` |  Transient, true or false |
438 | `notification-url` |  Url for notifications |
439
440 ## Function: api_put_policy() ##
441
442 Test of PUT '/policy' or V2 PUT '/policies'.
443 If more than one policy shall be created, add a count value to indicate the number of policies to create. Note that if more than one policy shall be created the provided policy-id must be numerical (will be used as the starting id).
444
445 | arg list |
446 |--|
447 | `<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]` |
448
449 | arg list V2 |
450 |--|
451 | `<response-code> <service-name> <ric-id> <policytype-id>\|NOTYPE <policy-id> <transient>\|NOTRANSIENT <notification-url>\|NOURL <template-file> [<count>]` |
452
453 | parameter | description |
454 | --------- | ----------- |
455 | `<response-code>` | Expected http response code |
456 | `<service-id>` | Id of the service  |
457 | `<ric-id>` | Id of the ric  |
458 | `<policy-type-id>` |  Id of the policy type |
459 | `<policy-id>` |  Id of the policy. This value shall be a numeric value if more than one policy shall be created |
460 | `transient>` |  Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provided) |
461 | `notification-url` |  Url for notifications |
462 |`NOURL`| Indicator for no url |
463 | `<template-file>` |  Path to the template file for the policy |
464 | `<count>` |  An optional count (default is 1). If a value greater than 1 is given, the policy ids will use the given policy id as the first id and add 1 to that id for each new policy |
465
466 ## Function: api_put_policy_batch() ##
467
468 This tests the same as function 'api_put_policy' except that all put requests are sent to dmaap in one go and then the responses are polled one by one.
469 If the agent api is not configured to use dmaap (see 'use_agent_dmaap', 'use_agent_rest_http' and 'use_agent_rest_https'), an error message is printed.
470 For arg list and parameters, see 'api_put_policy'.
471
472 ## Function: api_put_policy_parallel() ##
473
474 This tests the same as function 'api_put_policy' except that the policy create is spread out over a number of processes and it only uses the agent rest API. The total number of policies created is determined by the product of the parameters 'number-of-rics' and 'count'. The parameter 'number-of-threads' shall be selected to be not evenly divisible by the product of the parameters 'number-of-rics' and 'count' - this is to ensure that one process does not handle the creation of all the policies in one ric.
475
476 | arg list |
477 |--|
478 | `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <template-file> <count-per-ric> <number-of-threads>`
479
480 | arg list |
481 |--|
482 | `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <notification-url>\|NOURL <template-file> <count-per-ric> <number-of-threads>`
483
484 | parameter | description |
485 | --------- | ----------- |
486 | `<response-code>` | Expected http response code |
487 | `<service-id>` | Id of the service  |
488 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing  |
489 | `<number-of-rics>` | The number of rics, assuming the first index is '1'. The index is added to the 'ric-id-base' id  |
490 | `<policy-type-id>` |  Id of the policy type |
491 | `<policy-start-id>` |  Id of the policy. This value shall be a numeric value and will be the id of the first policy |
492 | `transient>` |  Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provide) |
493 | `notification-url` |  Url for notifications |
494 | `<template-file>` |  Path to the template file for the policy |
495 | `<count-per-ric>` |  Number of policies per ric |
496 | `<number-of-threads>` |  Number of threads (processes) to run in parallel |
497
498 ## Function: api_delete_policy() ##
499
500 This tests the DELETE '/policy' or V2 DELETE '/v2/policies/{policy_id}'. Removes the indicated policy or a 'count' number of policies starting with 'policy-id' as the first id.
501
502 | arg list |
503 |--|
504 | `<response-code> <policy-id> [<count>]`
505
506 | parameter | description |
507 | --------- | ----------- |
508 | `<response-code>` | Expected http response code |
509 | `<policy-id>` |  Id of the policy |
510 | `<count>` |  An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
511
512 ## Function: api_delete_policy_batch() ##
513
514 This tests the same as function 'api_delete_policy' except that all delete requests are sent to dmaap in one go and then the responses are polled one by one.
515 If the agent api is not configured to used dmaap (see 'use_agent_dmaap', 'use_agent_rest_http' and 'use_agent_rest_https'), an error message is printed.
516 For arg list and parameters, see 'api_delete_policy'.
517
518 ## Function: api_delete_policy_parallel() ##
519
520 This tests the same as function 'api_delete_policy' except that the policy delete is spread out over a number of processes and it only uses the agent rest API. The total number of policies deleted is determined by the product of the parameters 'number-of-rics' and 'count'. The parameter 'number-of-threads' shall be selected to be not evenly divisible by the product of the parameters 'number-of-rics' and 'count' - this is to ensure that one process does not handle the deletion of all the policies in one ric.
521
522 | arg list |
523 |--|
524 | `<response-code> <ric-id-base> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>`
525
526 | parameter | description |
527 | --------- | ----------- |
528 | `<response-code>` | Expected http response code |
529 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing  |
530 | `<number-of-rics>` | The number of rics, assuming the first index is '1'  |
531 | `<policy-start-id>` |  Id of the policy. This value shall be a numeric value and will be the id of the first policy |
532 | `<count-per-ric>` |  Number of policies per ric |
533 | `<number-of-threads>` |  Number of threads (processes) to run in parallel |
534
535 ## Function: api_get_policy_ids() ##
536
537 Test of GET '/policy_ids' or V2 GET '/v2/policies'.
538 To test response code only, provide the response code parameter as well as the following three parameters.
539 To also test the response payload add the 'NOID' for an expected empty array or repeat the 'policy-instance-id' for each expected policy id.
540
541 | arg list |
542 |--|
543 | `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <type-id>\|NOTYPE ([<policy-instance-id]*\|NOID)` |
544
545 | parameter | description |
546 | --------- | ----------- |
547 | `<response-code>` | Expected http response code |
548 | `<ric-id>` | Id of the ric  |
549 | `NORIC` | Indicator that no ric is provided  |
550 | `<service-id>` | Id of the service  |
551 | `NOSERVICE` | Indicator that no service id is provided  |
552 | `type-id>` |  Id of the policy type |
553 | `NOTYPE` | Indicator that no type id is provided  |
554 | `NOID` |  Indicator that no policy id is provided - indicate empty list of policies|
555 | `<policy-instance-id>` |  Id of the policy |
556
557 ## Function: api_get_policy_schema() ##
558
559 Test of V2 GET '/v2/policy-types/{policyTypeId}' and optional check of the returned json schema.
560 To test the response code only, provide the expected response code and policy type id.
561 To test the contents of the returned json schema, add a path to a schema file to compare with.
562
563 | arg list |
564 |--|
565 | `<response-code> <policy-type-id> [<schema-file>]` |
566
567 | parameter | description |
568 | --------- | ----------- |
569 | `<response-code>` | Expected http response code |
570 | `<policy-type-id>` |  Id of the policy type |
571 | `<schema-file>` |  Path to the schema file for the policy type |
572
573 ## Function: api_get_policy_schema() ##
574
575 Test of GET '/policy_schema' and optional check of the returned json schema.
576 To test the response code only, provide the expected response code and policy type id.
577 To test the contents of the returned json schema, add a path to a schema file to compare with.
578
579 | arg list |
580 |--|
581 | `<response-code> <policy-type-id> [<schema-file>]` |
582
583 | parameter | description |
584 | --------- | ----------- |
585 | `<response-code>` | Expected http response code |
586 | `<policy-type-id>` |  Id of the policy type |
587 | `<schema-file>` |  Path to the schema file for the policy type |
588
589 ## Function: api_get_policy_schemas() ##
590
591 Test of GET '/policy_schemas' and optional check of the returned json schemas.
592 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
593 To test the contents of the returned json schema, add a path to a schema file to compare with (or NOFILE to represent an empty '{}' type)
594
595 | arg list |
596 |--|
597 | `<response-code>  <ric-id>\|NORIC [<schema-file>\|NOFILE]*` |
598
599 | parameter | description |
600 | --------- | ----------- |
601 | `<response-code>` | Expected http response code |
602 | `<ric-id>` |  Id of the ric |
603 | `NORIC` |  No ric id given |
604 | `<schema-file>` |  Path to the schema file for the policy type |
605 | `NOFILE` |  Indicate the template for an empty type |
606
607 ## Function: api_get_policy_status() ##
608
609 Test of GET '/policy_status' or V2 GET '/policies/{policy_id}/status'.
610
611 | arg list |
612 |--|
613 | `<response-code> <policy-id> (STD\|STD2 <enforce-status>\|EMPTY [<reason>\|EMPTY])\|(OSC <instance-status> <has-been-deleted>)` |
614
615 | parameter | description |
616 | --------- | ----------- |
617 | `<response-code>` | Expected http response code |
618 | `<policy-id>` |  Id of the policy |
619 | `STD` |  Indicator of status of Standarized A1 |
620 | `STD2` |  Indicator of status of Standarized A1 version 2 |
621 | `<enforce-status>` |  Enforcement status |
622 | `<reason>` |  Optional reason |
623 | `EMPTY` |  Indicator of empty string status or reason |
624 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
625 | `<instance-status>` |  Instance status |
626 | `<has-been-deleted>` |  Deleted status, true or false |
627
628 ## Function: api_get_policy_types() ##
629
630 Test of GET '/policy_types' or  V2 GET '/v2/policy-types' and optional check of the returned ids.
631 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
632 To test the contents of the returned json payload, add the list of expected policy type id (or 'EMPTY' for the '{}' type)
633
634 | arg list |
635 |--|
636 | `<response-code> [<ric-id>\|NORIC [<policy-type-id>\|EMPTY [<policy-type-id>]*]]` |
637
638 | parameter | description |
639 | --------- | ----------- |
640 | `<response-code>` | Expected http response code |
641 | `<ric-id>` |  Id of the ric |
642 | `NORIC` |  No ric id given |
643 | `<policy-type-id>` |  Id of the policy type |
644 | `EMPTY` |  Indicate the empty type |
645
646 ## Function: api_get_status() ##
647
648 Test of GET /status or V2 GET /status
649
650 | arg list |
651 |--|
652 | `<response-code>` |
653
654 | parameter | description |
655 | --------- | ----------- |
656 | `<response-code>` | Expected http response code |
657
658 ## Function: api_get_ric() ##
659
660 Test of GET '/ric' or V2 GET '/v2/rics/ric'
661 To test the response code only, provide the expected response code and managed element id.
662 To test the returned ric id, provide the expected ric id.
663
664 | arg list |
665 |--|
666 | `<reponse-code> <managed-element-id> [<ric-id>]` |
667
668 | arg list V2 |
669 |--|
670 | `<reponse-code> <management-element-id>\|NOME <ric-id>\|<NORIC> [<string-of-ricinfo>]` |
671
672 | parameter | description |
673 | --------- | ----------- |
674 | `<response-code>` | Expected http response code |
675 | `<managed-element-id>` |  Id of the managed element |
676 | `NOME` |  Indicator for no ME |
677 | `ric-id` |  Id of the ric |
678 | `NORIC` |  Indicator no RIC |
679 | `string-of-ricinfo` |  String of ric info |
680
681 ## Function: api_get_rics() ##
682
683 Test of GET '/rics' or V2 GET '/v2/rics' and optional check of the returned json payload (ricinfo).
684 To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
685 To test also the returned payload, add the formatted string of info in the returned payload.
686 Format of ricinfo: <br>`<ric-id>:<list-of-mes>:<list-of-policy-type-ids>`<br>
687 Example <br>`<space-separate-string-of-ricinfo> = "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2,4 ricsim_g1_1:me2_........."`
688
689 | arg list |
690 |--|
691 | `<reponse-code> <policy-type-id>\|NOTYPE [<space-separate-string-of-ricinfo>]` |
692
693 | parameter | description |
694 | --------- | ----------- |
695 | `<response-code>` | Expected http response code |
696 | `<policy-type-id>` |  Policy type id of the ric |
697 | `NOTYPE>` |  No type given |
698 | `<space-separate-string-of-ricinfo>` |  A space separated string of ric info - needs to be quoted |
699
700 ## Function: api_put_service() ##
701
702 Test of PUT '/service' or V2 PUT '/service'.
703 | arg list |
704 |--|
705 | `<response-code>  <service-name> <keepalive-timeout> <callbackurl>` |
706
707 | parameter | description |
708 | --------- | ----------- |
709 | `<response-code>` | Expected http response code |
710 | `<service-name>` |  Service name |
711 | `<keepalive-timeout>` |  Timeout value |
712 | `<callbackurl>` |  Callback url |
713
714 ## Function: api_get_services() ##
715
716 Test of GET '/service' or V2 GET '/v2/services' and optional check of the returned json payload.
717 To test only the response code, omit all parameters except the expected response code.
718 To test the returned json, provide the parameters after the response code.
719
720 | arg list |
721 |--|
722 | `<response-code> [ (<query-service-name> <target-service-name> <keepalive-timeout> <callbackurl>) \| (NOSERVICE <target-service-name> <keepalive-timeout> <callbackurl> [<target-service-name> <keepalive-timeout> <callbackurl>]* )]` |
723
724 | parameter | description |
725 | --------- | ----------- |
726 | `<response-code>` | Expected http response code |
727 | `<query-service-name>` |  Service name for the query |
728 | `<target-service-name>` |  Target service name|
729 | `<keepalive-timeout>` |  Timeout value |
730 | `<callbackurl>` |  Callback url |
731 | `NOSERVICE` |  Indicator of no target service name |
732
733 ## Function: api_get_service_ids() ##
734
735 Test of GET '/services' or V2 GET /'v2/services'. Only check of service ids.
736
737 | arg list |
738 |--|
739 | `<response-code> [<service-name>]*` |
740
741 | parameter | description |
742 | --------- | ----------- |
743 | `<response-code>` | Expected http response code |
744 | `<service-name>` |  Service name |
745
746 ## Function: api_delete_services() ##
747
748 Test of DELETE '/services' or V2 DELETE '/v2/services/{serviceId}'
749
750 | arg list |
751 |--|
752 | `<response-code> [<service-name>]*` |
753
754 | parameter | description |
755 | --------- | ----------- |
756 | `<response-code>` | Expected http response code |
757 | `<service-name>` |  Service name |
758
759 ## Function: api_put_services_keepalive() ##
760
761 Test of PUT '/services/keepalive' or V2 PUT '/v2/services/{service_id}/keepalive'
762
763 | arg list |
764 |--|
765 | `<response-code> <service-name>` |
766
767 | parameter | description |
768 | --------- | ----------- |
769 | `<response-code>` | Expected http response code |
770 | `<service-name>` |  Service name |
771
772 ## Function: api_put_configuration() ##
773
774 Test of PUT '/v2/configuration'
775
776 | arg list |
777 |--|
778 | `<response-code> <config-file>` |
779
780 | parameter | description |
781 | --------- | ----------- |
782 | `<response-code>` | Expected http response code |
783 | `<config-file>` |  Path json config file |
784
785 ## Function: api_get_configuration() ##
786
787 Test of GET '/v2/configuration'
788
789 | arg list |
790 |--|
791 | `<response-code> [<config-file>]` |
792
793 | parameter | description |
794 | --------- | ----------- |
795 | `<response-code>` | Expected http response code |
796 | `<config-file>` |  Path json config file to compare the retrieved config with |
797
798 # Description of functions in consul_cbs_function.sh #
799
800 ## Function: consul_config_app ##
801
802 Function to load a json config from a file into consul for the Policy Agent
803
804 | arg list |
805 |--|
806 | `<json-config-file>` |
807
808 | parameter | description |
809 | --------- | ----------- |
810 | `<json-config-file>` | The path to the json file to be loaded to Consul/CBS |
811
812 ## Function: prepare_consul_config ##
813
814 Function to prepare a Consul config based on the previously configured (and started simulators). Note that all simulator must be running and the test script has to configure if http or https shall be used for the components (this is done by the functions 'use_simulator_http', 'use_simulator_https', 'use_sdnc_http', 'use_sdnc_https', 'use_mr_http', 'use_mr_https')
815 | arg list |
816 |--|
817 | `<deviation-message-to-print>` |
818
819 | parameter | description |
820 | --------- | ----------- |
821 | `SDNC\|NOSDNC` | Configure based on a1-controller (SNDC) or without a controller/adapter (NOSDNC) |
822 | `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app'  |
823
824 ## Function: start_consul_cbs ##
825
826 Start the Consul and CBS containers
827 | arg list |
828 |--|
829 | None |
830
831 # Description of functions in control_panel_api_function.sh #
832
833 ## Function: use_control_panel_http ##
834
835 Set http as the protocol to use for all communication to the Control Panel
836 | arg list |
837 |--|
838 | None |
839
840 ## Function: use_control_panel_https ##
841
842 Set https as the protocol to use for all communication to the Control Panel
843 | arg list |
844 |--|
845 | None |
846
847 ## Function: start_control_panel ##
848
849 Start the Control Panel container
850 | arg list |
851 |--|
852 | None |
853
854 # Description of functions in controller_api_functions.sh #
855
856 The file contains a selection of the possible API tests towards the a1-controller
857
858 ## Function: use_sdnc_http ##
859
860 Use http for all API calls towards the SDNC A1 Controller. This is the default. Note that this function shall be called before preparing the config for Consul.
861 | arg list |
862 |--|
863 | None |
864
865 ## Function: use_sdnc_https ##
866
867 Use https for all API calls towards the SDNC A1 Controller. Note that this function shall be called before preparing the config for Consul.
868 | arg list |
869 |--|
870 | None |
871
872 ## Function: start_sdnc ##
873
874 Start the SDNC A1 Controller container and its database container
875 | arg list |
876 |--|
877 | None |
878
879 ## Function: check_sdnc_logs ##
880
881 Check the SDNC log for any warnings and errors and print the count of each.
882 | arg list |
883 |--|
884 | None |
885
886 ## Function: controller_api_get_A1_policy_ids ##
887
888 Test of GET policy ids towards OSC or STD type simulator.
889 To test response code only, provide the response code, 'OSC' + policy type or 'STD'
890 To test the response payload, include the ids of the expexted response.
891
892 | arg list |
893 |--|
894 | `<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) \| ( STD <ric-id> [ <policy-id> [<policy-id>]* ]` |
895
896 | parameter | description |
897 | --------- | ----------- |
898 | `<response-code>` | Expected http response code |
899 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
900 | `<ric-id>` | Id of the ric  |
901 | `policy-type-id>` |  Id of the policy type |
902 | `<policy-id>` |  Id of the policy |
903 | `STD` |  Indicator of status of Standarized A1 |
904
905 ## Function: controller_api_get_A1_policy_type ##
906
907 Test of GET a policy type (OSC only)
908
909 | arg list |
910 |--|
911 | `<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]` |
912
913 | parameter | description |
914 | --------- | ----------- |
915 | `<response-code>` | Expected http response code |
916 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
917 | `<ric-id>` | Id of the ric  |
918 | `policy-type-id>` |  Id of the policy type |
919 | `policy-type-file>` |  Optional schema file to compare the returned type with |
920
921 ## Function: controller_api_delete_A1_policy ##
922
923 Deletes a policy instance
924
925 | arg list |
926 |--|
927 | `(STD <ric-id> <policy-id>) \| (OSC <ric-id> <policy-type-id> <policy-id>)` |
928
929 | parameter | description |
930 | --------- | ----------- |
931 | `<response-code>` | Expected http response code |
932 | `STD` |  Indicator of status of Standarized A1 |
933 | `<ric-id>` | Id of the ric  |
934 | `<policy-id>` |  Id of the policy |
935 | `policy-type-id>` |  Id of the policy type |
936 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
937 | `policy-type-file>` |  Optional schema file to compare the returned type with |
938
939 ## Function: controller_api_put_A1_policy ##
940
941 Creates a policy instance
942
943 | arg list |
944 |--|
945 | `<response-code> (STD <ric-id> <policy-id> <template-file> ) \| (OSC <ric-id> <policy-type-id> <policy-id> <template-file>)` |
946
947 | parameter | description |
948 | --------- | ----------- |
949 | `<response-code>` | Expected http response code |
950 | `STD` |  Indicator of status of Standarized A1 |
951 | `<ric-id>` | Id of the ric  |
952 | `<policy-id>` |  Id of the policy |
953 | `<template-file>` |  Path to the template file of the policy|
954 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
955 | `<policy-type-id>` |  Id of the policy type |
956
957 ## Function: controller_api_get_A1_policy_status ##
958
959 Checks the status of a policy
960
961  arg list |
962 |--|
963 | `<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) \| (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)` |
964
965 | parameter | description |
966 | --------- | ----------- |
967 | `<response-code>` | Expected http response code |
968 | `STD` |  Indicator of status of Standarized A1 |
969 | `<ric-id>` | Id of the ric  |
970 | `<policy-id>` |  Id of the policy |
971 | `<enforce-status>` |  Enforcement status |
972 | `<reason>` |  Optional reason |
973 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
974 | `<policy-type-id>` |  Id of the policy type |
975 | `<instance-status>` |  Instance status |
976 | `<has-been-deleted>` |  Deleted status, true or false |
977
978 # Description of functions in cr_api_functions.sh #
979
980 ## Function: use_cr_http ##
981
982 Use http for getting event from CR.  The admin API is not affected. This is the default.
983 | arg list |
984 |--|
985 | None |
986
987 ## Function: use_cr_https ##
988
989 Use https for getting event from CR. The admin API is not affected.
990 Note: Not yet used as callback event is not fully implemented/deciced.
991 | arg list |
992 |--|
993 | None |
994
995 ## Function: start_cr ##
996
997 Start the Callback Receiver container in docker or kube depending on start mode.
998 | arg list |
999 |--|
1000 | None |
1001
1002 ## Function: cr_equal ##
1003
1004 Tests if a variable value in the Callback Receiver (CR) simulator is equal to a target value.
1005 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1006 With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value becomes equal to the target value or not.
1007 See the 'cr' dir for more details.
1008 | arg list |
1009 |--|
1010 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1011
1012 | parameter | description |
1013 | --------- | ----------- |
1014 | `<variable-name>` | Variable name in the CR  |
1015 | `<target-value>` | Target value for the variable  |
1016 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1017
1018 ## Function: cr_api_check_all_sync_events() ##
1019
1020 Check the contents of all ric events received for a callback id.
1021
1022 | arg list |
1023 |--|
1024 | `<response-code> <id> [ EMPTY \| ( <ric-id> )+ ]` |
1025
1026 | parameter | description |
1027 | --------- | ----------- |
1028 | `<response-code>` | Expected http response code |
1029 | `<id>` | Id of the callback destination  |
1030 | `EMPTY` | Indicator for an empty list  |
1031 | `<ric-id>` | Id of the ric  |
1032
1033 ## Function: cr_api_check_all_ecs_events() ##
1034
1035 Check the contents of all current status events for one id from ECS
1036
1037 | arg list |
1038 |--|
1039 | `<response-code> <id> [ EMPTY \| ( <status> )+ ]` |
1040
1041 | parameter | description |
1042 | --------- | ----------- |
1043 | `<response-code>` | Expected http response code |
1044 | `<id>` | Id of the callback destination  |
1045 | `EMPTY` | Indicator for an empty list  |
1046 | `<status>` | Status string  |
1047
1048 ## Function: cr_api_check_all_ecs_subscription_events() ##
1049
1050 Check the contents of all current subscription events for one id from ECS
1051
1052 | arg list |
1053 |--|
1054 | `<response-code> <id> [ EMPTY | ( <type-id> <schema> <registration-status> )+ ]` |
1055
1056 | parameter | description |
1057 | --------- | ----------- |
1058 | `<response-code>` | Expected http response code |
1059 | `<id>` | Id of the callback destination  |
1060 | `EMPTY` | Indicator for an empty list  |
1061 | `<type-id>` | Id of the data type  |
1062 | `<schema>` | Path to typeschema file  |
1063 | `<registration-status>` | Status string  |
1064
1065
1066 ## Function: cr_api_reset() ##
1067
1068 Reset the callback receiver
1069
1070 | arg list |
1071 |--|
1072 | - |
1073
1074
1075 # Description of functions in ecs_api_functions.sh #
1076
1077 ## Function: use_ecs_rest_http ##
1078
1079 Use http for all API calls to the ECS. This is the default protocol.
1080 | arg list |
1081 |--|
1082 | None |
1083
1084 ## Function: use_ecs_rest_https ##
1085
1086 Use https for all API calls to the ECS.
1087 | arg list |
1088 |--|
1089 | None |
1090
1091 ## Function: use_ecs_dmaap_http ##
1092
1093 Send and recieve all API calls to the ECS over Dmaap via the MR using http.
1094 | arg list |
1095 |--|
1096 | None |
1097
1098 ## Function: use_ecs_dmaap_https ##
1099
1100 Send and recieve all API calls to the ECS over Dmaap via the MR using https.
1101 | arg list |
1102 |--|
1103 | None |
1104
1105 ## Function: start_ecs ##
1106
1107 Start the ECS container in docker or kube depending on running mode.
1108 | arg list |
1109 |--|
1110 | None |
1111
1112 ## Function: stop_ecs ##
1113
1114 Stop the ECS container.
1115 | arg list |
1116 |--|
1117 | None |
1118
1119 ## Function: start_stopped_ecs ##
1120
1121 Start a previously stopped ecs.
1122 | arg list |
1123 |--|
1124 | None |
1125
1126 ## Function: set_ecs_debug ##
1127
1128 Configure the ECS log on debug level. The ECS must be running.
1129 | arg list |
1130 |--|
1131 | None |
1132
1133 ## Function: set_ecs_trace ##
1134
1135 Configure the ECS log on trace level. The ECS must be running.
1136 | arg list |
1137 |--|
1138 | None |
1139
1140 ## Function: check_ecs_logs ##
1141
1142 Check the ECS log for any warnings and errors and print the count of each.
1143 | arg list |
1144 |--|
1145 | None |
1146
1147 ## Function: ecs_equal ##
1148
1149 Tests if a variable value in the ECS is equal to a target value.
1150 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1151 With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value becomes equal to the target value or not.
1152 See the 'a1-interface' repo for more details.
1153
1154 | arg list |
1155 |--|
1156 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1157
1158 | parameter | description |
1159 | --------- | ----------- |
1160 | `<variable-name>` | Variable name in ecs  |
1161 | `<target-value>` | Target value for the variable  |
1162 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1163
1164 ## Function: ecs_api_a1_get_job_ids() ##
1165
1166 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs' and optional check of the array of returned job ids.
1167 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1168 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1169
1170 | arg list |
1171 |--|
1172 | `<response-code> <type-id>  <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
1173
1174 | parameter | description |
1175 | --------- | ----------- |
1176 | `<response-code>` | Expected http response code |
1177 | `<type-id>` | Id of the EI type  |
1178 | `<owner-id>` | Id of the job owner  |
1179 | `NOOWNER` | No owner is given  |
1180 | `<job-id>` | Id of the expected job  |
1181 | `EMPTY` | The expected list of job id shall be empty  |
1182
1183 ## Function: ecs_api_a1_get_type() ##
1184
1185 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}' and optional check of the returned schema.
1186 To test the response code only, provide the response code parameter as well as the type-id.
1187 To also test the response payload add a path to the expected schema file.
1188
1189 | arg list |
1190 |--|
1191 | `<response-code> <type-id> [<schema-file>]` |
1192
1193 | parameter | description |
1194 | --------- | ----------- |
1195 | `<response-code>` | Expected http response code |
1196 | `<type-id>` | Id of the EI type  |
1197 | `<schema-file>` | Path to a schema file to compare with the returned schema  |
1198
1199 ## Function: ecs_api_a1_get_type_ids() ##
1200
1201 Test of GET '/A1-EI​/v1​/eitypes' and optional check of returned list of type ids.
1202 To test the response code only, provide the response only.
1203 To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
1204
1205 | arg list |
1206 |--|
1207 | `<response-code> [ (EMPTY \| [<type-id>]+) ]` |
1208
1209 | parameter | description |
1210 | --------- | ----------- |
1211 | `<response-code>` | Expected http response code |
1212 | `EMPTY` | The expected list of type ids shall be empty  |
1213 | `<type-id>` | Id of the EI type  |
1214
1215 ## Function: ecs_api_a1_get_job_status() ##
1216
1217 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}​/status' and optional check of the returned status.
1218 To test the response code only, provide the response code, type id and job id.
1219 To also test the response payload add the expected status.
1220
1221 | arg list |
1222 |--|
1223 | `<response-code> <type-id> <job-id> [<status>]` |
1224
1225 | parameter | description |
1226 | --------- | ----------- |
1227 | `<response-code>` | Expected http response code |
1228 | `<type-id>` | Id of the EI type  |
1229 | `<job-id>` | Id of the job  |
1230 | `<status>` | Expected status  |
1231
1232 ## Function: ecs_api_a1_get_job() ##
1233
1234 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}' and optional check of the returned job.
1235 To test the response code only, provide the response code, type id and job id.
1236 To also test the response payload add the remaining parameters.
1237
1238 | arg list |
1239 |--|
1240 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1241
1242 | parameter | description |
1243 | --------- | ----------- |
1244 | `<response-code>` | Expected http response code |
1245 | `<type-id>` | Id of the EI type  |
1246 | `<job-id>` | Id of the job  |
1247 | `<target-url>` | Expected target url for the job  |
1248 | `<owner-id>` | Expected owner for the job  |
1249 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1250
1251 ## Function: ecs_api_a1_delete_job() ##
1252
1253 Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1254 To test, provide all the specified parameters.
1255
1256 | arg list |
1257 |--|
1258 | `<response-code> <type-id> <job-id>` |
1259
1260 | parameter | description |
1261 | --------- | ----------- |
1262 | `<response-code>` | Expected http response code |
1263 | `<type-id>` | Id of the EI type  |
1264 | `<job-id>` | Id of the job  |
1265
1266 ## Function: ecs_api_a1_put_job() ##
1267
1268 Test of PUT '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1269 To test, provide all the specified parameters.
1270
1271 | arg list |
1272 |--|
1273 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
1274
1275 | parameter | description |
1276 | --------- | ----------- |
1277 | `<response-code>` | Expected http response code |
1278 | `<type-id>` | Id of the EI type  |
1279 | `<job-id>` | Id of the job  |
1280 | `<target-url>` | Target url for the job  |
1281 | `<owner-id>` | Owner of the job  |
1282 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1283
1284 ## Function: ecs_api_edp_get_type_ids() ##
1285
1286 Test of GET '/ei-producer/v1/eitypes' or '/data-producer/v1/info-types' depending on ecs version and an optional check of the returned list of type ids.
1287 To test the response code only, provide the response code.
1288 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1289
1290 | arg list |
1291 |--|
1292 | `<response-code> [ EMPTY \| <type-id>+]` |
1293
1294 | parameter | description |
1295 | --------- | ----------- |
1296 | `<response-code>` | Expected http response code |
1297 | `<type-id>` | Id of the type  |
1298 | `EMPTY` | The expected list of type ids shall be empty  |
1299
1300 ## Function: ecs_api_edp_get_producer_status() ##
1301
1302 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/status' or '/data-producer/v1/info-producers/{infoProducerId}/status' depending on ecs version and optional check of the returned status.
1303 To test the response code only, provide the response code and producer id.
1304 To also test the response payload add the expected status.
1305
1306 | arg list |
1307 |--|
1308 | `<response-code> <producer-id> [<status>]` |
1309
1310 | parameter | description |
1311 | --------- | ----------- |
1312 | `<response-code>` | Expected http response code |
1313 | `<producer-id>` | Id of the producer  |
1314 | `<status>` | The expected status string  |
1315
1316 ## Function: ecs_api_edp_get_producer_ids() ##
1317
1318 Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
1319 To test the response code only, provide the response.
1320 To also test the response payload add the list of expected producer-ids (or EMPTY if the list of ids is expected to be empty).
1321
1322 | arg list |
1323 |--|
1324 | `<response-code> [ EMPTY \| <producer-id>+]` |
1325
1326 | parameter | description |
1327 | --------- | ----------- |
1328 | `<response-code>` | Expected http response code |
1329 | `<producer-id>` | Id of the producer  |
1330 | `EMPTY` | The expected list of type ids shall be empty  |
1331
1332 ## Function: ecs_api_edp_get_producer_ids_2() ##
1333
1334 Test of GET '/ei-producer/v1/eiproducers' or '/data-producer/v1/info-producers' depending on ecs version and optional check of the returned producer ids.
1335 To test the response code only, provide the response.
1336 To also test the response payload add the type (if any) and a list of expected producer-ids (or EMPTY if the list of ids is expected to be empty).
1337
1338 | arg list |
1339 |--|
1340 | `<response-code> [ ( NOTYPE \| <type-id> ) [ EMPTY \| <producer-id>+]` |
1341
1342 | parameter | description |
1343 | --------- | ----------- |
1344 | `<response-code>` | Expected http response code |
1345 | `<type-id>` | Id of the type  |
1346 | `EMPTY` | No type given  |
1347 | `<producer-id>` | Id of the producer  |
1348 | `EMPTY` | The expected list of type ids shall be empty  |
1349
1350 ## Function: ecs_api_edp_get_type() ##
1351
1352 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
1353 To test the response code only, provide the response and the type-id.
1354 To also test the response payload add a path to a job schema file and a list expected producer-id (or EMPTY if the list of ids is expected to be empty).
1355
1356 | arg list |
1357 |--|
1358 | `<response-code> <type-id> [<job-schema-file> (EMPTY \| [<producer-id>]+)]` |
1359
1360 | parameter | description |
1361 | --------- | ----------- |
1362 | `<response-code>` | Expected http response code |
1363 | `<type-id>` | Id of the type  |
1364 | `<job-schema-file>` | Path to a job schema file  |
1365 | `<producer-id>` | Id of the producer  |
1366 | `EMPTY` | The expected list of type ids shall be empty  |
1367
1368 ## Function: ecs_api_edp_get_type_2() ##
1369
1370 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ecs version and optional check of the returned type.
1371 To test the response code only, provide the response and the type-id.
1372 To also test the response payload add a path to a job schema file.
1373
1374 | arg list |
1375 |--|
1376 | `<response-code> <type-id> [<job-schema-file>]` |
1377
1378 | parameter | description |
1379 | --------- | ----------- |
1380 | `<response-code>` | Expected http response code |
1381 | `<type-id>` | Id of the type  |
1382 | `<job-schema-file>` | Path to a job schema file  |
1383 | `EMPTY` | The expected list of type ids shall be empty  |
1384
1385 ## Function: ecs_api_edp_put_type_2() ##
1386
1387 Test of PUT '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ecs version and optional check of the returned type.
1388
1389 | arg list |
1390 |--|
1391 | `<response-code> <type-id> [<job-schema-file>]` |
1392
1393 | parameter | description |
1394 | --------- | ----------- |
1395 | `<response-code>` | Expected http response code |
1396 | `<type-id>` | Id of the type  |
1397 | `<job-schema-file>` | Path to a job schema file  |
1398 | `EMPTY` | The expected list of type ids shall be empty  |
1399
1400 ## Function: ecs_api_edp_delete_type_2() ##
1401
1402 Test of DELETE '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ecs version and optional check of the returned type.
1403
1404 | arg list |
1405 |--|
1406 | `<response-code> <type-id>` |
1407
1408 | parameter | description |
1409 | --------- | ----------- |
1410 | `<response-code>` | Expected http response code |
1411 | `<type-id>` | Id of the type  |
1412
1413 ## Function: ecs_api_edp_get_producer() ##
1414
1415 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
1416 To test the response code only, provide the response and the producer-id.
1417 To also test the response payload add the remaining parameters defining thee producer.
1418
1419 | arg list |
1420 |--|
1421 | `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY\| [<type-id> <schema-file>]+) ]` |
1422
1423 | parameter | description |
1424 | --------- | ----------- |
1425 | `<response-code>` | Expected http response code |
1426 | `<producer-id>` | Id of the producer  |
1427 | `<create-callback>` | Callback for create job  |
1428 | `<delete-callback>` | Callback for delete job  |
1429 | `<supervision-callback>` | Callback for producer supervision  |
1430 | `<type-id>` | Id of the type  |
1431 | `<schema-file>` | Path to a schema file  |
1432 | `EMPTY` | The expected list of type schema pairs shall be empty  |
1433
1434 ## Function: ecs_api_edp_get_producer_2() ##
1435
1436 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version and optional check of the returned producer.
1437 To test the response code only, provide the response and the producer-id.
1438 To also test the response payload add the remaining parameters defining thee producer.
1439
1440 | arg list |
1441 |--|
1442 | `<response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY \| <type-id>+) ]` |
1443
1444 | parameter | description |
1445 | --------- | ----------- |
1446 | `<response-code>` | Expected http response code |
1447 | `<producer-id>` | Id of the producer  |
1448 | `<job-callback>` | Callback for the url  |
1449 | `<supervision-callback>` | Callback for producer supervision  |
1450 | `<type-id>` | Id of the type  |
1451 | `EMPTY` | The expected list of types shall be empty  |
1452
1453 ## Function: ecs_api_edp_delete_producer() ##
1454
1455 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version.
1456 To test, provide all parameters.
1457
1458 | arg list |
1459 |--|
1460 | `<response-code> <producer-id>` |
1461
1462 | parameter | description |
1463 | --------- | ----------- |
1464 | `<response-code>` | Expected http response code |
1465 | `<producer-id>` | Id of the producer  |
1466
1467 ## Function: ecs_api_edp_put_producer() ##
1468
1469 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1470 To test, provide all parameters. The list of type/schema pair may be empty.
1471
1472 | arg list |
1473 |--|
1474 | `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY \| [<type-id> <schema-file>]+)` |
1475
1476 | parameter | description |
1477 | --------- | ----------- |
1478 | `<response-code>` | Expected http response code |
1479 | `<producer-id>` | Id of the producer  |
1480 | `<job-callback>` | Callback for create/delete job  |
1481 | `<supervision-callback>` | Callback for producer supervision  |
1482 | `<type-id>` | Id of the type  |
1483 | `<schema-file>` | Path to a schema file  |
1484 | `EMPTY` | The list of type/schema pairs is empty  |
1485
1486 ## Function: ecs_api_edp_put_producer_2() ##
1487
1488 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version.
1489 To test, provide all parameters. The list of type/schema pair may be empty.
1490
1491 | arg list |
1492 |--|
1493 | `<response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE\|[<type-id>+]` |
1494
1495 | parameter | description |
1496 | --------- | ----------- |
1497 | `<response-code>` | Expected http response code |
1498 | `<producer-id>` | Id of the producer  |
1499 | `<job-callback>` | Callback for create/delete job  |
1500 | `<supervision-callback>` | Callback for producer supervision  |
1501 | `<type-id>` | Id of the type  |
1502 | `NOTYPE` | The list of types is empty  |
1503
1504 ## Function: ecs_api_edp_get_producer_jobs() ##
1505
1506 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
1507 To test the response code only, provide the response and the producer-id.
1508 To also test the response payload add the remaining parameters.
1509
1510 | arg list |
1511 |--|
1512 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1513
1514 | parameter | description |
1515 | --------- | ----------- |
1516 | `<response-code>` | Expected http response code |
1517 | `<producer-id>` | Id of the producer  |
1518 | `<job-id>` | Id of the job  |
1519 | `<type-id>` | Id of the EI type  |
1520 | `<target-url>` | Target url for data delivery  |
1521 | `<job-owner>` | Id of the job owner  |
1522 | `<template-job-file>` | Path to a job template file  |
1523 | `EMPTY` | The list of job/type/target/job-file tuples is empty  |
1524
1525 ## Function: ecs_api_edp_get_producer_jobs_2() ##
1526
1527 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' or '/data-producer/v1/info-producers/{infoProducerId}/info-jobs' depending on ecs version and optional check of the returned producer job.
1528 To test the response code only, provide the response and the producer-id.
1529 To also test the response payload add the remaining parameters.
1530
1531 | arg list |
1532 |--|
1533 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1534
1535 | parameter | description |
1536 | --------- | ----------- |
1537 | `<response-code>` | Expected http response code |
1538 | `<producer-id>` | Id of the producer  |
1539 | `<job-id>` | Id of the job  |
1540 | `<type-id>` | Id of the type  |
1541 | `<target-url>` | Target url for data delivery  |
1542 | `<job-owner>` | Id of the job owner  |
1543 | `<template-job-file>` | Path to a job template file  |
1544 | `EMPTY` | The list of job/type/target/job-file tuples is empty  |
1545
1546 ## Function: ecs_api_service_status() ##
1547
1548 Test of GET '/status'.
1549
1550 | arg list |
1551 |--|
1552 | `<response-code>` |
1553
1554 | parameter | description |
1555 | --------- | ----------- |
1556 | `<response-code>` | Expected http response code |
1557
1558 ## Function: ecs_api_idc_get_type_ids() ##
1559
1560 Test of GET '/data-consumer/v1/info-types' and an optional check of the returned list of type ids.
1561 To test the response code only, provide the response code.
1562 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1563
1564 | arg list |
1565 |--|
1566 | `<response-code> [ EMPTY \| <type-id>+]` |
1567
1568 | parameter | description |
1569 | --------- | ----------- |
1570 | `<response-code>` | Expected http response code |
1571 | `<type-id>` | Id of the Info type  |
1572 | `EMPTY` | The expected list of type ids shall be empty  |
1573
1574 ## Function: ecs_api_idc_get_job_ids() ##
1575
1576 Test of GET '/data-consumer/v1/info-jobs' and optional check of the array of returned job ids.
1577 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1578 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1579
1580 | arg list |
1581 |--|
1582 | `<response-code> <type-id>  <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
1583
1584 | parameter | description |
1585 | --------- | ----------- |
1586 | `<response-code>` | Expected http response code |
1587 | `<type-id>` | Id of the Info type  |
1588 | `<owner-id>` | Id of the job owner  |
1589 | `NOOWNER` | No owner is given  |
1590 | `<job-id>` | Id of the expected job  |
1591 | `EMPTY` | The expected list of job id shall be empty  |
1592
1593 ## Function: ecs_api_idc_get_job() ##
1594
1595 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}' and optional check of the returned job.
1596 To test the response code only, provide the response code, type id and job id.
1597 To also test the response payload add the remaining parameters.
1598
1599 | arg list |
1600 |--|
1601 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1602
1603 | parameter | description |
1604 | --------- | ----------- |
1605 | `<response-code>` | Expected http response code |
1606 | `<type-id>` | Id of the Info type  |
1607 | `<job-id>` | Id of the job  |
1608 | `<target-url>` | Expected target url for the job  |
1609 | `<owner-id>` | Expected owner for the job  |
1610 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1611
1612 ## Function: ecs_api_idc_put_job() ##
1613
1614 Test of PUT '​/data-consumer/v1/info-jobs/{infoJobId}'.
1615 To test, provide all the specified parameters.
1616
1617 | arg list |
1618 |--|
1619 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file> [VALIDATE]` |
1620
1621 | parameter | description |
1622 | --------- | ----------- |
1623 | `<response-code>` | Expected http response code |
1624 | `<type-id>` | Id of the Info type  |
1625 | `<job-id>` | Id of the job  |
1626 | `<target-url>` | Target url for the job  |
1627 | `<owner-id>` | Owner of the job  |
1628 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1629 | `VALIIDATE` | Indicator to preform type validation at creation  |
1630
1631 ## Function: ecs_api_idc_delete_job() ##
1632
1633 Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1634 To test, provide all the specified parameters.
1635
1636 | arg list |
1637 |--|
1638 | `<response-code> <type-id> <job-id>` |
1639
1640 | parameter | description |
1641 | --------- | ----------- |
1642 | `<response-code>` | Expected http response code |
1643 | `<type-id>` | Id of the type  |
1644 | `<job-id>` | Id of the job  |
1645
1646 ## Function: ecs_api_idc_get_type() ##
1647
1648 Test of GET '/data-consumer/v1/info-types/{infoTypeId} and optional check of the returned schema.
1649 To test the response code only, provide the response code parameter as well as the type-id.
1650 To also test the response payload add a path to the expected schema file.
1651
1652 | arg list |
1653 |--|
1654 | `<response-code> <type-id> [<schema-file>]` |
1655
1656 | parameter | description |
1657 | --------- | ----------- |
1658 | `<response-code>` | Expected http response code |
1659 | `<type-id>` | Id of the Info type  |
1660 | `<schema-file>` | Path to a schema file to compare with the returned schema  |
1661
1662 ## Function: ecs_api_idc_get_job_status() ##
1663
1664 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' and optional check of the returned status and timeout.
1665 To test the response code only, provide the response code and job id.
1666 To also test the response payload add the expected status.
1667
1668 | arg list |
1669 |--|
1670 | `<response-code> <job-id> [<status> [ <timeout>]]` |
1671
1672 | parameter | description |
1673 | --------- | ----------- |
1674 | `<response-code>` | Expected http response code |
1675 | `<job-id>` | Id of the job  |
1676 | `<status>` | Expected status  |
1677 | `<timeout>` | Timeout |
1678
1679 ## Function: ecs_api_idc_get_job_status2() ##
1680
1681 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' with returned producers and optional check of the returned status and timeout.
1682 To test the response code only, provide the response code and job id.
1683 To also test the response payload add the expected status.
1684
1685 | arg list |
1686 |--|
1687 | `<response-code> <job-id> [<status> EMPTYPROD|( <prod-count> <producer-id>+ ) [<timeout>]]` |
1688
1689 | parameter | description |
1690 | --------- | ----------- |
1691 | `<response-code>` | Expected http response code |
1692 | `<job-id>` | Id of the job  |
1693 | `<status>` | Expected status  |
1694 | `<EMPTYPROD>` | Indicated for empty list of producer  |
1695 | `<prod-count>` | Number of expected producer  |
1696 | `<producer-id>` |Id of the producer  |
1697 | `<timeout>` | Timeout |
1698
1699
1700 ## Function: ecs_api_idc_get_subscription_ids() ##
1701 Test of GET '/data-consumer/v1/info-type-subscription' with the returned list of subscription ids
1702
1703 | arg list |
1704 |--|
1705 | `<response-code>  <owner-id>|NOOWNER [ EMPTY | <subscription-id>+]` |
1706
1707 | parameter | description |
1708 | --------- | ----------- |
1709 | `<response-code>` | Expected http response code |
1710 | `<owner-id>` | Id of the owner  |
1711 | `<NOOWNER>` | Indicator for empty owner  |
1712 | `<EMPTY>` | Indicated for empty list of subscription ids  |
1713 | `<subscription-id>` |Id of the subscription  |
1714
1715 ## Function: ecs_api_idc_get_subscription() ##
1716 Test of GET '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
1717
1718 | arg list |
1719 |--|
1720 | `<response-code>  <subscription-id> [ <owner-id> <status-uri> ]` |
1721
1722 | parameter | description |
1723 | --------- | ----------- |
1724 | `<response-code>` | Expected http response code |
1725 | `<subscription-id>` |Id of the subscription  |
1726 | `<owner-id>` | Id of the owner  |
1727 | `<status-uri>` | Url for status notifications  |
1728
1729
1730 ## Function: ecs_api_idc_put_subscription() ##
1731 Test of PUT '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
1732
1733 | arg list |
1734 |--|
1735 | `<response-code>  <subscription-id> <owner-id> <status-uri>` |
1736
1737 | parameter | description |
1738 | --------- | ----------- |
1739 | `<response-code>` | Expected http response code |
1740 | `<subscription-id>` |Id of the subscription  |
1741 | `<owner-id>` | Id of the owner  |
1742 | `<status-uri>` | Url for status notifications  |
1743
1744 ## Function: ecs_api_idc_delete_subscription() ##
1745 Test of DELETE /data-consumer/v1/info-type-subscription/{subscriptionId}
1746
1747 | arg list |
1748 |--|
1749 | `<response-code>  <subscription-id>` |
1750
1751 | parameter | description |
1752 | --------- | ----------- |
1753 | `<response-code>` | Expected http response code |
1754 | `<subscription-id>` |Id of the subscription  |
1755
1756
1757 ## Function: ecs_api_admin_reset() ##
1758
1759 Test of GET '/status'.
1760
1761 | arg list |
1762 |--|
1763 | `<response-code> [ <type> ]` |
1764
1765 | parameter | description |
1766 | --------- | ----------- |
1767 | `<response-code>` | Expected http response code |
1768 | `<type>` | Type id, if the interface supports type in url |
1769
1770 # Description of functions in gateway_api_functions.sh #
1771
1772 ## Function: use_gateway_http ##
1773
1774 Use http for all calls to the gateway. This is set by default.
1775 | arg list |
1776 |--|
1777 | None |
1778
1779 ## Function: use_gateway_https ##
1780
1781 Use https for all calls to the gateway.
1782 | arg list |
1783 |--|
1784 | None |
1785
1786 ## Function: set_gateway_debug ##
1787
1788 Set debug level logging in the gateway
1789 | arg list |
1790 |--|
1791 | None |
1792
1793 ## Function: set_gateway_trace ##
1794
1795 Set debug level logging in the trace
1796 | arg list |
1797 |--|
1798 | None |
1799
1800 ## Function: start_gateway ##
1801
1802 Start the the gateway container in docker or kube depending on start mode
1803 | arg list |
1804 |--|
1805 | None |
1806
1807 ## Function: gateway_pms_get_status ##
1808
1809 Sample test of pms api (status)
1810 | arg list |
1811 |--|
1812 | `<response-code>` |
1813
1814 | parameter | description |
1815 | --------- | ----------- |
1816 | `<response-code>` | Expected http response code |
1817
1818 ## Function: gateway_ecs_get_types ##
1819
1820 Sample test of ecs api (get types)
1821 Only response code tested - not payload
1822 | arg list |
1823 |--|
1824 | `<response-code>` |
1825
1826 | parameter | description |
1827 | --------- | ----------- |
1828 | `<response-code>` | Expected http response code |
1829
1830 # Description of functions in http_proxy_api_functions.sh #
1831
1832 ## Function: use_http_proxy_http ##
1833
1834 Use http for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
1835 | arg list |
1836 |--|
1837 | None |
1838
1839 ## Function: use_http_proxy_https ##
1840
1841 Use https for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
1842 | arg list |
1843 |--|
1844 | None |
1845
1846 ## Function: start_http_proxy ##
1847
1848 Start the http proxy container in docker or kube depending on running mode.
1849 | arg list |
1850 |--|
1851 | None |
1852
1853 # Description of functions in kube_proxy_api_functions.sh #
1854
1855 ## Function: use_kube_proxy_http ##
1856
1857 Use http for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
1858 | arg list |
1859 |--|
1860 | None |
1861
1862 ## Function: use_kube_proxy_https ##
1863
1864 Use https for all proxy requests. Note that this only applicable to the actual proxy request, the proxied protocol can still be http and https.
1865 | arg list |
1866 |--|
1867 | None |
1868
1869 ## Function: start_kube_proxy ##
1870
1871 Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
1872 No proxy is started if the function is called in docker mode.
1873 | arg list |
1874 |--|
1875 | None |
1876
1877 # Description of functions in mr_api_functions.sh #
1878
1879 ## Function: use_mr_http ##
1880
1881 Use http for all Dmaap calls to the MR. This is the default. The admin API is not affected. Note that this function shall be called before preparing the config for Consul.
1882 | arg list |
1883 |--|
1884 | None |
1885
1886 ## Function: use_mr_https ##
1887
1888 Use https for all Dmaap call to the MR. The admin API is not affected. Note that this function shall be called before preparing the config for Consul.
1889 | arg list |
1890 |--|
1891 | None |
1892
1893 ## Function: start_mr ##
1894
1895 Start the Message Router stub interface container in docker or kube depending on start mode
1896 | arg list |
1897 |--|
1898 | None |
1899
1900 ## Function: mr_equal ##
1901
1902 Tests if a variable value in the Message Router (MR) simulator is equal to a target value.
1903 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1904 With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value becomes equal to the target value or not.
1905 See the 'mrstub' dir for more details.
1906 | arg list |
1907 |--|
1908 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1909
1910 | parameter | description |
1911 | --------- | ----------- |
1912 | `<variable-name>` | Variable name in the MR  |
1913 | `<target-value>` | Target value for the variable  |
1914 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1915
1916 ## Function: mr_greater ##
1917
1918 Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
1919 Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than the target or not.
1920 With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value becomes greater than the target value or not.
1921 See the 'mrstub' dir for more details.
1922 | arg list |
1923 |--|
1924 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1925
1926 | parameter | description |
1927 | --------- | ----------- |
1928 | `<variable-name>` | Variable name in the MR  |
1929 | `<target-value>` | Target value for the variable  |
1930 | `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value  |
1931
1932 ## Function: mr_read ##
1933
1934 Reads the value of a variable in the Message Router (MR) simulator. The value is intended to be passed to a env variable in the test script.
1935 See the 'mrstub' dir for more details.
1936 | arg list |
1937 |--|
1938 | `<variable-name>` |
1939
1940 | parameter | description |
1941 | --------- | ----------- |
1942 | `<variable-name>` | Variable name in the MR  |
1943
1944 ## Function: mr_print ##
1945
1946 Prints the value of a variable in the Message Router (MR) simulator.
1947 See the 'mrstub' dir for more details.
1948 | arg list |
1949 |--|
1950 | `<variable-name>` |
1951
1952 | parameter | description |
1953 | --------- | ----------- |
1954 | `<variable-name>` | Variable name in the MR  |
1955
1956 # Description of functions in prodstub_api_functions.sh #
1957
1958 ## Function: use_prod_stub_http ##
1959
1960 Use http for the API.  The admin API is not affected. This is the default protocol.
1961 | arg list |
1962 |--|
1963 | None |
1964
1965 ## Function: use_prod_stub_https ##
1966
1967 Use https for the API. The admin API is not affected.
1968 | arg list |
1969 |--|
1970 | None |
1971
1972 ## Function: start_prod_stub ##
1973
1974 Start the Producer stub container in docker or kube depending on start mode
1975 | arg list |
1976 |--|
1977 | None |
1978
1979 ## Function: prodstub_arm_producer() ##
1980
1981 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
1982
1983 | arg list |
1984 |--|
1985 | `<response-code> <producer-id> [<forced_response_code>]` |
1986
1987 | parameter | description |
1988 | --------- | ----------- |
1989 | `<response-code>` | Expected http response code |
1990 | `<producer-id>` | Id of the producer  |
1991 | `<forced_response_code>` | Forced response code for the producer callback url |
1992
1993 ## Function: prodstub_arm_job_create() ##
1994
1995 Preconfigure the prodstub with a job or update an existing job. Optional create/update job response code, if not given the response code will be set to 200/201 depending on if the job has been previously created or not.
1996
1997 | arg list |
1998 |--|
1999 | `<response-code> <job-id> [<forced_response_code>]` |
2000
2001 | parameter | description |
2002 | --------- | ----------- |
2003 | `<response-code>` | Expected http response code |
2004 | `<job-id>` | Id of the job  |
2005 | `<forced_response_code>` | Forced response code for the create callback url |
2006
2007 ## Function: prodstub_arm_job_delete() ##
2008
2009 Preconfigure the prodstub with a job. Optional delete job response code, if not given the response code will be set to 204/404 depending on if the job exists or not.
2010
2011 | arg list |
2012 |--|
2013 | `<response-code> <job-id> [<forced_response_code>]` |
2014
2015 | parameter | description |
2016 | --------- | ----------- |
2017 | `<response-code>` | Expected http response code |
2018 | `<job-id>` | Id of the job  |
2019 | `<forced_response_code>` | Forced response code for the delete callback url |
2020
2021 ## Function: prodstub_arm_type() ##
2022
2023 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
2024
2025 | arg list |
2026 |--|
2027 | `<response-code> <producer-id> <type-id>` |
2028
2029 | parameter | description |
2030 | --------- | ----------- |
2031 | `<response-code>` | Expected http response code |
2032 | `<producer-id>` | Id of the producer  |
2033 | `<type-id>` | Id of the type  |
2034
2035 ## Function: prodstub_disarm_type() ##
2036
2037 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
2038
2039 | arg list |
2040 |--|
2041 | `<response-code> <producer-id> <type-id>` |
2042
2043 | parameter | description |
2044 | --------- | ----------- |
2045 | `<response-code>` | Expected http response code |
2046 | `<producer-id>` | Id of the producer  |
2047 | `<type-id>` | Id of the type  |
2048
2049 ## Function: prodstub_check_jobdata() ##
2050
2051 Check a job in the prodstub towards the list of provided parameters.
2052
2053 | arg list |
2054 |--|
2055 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2056
2057 | parameter | description |
2058 | --------- | ----------- |
2059 | `<response-code>` | Expected http response code |
2060 | `<producer-id>` | Id of the producer  |
2061 | `<job-id>` | Id of the job  |
2062 | `<type-id>` | Id of the type  |
2063 | `<target-url>` | Target url for data delivery  |
2064 | `<job-owner>` | Id of the job owner  |
2065 | `<template-job-file>` | Path to a job template file  |
2066
2067 ## Function: prodstub_check_jobdata_2() ##
2068
2069 Check a job in the prodstub towards the list of provided parameters.
2070
2071 | arg list |
2072 |--|
2073 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2074
2075 | parameter | description |
2076 | --------- | ----------- |
2077 | `<response-code>` | Expected http response code |
2078 | `<producer-id>` | Id of the producer  |
2079 | `<job-id>` | Id of the job  |
2080 | `<type-id>` | Id of the type  |
2081 | `<target-url>` | Target url for data delivery  |
2082 | `<job-owner>` | Id of the job owner  |
2083 | `<template-job-file>` | Path to a job template file  |
2084
2085 ## Function: prodstub_check_jobdata_3() ##
2086
2087 Check a job in the prodstub towards the list of provided parameters.
2088
2089 | arg list |
2090 |--|
2091 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2092
2093 | parameter | description |
2094 | --------- | ----------- |
2095 | `<response-code>` | Expected http response code |
2096 | `<producer-id>` | Id of the producer  |
2097 | `<job-id>` | Id of the job  |
2098 | `<type-id>` | Id of the type  |
2099 | `<target-url>` | Target url for data delivery  |
2100 | `<job-owner>` | Id of the job owner  |
2101 | `<template-job-file>` | Path to a job template file  |
2102
2103 ## Function: prodstub_delete_jobdata() ##
2104
2105 Delete the job parameters, job data, for a job.
2106
2107 | arg list |
2108 |--|
2109 | `<response-code> <producer-id> <job-id>` |
2110
2111 | parameter | description |
2112 | --------- | ----------- |
2113 | `<response-code>` | Expected http response code |
2114 | `<producer-id>` | Id of the producer  |
2115 | `<job-id>` | Id of the job  |
2116
2117 ## Function: prodstub_equal ##
2118
2119 Tests if a variable value in the prodstub is equal to a target value.
2120 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2121 With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value becomes equal to the target value or not.
2122
2123 | arg list |
2124 |--|
2125 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2126
2127 | parameter | description |
2128 | --------- | ----------- |
2129 | `<variable-name>` | Variable name in the prostub  |
2130 | `<target-value>` | Target value for the variable  |
2131 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
2132
2133 # Description of functions in rapp_catalogue_api_function.sh #
2134
2135 ## Function: use_rapp_catalogue_http ##
2136
2137 Use http for the API. This is the default protocol.
2138 | arg list |
2139 |--|
2140 | None |
2141
2142 ## Function: use_rapp_catalogue_https ##
2143
2144 Use https for the API.
2145 | arg list |
2146 |--|
2147 | None |
2148
2149 ## Function: start_rapp_catalogue ##
2150
2151 Start the rapp catalogue container in docker or kube depending on start mode
2152 | arg list |
2153 |--|
2154 | None |
2155
2156 ## Function: rc_equal ##
2157
2158 Tests if a variable value in the RAPP Catalogue is equal to a target value.
2159 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2160 With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value becomes equal to the target value or not.
2161 See the 'cr' dir for more details.
2162 | arg list |
2163 |--|
2164 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2165
2166 | parameter | description |
2167 | --------- | ----------- |
2168 | `<variable-name>` | Variable name in the RC  |
2169 | `<target-value>` | Target value for the variable  |
2170 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
2171
2172 ## Function: rapp_cat_api_get_services() ##
2173
2174 Check all registered services.
2175
2176 | arg list |
2177 |--|
2178 | `<response-code> [(<service-id> <version> <display-name> <description>)+ \| EMPTY ]` |
2179
2180 | parameter | description |
2181 | --------- | ----------- |
2182 | `<response-code>` | Expected http response code |
2183 | `<service-id>` | Id of the service  |
2184 | `<version>` | Version of the service  |
2185 | `<display-name>` | Dislay name of the service  |
2186 | `<description>` | Description of the service  |
2187 | `EMPTY` | Indicator for an empty list  |
2188
2189 ## Function: rapp_cat_api_put_service() ##
2190
2191 Register a services.
2192
2193 | arg list |
2194 |--|
2195 | `<response-code> <service-id> <version> <display-name> <description>` |
2196
2197 | parameter | description |
2198 | --------- | ----------- |
2199 | `<response-code>` | Expected http response code |
2200 | `<service-id>` | Id of the service  |
2201 | `<version>` | Version of the service  |
2202 | `<display-name>` | Dislay name of the service  |
2203 | `<description>` | Description of the service  |
2204
2205 ## Function: rapp_cat_api_get_service() ##
2206
2207 Check a registered service.
2208
2209 | arg list |
2210 |--|
2211 | `<response-code> <service-id> <version> <display-name> <description>` |
2212
2213 | parameter | description |
2214 | --------- | ----------- |
2215 | `<response-code>` | Expected http response code |
2216 | `<service-id>` | Id of the service  |
2217 | `<version>` | Version of the service  |
2218 | `<display-name>` | Dislay name of the service  |
2219 | `<description>` | Description of the service  |
2220
2221 ## Function: rapp_cat_api_delete_service() ##
2222
2223 Check a registered service.
2224
2225 | arg list |
2226 |--|
2227 | `<response-code> <service-id>` |
2228
2229 | parameter | description |
2230 | --------- | ----------- |
2231 | `<response-code>` | Expected http response code |
2232 | `<service-id>` | Id of the service  |
2233
2234 # Description of functions in ricsimulator_api_functions.sh #
2235
2236 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
2237
2238 ## Function: use_simulator_http ##
2239
2240 Use http for all API calls (A1) toward the simulator. This is the default. Admin API calls to the simulator are not affected. Note that this function shall be called before preparing the config for Consul.
2241 | arg list |
2242 |--|
2243 | None |
2244
2245 ## Function: use_simulator_https ##
2246
2247 Use https for all API calls (A1) toward the simulator. Admin API calls to the simulator are not affected. Note that this function shall be called before preparing the config for Consul.
2248 | arg list |
2249 |--|
2250 | None |
2251
2252 ## Function: start_ric_simulators ##
2253
2254 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
2255 | arg list |
2256 |--|
2257 | `ricsim_g1\|ricsim_g2\|ricsim_g3 <count> <interface-id>` |
2258
2259 | parameter | description |
2260 | --------- | ----------- |
2261 | `ricsim_g1\|ricsim_g2\|ricsim_g3` | Base name of the simulator. Each instance will have an postfix instance id added, starting on '1'. For examplle 'ricsim_g1_1', 'ricsim_g1_2' etc  |
2262 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
2263 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
2264
2265 ## Function: get_kube_sim_host ##
2266
2267 Translate ric name to kube host name.
2268 | arg list |
2269 |--|
2270 | `<ric-name>` |
2271
2272 | parameter | description |
2273 | --------- | ----------- |
2274 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
2275
2276 ## Function: generate_policy_uuid ##
2277
2278 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
2279 UUID is then automatically added to the policy id in GET/PUT/DELETE.
2280 | arg list |
2281 |--|
2282 | None |
2283
2284 ## Function: sim_equal ##
2285
2286 Tests if a variable value in the RIC simulator is equal to a target value.
2287 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2288 With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value becomes equal to the target value or not.
2289 See the 'a1-interface' repo for more details.
2290
2291 | arg list |
2292 |--|
2293 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2294
2295 | parameter | description |
2296 | --------- | ----------- |
2297 | `<variable-name>` | Variable name in the ric simulator  |
2298 | `<target-value>` | Target value for the variable  |
2299 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
2300
2301 ## Function: sim_print ##
2302
2303 Prints the value of a variable in the RIC simulator.
2304 See the 'a1-interface' repo for more details.
2305
2306 | arg list |
2307 |--|
2308 | `<variable-name>` |
2309
2310 | parameter | description |
2311 | --------- | ----------- |
2312 | `<variable-name>` | Variable name in the RIC simulator  |
2313
2314 ## Function: sim_contains_str ##
2315
2316 Tests if a variable value in the RIC simulator contains a target string.
2317 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
2318 With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value contains the target string or not.
2319 See the 'a1-interface' repo for more details.
2320
2321 | arg list |
2322 |--|
2323 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2324
2325 | parameter | description |
2326 | --------- | ----------- |
2327 | `<variable-name>` | Variable name in the ric simulator  |
2328 | `<target-value>` | Target substring for the variable  |
2329 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
2330
2331 ## Function: sim_put_policy_type ##
2332
2333 Loads a policy type to the simulator
2334
2335 | arg list |
2336 |--|
2337 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
2338
2339 | parameter | description |
2340 | --------- | ----------- |
2341 | `<response-code>` | Expected http response code |
2342 | `<ric-id>` |  Id of the ric |
2343 | `<policy-type-id>` |  Id of the policy type |
2344 | `<policy-type-file>` |  Path to the schema file of the policy type |
2345
2346 ## Function: sim_delete_policy_type ##
2347
2348 Deletes a policy type from the simulator
2349
2350 | arg list |
2351 |--|
2352 | `<response-code> <ric-id> <policy_type_id>` |
2353
2354 | parameter | description |
2355 | --------- | ----------- |
2356 | `<response-code>` | Expected http response code |
2357 | `<ric-id>` |  Id of the ric |
2358 | `<policy-type-id>` |  Id of the policy type |
2359
2360 ## Function: sim_post_delete_instances ##
2361
2362 Deletes all instances (and status), for one ric
2363
2364 | arg list |
2365 |--|
2366 | `<response-code> <ric-id>` |
2367
2368 | parameter | description |
2369 | --------- | ----------- |
2370 | `<response-code>` | Expected http response code |
2371 | `<ric-id>` |  Id of the ric |
2372
2373 ## Function: sim_post_delete_all ##
2374
2375 Deletes all types, instances (and status), for one ric
2376
2377 | arg list |
2378 |--|
2379 | `<response-code> <ric-id>` |
2380
2381 | parameter | description |
2382 | --------- | ----------- |
2383 | `<response-code>` | Expected http response code |
2384 | `<ric-id>` |  Id of the ric |
2385
2386 ## Function: sim_post_forcedresponse ##
2387
2388 Sets (or resets) response code for next (one) A1 message, for one ric.
2389 The intention is to simulate error response on the A1 interface.
2390
2391 | arg list |
2392 |--|
2393 | `<response-code> <ric-id> [<forced_response_code>]`|
2394
2395 | parameter | description |
2396 | --------- | ----------- |
2397 | `<response-code>` | Expected http response code |
2398 | `<ric-id>` |  Id of the ric |
2399 | `<forced_response_code>` |  Http response code to send |
2400
2401 ## Function: sim_post_forcedelay ##
2402
2403 Sets (or resets) A1 response delay, for one ric
2404 The intention is to delay responses on the A1 interface. Setting remains until removed.
2405
2406 | arg list |
2407 |--|
2408 | `<response-code> <ric-id> [<delay-in-seconds>]`|
2409
2410 | parameter | description |
2411 | --------- | ----------- |
2412 | `<response-code>` | Expected http response code |
2413 | `<ric-id>` |  Id of the ric |
2414 | `<delay-in-seconds>` |  Delay in seconds. If omitted, the delay is removed |
2415
2416 ## License
2417
2418 Copyright (C) 2020 Nordix Foundation. All rights reserved.
2419 Licensed under the Apache License, Version 2.0 (the "License");
2420 you may not use this file except in compliance with the License.
2421 You may obtain a copy of the License at
2422
2423      http://www.apache.org/licenses/LICENSE-2.0
2424
2425 Unless required by applicable law or agreed to in writing, software
2426 distributed under the License is distributed on an "AS IS" BASIS,
2427 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2428 See the License for the specific language governing permissions and
2429 limitations under the License.