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