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