Test FTC100 fails since A1-SIM update
[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 Management Service, Information Coordinator Service , A1 simulator as well as other components and simulators. The test environment supports both test with docker and kubernetes.
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 `a1pms_api_functions.sh` \
9 Contains functions for adapting towards the Policy Management Service (A1PMS) API.
10
11 `api_curl.sh` \
12 A common curl based function for the a1pms and ics apis. Also partly used for the Callback receiver and RAPP Catalogue apis.
13
14 `authsidecar_api_functions.sh` \
15 Image handling functions for the auth_token_fetch image.
16
17 `chartmus_api_functions.sh` \
18 Contains functions for managing a Chartmuseum instance.
19
20 `clean-docker.sh` \
21 Cleans all containers started by the test environment in docker.
22
23 `clean-kube.sh` \
24 Cleans all services, deployments, pods, replica set etc started by the test environment in kubernetes.
25
26 `clean-kube_ns.sh` \
27 Cleans all namespaces created by the test environment in kubernetes.
28
29 `compare_json.py` \
30 A python script to compare two json objects for equality. Note that the comparison 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 'don't care'.
31
32 `count_json_elements.py` \
33 A python script calculate the length of json array or size of a json dictionary'.
34
35 `count_json_elements.py` \
36 A python script returning the number of items in a json array.
37
38 `cp_api_function.sh` \
39 Contains functions for managing the Control Panel.
40
41 `cr_api_functions.sh` \
42 Contains functions for adapting towards the Callback receiver for checking received callback events.
43
44 `create_policies_process.py` \
45 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.
46
47 `create_rics_json.py` \
48 A python script to create a json file from a formatted string of ric info. Helper for the test environment.
49
50 `delete_policies_process.py` \
51 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.
52
53 `dmaapadp_api_function.sh`
54 Contains functions for managing the Dmaap Adapter.
55
56 `dmaapmed_api_function.sh`
57 Contains functions for managing the Dmaap Mediator Service.
58
59 `dmaapmr_api_function.sh`
60 All functions are implemented in `mr_api_functions.sh`.
61
62 `do_curl_function.sh`
63 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)
64
65 `extract_sdnc_reply.py` \
66 A python script to extract the information from an sdnc (A1 Controller) reply json. Helper for the test environment.
67
68 `format_endpoint_stats.sh` \
69 This script formats API statistics into a test report - data is collected only if the flag `--endpoint-stats` is given to the test script .
70
71 `genstat.sh` \
72 This script collects container statistics to a file. Works both in docker and kubernetes (only for docker runtime).
73
74 `helmmanager_api_functions.sh` \
75 Contains functions for managing and testing of the Helm Manager.
76
77 `http_proxy_api_functions.sh` \
78 Contains functions for managing the Http Proxy.
79
80 `ics_api_functions.sh` \
81 Contains functions for adapting towards the Information Coordinator Service API.
82
83 `istio_api_functions.sh` \
84 Contains functions for istio configurations.
85
86 `kafkapc_api_functions.sh` \
87 Contains functions for managing the kafka producer/consumer. Kafka is started by the dmaap message router component.
88
89 `keycloak_api_functions.sh` \
90 Contains functions for keycloak configuration.
91
92 `kube_proxy_api_functions.sh` \
93 Contains functions for managing the Kube Proxy - to gain access to all services pod inside a kube cluster or all containers in a private docker network.
94
95 `localhelm_api_functions.sh` \
96 Contains functions for helm access on localhost.
97
98 `mr_api_functions.sh` \
99 Contains functions for managing the MR Stub and the Dmaap Message Router
100
101 `ngw_api_functions.sh` \
102 Contains functions for managing the Non-RT RIC Gateway
103
104 `prodstub_api_functions.sh` \
105 Contains functions for adapting towards the Producer stub interface - simulates a producer.
106
107 `pvccleaner_api_functions.sh` \
108 Contains functions for managing the PVC Cleaner (used for reset mounted volumes in kubernetes).
109
110 `rc_api_functions.sh` \
111 Contains functions for adapting towards the RAPP Catalogue.
112
113 `ricsim_api_functions.sh` \
114 Contains functions for adapting towards the RIC (A1) simulator admin API.
115
116 `ricmediatorsim_api_functions.sh` \
117 Contains functions for adapting towards the ricmediator simulator (A1) API.
118
119 `sdnc_api_functions.sh` \
120 Contains functions for adaping towards the SDNC (used as an A1 controller).
121
122 `test_env*.sh` \
123 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.
124 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'.
125
126 `testcase_common.sh` \
127 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 environment variables needed by this script as well as the script adapting to the APIs.
128 The included functions are described in detail further below.
129
130 `testengine_config.sh` \
131 Configuration file to setup the applications (components and simulators) the test environment handles.
132
133 `testsuite_common.sh` \
134 Common functions for running two or more auto test scripts as a suite.
135
136 ## Integration of a new applicaton ##
137
138 Integration a new application to the test environment involves the following steps.
139
140 * Choose a short name for the application. Should be a uppercase name. For example, the NonRTRIC Gateway has NGW as short name.
141 This short name shall be added to the testengine_config.sh. See that file for detailed instructions.
142
143 Depending if the image is a locally built simulator image or an official image, the following env vara may need to be updated with the app short name: `PROJECT_IMAGES_APP_NAMES  ORAN_IMAGES_APP_NAMES  ORAN_IMAGES_APP_NAMES`.
144
145 * Create a file in this directory using the pattern `<application-name>_api_functions.sh`.
146 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 functions with kube prefix does not need to be implemented.
147
148 | Function |
149 |--|
150 | __<app-short_name>_imagesetup |
151 | __<app-short_name>_imagepull |
152 | __<app-short_name>_imagebuild |
153 | __<app-short_name>_image_data |
154 | __<app-short_name>_kube_scale_zero |
155 | __<app-short_name>_kube_scale_zero_and_wait |
156 | __<app-short_name>_kube_delete_all |
157 | __<app-short_name>_store_docker_logs |
158 | __<app-short_name>_initial_setup |
159 | __<app-short_name>_statistics_setup |
160 | __<app-short_name>_test_requirements |
161
162 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.
163
164 * 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 between direct rest calls or rest calls via message router.
165
166 * 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.
167
168 All docker-compose files and all kubernetes resource files need to defined special labels. These labels are used by the test engine to identify containers and resources started and used by the test engine.
169
170 | Label for docker compose | Description |
171 |--|--|
172 | nrttest_app | shall contain the application short name |
173 | nrttest_dp  | shall be set by a variable containing the display name, a short textual description of the applicaion |
174
175 | Label for kubernetes resource | Description |
176 |--|--|
177 | autotest | shall contain the application short name |
178
179 * 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>`.
180 In addition, all other needed environment shall also be defined in these file.
181
182 # Description of functions in testcase_common.sh #
183
184 ## Script args ##
185
186 The script can be started with these arguments
187
188 | arg list |
189 |--|
190 | `remote\|remote-remove `
191 ` docker\|kube `
192 ` --env-file <environment-filename> `
193 ` [release] `
194 ` [auto-clean]`
195 ` [--stop-at-error]`
196 ` [--ricsim-prefix <prefix> ]`
197 ` [--use-local-image <app-nam>+]`
198 ` [--use-snapshot-image <app-nam>+]`
199 ` [--use-staging-image <app-nam>+]`
200 ` [--use-release-image <app-nam>+]`
201 ` [--use-external-image <app-nam>+]`
202 ` [--image-repo <repo-address>]`
203 ` [--repo-policy local\|remote]`
204 ` [--cluster-timeout <timeout-in-seconds>]`
205 ` [--print-stats]`
206 ` [--override <override-environment-filename>]`
207 ` [--pre-clean]`
208 ` [--gen-stats]`
209 ` [--delete-namespaces]`
210 ` [--delete-containers]`
211 ` [--endpoint-stats]`
212 ` [--kubeconfig <config-file>]`
213 ` [--host-path-dir <local-host-dir>]`
214 ` [--kubecontext <context-name>]`
215 ` [--docker-host <docker-host-url>]`
216 ` [--docker-proxy <host-or-ip>] `
217 ` ["--target-platform <platform> ]` |
218
219 | parameter | description |
220 |-|-|
221 | `remote` | Use images from remote repositories. Can be overridden for individual images using the '--use_xxx' flags |
222 | `remote-remove` | Same as 'remote' but will also try to pull fresh images from remote repositories |
223 | `docker` | Use docker environment for test |
224 | `kube` | Use kubernetes environment for test. Requires access to a local or remote kubernetes cluster (or or more nodes). For example docker desktop, minikube, external kubernetes cluster, google cloud etc |
225 | `--env-file` | The script will use the supplied file to read environment variables from |
226 | `release` | If this flag is given the script will use release version of the images |
227 | `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 |
228 | `--stop-at-error` | The script will stop when the first failed test or configuration |
229 | `--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). |
230 | `--use-local-image` | The script will use local images for the supplied apps, space separated list of app short names |
231 | `--use-snapshot-image` | The script will use images from the nexus snapshot repo for the supplied apps, space separated list of app short names |
232 | `--use-staging-image` | The script will use images from the nexus staging repo for the supplied apps, space separated list of app short names |
233 | `--use-release-image` | The script will use images from the nexus release repo for the supplied apps, space separated list of app short names |
234 | `--use-external-image` | The script will use images from an external repo for the supplied apps, space separated list of app short names |
235 | `--image-repo` |  Url to optional image repo. Only locally built images will be re-tagged and pushed to this repo |
236 | `--repo-policy` |  Policy controlling which images to re-tag and push to image repo in param --image-repo. Can be set to 'local' (push only locally built images) or 'remote' (push locally built images and images from nexus repo). Default is 'local' |
237 | `--cluster-timeout` |  Optional timeout for cluster where it takes time to obtain external ip/host-name. Timeout in seconds |
238 | `--print-stats` |  Prints the number of tests, failed tests, failed configuration and deviations after each individual test or config |
239 | `--override <file>` |  Override setting from the file supplied by --env-file |
240 | `--pre-clean` |  Clean kube resources when running docker and vice versa |
241 | `--gen-stats`  | Collect container/pod runtime statistics |
242 | `--delete-namespaces`  | Delete kubernetes namespaces before starting tests - but only those created by the test scripts. Kube mode only. Ignored if running with pre-started apps. |
243 | `--delete-containers`  | Delete docker containers before starting tests - but only those created by the test scripts. Docker mode only. |
244 | `--endpoint-stats`  | Collect http endpoint statistics |
245 | `--kubeconfig`  | Kubernetes config file for kubectl, when running with non local kubernetes |
246 | `--host-path-dir`  | Path for storing persistent data in kubernetes. Must be available on all nodes. Default is `/tmp` |
247 | `--kubecontext`  | Kubernetes context name for kubectl, when running with non local kubernetes  |
248 | `--docker-host`  | Url to docker host, host and port. For non local docker |
249 | `--docker-proxy`  | Host or IP of the docker instance, for non local docker |
250 | `--target-platform` | Build and pull images for this target platform |
251
252
253 | `help` | Print this info along with the test script description and the list of app short names supported |
254
255 ## Function: setup_testenvironment ##
256
257 Main function to setup the test environment before any tests are started.
258 Must be called right after sourcing all component scripts.
259 | arg list |
260 |--|
261 | None |
262
263 ## Function: print_result ##
264
265 Print a test report of an auto-test script.
266 | arg list |
267 |--|
268 | None |
269
270 ## Function: start_timer ##
271
272 Start a timer for time measurement. Only one timer can be running.
273 | arg list |
274 |--|
275 | `<timer-message-to-print>` |
276 | None - but any args will be printed (It is good practice to use same args for this function as for the `print_timer`) |
277
278 ## Function: print_timer ##
279
280 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 arg to 'start_timer' will also be printed in the test report.
281 | arg list |
282 |--|
283 | None |
284
285 ## Function: deviation ##
286
287 Mark a test as a deviation from the requirements. The list of deviations will be printed in the test report.
288 | arg list |
289 |--|
290 | `<deviation-message-to-print>` |
291
292 | parameter | description |
293 | --------- | ----------- |
294 | `<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 |
295
296 ## Function: clean_environment ##
297
298 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).
299 | arg list |
300 |--|
301 | None |
302
303 ## Function: auto_clean_containers ##
304
305 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.
306 | arg list |
307 |--|
308 | None |
309
310 ## Function: sleep_wait ##
311
312 Make the script sleep for a number of seconds.
313 | arg list |
314 |--|
315 | `<sleep-time-in-sec> [<any-text-in-quotes-to-be-printed>]` |
316
317 | parameter | description |
318 | --------- | ----------- |
319 | `<sleep-time-in-sec>` | Number of seconds to sleep |
320 | `<any-text-in-quotes-to-be-printed>` | Optional. The text will be printed, if present |
321
322 ## Function: store_logs ##
323
324 Take a snap-shot of all logs for all running containers/pods 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.
325 | arg list |
326 |--|
327 | `<logfile-prefix>` |
328
329 | parameter | description |
330 | --------- | ----------- |
331 | `<logfile-prefix>` | Log file prefix  |
332
333 # Description of functions in testsuite_common.sh #
334
335 ## Function: suite_setup ##
336
337 Sets up the test suite and prints out a heading.
338 | arg list |
339 |--|
340 | None |
341
342 ## suite_complete ##
343
344 Print out the overall result of the executed test cases.
345 | arg list |
346 |--|
347 | None |
348
349 # Description of functions in a1pms_api_functions.sh #
350
351 ## General ##
352
353 Both A1PMS version 1 and 2 are supported. The version is controlled by the env variable `$A1PMS_VERSION` set in the test env file.
354 For api function in version 2, an url prefix is added if configured.
355
356 ## Function: use_a1pms_rest_http ##
357
358 Use http for all API calls to the A1PMS. This is the default.
359 | arg list |
360 |--|
361 | None |
362
363 ## Function: use_a1pms_rest_https ##
364
365 Use https for all API calls to the A1PMS.
366 | arg list |
367 |--|
368 | None |
369
370 ## Function: use_a1pms_dmaap_http ##
371
372 Send and receive all API calls to the A1PMS over Dmaap via the MR over http.
373 | arg list |
374 |--|
375 | None |
376
377 ## Function: use_a1pms_dmaap_https ##
378
379 Send and receive all API calls to the A1PMS over Dmaap via the MR over https.
380 | arg list |
381 |--|
382 | None |
383
384 ## Function: start_a1pms ##
385
386 Start the A1PMS container or corresponding kube resources depending on docker/kube mode.
387 | arg list |
388 |--|
389 | `<logfile-prefix>` |
390 | (docker) `PROXY\|NOPROXY <config-file>` |
391 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
392
393 | parameter | description |
394 | --------- | ----------- |
395 | `PROXY` | Configure with http proxy, if proxy is started  |
396 | `NOPROXY` | Configure without http proxy  |
397 | `<config-file>`| Path to application.yaml  |
398 | `<data-file>` | Optional path to application_configuration.json  |
399
400 ## Function: stop_a1pms ##
401
402 Stop the a1pms container (docker) or scale it to zero (kubernetes).
403 | arg list |
404 |--|
405 |  None |
406
407 ## Function: start_stopped_a1pms ##
408
409 Start a previously stopped a1pms container (docker) or scale it to 1 (kubernetes).
410 | arg list |
411 |--|
412 |  None |
413
414 ## Function: prepare_a1pms_config ##
415
416 Function to prepare an a1pms 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')
417 | arg list |
418 |--|
419 | `SDNC|NOSDNC <output-file>` |
420
421 | parameter | description |
422 | --------- | ----------- |
423 | `SDNC` | Configure with controller |
424 | `NOSDNC` | Configure without controller |
425 | `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'a1pms_load_config'  |
426
427 ## Function: a1pms_load_config ##
428
429 Load the config into a config map (kubernetes only).
430 | arg list |
431 |--|
432 |  `<data-file>` |
433
434 | parameter | description |
435 | --------- | ----------- |
436 |  `<data-file>` | Path to application_configuration.json  |
437
438 ## Function: set_a1pms_debug ##
439
440 Configure the A1PMS log on debug level. The A1PMS must be running.
441 | arg list |
442 |--|
443 | None |
444
445 ## Function: set_a1pms_trace ##
446
447 Configure the A1PMS log on trace level. The A1PMS must be running.
448 | arg list |
449 |--|
450 | None |
451
452 ## Function: use_a1pms_retries ##
453
454 Configure the A1PMS to make up-to 5 retries if an API call returns any of the specified http return codes.
455 | arg list |
456 |--|
457 | `[<response-code>]*` |
458
459 ## Function: check_a1pms_logs ##
460
461 Check the A1PMS log for any warnings and errors and print the count of each.
462 | arg list |
463 |--|
464 | None |
465
466 ## Function: a1pms_equal ##
467
468 Tests if the array length of a json array in the A1PMS simulator is equal to a target value.
469 Without the timeout, the test sets pass or fail immediately depending on if the array length is equal to the target or not.
470 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.
471 See the 'cr' dir for more details.
472
473 | arg list |
474 |--|
475 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
476
477 | parameter | description |
478 | --------- | ----------- |
479 | `<variable-name>` | Relative url. Example 'json:policy_types' - checks the json array length of the url /policy_types  |
480 | `<target-value>` | Target value for the length  |
481 | `<timeout-in-sec>` | Max time to wait for the length to reach the target value  |
482
483 ## Function: a1pms_api_get_policies ##
484
485 Test of GET '/policies' or V2 GET '/v2/policy-instances' and optional check of the array of returned policies.
486 To test the response code only, provide the response code parameter as well as the following three parameters.
487 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.
488
489 | arg list |
490 |--|
491 | `<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>]*]` |
492
493 | arg list V2 |
494 |--|
495 | `<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>]*]` |
496
497 | parameter | description |
498 | --------- | ----------- |
499 | `<response-code>` | Expected http response code |
500 | `<ric-id>` | Id of the ric  |
501 | `NORIC` | Indicator that no ric is provided  |
502 | `<service-id>` | Id of the service  |
503 | `NOSERVICE` | Indicator that no service id is provided  |
504 | `<policy-type-id>` |  Id of the policy type |
505 | `NOTYPE` | Indicator that no type id is provided  |
506 | `NOID` |  Indicator that no policy id is provided - indicate empty list of policies|
507 | `<policy-id>` |  Id of the policy |
508 | `EMPTY` |  Indicate for the special empty policy type |
509 | `transient` |  Transient, true or false |
510 | `notification-url` |  Url for notifications |
511 | `<template-file>` |  Path to the template file for the policy (same template used when creating the policy) |
512
513 ## Function: a1pms_api_get_policy ##
514
515 Test of GET '/policy' or V2 GET '/v2/policies/{policy_id}' and optional check of the returned json payload.
516 To test the the response code only, provide the expected response code and policy id.
517 To test the contents of the returned json payload, add a path to the template file used when creating the policy.
518
519 | arg list |
520 |--|
521 | `<response-code>  <policy-id> [<template-file>]` |
522
523 | arg list V2|
524 |--|
525 | `<response-code> <policy-id> [ <template-file> <service-name> <ric-id> <policytype-id>\|NOTYPE <transient> <notification-url>\|NOURL ]` |
526
527 | parameter | description |
528 | --------- | ----------- |
529 | `<response-code>` | Expected http response code |
530 | `<policy-id>` |  Id of the policy |
531 | `<template-file>` |  Path to the template file for the policy (same template used when creating the policy) |
532 | `<service-id>` | Id of the service  |
533 | `<ric-id>` | Id of the ric  |
534 | `<policy-type-id>` |  Id of the policy type |
535 | `NOTYPE` | Indicator that no type id is provided  |
536 | `transient` |  Transient, true or false |
537 | `notification-url` |  Url for notifications |
538
539 ## Function: a1pms_api_put_policy ##
540
541 Test of PUT '/policy' or V2 PUT '/policies'.
542 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).
543
544 | arg list |
545 |--|
546 | `<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]` |
547
548 | arg list V2 |
549 |--|
550 | `<response-code> <service-name> <ric-id> <policytype-id>\|NOTYPE <policy-id> <transient>\|NOTRANSIENT <notification-url>\|NOURL <template-file> [<count>]` |
551
552 | parameter | description |
553 | --------- | ----------- |
554 | `<response-code>` | Expected http response code |
555 | `<service-id>` | Id of the service  |
556 | `<ric-id>` | Id of the ric  |
557 | `<policy-type-id>` |  Id of the policy type |
558 | `<policy-id>` |  Id of the policy. This value shall be a numeric value if more than one policy shall be created |
559 | `transient>` |  Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provided) |
560 | `notification-url` |  Url for notifications |
561 |`NOURL`| Indicator for no url |
562 | `<template-file>` |  Path to the template file for the policy |
563 | `<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 |
564
565 ## Function: a1pms_api_put_policy_batch ##
566
567 This tests the same as function 'a1pms_api_put_policy' except that all put requests are sent to dmaap in one go and then the responses are polled one by one.
568 If the a1pms api is not configured to use dmaap (see 'use_a1pms_dmaap', 'use_a1pms_rest_http' and 'use_a1pms_rest_https'), an error message is printed.
569 For arg list and parameters, see 'a1pms_api_put_policy'.
570
571 ## Function: a1pms_api_put_policy_parallel ##
572
573 This tests the same as function 'a1pms_api_put_policy' except that the policy created is spread out over a number of processes and it only uses the a1pms 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' should not be 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.
574
575 | arg list |
576 |--|
577 | `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <template-file> <count-per-ric> <number-of-threads>`
578
579 | arg list |
580 |--|
581 | `<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>`
582
583 | parameter | description |
584 | --------- | ----------- |
585 | `<response-code>` | Expected http response code |
586 | `<service-id>` | Id of the service  |
587 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing  |
588 | `<number-of-rics>` | The number of rics, assuming the first index is '1'. The index is added to the 'ric-id-base' id  |
589 | `<policy-type-id>` |  Id of the policy type |
590 | `<policy-start-id>` |  Id of the policy. This value shall be a numeric value and will be the id of the first policy |
591 | `transient>` |  Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provide) |
592 | `notification-url` |  Url for notifications |
593 | `<template-file>` |  Path to the template file for the policy |
594 | `<count-per-ric>` |  Number of policies per ric |
595 | `<number-of-threads>` |  Number of threads (processes) to run in parallel |
596
597 ## Function: a1pms_api_delete_policy ##
598
599 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.
600
601 | arg list |
602 |--|
603 | `<response-code> <policy-id> [<count>]`
604
605 | parameter | description |
606 | --------- | ----------- |
607 | `<response-code>` | Expected http response code |
608 | `<policy-id>` |  Id of the policy |
609 | `<count>` |  An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
610
611 ## Function: a1pms_api_delete_policy_batch ##
612
613 This tests the same as function 'a1pms_api_delete_policy' except that all delete requests are sent to dmaap in one go and then the responses are polled one by one.
614 If the a1pms api is not configured to used dmaap (see 'use_a1pms_dmaap', 'use_a1pms_rest_http' and 'use_a1pms_rest_https'), an error message is printed.
615 For arg list and parameters, see 'a1pms_api_delete_policy'.
616
617 ## Function: a1pms_api_delete_policy_parallel ##
618
619 This tests the same as function 'a1pms_api_delete_policy' except that the policy deleted is spread out over a number of processes and it only uses the a1pms 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.
620
621 | arg list |
622 |--|
623 | `<response-code> <ric-id-base> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>`
624
625 | parameter | description |
626 | --------- | ----------- |
627 | `<response-code>` | Expected http response code |
628 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing  |
629 | `<number-of-rics>` | The number of rics, assuming the first index is '1'  |
630 | `<policy-start-id>` |  Id of the policy. This value shall be a numeric value and will be the id of the first policy |
631 | `<count-per-ric>` |  Number of policies per ric |
632 | `<number-of-threads>` |  Number of threads (processes) to run in parallel |
633
634 ## Function: a1pms_api_get_policy_ids ##
635
636 Test of GET '/policy_ids' or V2 GET '/v2/policies'.
637 To test response code only, provide the response code parameter as well as the following three parameters.
638 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.
639
640 | arg list |
641 |--|
642 | `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <type-id>\|NOTYPE ([<policy-instance-id]*\|NOID)` |
643
644 | parameter | description |
645 | --------- | ----------- |
646 | `<response-code>` | Expected http response code |
647 | `<ric-id>` | Id of the ric  |
648 | `NORIC` | Indicator that no ric is provided  |
649 | `<service-id>` | Id of the service  |
650 | `NOSERVICE` | Indicator that no service id is provided  |
651 | `type-id>` |  Id of the policy type |
652 | `NOTYPE` | Indicator that no type id is provided  |
653 | `NOID` |  Indicator that no policy id is provided - indicate empty list of policies|
654 | `<policy-instance-id>` |  Id of the policy |
655
656 ## Function: a1pms_api_get_policy_schema ##
657
658 Test of V2 GET '/v2/policy-types/{policyTypeId}' and optional check of the returned json schema.
659 To test the response code only, provide the expected response code and policy type id.
660 To test the contents of the returned json schema, add a path to a schema file to compare with.
661
662 | arg list |
663 |--|
664 | `<response-code> <policy-type-id> [<schema-file>]` |
665
666 | parameter | description |
667 | --------- | ----------- |
668 | `<response-code>` | Expected http response code |
669 | `<policy-type-id>` |  Id of the policy type |
670 | `<schema-file>` |  Path to the schema file for the policy type |
671
672 ## Function: a1pms_api_get_policy_schema ##
673
674 Test of GET '/policy_schema' and optional check of the returned json schema.
675 To test the response code only, provide the expected response code and policy type id.
676 To test the contents of the returned json schema, add a path to a schema file to compare with.
677
678 | arg list |
679 |--|
680 | `<response-code> <policy-type-id> [<schema-file>]` |
681
682 | parameter | description |
683 | --------- | ----------- |
684 | `<response-code>` | Expected http response code |
685 | `<policy-type-id>` |  Id of the policy type |
686 | `<schema-file>` |  Path to the schema file for the policy type |
687
688 ## Function: a1pms_api_get_policy_schemas ##
689
690 Test of GET '/policy_schemas' and optional check of the returned json schemas.
691 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
692 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)
693
694 | arg list |
695 |--|
696 | `<response-code>  <ric-id>\|NORIC [<schema-file>\|NOFILE]*` |
697
698 | parameter | description |
699 | --------- | ----------- |
700 | `<response-code>` | Expected http response code |
701 | `<ric-id>` |  Id of the ric |
702 | `NORIC` |  No ric id given |
703 | `<schema-file>` |  Path to the schema file for the policy type |
704 | `NOFILE` |  Indicate the template for an empty type |
705
706 ## Function: a1pms_api_get_policy_status ##
707
708 Test of GET '/policy_status' or V2 GET '/policies/{policy_id}/status'.
709
710 | arg list |
711 |--|
712 | `<response-code> <policy-id> (STD\|STD2 <enforce-status>\|EMPTY [<reason>\|EMPTY])\|(OSC <instance-status> <has-been-deleted>)` |
713
714 | parameter | description |
715 | --------- | ----------- |
716 | `<response-code>` | Expected http response code |
717 | `<policy-id>` |  Id of the policy |
718 | `STD` |  Indicator of status of Standarized A1 |
719 | `STD2` |  Indicator of status of Standarized A1 version 2 |
720 | `<enforce-status>` |  Enforcement status |
721 | `<reason>` |  Optional reason |
722 | `EMPTY` |  Indicator of empty string status or reason |
723 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
724 | `<instance-status>` |  Instance status |
725 | `<has-been-deleted>` |  Deleted status, true or false |
726
727 ## Function: a1pms_api_get_policy_types ##
728
729 Test of GET '/policy_types' or  V2 GET '/v2/policy-types' and optional check of the returned ids.
730 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
731 To test the contents of the returned json payload, add the list of expected policy type id (or 'EMPTY' for the '{}' type)
732
733 | arg list |
734 |--|
735 | `<response-code> [<ric-id>\|NORIC [<policy-type-id>\|EMPTY [<policy-type-id>]*]]` |
736
737 | parameter | description |
738 | --------- | ----------- |
739 | `<response-code>` | Expected http response code |
740 | `<ric-id>` |  Id of the ric |
741 | `NORIC` |  No ric id given |
742 | `<policy-type-id>` |  Id of the policy type |
743 | `EMPTY` |  Indicate the empty type |
744
745 ## Function: a1pms_api_get_status ##
746
747 Test of GET /status or V2 GET /status
748
749 | arg list |
750 |--|
751 | `<response-code>` |
752
753 | parameter | description |
754 | --------- | ----------- |
755 | `<response-code>` | Expected http response code |
756
757 ## Function: a1pms_api_get_ric ##
758
759 Test of GET '/ric' or V2 GET '/v2/rics/ric'
760 To test the response code only, provide the expected response code and managed element id.
761 To test the returned ric id, provide the expected ric id.
762
763 | arg list |
764 |--|
765 | `<reponse-code> <managed-element-id> [<ric-id>]` |
766
767 | arg list V2 |
768 |--|
769 | `<reponse-code> <management-element-id>\|NOME <ric-id>\|<NORIC> [<string-of-ricinfo>]` |
770
771 | parameter | description |
772 | --------- | ----------- |
773 | `<response-code>` | Expected http response code |
774 | `<managed-element-id>` |  Id of the managed element |
775 | `NOME` |  Indicator for no ME |
776 | `ric-id` |  Id of the ric |
777 | `NORIC` |  Indicator no RIC |
778 | `string-of-ricinfo` |  String of ric info |
779
780 ## Function: a1pms_api_get_rics ##
781
782 Test of GET '/rics' or V2 GET '/v2/rics' and optional check of the returned json payload (ricinfo).
783 To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
784 To test also the returned payload, add the formatted string of info in the returned payload.
785 Format of ricinfo: <br>`<ric-id>:<list-of-mes>:<list-of-policy-type-ids>`<br>
786 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_........."`
787
788 | arg list |
789 |--|
790 | `<reponse-code> <policy-type-id>\|NOTYPE [<space-separate-string-of-ricinfo>]` |
791
792 | parameter | description |
793 | --------- | ----------- |
794 | `<response-code>` | Expected http response code |
795 | `<policy-type-id>` |  Policy type id of the ric |
796 | `NOTYPE>` |  No type given |
797 | `<space-separate-string-of-ricinfo>` |  A space separated string of ric info - needs to be quoted |
798
799 ## Function: a1pms_api_put_service ##
800
801 Test of PUT '/service' or V2 PUT '/service'.
802 | arg list |
803 |--|
804 | `<response-code>  <service-name> <keepalive-timeout> <callbackurl>` |
805
806 | parameter | description |
807 | --------- | ----------- |
808 | `<response-code>` | Expected http response code |
809 | `<service-name>` |  Service name |
810 | `<keepalive-timeout>` |  Timeout value |
811 | `<callbackurl>` |  Callback url |
812
813 ## Function: a1pms_api_get_services ##
814
815 Test of GET '/service' or V2 GET '/v2/services' and optional check of the returned json payload.
816 To test only the response code, omit all parameters except the expected response code.
817 To test the returned json, provide the parameters after the response code.
818
819 | arg list |
820 |--|
821 | `<response-code> [ (<query-service-name> <target-service-name> <keepalive-timeout> <callbackurl>) \| (NOSERVICE <target-service-name> <keepalive-timeout> <callbackurl> [<target-service-name> <keepalive-timeout> <callbackurl>]* )]` |
822
823 | parameter | description |
824 | --------- | ----------- |
825 | `<response-code>` | Expected http response code |
826 | `<query-service-name>` |  Service name for the query |
827 | `<target-service-name>` |  Target service name|
828 | `<keepalive-timeout>` |  Timeout value |
829 | `<callbackurl>` |  Callback url |
830 | `NOSERVICE` |  Indicator of no target service name |
831
832 ## Function: a1pms_api_get_service_ids ##
833
834 Test of GET '/services' or V2 GET /'v2/services'. Only check of service ids.
835
836 | arg list |
837 |--|
838 | `<response-code> [<service-name>]*` |
839
840 | parameter | description |
841 | --------- | ----------- |
842 | `<response-code>` | Expected http response code |
843 | `<service-name>` |  Service name |
844
845 ## Function: a1pms_api_delete_services ##
846
847 Test of DELETE '/services' or V2 DELETE '/v2/services/{serviceId}'
848
849 | arg list |
850 |--|
851 | `<response-code> [<service-name>]*` |
852
853 | parameter | description |
854 | --------- | ----------- |
855 | `<response-code>` | Expected http response code |
856 | `<service-name>` |  Service name |
857
858 ## Function: a1pms_api_put_services_keepalive ##
859
860 Test of PUT '/services/keepalive' or V2 PUT '/v2/services/{service_id}/keepalive'
861
862 | arg list |
863 |--|
864 | `<response-code> <service-name>` |
865
866 | parameter | description |
867 | --------- | ----------- |
868 | `<response-code>` | Expected http response code |
869 | `<service-name>` |  Service name |
870
871 ## Function: a1pms_api_put_configuration ##
872
873 Test of PUT '/v2/configuration'
874
875 | arg list |
876 |--|
877 | `<response-code> <config-file>` |
878
879 | parameter | description |
880 | --------- | ----------- |
881 | `<response-code>` | Expected http response code |
882 | `<config-file>` |  Path json config file |
883
884 ## Function: a1pms_api_get_configuration ##
885
886 Test of GET '/v2/configuration'
887
888 | arg list |
889 |--|
890 | `<response-code> [<config-file>]` |
891
892 | parameter | description |
893 | --------- | ----------- |
894 | `<response-code>` | Expected http response code |
895 | `<config-file>` |  Path json config file to compare the retrieved config with |
896
897 ## Function: a1pms_kube_pvc_reset ##
898 Admin reset to remove all policies and services
899 All types and instances etc are removed - types and instances in a1 sims need to be removed separately
900 NOTE - only works in kubernetes and the pod should not be running
901
902 | arg list |
903 |--|
904 | None |
905
906
907 # Description of functions in authsidecar_api_function.sh #
908 Only common API functions in this file.
909
910
911 ## Function: start_chart_museum ##
912
913 Start the Chart Museum
914 | arg list |
915 |--|
916 | None |
917
918 ## Function: chartmus_upload_test_chart ##
919
920 Upload a package chart to chartmusem
921 | arg list |
922 |--|
923 | `<chart-name>` |
924
925 | parameter | description |
926 | --------- | ----------- |
927 | `<chart-name>` | Name of the chart to upload |
928
929 ## Function: chartmus_delete_test_chart ##
930
931 Delete a chart in chartmusem
932 | arg list |
933 |--|
934 | `<chart-name> [<version>]` |
935
936 | parameter | description |
937 | --------- | ----------- |
938 | `<chart-name>` | Name of the chart to delete |
939 | `<version>` | Chart version, default is 0.1.0 |
940
941 # Description of functions in cp_api_function.sh #
942
943 ## Function: use_control_panel_http ##
944
945 Set http as the protocol to use for all communication to the Control Panel
946 | arg list |
947 |--|
948 | None |
949
950 ## Function: use_control_panel_https ##
951
952 Set https as the protocol to use for all communication to the Control Panel
953 | arg list |
954 |--|
955 | None |
956
957 ## Function: start_control_panel ##
958
959 Start the Control Panel container
960 | arg list |
961 |--|
962 | None |
963
964 # Description of functions in cr_api_functions.sh #
965
966 ## Function: use_cr_http ##
967
968 Use http for getting event from CR.  The admin API is not affected. This is the default.
969 | arg list |
970 |--|
971 | None |
972
973 ## Function: use_cr_https ##
974
975 Use https for getting event from CR. The admin API is not affected.
976 Note: Not yet used as callback event is not fully implemented/deciced.
977 | arg list |
978 |--|
979 | None |
980
981 ## Function: start_cr ##
982
983 Start the Callback Receiver container in docker or kube depending on start mode.
984 | arg list |
985 |--|
986 | None |
987
988 ## Function: cr_equal ##
989
990 Tests if a variable value in the Callback Receiver (CR) simulator is equal to a target value.
991 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
992 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.
993 See the 'cr' dir for more details.
994 | arg list |
995 |--|
996 | `<cr-path-id> <variable-name> <target-value> [ <timeout-in-sec> ]` |
997
998 | parameter | description |
999 | --------- | ----------- |
1000 | `<cr-path-id>` |  Variable index to CR |
1001 | `<variable-name>` | Variable name in the CR  |
1002 | `<target-value>` | Target value for the variable  |
1003 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1004
1005 ## Function: cr_greater_or_equal ##
1006 Tests if a variable value in the Callback Receiver (CR) simulator is equal to or greater than a target value.
1007 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to or greater than the target or not.
1008 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.
1009 See the 'cr' dir for more details.
1010 | arg list |
1011 |--|
1012 | `<cr-path-id>  <variable-name> <target-value> [ <timeout-in-sec> ]` |
1013
1014 | parameter | description |
1015 | --------- | ----------- |
1016 | `<cr-path-id>` |  Variable index to CR |
1017 | `<variable-name>` | Variable name in the CR  |
1018 | `<target-value>` | Target value for the variable  |
1019 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1020
1021 ## Function: cr_contains_str ##
1022
1023 Tests if a variable value in the CR contains a target string.
1024 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
1025 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.
1026 See the 'a1-interface' repo for more details.
1027
1028 | arg list |
1029 |--|
1030 | `<cr-path-id>  <variable-name> <target-value> [ <timeout-in-sec> ]` |
1031
1032
1033 | parameter | description |
1034 | --------- | ----------- |
1035 | `<cr-path-id>` |  Variable index to CR |
1036 | `<variable-name>` | Variable name in the CR  |
1037 | `<target-value>` | Target substring for the variable  |
1038 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1039
1040 ## Function: cr_read ##
1041
1042 Reads the value of a variable in the CR simulator. The value is intended to be passed to a env variable in the test script.
1043 See the 'mrstub' dir for more details.
1044 | arg list |
1045 |--|
1046 | `<cr-path-id> <variable-name>` |
1047
1048 | parameter | description |
1049 | --------- | ----------- |
1050 | `<cr-path-id>` |  Variable index to CR |
1051 | `<variable-name>` | Variable name in the CR  |
1052
1053 ## Function: cr_delay_callback ##
1054
1055 Function to configure write delay on callbacks. Delay given in seconds. Setting remains until removed.
1056
1057 | arg list |
1058 |--|
1059 | `<response-code> <cr-path-id> [<delay-in-seconds>]`|
1060
1061 | parameter | description |
1062 | --------- | ----------- |
1063 | `<response-code>` | Expected http response code |
1064 | `<cr-path-id>` |  Variable index to CR |
1065 | `<delay-in-seconds>` |  Delay in seconds. If omitted, the delay is removed |
1066
1067 ## Function: cr_api_check_all_sync_events ##
1068
1069 Check the contents of all ric events received for a callback id.
1070
1071 | arg list |
1072 |--|
1073 | `<response-code> <cr-path-id>  <id> [ EMPTY \| ( <ric-id> )+ ]` |
1074
1075 | parameter | description |
1076 | --------- | ----------- |
1077 | `<response-code>` | Expected http response code |
1078 | `<cr-path-id>` | Variable index for CR  |
1079 | `<id>` | Id of the callback destination  |
1080 | `EMPTY` | Indicator for an empty list  |
1081 | `<ric-id>` | Id of the ric  |
1082
1083 ## Function: cr_api_check_all_ics_events ##
1084
1085 Check the contents of all current status events for one id from ICS
1086
1087 | arg list |
1088 |--|
1089 | `<response-code> <cr-path-id> <id> [ EMPTY \| ( <status> )+ ]` |
1090
1091 | parameter | description |
1092 | --------- | ----------- |
1093 | `<response-code>` | Expected http response code |
1094 | `<cr-path-id>` | Variable index for CR  |
1095 | `<id>` | Id of the callback destination  |
1096 | `EMPTY` | Indicator for an empty list  |
1097 | `<status>` | Status string  |
1098
1099 ## Function: cr_api_check_all_ics_subscription_events ##
1100
1101 Check the contents of all current subscription events for one id from ICS
1102
1103 | arg list |
1104 |--|
1105 | `<response-code> <cr-path-id>  <id> [ EMPTY | ( <type-id> <schema> <registration-status> )+ ]` |
1106
1107 | parameter | description |
1108 | --------- | ----------- |
1109 | `<response-code>` | Expected http response code |
1110 | `<cr-path-id>` | Variable index for CR  |
1111 | `<id>` | Id of the callback destination  |
1112 | `EMPTY` | Indicator for an empty list  |
1113 | `<type-id>` | Id of the data type  |
1114 | `<schema>` | Path to typeschema file  |
1115 | `<registration-status>` | Status string  |
1116
1117 ## Function: cr_api_reset ##
1118
1119 Reset the callback receiver
1120
1121 | arg list |
1122 |--|
1123 | `<cr-path-id>` |
1124
1125 | parameter | description |
1126 | --------- | ----------- |
1127 | `<cr-path-id>` | Variable index for CR  |
1128
1129 ## Function: cr_api_check_all_generic_json_events ##
1130
1131 Check the contents of all json events for path
1132
1133 | arg list |
1134 |--|
1135 | `<response-code> <cr-path-id>  <topic-url> (EMPTY | <json-msg>+ )` |
1136
1137 | parameter | description |
1138 | --------- | ----------- |
1139 | `<response-code>` | Expected http response code |
1140 | `<cr-path-id>` | Variable index for CR  |
1141 | `<topic-url>` | Topic url  |
1142 | `EMPTY` | Indicator for an empty list  |
1143 | `json-msg` | Json msg string to compare with  |
1144
1145 ## Function: cr_api_check_single_generic_json_event ##
1146
1147 Check a single (oldest) json event (or none if empty) for path
1148
1149 | arg list |
1150 |--|
1151 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <json-msg> )` |
1152
1153 | parameter | description |
1154 | --------- | ----------- |
1155 | `<response-code>` | Expected http response code |
1156 | `<cr-path-id>` | Variable index for CR  |
1157 | `<topic-url>` | Topic url  |
1158 | `EMPTY` | Indicator for no msg  |
1159 | `json-msg` | Json msg string to compare with  |
1160
1161 ## Function: cr_api_check_single_generic_event_md5 ##
1162
1163 Check a single (oldest) json in md5 format (or none if empty) for path.
1164 Note that if a json message is given, it shall be compact, no ws except inside string.
1165 The MD5 will generate different hash if whitespace is present or not in otherwise equivalent json.
1166
1167 | arg list |
1168 |--|
1169 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <data-msg> )` |
1170
1171 | parameter | description |
1172 | --------- | ----------- |
1173 | `<response-code>` | Expected http response code |
1174 | `<cr-path-id>` | Variable index for CR  |
1175 | `<topic-url>` | Topic url  |
1176 | `EMPTY` | Indicator for no msg  |
1177 | `data-msg` | msg string to compare with  |
1178
1179 ## Function: cr_api_check_single_generic_event_md5_file ##
1180
1181 Check a single (oldest) event in md5 format (or none if empty) for path.
1182 Note that if a file with json message is given, the json shall be compact, no ws except inside string and not newlines.
1183 The MD5 will generate different hash if ws/newlines is present or not in otherwise equivalent json
1184
1185 | arg list |
1186 |--|
1187 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <data-file> )` |
1188
1189 | parameter | description |
1190 | --------- | ----------- |
1191 | `<response-code>` | Expected http response code |
1192 | `<cr-path-id>` | Variable index for CR  |
1193 | `<topic-url>` | Topic url  |
1194 | `EMPTY` | Indicator for no msg  |
1195 | `data-file` | path to file to compare with  |
1196
1197 # Description of functions in dmaapadp_api_functions.sh #
1198
1199 ## Function: use_dmaapadp_http ##
1200
1201 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.
1202
1203 | arg list |
1204 |--|
1205 | None |
1206
1207 ## Function: use_dmaapadp_https ##
1208
1209 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.
1210
1211 | arg list |
1212 |--|
1213 | None |
1214
1215 ## Function: start_dmaapadp ##
1216
1217 Start the dmaap adator service container in docker or kube depending on running mode.
1218
1219 | arg list |
1220 |--|
1221 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
1222
1223 | parameter | description |
1224 | --------- | ----------- |
1225 | `PROXY` | Configure with http proxy, if proxy is started  |
1226 | `NOPROXY` | Configure without http proxy  |
1227 | `<config-file>`| Path to application.yaml  |
1228 | `<data-file>` | Optional path to application_configuration.json  |
1229
1230 ## Function: set_dmaapadp_trace ##
1231
1232 Configure the dmaap adaptor service log on trace level. The app must be running.
1233 | arg list |
1234 |--|
1235 | None |
1236
1237 # Description of functions in dmaapmed_api_functions.sh #
1238
1239 ## Function: use_dmaapmed_http ##
1240
1241 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.
1242
1243 | arg list |
1244 |--|
1245 | None |
1246
1247 ## Function: use_dmaapmed_https ##
1248
1249 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.
1250
1251 | arg list |
1252 |--|
1253 | None |
1254
1255 ## Function: start_dmaapmed ##
1256
1257 Start the dmaap mediator service container in docker or kube depending on running mode.
1258
1259 | arg list |
1260 |--|
1261 | None |
1262
1263 # Description of functions in helmmanager_api_functions.sh #
1264
1265 ## Function: use_helm_manager_http ##
1266
1267 Use http for all API calls to the Helm Manager. This is the default protocol.
1268 | arg list |
1269 |--|
1270 | None |
1271
1272 ## Function: use_helm_manager_https ##
1273
1274 Use https for all API calls to the Helm Manager.
1275 | arg list |
1276 |--|
1277 | None |
1278
1279 ## Function: start_helm_manager ##
1280
1281 Start the Helm Manager container in docker or kube depending on running mode.
1282 | arg list |
1283 |--|
1284 | None |
1285
1286 ## Function: helm_manager_api_get_charts ##
1287
1288 Get all charts and compare the expected contents.
1289 | arg list |
1290 |--|
1291 | `<response-code> [ EMPTY | ( <chart> <version> <namespace> <release> <repo> )+ ]` |
1292
1293 | parameter | description |
1294 | --------- | ----------- |
1295 | `<response-code>` | Expected response code |
1296 | `EMPTY` | Indicator for empty list  |
1297 | `<chart>`| Name of the chart  |
1298 | `<version>`| Version of the chart  |
1299 | `<namespace>`| Namespace to of the chart  |
1300 | `<release>`| Release name of the chart  |
1301 | `<repo>`| Repository of the chart  |
1302
1303 ## Function: helm_manager_api_post_repo ##
1304
1305 Add repo to the helm manager.
1306 | arg list |
1307 |--|
1308 | `<response-code> <repo-name> <repo-protocol> <repo-address> <repo-port>` |
1309
1310 | parameter | description |
1311 | --------- | ----------- |
1312 | `<response-code>` | Expected response code |
1313 | `<repo-name>` | Name of the repo  |
1314 | `<repo-protocol>`| Protocol http or https  |
1315 | `<repo-address>`| Host name of the repo |
1316 | `<repo-port>`| Host port of the repo  |
1317
1318 ## Function: helm_manager_api_post_onboard_chart ##
1319
1320 Onboard a chart to the helm manager.
1321 | arg list |
1322 |--|
1323 | `<response-code> <repo> <chart> <version> <release> <namespace>` |
1324
1325 | parameter | description |
1326 | --------- | ----------- |
1327 | `<response-code>` | Expected response code |
1328 | `<repo>`| Target repo of the chart  |
1329 | `<chart>`| Name of the chart  |
1330 | `<version>`| Version of the chart  |
1331 | `<namespace>`| Namespace to of the chart  |
1332 | `<release>`| Release name of the chart  |
1333
1334 ## Function: helm_manager_api_post_install_chart ##
1335
1336 Install an onboarded chart.
1337 | arg list |
1338 |--|
1339 | `<response-code> <chart> <version>` |
1340
1341 | parameter | description |
1342 | --------- | ----------- |
1343 | `<response-code>` | Expected response code |
1344 | `<chart>`| Name of the chart  |
1345 | `<version>`| Version of the chart  |
1346
1347 ## Function: helm_manager_api_uninstall_chart ##
1348
1349 Uninstall a chart.
1350 | arg list |
1351 |--|
1352 | `<response-code> <chart> <version>` |
1353
1354 | parameter | description |
1355 | --------- | ----------- |
1356 | `<response-code>` | Expected response code |
1357 | `<chart>`| Name of the chart  |
1358 | `<version>`| Version of the chart  |
1359
1360 ## Function: helm_manager_api_delete_chart ##
1361
1362 Delete a chart.
1363 | arg list |
1364 |--|
1365 | `<response-code> <chart> <version>` |
1366
1367 | parameter | description |
1368 | --------- | ----------- |
1369 | `<response-code>` | Expected response code |
1370 | `<chart>`| Name of the chart  |
1371 | `<version>`| Version of the chart  |
1372
1373 ## Function: helm_manager_api_exec_add_repo ##
1374
1375 Add repo in helm manager by helm using exec.
1376 | arg list |
1377 |--|
1378 | `<repo-name> <repo-url>` |
1379
1380 | parameter | description |
1381 | --------- | ----------- |
1382 | `<response-code>` | Expected response code |
1383 | `<repo-name>`| Name of the repo  |
1384 | `<repo-url>`| Full url to the repo. Url must be accessible by the container  |
1385
1386 # Description of functions in httpproxy_api_functions.sh #
1387
1388 ## Function: use_http_proxy_http ##
1389
1390 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.
1391 | arg list |
1392 |--|
1393 | None |
1394
1395 ## Function: use_http_proxy_https ##
1396
1397 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.
1398 | arg list |
1399 |--|
1400 | None |
1401
1402 ## Function: start_http_proxy ##
1403
1404 Start the http proxy container in docker or kube depending on running mode.
1405 | arg list |
1406 |--|
1407 | None |
1408
1409
1410 # Description of functions in ics_api_functions.sh #
1411
1412 ## Function: use_ics_rest_http ##
1413
1414 Use http for all API calls to the ICS. This is the default protocol.
1415 | arg list |
1416 |--|
1417 | None |
1418
1419 ## Function: use_ics_rest_https ##
1420
1421 Use https for all API calls to the ICS.
1422 | arg list |
1423 |--|
1424 | None |
1425
1426 ## Function: use_ics_dmaap_http ##
1427
1428 Send and recieve all API calls to the ICS over Dmaap via the MR using http.
1429 | arg list |
1430 |--|
1431 | None |
1432
1433 ## Function: use_ics_dmaap_https ##
1434
1435 Send and recieve all API calls to the ICS over Dmaap via the MR using https.
1436 | arg list |
1437 |--|
1438 | None |
1439
1440 ## Function: start_ics ##
1441
1442 Start the ICS container in docker or kube depending on running mode.
1443 | arg list |
1444 |--|
1445 | `PROXY|NOPROXY <config-file>` |
1446
1447 | parameter | description |
1448 | --------- | ----------- |
1449 | `PROXY` | Configure with http proxy, if proxy is started  |
1450 | `NOPROXY` | Configure without http proxy  |
1451 | `<config-file>`| Path to application.yaml  |
1452
1453 ## Function: stop_ics ##
1454
1455 Stop the ICS container.
1456 | arg list |
1457 |--|
1458 | None |
1459
1460 ## Function: start_stopped_ics ##
1461
1462 Start a previously stopped ics.
1463 | arg list |
1464 |--|
1465 | None |
1466
1467 ## Function: set_ics_debug ##
1468
1469 Configure the ICS log on debug level. The ICS must be running.
1470 | arg list |
1471 |--|
1472 | None |
1473
1474 ## Function: set_ics_trace ##
1475
1476 Configure the ICS log on trace level. The ICS must be running.
1477 | arg list |
1478 |--|
1479 | None |
1480
1481 ## Function: use_ics_retries ##
1482
1483 Perform curl retries when making direct call to ICS for the specified http response codes
1484 Speace separated list of http response codes
1485 | arg list |
1486 |--|
1487 | `[<response-code>]*` |
1488
1489 | parameter | description |
1490 | --------- | ----------- |
1491 | `<response-code>` | Http response code to make retry for  |
1492
1493 ## Function: check_ics_logs ##
1494
1495 Check the ICS log for any warnings and errors and print the count of each.
1496 | arg list |
1497 |--|
1498 | None |
1499
1500 ## Function: ics_equal ##
1501
1502 Tests if a variable value in the ICS is equal to a target value.
1503 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1504 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.
1505 See the 'a1-interface' repo for more details.
1506
1507 | arg list |
1508 |--|
1509 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1510
1511 | parameter | description |
1512 | --------- | ----------- |
1513 | `<variable-name>` | Variable name in ics  |
1514 | `<target-value>` | Target value for the variable  |
1515 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1516
1517 ## Function: ics_api_a1_get_job_ids ##
1518
1519 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs' and optional check of the array of returned job ids.
1520 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1521 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1522
1523 | arg list |
1524 |--|
1525 | `<response-code> <type-id>  <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
1526
1527 | parameter | description |
1528 | --------- | ----------- |
1529 | `<response-code>` | Expected http response code |
1530 | `<type-id>` | Id of the EI type  |
1531 | `<owner-id>` | Id of the job owner  |
1532 | `NOOWNER` | No owner is given  |
1533 | `<job-id>` | Id of the expected job  |
1534 | `EMPTY` | The expected list of job id shall be empty  |
1535
1536 ## Function: ics_api_a1_get_type ##
1537
1538 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}' and optional check of the returned schema.
1539 To test the response code only, provide the response code parameter as well as the type-id.
1540 To also test the response payload add a path to the expected schema file.
1541
1542 | arg list |
1543 |--|
1544 | `<response-code> <type-id> [<schema-file>]` |
1545
1546 | parameter | description |
1547 | --------- | ----------- |
1548 | `<response-code>` | Expected http response code |
1549 | `<type-id>` | Id of the EI type  |
1550 | `<schema-file>` | Path to a schema file to compare with the returned schema  |
1551
1552 ## Function: ics_api_a1_get_type_ids ##
1553
1554 Test of GET '/A1-EI/v1/eitypes' and optional check of returned list of type ids.
1555 To test the response code only, provide the response only.
1556 To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
1557
1558 | arg list |
1559 |--|
1560 | `<response-code> [ (EMPTY \| [<type-id>]+) ]` |
1561
1562 | parameter | description |
1563 | --------- | ----------- |
1564 | `<response-code>` | Expected http response code |
1565 | `EMPTY` | The expected list of type ids shall be empty  |
1566 | `<type-id>` | Id of the EI type  |
1567
1568 ## Function: ics_api_a1_get_job_status ##
1569
1570 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}/status' and optional check of the returned status.
1571 To test the response code only, provide the response code, type id and job id.
1572 To also test the response payload add the expected status.
1573
1574 | arg list |
1575 |--|
1576 | `<response-code> <type-id> <job-id> [<status>]` |
1577
1578 | parameter | description |
1579 | --------- | ----------- |
1580 | `<response-code>` | Expected http response code |
1581 | `<type-id>` | Id of the EI type  |
1582 | `<job-id>` | Id of the job  |
1583 | `<status>` | Expected status  |
1584
1585 ## Function: ics_api_a1_get_job ##
1586
1587 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}' and optional check of the returned job.
1588 To test the response code only, provide the response code, type id and job id.
1589 To also test the response payload add the remaining parameters.
1590
1591 | arg list |
1592 |--|
1593 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1594
1595 | parameter | description |
1596 | --------- | ----------- |
1597 | `<response-code>` | Expected http response code |
1598 | `<type-id>` | Id of the EI type  |
1599 | `<job-id>` | Id of the job  |
1600 | `<target-url>` | Expected target url for the job  |
1601 | `<owner-id>` | Expected owner for the job  |
1602 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1603
1604 ## Function: ics_api_a1_delete_job ##
1605
1606 Test of DELETE '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1607 To test, provide all the specified parameters.
1608
1609 | arg list |
1610 |--|
1611 | `<response-code> <type-id> <job-id>` |
1612
1613 | parameter | description |
1614 | --------- | ----------- |
1615 | `<response-code>` | Expected http response code |
1616 | `<type-id>` | Id of the EI type  |
1617 | `<job-id>` | Id of the job  |
1618
1619 ## Function: ics_api_a1_put_job ##
1620
1621 Test of PUT '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1622 To test, provide all the specified parameters.
1623
1624 | arg list |
1625 |--|
1626 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
1627
1628 | parameter | description |
1629 | --------- | ----------- |
1630 | `<response-code>` | Expected http response code |
1631 | `<type-id>` | Id of the EI type  |
1632 | `<job-id>` | Id of the job  |
1633 | `<target-url>` | Target url for the job  |
1634 | `<owner-id>` | Owner of the job  |
1635 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1636
1637 ## Function: ics_api_edp_get_type_ids ##
1638
1639 Test of GET '/ei-producer/v1/eitypes' or '/data-producer/v1/info-types' depending on ics version and an optional check of the returned list of type ids.
1640 To test the response code only, provide the response code.
1641 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1642
1643 | arg list |
1644 |--|
1645 | `<response-code> [ EMPTY \| <type-id>+]` |
1646
1647 | parameter | description |
1648 | --------- | ----------- |
1649 | `<response-code>` | Expected http response code |
1650 | `<type-id>` | Id of the type  |
1651 | `EMPTY` | The expected list of type ids shall be empty  |
1652
1653 ## Function: ics_api_edp_get_producer_status ##
1654
1655 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/status' or '/data-producer/v1/info-producers/{infoProducerId}/status' depending on ics version and optional check of the returned status.
1656 To test the response code only, provide the response code and producer id.
1657 To also test the response payload add the expected status.
1658
1659 | arg list |
1660 |--|
1661 | `<response-code> <producer-id> [<status>]` |
1662
1663 | parameter | description |
1664 | --------- | ----------- |
1665 | `<response-code>` | Expected http response code |
1666 | `<producer-id>` | Id of the producer  |
1667 | `<status>` | The expected status string  |
1668
1669 ## Function: ics_api_edp_get_producer_ids ##
1670
1671 Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
1672 To test the response code only, provide the response.
1673 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).
1674
1675 | arg list |
1676 |--|
1677 | `<response-code> [ EMPTY \| <producer-id>+]` |
1678
1679 | parameter | description |
1680 | --------- | ----------- |
1681 | `<response-code>` | Expected http response code |
1682 | `<producer-id>` | Id of the producer  |
1683 | `EMPTY` | The expected list of type ids shall be empty  |
1684
1685 ## Function: ics_api_edp_get_producer_ids_2 ##
1686
1687 Test of GET '/ei-producer/v1/eiproducers' or '/data-producer/v1/info-producers' depending on ics version and optional check of the returned producer ids.
1688 To test the response code only, provide the response.
1689 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).
1690
1691 | arg list |
1692 |--|
1693 | `<response-code> [ ( NOTYPE \| <type-id> ) [ EMPTY \| <producer-id>+]` |
1694
1695 | parameter | description |
1696 | --------- | ----------- |
1697 | `<response-code>` | Expected http response code |
1698 | `<type-id>` | Id of the type  |
1699 | `EMPTY` | No type given  |
1700 | `<producer-id>` | Id of the producer  |
1701 | `EMPTY` | The expected list of type ids shall be empty  |
1702
1703 ## Function: ics_api_edp_get_type ##
1704
1705 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
1706 To test the response code only, provide the response and the type-id.
1707 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).
1708
1709 | arg list |
1710 |--|
1711 | `<response-code> <type-id> [<job-schema-file> (EMPTY \| [<producer-id>]+)]` |
1712
1713 | parameter | description |
1714 | --------- | ----------- |
1715 | `<response-code>` | Expected http response code |
1716 | `<type-id>` | Id of the type  |
1717 | `<job-schema-file>` | Path to a job schema file  |
1718 | `<producer-id>` | Id of the producer  |
1719 | `EMPTY` | The expected list of type ids shall be empty  |
1720
1721 ## Function: ics_api_edp_get_type_2 ##
1722
1723 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ics version and optional check of the returned type.
1724 To test the response code only, provide the response and the type-id.
1725 To also test the response payload add a path to a job schema file.
1726
1727 | arg list |
1728 |--|
1729 | `<response-code> <type-id> [<job-schema-file>]` |
1730
1731 | parameter | description |
1732 | --------- | ----------- |
1733 | `<response-code>` | Expected http response code |
1734 | `<type-id>` | Id of the type  |
1735 | `<job-schema-file>` | Path to a job schema file  |
1736 | `EMPTY` | The expected list of type ids shall be empty  |
1737
1738 ## Function: ics_api_edp_put_type_2 ##
1739
1740 Test of PUT '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ics version and optional check of the returned type.
1741
1742 | arg list |
1743 |--|
1744 | `<response-code> <type-id> [<job-schema-file>]` |
1745
1746 | parameter | description |
1747 | --------- | ----------- |
1748 | `<response-code>` | Expected http response code |
1749 | `<type-id>` | Id of the type  |
1750 | `<job-schema-file>` | Path to a job schema file  |
1751 | `EMPTY` | The expected list of type ids shall be empty  |
1752
1753 ## Function: ics_api_edp_delete_type_2 ##
1754
1755 Test of DELETE '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ics version and optional check of the returned type.
1756
1757 | arg list |
1758 |--|
1759 | `<response-code> <type-id>` |
1760
1761 | parameter | description |
1762 | --------- | ----------- |
1763 | `<response-code>` | Expected http response code |
1764 | `<type-id>` | Id of the type  |
1765
1766 ## Function: ics_api_edp_get_producer ##
1767
1768 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
1769 To test the response code only, provide the response and the producer-id.
1770 To also test the response payload add the remaining parameters defining thee producer.
1771
1772 | arg list |
1773 |--|
1774 | `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY\| [<type-id> <schema-file>]+) ]` |
1775
1776 | parameter | description |
1777 | --------- | ----------- |
1778 | `<response-code>` | Expected http response code |
1779 | `<producer-id>` | Id of the producer  |
1780 | `<create-callback>` | Callback for create job  |
1781 | `<delete-callback>` | Callback for delete job  |
1782 | `<supervision-callback>` | Callback for producer supervision  |
1783 | `<type-id>` | Id of the type  |
1784 | `<schema-file>` | Path to a schema file  |
1785 | `EMPTY` | The expected list of type schema pairs shall be empty  |
1786
1787 ## Function: ics_api_edp_get_producer_2 ##
1788
1789 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version and optional check of the returned producer.
1790 To test the response code only, provide the response and the producer-id.
1791 To also test the response payload add the remaining parameters defining thee producer.
1792
1793 | arg list |
1794 |--|
1795 | `<response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY \| <type-id>+) ]` |
1796
1797 | parameter | description |
1798 | --------- | ----------- |
1799 | `<response-code>` | Expected http response code |
1800 | `<producer-id>` | Id of the producer  |
1801 | `<job-callback>` | Callback for the url  |
1802 | `<supervision-callback>` | Callback for producer supervision  |
1803 | `<type-id>` | Id of the type  |
1804 | `EMPTY` | The expected list of types shall be empty  |
1805
1806 ## Function: ics_api_edp_delete_producer ##
1807
1808 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version.
1809 To test, provide all parameters.
1810
1811 | arg list |
1812 |--|
1813 | `<response-code> <producer-id>` |
1814
1815 | parameter | description |
1816 | --------- | ----------- |
1817 | `<response-code>` | Expected http response code |
1818 | `<producer-id>` | Id of the producer  |
1819
1820 ## Function: ics_api_edp_put_producer ##
1821
1822 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1823 To test, provide all parameters. The list of type/schema pair may be empty.
1824
1825 | arg list |
1826 |--|
1827 | `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY \| [<type-id> <schema-file>]+)` |
1828
1829 | parameter | description |
1830 | --------- | ----------- |
1831 | `<response-code>` | Expected http response code |
1832 | `<producer-id>` | Id of the producer  |
1833 | `<job-callback>` | Callback for create/delete job  |
1834 | `<supervision-callback>` | Callback for producer supervision  |
1835 | `<type-id>` | Id of the type  |
1836 | `<schema-file>` | Path to a schema file  |
1837 | `EMPTY` | The list of type/schema pairs is empty  |
1838
1839 ## Function: ics_api_edp_put_producer_2 ##
1840
1841 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version.
1842 To test, provide all parameters. The list of type/schema pair may be empty.
1843
1844 | arg list |
1845 |--|
1846 | `<response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE\|[<type-id>+]` |
1847
1848 | parameter | description |
1849 | --------- | ----------- |
1850 | `<response-code>` | Expected http response code |
1851 | `<producer-id>` | Id of the producer  |
1852 | `<job-callback>` | Callback for create/delete job  |
1853 | `<supervision-callback>` | Callback for producer supervision  |
1854 | `<type-id>` | Id of the type  |
1855 | `NOTYPE` | The list of types is empty  |
1856
1857 ## Function: ics_api_edp_get_producer_jobs ##
1858
1859 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
1860 To test the response code only, provide the response and the producer-id.
1861 To also test the response payload add the remaining parameters.
1862
1863 | arg list |
1864 |--|
1865 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1866
1867 | parameter | description |
1868 | --------- | ----------- |
1869 | `<response-code>` | Expected http response code |
1870 | `<producer-id>` | Id of the producer  |
1871 | `<job-id>` | Id of the job  |
1872 | `<type-id>` | Id of the EI type  |
1873 | `<target-url>` | Target url for data delivery  |
1874 | `<job-owner>` | Id of the job owner  |
1875 | `<template-job-file>` | Path to a job template file  |
1876 | `EMPTY` | The list of job/type/target/job-file tuples is empty  |
1877
1878 ## Function: ics_api_edp_get_producer_jobs_2 ##
1879
1880 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' or '/data-producer/v1/info-producers/{infoProducerId}/info-jobs' depending on ics version and optional check of the returned producer job.
1881 To test the response code only, provide the response and the producer-id.
1882 To also test the response payload add the remaining parameters.
1883
1884 | arg list |
1885 |--|
1886 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1887
1888 | parameter | description |
1889 | --------- | ----------- |
1890 | `<response-code>` | Expected http response code |
1891 | `<producer-id>` | Id of the producer  |
1892 | `<job-id>` | Id of the job  |
1893 | `<type-id>` | Id of the type  |
1894 | `<target-url>` | Target url for data delivery  |
1895 | `<job-owner>` | Id of the job owner  |
1896 | `<template-job-file>` | Path to a job template file  |
1897 | `EMPTY` | The list of job/type/target/job-file tuples is empty  |
1898
1899 ## Function: ics_api_service_status ##
1900
1901 Test of GET '/status'.
1902
1903 | arg list |
1904 |--|
1905 | `<response-code>` |
1906
1907 | parameter | description |
1908 | --------- | ----------- |
1909 | `<response-code>` | Expected http response code |
1910
1911 ## Function: ics_api_idc_get_type_ids ##
1912
1913 Test of GET '/data-consumer/v1/info-types' and an optional check of the returned list of type ids.
1914 To test the response code only, provide the response code.
1915 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1916
1917 | arg list |
1918 |--|
1919 | `<response-code> [ EMPTY \| <type-id>+]` |
1920
1921 | parameter | description |
1922 | --------- | ----------- |
1923 | `<response-code>` | Expected http response code |
1924 | `<type-id>` | Id of the Info type  |
1925 | `EMPTY` | The expected list of type ids shall be empty  |
1926
1927 ## Function: ics_api_idc_get_job_ids ##
1928
1929 Test of GET '/data-consumer/v1/info-jobs' and optional check of the array of returned job ids.
1930 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1931 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1932
1933 | arg list |
1934 |--|
1935 | `<response-code> <type-id>  <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
1936
1937 | parameter | description |
1938 | --------- | ----------- |
1939 | `<response-code>` | Expected http response code |
1940 | `<type-id>` | Id of the Info type  |
1941 | `<owner-id>` | Id of the job owner  |
1942 | `NOOWNER` | No owner is given  |
1943 | `<job-id>` | Id of the expected job  |
1944 | `EMPTY` | The expected list of job id shall be empty  |
1945
1946 ## Function: ics_api_idc_get_job ##
1947
1948 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}' and optional check of the returned job.
1949 To test the response code only, provide the response code, type id and job id.
1950 To also test the response payload add the remaining parameters.
1951
1952 | arg list |
1953 |--|
1954 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1955
1956 | parameter | description |
1957 | --------- | ----------- |
1958 | `<response-code>` | Expected http response code |
1959 | `<type-id>` | Id of the Info type  |
1960 | `<job-id>` | Id of the job  |
1961 | `<target-url>` | Expected target url for the job  |
1962 | `<owner-id>` | Expected owner for the job  |
1963 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1964
1965 ## Function: ics_api_idc_put_job ##
1966
1967 Test of PUT '/data-consumer/v1/info-jobs/{infoJobId}'.
1968 To test, provide all the specified parameters.
1969
1970 | arg list |
1971 |--|
1972 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file> [VALIDATE]` |
1973
1974 | parameter | description |
1975 | --------- | ----------- |
1976 | `<response-code>` | Expected http response code |
1977 | `<type-id>` | Id of the Info type  |
1978 | `<job-id>` | Id of the job  |
1979 | `<target-url>` | Target url for the job  |
1980 | `<owner-id>` | Owner of the job  |
1981 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1982 | `VALIIDATE` | Indicator to preform type validation at creation  |
1983
1984 ## Function: ics_api_idc_delete_job ##
1985
1986 Test of DELETE '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1987 To test, provide all the specified parameters.
1988
1989 | arg list |
1990 |--|
1991 | `<response-code> <type-id> <job-id>` |
1992
1993 | parameter | description |
1994 | --------- | ----------- |
1995 | `<response-code>` | Expected http response code |
1996 | `<type-id>` | Id of the type  |
1997 | `<job-id>` | Id of the job  |
1998
1999 ## Function: ics_api_idc_get_type ##
2000
2001 Test of GET '/data-consumer/v1/info-types/{infoTypeId} and optional check of the returned schema.
2002 To test the response code only, provide the response code parameter as well as the type-id.
2003 To also test the response payload add a path to the expected schema file.
2004
2005 | arg list |
2006 |--|
2007 | `<response-code> <type-id> [<schema-file>]` |
2008
2009 | parameter | description |
2010 | --------- | ----------- |
2011 | `<response-code>` | Expected http response code |
2012 | `<type-id>` | Id of the Info type  |
2013 | `<schema-file>` | Path to a schema file to compare with the returned schema  |
2014
2015 ## Function: ics_api_idc_get_job_status ##
2016
2017 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' and optional check of the returned status and timeout.
2018 To test the response code only, provide the response code and job id.
2019 To also test the response payload add the expected status.
2020
2021 | arg list |
2022 |--|
2023 | `<response-code> <job-id> [<status> [ <timeout>]]` |
2024
2025 | parameter | description |
2026 | --------- | ----------- |
2027 | `<response-code>` | Expected http response code |
2028 | `<job-id>` | Id of the job  |
2029 | `<status>` | Expected status  |
2030 | `<timeout>` | Timeout |
2031
2032 ## Function: ics_api_idc_get_job_status2 ##
2033
2034 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' with returned producers and optional check of the returned status and timeout.
2035 To test the response code only, provide the response code and job id.
2036 To also test the response payload add the expected status.
2037
2038 | arg list |
2039 |--|
2040 | `<response-code> <job-id> [<status> EMPTYPROD|( <prod-count> <producer-id>+ ) [<timeout>]]` |
2041
2042 | parameter | description |
2043 | --------- | ----------- |
2044 | `<response-code>` | Expected http response code |
2045 | `<job-id>` | Id of the job  |
2046 | `<status>` | Expected status  |
2047 | `<EMPTYPROD>` | Indicated for empty list of producer  |
2048 | `<prod-count>` | Number of expected producer  |
2049 | `<producer-id>` |Id of the producer  |
2050 | `<timeout>` | Timeout |
2051
2052
2053 ## Function: ics_api_idc_get_subscription_ids ##
2054 Test of GET '/data-consumer/v1/info-type-subscription' with the returned list of subscription ids
2055
2056 | arg list |
2057 |--|
2058 | `<response-code>  <owner-id>|NOOWNER [ EMPTY | <subscription-id>+]` |
2059
2060 | parameter | description |
2061 | --------- | ----------- |
2062 | `<response-code>` | Expected http response code |
2063 | `<owner-id>` | Id of the owner  |
2064 | `<NOOWNER>` | Indicator for empty owner  |
2065 | `<EMPTY>` | Indicated for empty list of subscription ids  |
2066 | `<subscription-id>` |Id of the subscription  |
2067
2068 ## Function: ics_api_idc_get_subscription ##
2069 Test of GET '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
2070
2071 | arg list |
2072 |--|
2073 | `<response-code>  <subscription-id> [ <owner-id> <status-uri> ]` |
2074
2075 | parameter | description |
2076 | --------- | ----------- |
2077 | `<response-code>` | Expected http response code |
2078 | `<subscription-id>` |Id of the subscription  |
2079 | `<owner-id>` | Id of the owner  |
2080 | `<status-uri>` | Url for status notifications  |
2081
2082
2083 ## Function: ics_api_idc_put_subscription ##
2084 Test of PUT '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
2085
2086 | arg list |
2087 |--|
2088 | `<response-code>  <subscription-id> <owner-id> <status-uri>` |
2089
2090 | parameter | description |
2091 | --------- | ----------- |
2092 | `<response-code>` | Expected http response code |
2093 | `<subscription-id>` |Id of the subscription  |
2094 | `<owner-id>` | Id of the owner  |
2095 | `<status-uri>` | Url for status notifications  |
2096
2097 ## Function: ics_api_idc_delete_subscription ##
2098 Test of DELETE /data-consumer/v1/info-type-subscription/{subscriptionId}
2099
2100 | arg list |
2101 |--|
2102 | `<response-code>  <subscription-id>` |
2103
2104 | parameter | description |
2105 | --------- | ----------- |
2106 | `<response-code>` | Expected http response code |
2107 | `<subscription-id>` |Id of the subscription  |
2108
2109
2110 ## Function: ics_api_admin_reset ##
2111
2112 Test of GET '/status'.
2113
2114 | arg list |
2115 |--|
2116 | `<response-code> [ <type> ]` |
2117
2118 | parameter | description |
2119 | --------- | ----------- |
2120 | `<response-code>` | Expected http response code |
2121 | `<type>` | Type id, if the interface supports type in url |
2122
2123 ## Function: ics_kube_pvc_reset ##
2124
2125 Admin reset to remove all data in ics; jobs, producers etc
2126 NOTE - only works in kubernetes and the pod should not be running
2127
2128 | arg list |
2129 |--|
2130 | None |
2131
2132 # Description of functions in istio_api_functions.sh #
2133
2134 ## Function: istio_enable_istio_namespace ##
2135 Enable istio on a namespace
2136
2137 | arg list |
2138 |--|
2139 | `<namespace>` |
2140
2141 | parameter | description |
2142 | --------- | ----------- |
2143 | `namespace` | Namespace name to enable istio on |
2144
2145 ## Function: istio_req_auth_by_jwksuri ##
2146 Set isto authentication by jwks uri
2147
2148 | arg list |
2149 |--|
2150 | `<app-name> <namespace> <realm>>` |
2151
2152 | parameter | description |
2153 | --------- | ----------- |
2154 | `<app-name>` | App-name, short name |
2155 | `<namespace>` | Namespace of app  |
2156 | `<realm>` | Name of realm  |
2157
2158 ## Function: istio_req_auth_by_jwks ##
2159 Set isto authentication by jwks keys (inline)
2160
2161 | arg list |
2162 |--|
2163 | `<app> <namespace> <issuer> <key>` |
2164
2165 | parameter | description |
2166 | --------- | ----------- |
2167 | `<app-name>` | App-name, short name |
2168 | `<namespace>` | Namespace of app  |
2169 | `<issuer>` | Name of issuer |
2170 | `key` | Inline key  |
2171
2172 ## Function: istio_auth_policy_by_realm ##
2173 Set isio authorization by realm
2174
2175 | arg list |
2176 |--|
2177 | `<app> <namespace> <realam> [<client-id> <client-role>]` |
2178
2179 | parameter | description |
2180 | --------- | ----------- |
2181 | `<app-name>` | App-name, short name |
2182 | `<namespace>` | Namespace of app  |
2183 | `<realm>` | Name of realm  |
2184 | `<client-id>` | Client id to authorize |
2185 | `<client-role>` | Client role to authorize |
2186
2187
2188 ## Function: istio_auth_policy_by_issuer ##
2189 Set isio authorization by issuer
2190
2191 | arg list |
2192 |--|
2193 | `<app> <namespace> <issuer>` |
2194
2195 | parameter | description |
2196 | --------- | ----------- |
2197 | `<app-name>` | App-name, short name |
2198 | `<namespace>` | Namespace of app  |
2199 | `<issuer>` | Name of issuer |
2200
2201
2202 # Description of functions in kafkapc_api_functions.sh #
2203
2204 ## Function: use_kafkapc_http ##
2205
2206 Use http for all calls to the KAFKAPC.
2207 | arg list |
2208 |--|
2209 | None |
2210
2211 ## Function: use_kafkapc_https ##
2212
2213 Use https for all calls to the KAFKAPC.
2214 | arg list |
2215 |--|
2216 | None |
2217
2218 ## Function: start_kafkapc ##
2219
2220 Start the KAFKAPC container in docker or kube depending on start mode
2221 | arg list |
2222 |--|
2223 | None |
2224
2225 ## Function: kafkapc_equal ##
2226
2227 Tests if a variable value in the KAFKAPC is equal to a target value.
2228 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2229 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.
2230 See the 'mrstub' dir for more details.
2231 | arg list |
2232 |--|
2233 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2234
2235 | parameter | description |
2236 | --------- | ----------- |
2237 | `<variable-name>` | Variable name in the KAFKAPC  |
2238 | `<target-value>` | Target value for the variable  |
2239 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
2240
2241 ## Function: kafkapc_api_reset ##
2242
2243 Deep reset of KAFKAPC. Note that kafka itself is not affected, i.e. created topic still exist in kafka.
2244 | arg list |
2245 |--|
2246 | None |
2247
2248 ## Function: kafkapc_api_create_topic ##
2249
2250 Create a topic in kafka via kafkapc.
2251 | `<response-code> <topic-name>  <mime-type>` |
2252
2253 | parameter | description |
2254 | --------- | ----------- |
2255 | `<response-code>` | Http response code  |
2256 | `<topic-name>` | Name of the topic  |
2257 | `<mime-type>` | Mime type of the data to send to the topic. Data on the topic is expected to be of this type  |
2258
2259 ## Function: kafkapc_api_get_topic ##
2260
2261 Create a from kafkapc.
2262 | `<response-code> <topic-name>  <mime-type>` |
2263
2264 | parameter | description |
2265 | --------- | ----------- |
2266 | `<response-code>` | Http response code  |
2267 | `<topic-name>` | Name of the topic  |
2268 | `<mime-type>` | Mime type of the topic  |
2269
2270 ## Function: kafkapc_api_start_sending ##
2271
2272 Start sending msg from the msg queue to kafka for a topic.
2273 | `<response-code> <topic-name>` |
2274
2275 | parameter | description |
2276 | --------- | ----------- |
2277 | `<response-code>` | Http response code  |
2278 | `<topic-name>` | Name of the topic  |
2279
2280 ## Function: kafkapc_api_start_receiving ##
2281
2282 Start receiving msg from a kafka topic to the msg queue in kafkapc.
2283 | `<response-code> <topic-name>` |
2284
2285 | parameter | description |
2286 | --------- | ----------- |
2287 | `<response-code>` | Http response code  |
2288 | `<topic-name>` | Name of the topic  |
2289
2290 ## Function: kafkapc_api_stop_sending ##
2291
2292 Stop sending msg from the msg queue to kafka for a topic.
2293 | `<response-code> <topic-name>` |
2294
2295 | parameter | description |
2296 | --------- | ----------- |
2297 | `<response-code>` | Http response code  |
2298 | `<topic-name>` | Name of the topic  |
2299
2300 ## Function: kafkapc_api_stop_receiving ##
2301
2302 Stop receiving msg from a kafka topic to the msg queue in kafkapc.
2303 | `<response-code> <topic-name>` |
2304
2305 | parameter | description |
2306 | --------- | ----------- |
2307 | `<response-code>` | Http response code  |
2308 | `<topic-name>` | Name of the topic  |
2309
2310 ## Function: kafkapc_api_post_msg ##
2311
2312 Send a message on a topic.
2313 | arg list |
2314 |--|
2315 | `<response-code> <topic> <mime-type> <msg>` |
2316
2317 | parameter | description |
2318 | --------- | ----------- |
2319 | `<response-code>` | Http response code  |
2320 | `<topic>` | Topic name  |
2321 | `<mime-type>` | Mime type of the msg  |
2322 | `<msg>` | String msg to send  |
2323
2324 ## Function: kafkapc_api_get_msg ##
2325
2326 Get a message on a topic.
2327 | arg list |
2328 |--|
2329 | `<response-code> <topic>  ([ <mime-type>  <msg> ] | NOMSG )` |
2330
2331 | parameter | description |
2332 | --------- | ----------- |
2333 | `<response-code>` | Http response code  |
2334 | `<topic>` | Topic name  |
2335 | `<mime-type>` | Mime type of the msg  |
2336 | `<msg>` | String msg to receive  |
2337 | `NOMSG` | Indicated for no msg  |
2338
2339 ## Function: kafkapc_api_post_msg_from_file ##
2340
2341 Send a message in a file on a topic.
2342 | arg list |
2343 |--|
2344 | `<response-code> <topic> <mime-type> <file>` |
2345
2346 | parameter | description |
2347 | --------- | ----------- |
2348 | `<response-code>` | Http response code  |
2349 | `<topic>` | Topic name  |
2350 | `<mime-type>` | Mime type of the msg  |
2351 | `<file>` | Filepath to the string msg to send  |
2352
2353 ## Function: kafkapc_api_get_msg_from_file ##
2354
2355 Get a message on a topic.
2356 | arg list |
2357 |--|
2358 | `<response-code> <topic>  <mime-type>  <file> ` |
2359
2360 | parameter | description |
2361 | --------- | ----------- |
2362 | `<response-code>` | Http response code  |
2363 | `<topic>` | Topic name  |
2364 | `<mime-type>` | Mime type of the msg  |
2365 | `<file>` | Filepath to the string msg to receive  |
2366
2367 ## Function: kafkapc_api_generate_json_payload_file ##
2368
2369 Create json file with dummy data for payload.
2370 | arg list |
2371 |--|
2372 | `<size-in-kb> <filename>` |
2373
2374 | parameter | description |
2375 | --------- | ----------- |
2376 | `<size-in-kb>` | Generated size in kb  |
2377 | `<filename>` | Path to output file  |
2378
2379 ## Function: kafkapc_api_generate_text_payload_file ##
2380
2381 Create file with dummy text data for payload.
2382 | arg list |
2383 |--|
2384 | `<size-in-kb> <filename>` |
2385
2386 | parameter | description |
2387 | --------- | ----------- |
2388 | `<size-in-kb>` | Generated size in kb  |
2389 | `<filename>` | Path to output file  |
2390
2391 # Description of functions in keycloak_api_functions.sh #
2392
2393 ## Function: start_keycloak ##
2394
2395 Start the KEYCLOAK app in docker or kube depending on start mode
2396 | arg list |
2397 |--|
2398 | None |
2399
2400 ## Function: keycloak_api_obtain_admin_token ##
2401
2402 Get the admin token to use for subsequent rest calls to keycloak
2403 | arg list |
2404 |--|
2405 | None |
2406
2407 ## Function: keycloak_api_create_realm ##
2408
2409 Create a realm
2410 | arg list |
2411 |--|
2412 | `<realm-name> <enabled> <token-expiry>` |
2413
2414 | parameter | description |
2415 | --------- | ----------- |
2416 | `realm-name` | Name of the realm |
2417 | `enabled` | Enabled, true or false |
2418 | `token-expiry` | Token lifespan in seconds |
2419
2420 ## Function: keycloak_api_update_realm ##
2421
2422 Update a realm
2423 | arg list |
2424 |--|
2425 | `<realm-name> <enabled> <token-expiry>` |
2426
2427 | parameter | description |
2428 | --------- | ----------- |
2429 | `realm-name` | Name of the realm |
2430 | `enabled` | Enabled, true or false |
2431 | `token-expiry` | Token lifespan in seconds |
2432
2433 ## Function: keycloak_api_create_confidential_client ##
2434
2435 Create a client
2436 | arg list |
2437 |--|
2438 | `<realm-name> <client-name>` |
2439
2440 | parameter | description |
2441 | --------- | ----------- |
2442 | `realm-name` | Name of the realm |
2443 | `client-name` | Name of the client |
2444
2445 ## Function: keycloak_api_generate_client_secret ##
2446
2447 Generate secret for client
2448 | arg list |
2449 |--|
2450 | `<realm-name> <client-name>` |
2451
2452 | parameter | description |
2453 | --------- | ----------- |
2454 | `realm-name` | Name of the realm |
2455 | `client-name` | Name of the client |
2456
2457 ## Function: keycloak_api_get_client_secret ##
2458
2459 Get a  secret for client
2460 | arg list |
2461 |--|
2462 | `<realm-name> <client-name>` |
2463
2464 | parameter | description |
2465 | --------- | ----------- |
2466 | `realm-name` | Name of the realm |
2467 | `client-name` | Name of the client |
2468
2469 ## Function: keycloak_api_create_client_roles ##
2470
2471 Create client roles
2472 | arg list |
2473 |--|
2474 | `<realm-name> <client-name> <role>+` |
2475
2476 | parameter | description |
2477 | --------- | ----------- |
2478 | `realm-name` | Name of the realm |
2479 | `client-name` | Name of the client |
2480 | `role` | Name of the role |
2481
2482 ## Function: keycloak_api_map_client_roles ##
2483
2484 Map roles to a client
2485 | arg list |
2486 |--|
2487 | `<realm-name> <client-name> <role>+` |
2488
2489 | parameter | description |
2490 | --------- | ----------- |
2491 | `realm-name` | Name of the realm |
2492 | `client-name` | Name of the client |
2493 | `role` | Name of the role |
2494
2495 ## Function: keycloak_api_get_client_token ##
2496
2497 Get a client token
2498 | arg list |
2499 |--|
2500 | `<realm-name> <client-name>` |
2501
2502 | parameter | description |
2503 | --------- | ----------- |
2504 | `realm-name` | Name of the realm |
2505 | `client-name` | Name of the client |
2506
2507 ## Function: keycloak_api_read_client_token ##
2508
2509 Read a client token
2510 | arg list |
2511 |--|
2512 | `<realm-name> <client-name>` |
2513
2514 | parameter | description |
2515 | --------- | ----------- |
2516 | `realm-name` | Name of the realm |
2517 | `client-name` | Name of the client |
2518
2519 ## Function: keycloak_api_read_client_secret ##
2520
2521 Read the secret for client
2522 | arg list |
2523 |--|
2524 | `<realm-name> <client-name>` |
2525
2526 | parameter | description |
2527 | --------- | ----------- |
2528 | `realm-name` | Name of the realm |
2529 | `client-name` | Name of the client |
2530
2531 # Description of functions in kubeproxy_api_functions.sh #
2532
2533 ## Function: use_kube_proxy_http ##
2534
2535 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.
2536 | arg list |
2537 |--|
2538 | None |
2539
2540 ## Function: use_kube_proxy_https ##
2541
2542 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.
2543 | arg list |
2544 |--|
2545 | None |
2546
2547 ## Function: start_kube_proxy ##
2548
2549 Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
2550 No proxy is started if the function is called in docker mode.
2551 | arg list |
2552 |--|
2553 | None |
2554
2555 # Description of functions in localhelm_api_functions.sh #
2556
2557 ## Function: localhelm_create_test_chart ##
2558
2559 Create a dummy chart using helm
2560 | arg list |
2561 |--|
2562 | `chart-name` |
2563
2564 | parameter | description |
2565 | --------- | ----------- |
2566 | `chart-name` | Name of the chart |
2567
2568 ## Function: localhelm_package_test_chart ##
2569
2570 Package a dummy chart using helm
2571 | arg list |
2572 |--|
2573 | `chart-name` |
2574
2575 | parameter | description |
2576 | --------- | ----------- |
2577 | `chart-name` | Name of the chart |
2578
2579 ## Function: localhelm_installed_chart_release ##
2580
2581 Check if a chart is installed or not using helm
2582 | arg list |
2583 |--|
2584 | `INSTALLED|NOTINSTALLED <release-name> <name-space> |
2585
2586 | parameter | description |
2587 | --------- | ----------- |
2588 | `INSTALLED` | Expecting installed chart |
2589 | `NOTINSTALLED` | Expecting a not installed chart |
2590 | `release-name` | Name of the release |
2591 | `name-space` | Expected namespace |
2592
2593 # Description of functions in mr_api_functions.sh #
2594
2595 ## Function: use_mr_http ##
2596
2597 Use http for all Dmaap calls to the MR. This is the default. The admin API is not affected.
2598
2599 | arg list |
2600 |--|
2601 | None |
2602
2603 ## Function: use_mr_https ##
2604
2605 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.
2606 | arg list |
2607 |--|
2608 | None |
2609
2610 ## Function: start_mr ##
2611
2612 Start the Message Router stub interface container in docker or kube depending on start mode
2613 | arg list |
2614 |--|
2615 | None |
2616
2617 ## Function: dmaap_api_print_topics ##
2618
2619 Prints the current list of topics in DMAAP MR
2620
2621 | arg list |
2622 |--|
2623 | None |
2624
2625 ## Function: mr_equal ##
2626
2627 Tests if a variable value in the Message Router (MR) simulator is equal to a target value.
2628 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2629 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.
2630 See the 'mrstub' dir for more details.
2631 | arg list |
2632 |--|
2633 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2634
2635 | parameter | description |
2636 | --------- | ----------- |
2637 | `<variable-name>` | Variable name in the MR  |
2638 | `<target-value>` | Target value for the variable  |
2639 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
2640
2641 ## Function: mr_greater ##
2642
2643 Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
2644 Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than the target or not.
2645 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.
2646 See the 'mrstub' dir for more details.
2647 | arg list |
2648 |--|
2649 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2650
2651 | parameter | description |
2652 | --------- | ----------- |
2653 | `<variable-name>` | Variable name in the MR  |
2654 | `<target-value>` | Target value for the variable  |
2655 | `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value  |
2656
2657 ## Function: mr_read ##
2658
2659 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.
2660 See the 'mrstub' dir for more details.
2661 | arg list |
2662 |--|
2663 | `<variable-name>` |
2664
2665 | parameter | description |
2666 | --------- | ----------- |
2667 | `<variable-name>` | Variable name in the MR  |
2668
2669 ## Function: mr_print ##
2670
2671 Prints the value of a variable in the Message Router (MR) simulator.
2672 See the 'mrstub' dir for more details.
2673 | arg list |
2674 |--|
2675 | `<variable-name>` |
2676
2677 | parameter | description |
2678 | --------- | ----------- |
2679 | `<variable-name>` | Variable name in the MR  |
2680
2681 ## Function: mr_api_send_json ##
2682
2683 Send json to topic in mr-stub.
2684 | arg list |
2685 |--|
2686 | `<topic-url> <json-msg>` |
2687
2688 | parameter | description |
2689 | --------- | ----------- |
2690 | `<topic-url>` | Topic url  |
2691 | `<json-msg>` | Json msg as string  |
2692
2693 ## Function: mr_api_send_text ##
2694
2695 Send text to topic in mr-stub.
2696 | arg list |
2697 |--|
2698 | `<topic-url> <text-msg>` |
2699
2700 | parameter | description |
2701 | --------- | ----------- |
2702 | `<topic-url>` | Topic url  |
2703 | `<text-msg>` | Text (string) msg  |
2704
2705
2706
2707 ## Function: mr_api_send_json_file ##
2708
2709 Send json to topic in mr-stub.
2710 | arg list |
2711 |--|
2712 | `<topic-url> <json-file>` |
2713
2714 | parameter | description |
2715 | --------- | ----------- |
2716 | `<topic-url>` | Topic url  |
2717 | `<json-file>` | Path to file with json msg as string  |
2718
2719 ## Function: mr_api_send_text_file ##
2720
2721 Send text to topic in mr-stub.
2722 | arg list |
2723 |--|
2724 | `<topic-url> <text-file>` |
2725
2726 | parameter | description |
2727 | --------- | ----------- |
2728 | `<topic-url>` | Topic url  |
2729 | `<text-file>` | Path to file with text msg as string  |
2730
2731 ## Function: mr_api_generate_json_payload_file ##
2732
2733 Create json file with dummy data for payload.
2734 | arg list |
2735 |--|
2736 | `<size-in-kb> <filename>` |
2737
2738 | parameter | description |
2739 | --------- | ----------- |
2740 | `<size-in-kb>` | Generated size in kb  |
2741 | `<filename>` | Path to output file  |
2742
2743 ## Function: mr_api_generate_text_payload_file ##
2744
2745 Create file with dummy text data for payload.
2746 | arg list |
2747 |--|
2748 | `<size-in-kb> <filename>` |
2749
2750 | parameter | description |
2751 | --------- | ----------- |
2752 | `<size-in-kb>` | Generated size in kb  |
2753 | `<filename>` | Path to output file  |
2754
2755 # Description of functions in ngw_api_functions.sh #
2756
2757 ## Function: use_gateway_http ##
2758
2759 Use http for all calls to the gateway. This is set by default.
2760 | arg list |
2761 |--|
2762 | None |
2763
2764 ## Function: use_gateway_https ##
2765
2766 Use https for all calls to the gateway.
2767 | arg list |
2768 |--|
2769 | None |
2770
2771 ## Function: set_gateway_debug ##
2772
2773 Set debug level logging in the gateway
2774 | arg list |
2775 |--|
2776 | None |
2777
2778 ## Function: set_gateway_trace ##
2779
2780 Set debug level logging in the trace
2781 | arg list |
2782 |--|
2783 | None |
2784
2785 ## Function: start_gateway ##
2786
2787 Start the the gateway container in docker or kube depending on start mode
2788 | arg list |
2789 |--|
2790 | None |
2791
2792 ## Function: gateway_a1pms_get_status ##
2793
2794 Sample test of a1pms api (status)
2795 Only response code tested - not payload
2796 | arg list |
2797 |--|
2798 | `<response-code>` |
2799
2800 | parameter | description |
2801 | --------- | ----------- |
2802 | `<response-code>` | Expected http response code |
2803
2804 ## Function: gateway_ics_get_types ##
2805
2806 Sample test of ics api (get types)
2807 Only response code tested - not payload
2808 | arg list |
2809 |--|
2810 | `<response-code>` |
2811
2812 | parameter | description |
2813 | --------- | ----------- |
2814 | `<response-code>` | Expected http response code |
2815
2816
2817 # Description of functions in prodstub_api_functions.sh #
2818
2819 ## Function: use_prod_stub_http ##
2820
2821 Use http for the API.  The admin API is not affected. This is the default protocol.
2822 | arg list |
2823 |--|
2824 | None |
2825
2826 ## Function: use_prod_stub_https ##
2827
2828 Use https for the API. The admin API is not affected.
2829 | arg list |
2830 |--|
2831 | None |
2832
2833 ## Function: start_prod_stub ##
2834
2835 Start the Producer stub container in docker or kube depending on start mode
2836 | arg list |
2837 |--|
2838 | None |
2839
2840 ## Function: prodstub_arm_producer ##
2841
2842 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
2843
2844 | arg list |
2845 |--|
2846 | `<response-code> <producer-id> [<forced_response_code>]` |
2847
2848 | parameter | description |
2849 | --------- | ----------- |
2850 | `<response-code>` | Expected http response code |
2851 | `<producer-id>` | Id of the producer  |
2852 | `<forced_response_code>` | Forced response code for the producer callback url |
2853
2854 ## Function: prodstub_arm_job_create ##
2855
2856 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.
2857
2858 | arg list |
2859 |--|
2860 | `<response-code> <job-id> [<forced_response_code>]` |
2861
2862 | parameter | description |
2863 | --------- | ----------- |
2864 | `<response-code>` | Expected http response code |
2865 | `<job-id>` | Id of the job  |
2866 | `<forced_response_code>` | Forced response code for the create callback url |
2867
2868 ## Function: prodstub_arm_job_delete ##
2869
2870 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.
2871
2872 | arg list |
2873 |--|
2874 | `<response-code> <job-id> [<forced_response_code>]` |
2875
2876 | parameter | description |
2877 | --------- | ----------- |
2878 | `<response-code>` | Expected http response code |
2879 | `<job-id>` | Id of the job  |
2880 | `<forced_response_code>` | Forced response code for the delete callback url |
2881
2882 ## Function: prodstub_arm_type ##
2883
2884 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
2885
2886 | arg list |
2887 |--|
2888 | `<response-code> <producer-id> <type-id>` |
2889
2890 | parameter | description |
2891 | --------- | ----------- |
2892 | `<response-code>` | Expected http response code |
2893 | `<producer-id>` | Id of the producer  |
2894 | `<type-id>` | Id of the type  |
2895
2896 ## Function: prodstub_disarm_type ##
2897
2898 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
2899
2900 | arg list |
2901 |--|
2902 | `<response-code> <producer-id> <type-id>` |
2903
2904 | parameter | description |
2905 | --------- | ----------- |
2906 | `<response-code>` | Expected http response code |
2907 | `<producer-id>` | Id of the producer  |
2908 | `<type-id>` | Id of the type  |
2909
2910 ## Function: prodstub_check_jobdata ##
2911
2912 Check a job in the prodstub towards the list of provided parameters.
2913
2914 | arg list |
2915 |--|
2916 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2917
2918 | parameter | description |
2919 | --------- | ----------- |
2920 | `<response-code>` | Expected http response code |
2921 | `<producer-id>` | Id of the producer  |
2922 | `<job-id>` | Id of the job  |
2923 | `<type-id>` | Id of the type  |
2924 | `<target-url>` | Target url for data delivery  |
2925 | `<job-owner>` | Id of the job owner  |
2926 | `<template-job-file>` | Path to a job template file  |
2927
2928 ## Function: prodstub_check_jobdata_2 ##
2929
2930 Check a job in the prodstub towards the list of provided parameters.
2931
2932 | arg list |
2933 |--|
2934 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2935
2936 | parameter | description |
2937 | --------- | ----------- |
2938 | `<response-code>` | Expected http response code |
2939 | `<producer-id>` | Id of the producer  |
2940 | `<job-id>` | Id of the job  |
2941 | `<type-id>` | Id of the type  |
2942 | `<target-url>` | Target url for data delivery  |
2943 | `<job-owner>` | Id of the job owner  |
2944 | `<template-job-file>` | Path to a job template file  |
2945
2946 ## Function: prodstub_check_jobdata_3 ##
2947
2948 Check a job in the prodstub towards the list of provided parameters.
2949
2950 | arg list |
2951 |--|
2952 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2953
2954 | parameter | description |
2955 | --------- | ----------- |
2956 | `<response-code>` | Expected http response code |
2957 | `<producer-id>` | Id of the producer  |
2958 | `<job-id>` | Id of the job  |
2959 | `<type-id>` | Id of the type  |
2960 | `<target-url>` | Target url for data delivery  |
2961 | `<job-owner>` | Id of the job owner  |
2962 | `<template-job-file>` | Path to a job template file  |
2963
2964 ## Function: prodstub_delete_jobdata ##
2965
2966 Delete the job parameters, job data, for a job.
2967
2968 | arg list |
2969 |--|
2970 | `<response-code> <producer-id> <job-id>` |
2971
2972 | parameter | description |
2973 | --------- | ----------- |
2974 | `<response-code>` | Expected http response code |
2975 | `<producer-id>` | Id of the producer  |
2976 | `<job-id>` | Id of the job  |
2977
2978 ## Function: prodstub_equal ##
2979
2980 Tests if a variable value in the prodstub is equal to a target value.
2981 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2982 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.
2983
2984 | arg list |
2985 |--|
2986 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2987
2988 | parameter | description |
2989 | --------- | ----------- |
2990 | `<variable-name>` | Variable name in the prostub  |
2991 | `<target-value>` | Target value for the variable  |
2992 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
2993
2994 # Description of functions in rc_api_function.sh #
2995
2996 ## Function: use_rapp_catalogue_http ##
2997
2998 Use http for the API. This is the default protocol.
2999 | arg list |
3000 |--|
3001 | None |
3002
3003 ## Function: use_rapp_catalogue_https ##
3004
3005 Use https for the API.
3006 | arg list |
3007 |--|
3008 | None |
3009
3010 ## Function: start_rapp_catalogue ##
3011
3012 Start the rapp catalogue container in docker or kube depending on start mode
3013 | arg list |
3014 |--|
3015 | None |
3016
3017 ## Function: rc_equal ##
3018
3019 Tests if a variable value in the RAPP Catalogue is equal to a target value.
3020 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
3021 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.
3022 See the 'cr' dir for more details.
3023 | arg list |
3024 |--|
3025 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
3026
3027 | parameter | description |
3028 | --------- | ----------- |
3029 | `<variable-name>` | Variable name in the RC  |
3030 | `<target-value>` | Target value for the variable  |
3031 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
3032
3033 ## Function: rapp_cat_api_get_services ##
3034
3035 Check all registered services.
3036
3037 | arg list |
3038 |--|
3039 | `<response-code> [(<service-id> <version> <display-name> <description>)+ \| EMPTY ]` |
3040
3041 | parameter | description |
3042 | --------- | ----------- |
3043 | `<response-code>` | Expected http response code |
3044 | `<service-id>` | Id of the service  |
3045 | `<version>` | Version of the service  |
3046 | `<display-name>` | Dislay name of the service  |
3047 | `<description>` | Description of the service  |
3048 | `EMPTY` | Indicator for an empty list  |
3049
3050 ## Function: rapp_cat_api_put_service ##
3051
3052 Register a services.
3053
3054 | arg list |
3055 |--|
3056 | `<response-code> <service-id> <version> <display-name> <description>` |
3057
3058 | parameter | description |
3059 | --------- | ----------- |
3060 | `<response-code>` | Expected http response code |
3061 | `<service-id>` | Id of the service  |
3062 | `<version>` | Version of the service  |
3063 | `<display-name>` | Dislay name of the service  |
3064 | `<description>` | Description of the service  |
3065
3066 ## Function: rapp_cat_api_get_service ##
3067
3068 Check a registered service.
3069
3070 | arg list |
3071 |--|
3072 | `<response-code> <service-id> <version> <display-name> <description>` |
3073
3074 | parameter | description |
3075 | --------- | ----------- |
3076 | `<response-code>` | Expected http response code |
3077 | `<service-id>` | Id of the service  |
3078 | `<version>` | Version of the service  |
3079 | `<display-name>` | Dislay name of the service  |
3080 | `<description>` | Description of the service  |
3081
3082 ## Function: rapp_cat_api_delete_service ##
3083
3084 Check a registered service.
3085
3086 | arg list |
3087 |--|
3088 | `<response-code> <service-id>` |
3089
3090 | parameter | description |
3091 | --------- | ----------- |
3092 | `<response-code>` | Expected http response code |
3093 | `<service-id>` | Id of the service  |
3094
3095
3096 # Description of functions in ricmediatorsim_api_functions.sh #
3097
3098 The functions below only use the admin interface of the ricmediator, no usage of the A1 interface.
3099
3100 ## Function: use_ricmediator_simulator_http ##
3101
3102 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 A1PMS.
3103 | arg list |
3104 |--|
3105 | None |
3106
3107 ## Function: use_ricmediator_simulator_https ##
3108
3109 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 A1PMS.
3110 | arg list |
3111 |--|
3112 | None |
3113
3114 ## Function: start_ricmediator_simulators ##
3115
3116 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
3117 | arg list |
3118 |--|
3119 | `ricsim_g1\|ricsim_g2\|ricsim_g3 <count> <interface-id>` |
3120
3121 | parameter | description |
3122 | --------- | ----------- |
3123 | `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  |
3124 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
3125 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
3126
3127 ## Function: get_kube_ricmediatorsim_host ##
3128
3129 Translate ric name to kube host name.
3130 | arg list |
3131 |--|
3132 | `<ric-name>` |
3133
3134 | parameter | description |
3135 | --------- | ----------- |
3136 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
3137
3138 ## Function: nearsim_generate_policy_uuid ##
3139
3140 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
3141 UUID is then automatically added to the policy id in GET/PUT/DELETE.
3142 | arg list |
3143 |--|
3144 | None |
3145
3146
3147 ## Function: ricmediatorsim_put_policy_type ##
3148
3149 Loads a policy type to the simulator
3150
3151 | arg list |
3152 |--|
3153 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
3154
3155 | parameter | description |
3156 | --------- | ----------- |
3157 | `<response-code>` | Expected http response code |
3158 | `<ric-id>` |  Id of the ric |
3159 | `<policy-type-id>` |  Id of the policy type |
3160 | `<policy-type-file>` |  Path to the schema file of the policy type |
3161
3162 ## Function: ricmediatorsim_delete_policy_type ##
3163
3164 Deletes a policy type from the simulator
3165
3166 | arg list |
3167 |--|
3168 | `<response-code> <ric-id> <policy_type_id>` |
3169
3170 | parameter | description |
3171 | --------- | ----------- |
3172 | `<response-code>` | Expected http response code |
3173 | `<ric-id>` |  Id of the ric |
3174 | `<policy-type-id>` |  Id of the policy type |
3175
3176
3177 # Description of functions in ricsim_api_functions.sh #
3178
3179 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
3180
3181 ## Function: use_simulator_http ##
3182
3183 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 A1PMS.
3184 | arg list |
3185 |--|
3186 | None |
3187
3188 ## Function: use_simulator_https ##
3189
3190 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 A1PMS.
3191 | arg list |
3192 |--|
3193 | None |
3194
3195 ## Function: start_ric_simulators ##
3196
3197 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
3198 | arg list |
3199 |--|
3200 | `ricsim_g1\|ricsim_g2\|ricsim_g3 <count> <interface-id>` |
3201
3202 | parameter | description |
3203 | --------- | ----------- |
3204 | `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  |
3205 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
3206 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
3207
3208 ## Function: get_kube_sim_host ##
3209
3210 Translate ric name to kube host name.
3211 | arg list |
3212 |--|
3213 | `<ric-name>` |
3214
3215 | parameter | description |
3216 | --------- | ----------- |
3217 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
3218
3219 ## Function: sim_generate_policy_uuid ##
3220
3221 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
3222 UUID is then automatically added to the policy id in GET/PUT/DELETE.
3223 | arg list |
3224 |--|
3225 | None |
3226
3227 ## Function: sim_equal ##
3228
3229 Tests if a variable value in the RIC simulator is equal to a target value.
3230 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
3231 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.
3232 See the 'a1-interface' repo for more details.
3233
3234 | arg list |
3235 |--|
3236 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
3237
3238 | parameter | description |
3239 | --------- | ----------- |
3240 | `<variable-name>` | Variable name in the ric simulator  |
3241 | `<target-value>` | Target value for the variable  |
3242 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
3243
3244 ## Function: sim_print ##
3245
3246 Prints the value of a variable in the RIC simulator.
3247 See the 'a1-interface' repo for more details.
3248
3249 | arg list |
3250 |--|
3251 | `<variable-name>` |
3252
3253 | parameter | description |
3254 | --------- | ----------- |
3255 | `<variable-name>` | Variable name in the RIC simulator  |
3256
3257 ## Function: sim_contains_str ##
3258
3259 Tests if a variable value in the RIC simulator contains a target string.
3260 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
3261 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.
3262 See the 'a1-interface' repo for more details.
3263
3264 | arg list |
3265 |--|
3266 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
3267
3268 | parameter | description |
3269 | --------- | ----------- |
3270 | `<variable-name>` | Variable name in the ric simulator  |
3271 | `<target-value>` | Target substring for the variable  |
3272 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
3273
3274 ## Function: sim_put_policy_type ##
3275
3276 Loads a policy type to the simulator
3277
3278 | arg list |
3279 |--|
3280 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
3281
3282 | parameter | description |
3283 | --------- | ----------- |
3284 | `<response-code>` | Expected http response code |
3285 | `<ric-id>` |  Id of the ric |
3286 | `<policy-type-id>` |  Id of the policy type |
3287 | `<policy-type-file>` |  Path to the schema file of the policy type |
3288
3289 ## Function: sim_delete_policy_type ##
3290
3291 Deletes a policy type from the simulator
3292
3293 | arg list |
3294 |--|
3295 | `<response-code> <ric-id> <policy_type_id>` |
3296
3297 | parameter | description |
3298 | --------- | ----------- |
3299 | `<response-code>` | Expected http response code |
3300 | `<ric-id>` |  Id of the ric |
3301 | `<policy-type-id>` |  Id of the policy type |
3302
3303 ## Function: sim_post_delete_instances ##
3304
3305 Deletes all instances (and status), for one ric
3306
3307 | arg list |
3308 |--|
3309 | `<response-code> <ric-id>` |
3310
3311 | parameter | description |
3312 | --------- | ----------- |
3313 | `<response-code>` | Expected http response code |
3314 | `<ric-id>` |  Id of the ric |
3315
3316 ## Function: sim_post_delete_all ##
3317
3318 Deletes all types, instances (and status), for one ric
3319
3320 | arg list |
3321 |--|
3322 | `<response-code> <ric-id>` |
3323
3324 | parameter | description |
3325 | --------- | ----------- |
3326 | `<response-code>` | Expected http response code |
3327 | `<ric-id>` |  Id of the ric |
3328
3329 ## Function: sim_post_forcedresponse ##
3330
3331 Sets (or resets) response code for next (one) A1 message, for one ric.
3332 The intention is to simulate error response on the A1 interface.
3333
3334 | arg list |
3335 |--|
3336 | `<response-code> <ric-id> [<forced_response_code>]`|
3337
3338 | parameter | description |
3339 | --------- | ----------- |
3340 | `<response-code>` | Expected http response code |
3341 | `<ric-id>` |  Id of the ric |
3342 | `<forced_response_code>` |  Http response code to send |
3343
3344 ## Function: sim_post_forcedelay ##
3345
3346 Sets (or resets) A1 response delay, for one ric
3347 The intention is to delay responses on the A1 interface. Setting remains until removed.
3348
3349 | arg list |
3350 |--|
3351 | `<response-code> <ric-id> [<delay-in-seconds>]`|
3352
3353 | parameter | description |
3354 | --------- | ----------- |
3355 | `<response-code>` | Expected http response code |
3356 | `<ric-id>` |  Id of the ric |
3357 | `<delay-in-seconds>` |  Delay in seconds. If omitted, the delay is removed |
3358
3359 # Description of functions in sdnc_api_functions.sh #
3360
3361 The file contains a selection of the possible API tests towards the SDNC (a1-controller)
3362
3363 ## Function: use_sdnc_http ##
3364
3365 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 A1PMS.
3366 | arg list |
3367 |--|
3368 | None |
3369
3370 ## Function: use_sdnc_https ##
3371
3372 Use https for all API calls towards the SDNC A1 Controller. Note that this function shall be called before preparing the config for A1PMS.
3373 | arg list |
3374 |--|
3375 | None |
3376
3377 ## Function: start_sdnc ##
3378
3379 Start the SDNC A1 Controller container and its database container
3380 | arg list |
3381 |--|
3382 | None |
3383
3384 ## Function: stop_sdnc ##
3385
3386 Stop the SDNC A1 Controller container and its database container
3387 | arg list |
3388 |--|
3389 | None |
3390
3391 ## Function: start_stopped_sdnc ##
3392
3393 Start a previously stopped SDNC
3394 | arg list |
3395 |--|
3396 | None |
3397
3398 ## Function: check_sdnc_logs ##
3399
3400 Check the SDNC log for any warnings and errors and print the count of each.
3401 | arg list |
3402 |--|
3403 | None |
3404
3405 ## Function: controller_api_get_A1_policy_ids ##
3406
3407 Test of GET policy ids towards OSC or STD type simulator.
3408 To test response code only, provide the response code, 'OSC' + policy type or 'STD'
3409 To test the response payload, include the ids of the expexted response.
3410
3411 | arg list |
3412 |--|
3413 | `<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) \| ( STD <ric-id> [ <policy-id> [<policy-id>]* ]` |
3414
3415 | parameter | description |
3416 | --------- | ----------- |
3417 | `<response-code>` | Expected http response code |
3418 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
3419 | `<ric-id>` | Id of the ric  |
3420 | `policy-type-id>` |  Id of the policy type |
3421 | `<policy-id>` |  Id of the policy |
3422 | `STD` |  Indicator of status of Standarized A1 |
3423
3424 ## Function: controller_api_get_A1_policy_type ##
3425
3426 Test of GET a policy type (OSC only)
3427
3428 | arg list |
3429 |--|
3430 | `<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]` |
3431
3432 | parameter | description |
3433 | --------- | ----------- |
3434 | `<response-code>` | Expected http response code |
3435 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
3436 | `<ric-id>` | Id of the ric  |
3437 | `policy-type-id>` |  Id of the policy type |
3438 | `policy-type-file>` |  Optional schema file to compare the returned type with |
3439
3440 ## Function: controller_api_delete_A1_policy ##
3441
3442 Deletes a policy instance
3443
3444 | arg list |
3445 |--|
3446 | `(STD <ric-id> <policy-id>) \| (OSC <ric-id> <policy-type-id> <policy-id>)` |
3447
3448 | parameter | description |
3449 | --------- | ----------- |
3450 | `<response-code>` | Expected http response code |
3451 | `STD` |  Indicator of status of Standarized A1 |
3452 | `<ric-id>` | Id of the ric  |
3453 | `<policy-id>` |  Id of the policy |
3454 | `policy-type-id>` |  Id of the policy type |
3455 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
3456 | `policy-type-file>` |  Optional schema file to compare the returned type with |
3457
3458 ## Function: controller_api_put_A1_policy ##
3459
3460 Creates a policy instance
3461
3462 | arg list |
3463 |--|
3464 | `<response-code> (STD <ric-id> <policy-id> <template-file> ) \| (OSC <ric-id> <policy-type-id> <policy-id> <template-file>)` |
3465
3466 | parameter | description |
3467 | --------- | ----------- |
3468 | `<response-code>` | Expected http response code |
3469 | `STD` |  Indicator of status of Standarized A1 |
3470 | `<ric-id>` | Id of the ric  |
3471 | `<policy-id>` |  Id of the policy |
3472 | `<template-file>` |  Path to the template file of the policy|
3473 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
3474 | `<policy-type-id>` |  Id of the policy type |
3475
3476 ## Function: controller_api_get_A1_policy_status ##
3477
3478 Checks the status of a policy
3479
3480  arg list |
3481 |--|
3482 | `<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) \| (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)` |
3483
3484 | parameter | description |
3485 | --------- | ----------- |
3486 | `<response-code>` | Expected http response code |
3487 | `STD` |  Indicator of status of Standarized A1 |
3488 | `<ric-id>` | Id of the ric  |
3489 | `<policy-id>` |  Id of the policy |
3490 | `<enforce-status>` |  Enforcement status |
3491 | `<reason>` |  Optional reason |
3492 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
3493 | `<policy-type-id>` |  Id of the policy type |
3494 | `<instance-status>` |  Instance status |
3495 | `<has-been-deleted>` |  Deleted status, true or false |
3496
3497
3498 ## License
3499
3500 Copyright (C) 2020-2023 Nordix Foundation. All rights reserved.
3501 Licensed under the Apache License, Version 2.0 (the "License");
3502 you may not use this file except in compliance with the License.
3503 You may obtain a copy of the License at
3504
3505      http://www.apache.org/licenses/LICENSE-2.0
3506
3507 Unless required by applicable law or agreed to in writing, software
3508 distributed under the License is distributed on an "AS IS" BASIS,
3509 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3510 See the License for the specific language governing permissions and
3511 limitations under the License.