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