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.
6 ## Overview for common test scripts and files ##
8 `a1pms_api_functions.sh` \
9 Contains functions for adapting towards the Policy Management Service (A1PMS) API.
12 A common curl based function for the a1pms and ics apis. Also partly used for the Callback receiver and RAPP Catalogue apis.
14 `authsidecar_api_functions.sh` \
15 Image handling functions for the auth_token_fetch image.
17 `chartmus_api_functions.sh` \
18 Contains functions for managing a Chartmuseum instance.
21 Cleans all containers started by the test environment in docker.
24 Cleans all services, deployments, pods, replica set etc started by the test environment in kubernetes.
27 Cleans all namespaces created by the test environment in kubernetes.
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'.
32 `count_json_elements.py` \
33 A python script calculate the length of json array or size of a json dictionary'.
35 `count_json_elements.py` \
36 A python script returning the number of items in a json array.
38 `cp_api_function.sh` \
39 Contains functions for managing the Control Panel.
41 `cr_api_functions.sh` \
42 Contains functions for adapting towards the Callback receiver for checking received callback events.
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.
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.
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.
53 `dmaapadp_api_function.sh`
54 Contains functions for managing the Dmaap Adapter.
56 `dmaapmed_api_function.sh`
57 Contains functions for managing the Dmaap Mediator Service.
59 `dmaapmr_api_function.sh`
60 All functions are implemented in `mr_api_functions.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)
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.
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 .
72 This script collects container statistics to a file. Works both in docker and kubernetes (only for docker runtime).
74 `helmmanager_api_functions.sh` \
75 Contains functions for managing and testing of the Helm Manager.
77 `http_proxy_api_functions.sh` \
78 Contains functions for managing the Http Proxy.
80 `ics_api_functions.sh` \
81 Contains functions for adapting towards the Information Coordinator Service API.
83 `istio_api_functions.sh` \
84 Contains functions for istio configurations.
86 `kafkapc_api_functions.sh` \
87 Contains functions for managing the kafka producer/consumer. Kafka is started by the dmaap message router component.
89 `keycloak_api_functions.sh` \
90 Contains functions for keycloak configuration.
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.
95 `localhelm_api_functions.sh` \
96 Contains functions for helm access on localhost.
98 `mr_api_functions.sh` \
99 Contains functions for managing the MR Stub and the Dmaap Message Router
101 `ngw_api_functions.sh` \
102 Contains functions for managing the Non-RT RIC Gateway
104 `prodstub_api_functions.sh` \
105 Contains functions for adapting towards the Producer stub interface - simulates a producer.
107 `pvccleaner_api_functions.sh` \
108 Contains functions for managing the PVC Cleaner (used for reset mounted volumes in kubernetes).
110 `rc_api_functions.sh` \
111 Contains functions for adapting towards the RAPP Catalogue.
113 `ricsim_api_functions.sh` \
114 Contains functions for adapting towards the RIC (A1) simulator admin API.
116 `ricmediatorsim_api_functions.sh` \
117 Contains functions for adapting towards the ricmediator simulator (A1) API.
119 `sdnc_api_functions.sh` \
120 Contains functions for adaping towards the SDNC (used as an A1 controller).
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'.
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.
130 `testengine_config.sh` \
131 Configuration file to setup the applications (components and simulators) the test environment handles.
133 `testsuite_common.sh` \
134 Common functions for running two or more auto test scripts as a suite.
136 ## Integration of a new applicaton ##
138 Integration a new application to the test environment involves the following steps.
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.
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`.
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.
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 |
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.
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.
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.
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.
170 | Label for docker compose | Description |
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 |
175 | Label for kubernetes resource | Description |
177 | autotest | shall contain the application short name |
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.
182 # Description of functions in testcase_common.sh #
186 The script can be started with these arguments
190 | `remote\|remote-remove `
192 ` --env-file <environment-filename> `
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>]`
206 ` [--override <override-environment-filename>]`
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> ]` |
219 | parameter | description |
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 |
253 | `help` | Print this info along with the test script description and the list of app short names supported |
255 ## Function: setup_testenvironment ##
257 Main function to setup the test environment before any tests are started.
258 Must be called right after sourcing all component scripts.
263 ## Function: print_result ##
265 Print a test report of an auto-test script.
270 ## Function: start_timer ##
272 Start a timer for time measurement. Only one timer can be running.
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`) |
278 ## Function: print_timer ##
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.
285 ## Function: deviation ##
287 Mark a test as a deviation from the requirements. The list of deviations will be printed in the test report.
290 | `<deviation-message-to-print>` |
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 |
296 ## Function: clean_environment ##
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).
303 ## Function: auto_clean_containers ##
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.
310 ## Function: sleep_wait ##
312 Make the script sleep for a number of seconds.
315 | `<sleep-time-in-sec> [<any-text-in-quotes-to-be-printed>]` |
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 |
322 ## Function: store_logs ##
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.
327 | `<logfile-prefix>` |
329 | parameter | description |
330 | --------- | ----------- |
331 | `<logfile-prefix>` | Log file prefix |
333 # Description of functions in testsuite_common.sh #
335 ## Function: suite_setup ##
337 Sets up the test suite and prints out a heading.
344 Print out the overall result of the executed test cases.
349 # Description of functions in a1pms_api_functions.sh #
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.
356 ## Function: use_a1pms_rest_http ##
358 Use http for all API calls to the A1PMS. This is the default.
363 ## Function: use_a1pms_rest_https ##
365 Use https for all API calls to the A1PMS.
370 ## Function: use_a1pms_dmaap_http ##
372 Send and receive all API calls to the A1PMS over Dmaap via the MR over http.
377 ## Function: use_a1pms_dmaap_https ##
379 Send and receive all API calls to the A1PMS over Dmaap via the MR over https.
384 ## Function: start_a1pms ##
386 Start the A1PMS container or corresponding kube resources depending on docker/kube mode.
389 | `<logfile-prefix>` |
390 | (docker) `PROXY\|NOPROXY <config-file>` |
391 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
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 |
400 ## Function: stop_a1pms ##
402 Stop the a1pms container (docker) or scale it to zero (kubernetes).
407 ## Function: start_stopped_a1pms ##
409 Start a previously stopped a1pms container (docker) or scale it to 1 (kubernetes).
414 ## Function: prepare_a1pms_config ##
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')
419 | `SDNC|NOSDNC <output-file>` |
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' |
427 ## Function: a1pms_load_config ##
429 Load the config into a config map (kubernetes only).
434 | parameter | description |
435 | --------- | ----------- |
436 | `<data-file>` | Path to application_configuration.json |
438 ## Function: set_a1pms_debug ##
440 Configure the A1PMS log on debug level. The A1PMS must be running.
445 ## Function: set_a1pms_trace ##
447 Configure the A1PMS log on trace level. The A1PMS must be running.
452 ## Function: use_a1pms_retries ##
454 Configure the A1PMS to make up-to 5 retries if an API call returns any of the specified http return codes.
457 | `[<response-code>]*` |
459 ## Function: check_a1pms_logs ##
461 Check the A1PMS log for any warnings and errors and print the count of each.
466 ## Function: a1pms_equal ##
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.
475 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
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 |
483 ## Function: a1pms_api_get_policies ##
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.
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>]*]` |
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>]*]` |
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) |
513 ## Function: a1pms_api_get_policy ##
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.
521 | `<response-code> <policy-id> [<template-file>]` |
525 | `<response-code> <policy-id> [ <template-file> <service-name> <ric-id> <policytype-id>\|NOTYPE <transient> <notification-url>\|NOURL ]` |
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 |
539 ## Function: a1pms_api_put_policy ##
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).
546 | `<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]` |
550 | `<response-code> <service-name> <ric-id> <policytype-id>\|NOTYPE <policy-id> <transient>\|NOTRANSIENT <notification-url>\|NOURL <template-file> [<count>]` |
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 |
565 ## Function: a1pms_api_put_policy_batch ##
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'.
571 ## Function: a1pms_api_put_policy_parallel ##
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.
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>`
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>`
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 |
597 ## Function: a1pms_api_delete_policy ##
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.
603 | `<response-code> <policy-id> [<count>]`
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. |
611 ## Function: a1pms_api_delete_policy_batch ##
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'.
617 ## Function: a1pms_api_delete_policy_parallel ##
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.
623 | `<response-code> <ric-id-base> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>`
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 |
634 ## Function: a1pms_api_get_policy_ids ##
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.
642 | `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <type-id>\|NOTYPE ([<policy-instance-id]*\|NOID)` |
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 |
656 ## Function: a1pms_api_get_policy_schema ##
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.
664 | `<response-code> <policy-type-id> [<schema-file>]` |
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 |
672 ## Function: a1pms_api_get_policy_schema ##
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.
680 | `<response-code> <policy-type-id> [<schema-file>]` |
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 |
688 ## Function: a1pms_api_get_policy_schemas ##
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)
696 | `<response-code> <ric-id>\|NORIC [<schema-file>\|NOFILE]*` |
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 |
706 ## Function: a1pms_api_get_policy_status ##
708 Test of GET '/policy_status' or V2 GET '/policies/{policy_id}/status'.
712 | `<response-code> <policy-id> (STD\|STD2 <enforce-status>\|EMPTY [<reason>\|EMPTY])\|(OSC <instance-status> <has-been-deleted>)` |
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 |
727 ## Function: a1pms_api_get_policy_types ##
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)
735 | `<response-code> [<ric-id>\|NORIC [<policy-type-id>\|EMPTY [<policy-type-id>]*]]` |
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 |
745 ## Function: a1pms_api_get_status ##
747 Test of GET /status or V2 GET /status
751 | `<response-code>` |
753 | parameter | description |
754 | --------- | ----------- |
755 | `<response-code>` | Expected http response code |
757 ## Function: a1pms_api_get_ric ##
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.
765 | `<reponse-code> <managed-element-id> [<ric-id>]` |
769 | `<reponse-code> <management-element-id>\|NOME <ric-id>\|<NORIC> [<string-of-ricinfo>]` |
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 |
780 ## Function: a1pms_api_get_rics ##
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_........."`
790 | `<reponse-code> <policy-type-id>\|NOTYPE [<space-separate-string-of-ricinfo>]` |
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 |
799 ## Function: a1pms_api_put_service ##
801 Test of PUT '/service' or V2 PUT '/service'.
804 | `<response-code> <service-name> <keepalive-timeout> <callbackurl>` |
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 |
813 ## Function: a1pms_api_get_services ##
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.
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>]* )]` |
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 |
832 ## Function: a1pms_api_get_service_ids ##
834 Test of GET '/services' or V2 GET /'v2/services'. Only check of service ids.
838 | `<response-code> [<service-name>]*` |
840 | parameter | description |
841 | --------- | ----------- |
842 | `<response-code>` | Expected http response code |
843 | `<service-name>` | Service name |
845 ## Function: a1pms_api_delete_services ##
847 Test of DELETE '/services' or V2 DELETE '/v2/services/{serviceId}'
851 | `<response-code> [<service-name>]*` |
853 | parameter | description |
854 | --------- | ----------- |
855 | `<response-code>` | Expected http response code |
856 | `<service-name>` | Service name |
858 ## Function: a1pms_api_put_services_keepalive ##
860 Test of PUT '/services/keepalive' or V2 PUT '/v2/services/{service_id}/keepalive'
864 | `<response-code> <service-name>` |
866 | parameter | description |
867 | --------- | ----------- |
868 | `<response-code>` | Expected http response code |
869 | `<service-name>` | Service name |
871 ## Function: a1pms_api_put_configuration ##
873 Test of PUT '/v2/configuration'
877 | `<response-code> <config-file>` |
879 | parameter | description |
880 | --------- | ----------- |
881 | `<response-code>` | Expected http response code |
882 | `<config-file>` | Path json config file |
884 ## Function: a1pms_api_get_configuration ##
886 Test of GET '/v2/configuration'
890 | `<response-code> [<config-file>]` |
892 | parameter | description |
893 | --------- | ----------- |
894 | `<response-code>` | Expected http response code |
895 | `<config-file>` | Path json config file to compare the retrieved config with |
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
907 # Description of functions in authsidecar_api_function.sh #
908 Only common API functions in this file.
911 ## Function: start_chart_museum ##
913 Start the Chart Museum
918 ## Function: chartmus_upload_test_chart ##
920 Upload a package chart to chartmusem
925 | parameter | description |
926 | --------- | ----------- |
927 | `<chart-name>` | Name of the chart to upload |
929 ## Function: chartmus_delete_test_chart ##
931 Delete a chart in chartmusem
934 | `<chart-name> [<version>]` |
936 | parameter | description |
937 | --------- | ----------- |
938 | `<chart-name>` | Name of the chart to delete |
939 | `<version>` | Chart version, default is 0.1.0 |
941 # Description of functions in cp_api_function.sh #
943 ## Function: use_control_panel_http ##
945 Set http as the protocol to use for all communication to the Control Panel
950 ## Function: use_control_panel_https ##
952 Set https as the protocol to use for all communication to the Control Panel
957 ## Function: start_control_panel ##
959 Start the Control Panel container
964 # Description of functions in cr_api_functions.sh #
966 ## Function: use_cr_http ##
968 Use http for getting event from CR. The admin API is not affected. This is the default.
973 ## Function: use_cr_https ##
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.
981 ## Function: start_cr ##
983 Start the Callback Receiver container in docker or kube depending on start mode.
988 ## Function: cr_equal ##
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.
996 | `<cr-path-id> <variable-name> <target-value> [ <timeout-in-sec> ]` |
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 |
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.
1012 | `<cr-path-id> <variable-name> <target-value> [ <timeout-in-sec> ]` |
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 |
1021 ## Function: cr_contains_str ##
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.
1030 | `<cr-path-id> <variable-name> <target-value> [ <timeout-in-sec> ]` |
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 |
1040 ## Function: cr_read ##
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.
1046 | `<cr-path-id> <variable-name>` |
1048 | parameter | description |
1049 | --------- | ----------- |
1050 | `<cr-path-id>` | Variable index to CR |
1051 | `<variable-name>` | Variable name in the CR |
1053 ## Function: cr_delay_callback ##
1055 Function to configure write delay on callbacks. Delay given in seconds. Setting remains until removed.
1059 | `<response-code> <cr-path-id> [<delay-in-seconds>]`|
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 |
1067 ## Function: cr_api_check_all_sync_events ##
1069 Check the contents of all ric events received for a callback id.
1073 | `<response-code> <cr-path-id> <id> [ EMPTY \| ( <ric-id> )+ ]` |
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 |
1083 ## Function: cr_api_check_all_ics_events ##
1085 Check the contents of all current status events for one id from ICS
1089 | `<response-code> <cr-path-id> <id> [ EMPTY \| ( <status> )+ ]` |
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 |
1099 ## Function: cr_api_check_all_ics_subscription_events ##
1101 Check the contents of all current subscription events for one id from ICS
1105 | `<response-code> <cr-path-id> <id> [ EMPTY | ( <type-id> <schema> <registration-status> )+ ]` |
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 |
1117 ## Function: cr_api_reset ##
1119 Reset the callback receiver
1125 | parameter | description |
1126 | --------- | ----------- |
1127 | `<cr-path-id>` | Variable index for CR |
1129 ## Function: cr_api_check_all_generic_json_events ##
1131 Check the contents of all json events for path
1135 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <json-msg>+ )` |
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 |
1145 ## Function: cr_api_check_single_generic_json_event ##
1147 Check a single (oldest) json event (or none if empty) for path
1151 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <json-msg> )` |
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 |
1161 ## Function: cr_api_check_single_generic_event_md5 ##
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.
1169 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <data-msg> )` |
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 |
1179 ## Function: cr_api_check_single_generic_event_md5_file ##
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
1187 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <data-file> )` |
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 |
1197 # Description of functions in dmaapadp_api_functions.sh #
1199 ## Function: use_dmaapadp_http ##
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.
1207 ## Function: use_dmaapadp_https ##
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.
1215 ## Function: start_dmaapadp ##
1217 Start the dmaap adator service container in docker or kube depending on running mode.
1221 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
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 |
1230 ## Function: set_dmaapadp_trace ##
1232 Configure the dmaap adaptor service log on trace level. The app must be running.
1237 # Description of functions in dmaapmed_api_functions.sh #
1239 ## Function: use_dmaapmed_http ##
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.
1247 ## Function: use_dmaapmed_https ##
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.
1255 ## Function: start_dmaapmed ##
1257 Start the dmaap mediator service container in docker or kube depending on running mode.
1263 # Description of functions in helmmanager_api_functions.sh #
1265 ## Function: use_helm_manager_http ##
1267 Use http for all API calls to the Helm Manager. This is the default protocol.
1272 ## Function: use_helm_manager_https ##
1274 Use https for all API calls to the Helm Manager.
1279 ## Function: start_helm_manager ##
1281 Start the Helm Manager container in docker or kube depending on running mode.
1286 ## Function: helm_manager_api_get_charts ##
1288 Get all charts and compare the expected contents.
1291 | `<response-code> [ EMPTY | ( <chart> <version> <namespace> <release> <repo> )+ ]` |
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 |
1303 ## Function: helm_manager_api_post_repo ##
1305 Add repo to the helm manager.
1308 | `<response-code> <repo-name> <repo-protocol> <repo-address> <repo-port>` |
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 |
1318 ## Function: helm_manager_api_post_onboard_chart ##
1320 Onboard a chart to the helm manager.
1323 | `<response-code> <repo> <chart> <version> <release> <namespace>` |
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 |
1334 ## Function: helm_manager_api_post_install_chart ##
1336 Install an onboarded chart.
1339 | `<response-code> <chart> <version>` |
1341 | parameter | description |
1342 | --------- | ----------- |
1343 | `<response-code>` | Expected response code |
1344 | `<chart>`| Name of the chart |
1345 | `<version>`| Version of the chart |
1347 ## Function: helm_manager_api_uninstall_chart ##
1352 | `<response-code> <chart> <version>` |
1354 | parameter | description |
1355 | --------- | ----------- |
1356 | `<response-code>` | Expected response code |
1357 | `<chart>`| Name of the chart |
1358 | `<version>`| Version of the chart |
1360 ## Function: helm_manager_api_delete_chart ##
1365 | `<response-code> <chart> <version>` |
1367 | parameter | description |
1368 | --------- | ----------- |
1369 | `<response-code>` | Expected response code |
1370 | `<chart>`| Name of the chart |
1371 | `<version>`| Version of the chart |
1373 ## Function: helm_manager_api_exec_add_repo ##
1375 Add repo in helm manager by helm using exec.
1378 | `<repo-name> <repo-url>` |
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 |
1386 # Description of functions in httpproxy_api_functions.sh #
1388 ## Function: use_http_proxy_http ##
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.
1395 ## Function: use_http_proxy_https ##
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.
1402 ## Function: start_http_proxy ##
1404 Start the http proxy container in docker or kube depending on running mode.
1410 # Description of functions in ics_api_functions.sh #
1412 ## Function: use_ics_rest_http ##
1414 Use http for all API calls to the ICS. This is the default protocol.
1419 ## Function: use_ics_rest_https ##
1421 Use https for all API calls to the ICS.
1426 ## Function: use_ics_dmaap_http ##
1428 Send and recieve all API calls to the ICS over Dmaap via the MR using http.
1433 ## Function: use_ics_dmaap_https ##
1435 Send and recieve all API calls to the ICS over Dmaap via the MR using https.
1440 ## Function: start_ics ##
1442 Start the ICS container in docker or kube depending on running mode.
1445 | `PROXY|NOPROXY <config-file>` |
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 |
1453 ## Function: stop_ics ##
1455 Stop the ICS container.
1460 ## Function: start_stopped_ics ##
1462 Start a previously stopped ics.
1467 ## Function: set_ics_debug ##
1469 Configure the ICS log on debug level. The ICS must be running.
1474 ## Function: set_ics_trace ##
1476 Configure the ICS log on trace level. The ICS must be running.
1481 ## Function: use_ics_retries ##
1483 Perform curl retries when making direct call to ICS for the specified http response codes
1484 Speace separated list of http response codes
1487 | `[<response-code>]*` |
1489 | parameter | description |
1490 | --------- | ----------- |
1491 | `<response-code>` | Http response code to make retry for |
1493 ## Function: check_ics_logs ##
1495 Check the ICS log for any warnings and errors and print the count of each.
1500 ## Function: ics_equal ##
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.
1509 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
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 |
1517 ## Function: ics_api_a1_get_job_ids ##
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.
1525 | `<response-code> <type-id> <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
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 |
1536 ## Function: ics_api_a1_get_type ##
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.
1544 | `<response-code> <type-id> [<schema-file>]` |
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 |
1552 ## Function: ics_api_a1_get_type_ids ##
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).
1560 | `<response-code> [ (EMPTY \| [<type-id>]+) ]` |
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 |
1568 ## Function: ics_api_a1_get_job_status ##
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.
1576 | `<response-code> <type-id> <job-id> [<status>]` |
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 |
1585 ## Function: ics_api_a1_get_job ##
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.
1593 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
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 |
1604 ## Function: ics_api_a1_delete_job ##
1606 Test of DELETE '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1607 To test, provide all the specified parameters.
1611 | `<response-code> <type-id> <job-id>` |
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 |
1619 ## Function: ics_api_a1_put_job ##
1621 Test of PUT '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1622 To test, provide all the specified parameters.
1626 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
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 |
1637 ## Function: ics_api_edp_get_type_ids ##
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).
1645 | `<response-code> [ EMPTY \| <type-id>+]` |
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 |
1653 ## Function: ics_api_edp_get_producer_status ##
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.
1661 | `<response-code> <producer-id> [<status>]` |
1663 | parameter | description |
1664 | --------- | ----------- |
1665 | `<response-code>` | Expected http response code |
1666 | `<producer-id>` | Id of the producer |
1667 | `<status>` | The expected status string |
1669 ## Function: ics_api_edp_get_producer_ids ##
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).
1677 | `<response-code> [ EMPTY \| <producer-id>+]` |
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 |
1685 ## Function: ics_api_edp_get_producer_ids_2 ##
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).
1693 | `<response-code> [ ( NOTYPE \| <type-id> ) [ EMPTY \| <producer-id>+]` |
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 |
1703 ## Function: ics_api_edp_get_type ##
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).
1711 | `<response-code> <type-id> [<job-schema-file> (EMPTY \| [<producer-id>]+)]` |
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 |
1721 ## Function: ics_api_edp_get_type_2 ##
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.
1729 | `<response-code> <type-id> [<job-schema-file>]` |
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 |
1738 ## Function: ics_api_edp_put_type_2 ##
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.
1744 | `<response-code> <type-id> [<job-schema-file>]` |
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 |
1753 ## Function: ics_api_edp_delete_type_2 ##
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.
1759 | `<response-code> <type-id>` |
1761 | parameter | description |
1762 | --------- | ----------- |
1763 | `<response-code>` | Expected http response code |
1764 | `<type-id>` | Id of the type |
1766 ## Function: ics_api_edp_get_producer ##
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.
1774 | `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY\| [<type-id> <schema-file>]+) ]` |
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 |
1787 ## Function: ics_api_edp_get_producer_2 ##
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.
1795 | `<response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY \| <type-id>+) ]` |
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 |
1806 ## Function: ics_api_edp_delete_producer ##
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.
1813 | `<response-code> <producer-id>` |
1815 | parameter | description |
1816 | --------- | ----------- |
1817 | `<response-code>` | Expected http response code |
1818 | `<producer-id>` | Id of the producer |
1820 ## Function: ics_api_edp_put_producer ##
1822 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1823 To test, provide all parameters. The list of type/schema pair may be empty.
1827 | `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY \| [<type-id> <schema-file>]+)` |
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 |
1839 ## Function: ics_api_edp_put_producer_2 ##
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.
1846 | `<response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE\|[<type-id>+]` |
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 |
1857 ## Function: ics_api_edp_get_producer_jobs ##
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.
1865 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
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 |
1878 ## Function: ics_api_edp_get_producer_jobs_2 ##
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.
1886 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
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 |
1899 ## Function: ics_api_service_status ##
1901 Test of GET '/status'.
1905 | `<response-code>` |
1907 | parameter | description |
1908 | --------- | ----------- |
1909 | `<response-code>` | Expected http response code |
1911 ## Function: ics_api_idc_get_type_ids ##
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).
1919 | `<response-code> [ EMPTY \| <type-id>+]` |
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 |
1927 ## Function: ics_api_idc_get_job_ids ##
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.
1935 | `<response-code> <type-id> <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
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 |
1946 ## Function: ics_api_idc_get_job ##
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.
1954 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
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 |
1965 ## Function: ics_api_idc_put_job ##
1967 Test of PUT '/data-consumer/v1/info-jobs/{infoJobId}'.
1968 To test, provide all the specified parameters.
1972 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file> [VALIDATE]` |
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 |
1984 ## Function: ics_api_idc_delete_job ##
1986 Test of DELETE '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1987 To test, provide all the specified parameters.
1991 | `<response-code> <type-id> <job-id>` |
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 |
1999 ## Function: ics_api_idc_get_type ##
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.
2007 | `<response-code> <type-id> [<schema-file>]` |
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 |
2015 ## Function: ics_api_idc_get_job_status ##
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.
2023 | `<response-code> <job-id> [<status> [ <timeout>]]` |
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 |
2032 ## Function: ics_api_idc_get_job_status2 ##
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.
2040 | `<response-code> <job-id> [<status> EMPTYPROD|( <prod-count> <producer-id>+ ) [<timeout>]]` |
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 |
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
2058 | `<response-code> <owner-id>|NOOWNER [ EMPTY | <subscription-id>+]` |
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 |
2068 ## Function: ics_api_idc_get_subscription ##
2069 Test of GET '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
2073 | `<response-code> <subscription-id> [ <owner-id> <status-uri> ]` |
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 |
2083 ## Function: ics_api_idc_put_subscription ##
2084 Test of PUT '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
2088 | `<response-code> <subscription-id> <owner-id> <status-uri>` |
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 |
2097 ## Function: ics_api_idc_delete_subscription ##
2098 Test of DELETE /data-consumer/v1/info-type-subscription/{subscriptionId}
2102 | `<response-code> <subscription-id>` |
2104 | parameter | description |
2105 | --------- | ----------- |
2106 | `<response-code>` | Expected http response code |
2107 | `<subscription-id>` |Id of the subscription |
2110 ## Function: ics_api_admin_reset ##
2112 Test of GET '/status'.
2116 | `<response-code> [ <type> ]` |
2118 | parameter | description |
2119 | --------- | ----------- |
2120 | `<response-code>` | Expected http response code |
2121 | `<type>` | Type id, if the interface supports type in url |
2123 ## Function: ics_kube_pvc_reset ##
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
2132 # Description of functions in istio_api_functions.sh #
2134 ## Function: istio_enable_istio_namespace ##
2135 Enable istio on a namespace
2141 | parameter | description |
2142 | --------- | ----------- |
2143 | `namespace` | Namespace name to enable istio on |
2145 ## Function: istio_req_auth_by_jwksuri ##
2146 Set isto authentication by jwks uri
2150 | `<app-name> <namespace> <realm>>` |
2152 | parameter | description |
2153 | --------- | ----------- |
2154 | `<app-name>` | App-name, short name |
2155 | `<namespace>` | Namespace of app |
2156 | `<realm>` | Name of realm |
2158 ## Function: istio_req_auth_by_jwks ##
2159 Set isto authentication by jwks keys (inline)
2163 | `<app> <namespace> <issuer> <key>` |
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 |
2172 ## Function: istio_auth_policy_by_realm ##
2173 Set isio authorization by realm
2177 | `<app> <namespace> <realam> [<client-id> <client-role>]` |
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 |
2188 ## Function: istio_auth_policy_by_issuer ##
2189 Set isio authorization by issuer
2193 | `<app> <namespace> <issuer>` |
2195 | parameter | description |
2196 | --------- | ----------- |
2197 | `<app-name>` | App-name, short name |
2198 | `<namespace>` | Namespace of app |
2199 | `<issuer>` | Name of issuer |
2202 # Description of functions in kafkapc_api_functions.sh #
2204 ## Function: use_kafkapc_http ##
2206 Use http for all calls to the KAFKAPC.
2211 ## Function: use_kafkapc_https ##
2213 Use https for all calls to the KAFKAPC.
2218 ## Function: start_kafkapc ##
2220 Start the KAFKAPC container in docker or kube depending on start mode
2225 ## Function: kafkapc_equal ##
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.
2233 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
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 |
2241 ## Function: kafkapc_api_reset ##
2243 Deep reset of KAFKAPC. Note that kafka itself is not affected, i.e. created topic still exist in kafka.
2248 ## Function: kafkapc_api_create_topic ##
2250 Create a topic in kafka via kafkapc.
2251 | `<response-code> <topic-name> <mime-type>` |
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 |
2259 ## Function: kafkapc_api_get_topic ##
2261 Create a from kafkapc.
2262 | `<response-code> <topic-name> <mime-type>` |
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 |
2270 ## Function: kafkapc_api_start_sending ##
2272 Start sending msg from the msg queue to kafka for a topic.
2273 | `<response-code> <topic-name>` |
2275 | parameter | description |
2276 | --------- | ----------- |
2277 | `<response-code>` | Http response code |
2278 | `<topic-name>` | Name of the topic |
2280 ## Function: kafkapc_api_start_receiving ##
2282 Start receiving msg from a kafka topic to the msg queue in kafkapc.
2283 | `<response-code> <topic-name>` |
2285 | parameter | description |
2286 | --------- | ----------- |
2287 | `<response-code>` | Http response code |
2288 | `<topic-name>` | Name of the topic |
2290 ## Function: kafkapc_api_stop_sending ##
2292 Stop sending msg from the msg queue to kafka for a topic.
2293 | `<response-code> <topic-name>` |
2295 | parameter | description |
2296 | --------- | ----------- |
2297 | `<response-code>` | Http response code |
2298 | `<topic-name>` | Name of the topic |
2300 ## Function: kafkapc_api_stop_receiving ##
2302 Stop receiving msg from a kafka topic to the msg queue in kafkapc.
2303 | `<response-code> <topic-name>` |
2305 | parameter | description |
2306 | --------- | ----------- |
2307 | `<response-code>` | Http response code |
2308 | `<topic-name>` | Name of the topic |
2310 ## Function: kafkapc_api_post_msg ##
2312 Send a message on a topic.
2315 | `<response-code> <topic> <mime-type> <msg>` |
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 |
2324 ## Function: kafkapc_api_get_msg ##
2326 Get a message on a topic.
2329 | `<response-code> <topic> ([ <mime-type> <msg> ] | NOMSG )` |
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 |
2339 ## Function: kafkapc_api_post_msg_from_file ##
2341 Send a message in a file on a topic.
2344 | `<response-code> <topic> <mime-type> <file>` |
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 |
2353 ## Function: kafkapc_api_get_msg_from_file ##
2355 Get a message on a topic.
2358 | `<response-code> <topic> <mime-type> <file> ` |
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 |
2367 ## Function: kafkapc_api_generate_json_payload_file ##
2369 Create json file with dummy data for payload.
2372 | `<size-in-kb> <filename>` |
2374 | parameter | description |
2375 | --------- | ----------- |
2376 | `<size-in-kb>` | Generated size in kb |
2377 | `<filename>` | Path to output file |
2379 ## Function: kafkapc_api_generate_text_payload_file ##
2381 Create file with dummy text data for payload.
2384 | `<size-in-kb> <filename>` |
2386 | parameter | description |
2387 | --------- | ----------- |
2388 | `<size-in-kb>` | Generated size in kb |
2389 | `<filename>` | Path to output file |
2391 # Description of functions in keycloak_api_functions.sh #
2393 ## Function: start_keycloak ##
2395 Start the KEYCLOAK app in docker or kube depending on start mode
2400 ## Function: keycloak_api_obtain_admin_token ##
2402 Get the admin token to use for subsequent rest calls to keycloak
2407 ## Function: keycloak_api_create_realm ##
2412 | `<realm-name> <enabled> <token-expiry>` |
2414 | parameter | description |
2415 | --------- | ----------- |
2416 | `realm-name` | Name of the realm |
2417 | `enabled` | Enabled, true or false |
2418 | `token-expiry` | Token lifespan in seconds |
2420 ## Function: keycloak_api_update_realm ##
2425 | `<realm-name> <enabled> <token-expiry>` |
2427 | parameter | description |
2428 | --------- | ----------- |
2429 | `realm-name` | Name of the realm |
2430 | `enabled` | Enabled, true or false |
2431 | `token-expiry` | Token lifespan in seconds |
2433 ## Function: keycloak_api_create_confidential_client ##
2438 | `<realm-name> <client-name>` |
2440 | parameter | description |
2441 | --------- | ----------- |
2442 | `realm-name` | Name of the realm |
2443 | `client-name` | Name of the client |
2445 ## Function: keycloak_api_generate_client_secret ##
2447 Generate secret for client
2450 | `<realm-name> <client-name>` |
2452 | parameter | description |
2453 | --------- | ----------- |
2454 | `realm-name` | Name of the realm |
2455 | `client-name` | Name of the client |
2457 ## Function: keycloak_api_get_client_secret ##
2459 Get a secret for client
2462 | `<realm-name> <client-name>` |
2464 | parameter | description |
2465 | --------- | ----------- |
2466 | `realm-name` | Name of the realm |
2467 | `client-name` | Name of the client |
2469 ## Function: keycloak_api_create_client_roles ##
2474 | `<realm-name> <client-name> <role>+` |
2476 | parameter | description |
2477 | --------- | ----------- |
2478 | `realm-name` | Name of the realm |
2479 | `client-name` | Name of the client |
2480 | `role` | Name of the role |
2482 ## Function: keycloak_api_map_client_roles ##
2484 Map roles to a client
2487 | `<realm-name> <client-name> <role>+` |
2489 | parameter | description |
2490 | --------- | ----------- |
2491 | `realm-name` | Name of the realm |
2492 | `client-name` | Name of the client |
2493 | `role` | Name of the role |
2495 ## Function: keycloak_api_get_client_token ##
2500 | `<realm-name> <client-name>` |
2502 | parameter | description |
2503 | --------- | ----------- |
2504 | `realm-name` | Name of the realm |
2505 | `client-name` | Name of the client |
2507 ## Function: keycloak_api_read_client_token ##
2512 | `<realm-name> <client-name>` |
2514 | parameter | description |
2515 | --------- | ----------- |
2516 | `realm-name` | Name of the realm |
2517 | `client-name` | Name of the client |
2519 ## Function: keycloak_api_read_client_secret ##
2521 Read the secret for client
2524 | `<realm-name> <client-name>` |
2526 | parameter | description |
2527 | --------- | ----------- |
2528 | `realm-name` | Name of the realm |
2529 | `client-name` | Name of the client |
2531 # Description of functions in kubeproxy_api_functions.sh #
2533 ## Function: use_kube_proxy_http ##
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.
2540 ## Function: use_kube_proxy_https ##
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.
2547 ## Function: start_kube_proxy ##
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.
2555 # Description of functions in localhelm_api_functions.sh #
2557 ## Function: localhelm_create_test_chart ##
2559 Create a dummy chart using helm
2564 | parameter | description |
2565 | --------- | ----------- |
2566 | `chart-name` | Name of the chart |
2568 ## Function: localhelm_package_test_chart ##
2570 Package a dummy chart using helm
2575 | parameter | description |
2576 | --------- | ----------- |
2577 | `chart-name` | Name of the chart |
2579 ## Function: localhelm_installed_chart_release ##
2581 Check if a chart is installed or not using helm
2584 | `INSTALLED|NOTINSTALLED <release-name> <name-space> |
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 |
2593 # Description of functions in mr_api_functions.sh #
2595 ## Function: use_mr_http ##
2597 Use http for all Dmaap calls to the MR. This is the default. The admin API is not affected.
2603 ## Function: use_mr_https ##
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.
2610 ## Function: start_mr ##
2612 Start the Message Router stub interface container in docker or kube depending on start mode
2617 ## Function: dmaap_api_print_topics ##
2619 Prints the current list of topics in DMAAP MR
2625 ## Function: mr_equal ##
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.
2633 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
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 |
2641 ## Function: mr_greater ##
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.
2649 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
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 |
2657 ## Function: mr_read ##
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.
2663 | `<variable-name>` |
2665 | parameter | description |
2666 | --------- | ----------- |
2667 | `<variable-name>` | Variable name in the MR |
2669 ## Function: mr_print ##
2671 Prints the value of a variable in the Message Router (MR) simulator.
2672 See the 'mrstub' dir for more details.
2675 | `<variable-name>` |
2677 | parameter | description |
2678 | --------- | ----------- |
2679 | `<variable-name>` | Variable name in the MR |
2681 ## Function: mr_api_send_json ##
2683 Send json to topic in mr-stub.
2686 | `<topic-url> <json-msg>` |
2688 | parameter | description |
2689 | --------- | ----------- |
2690 | `<topic-url>` | Topic url |
2691 | `<json-msg>` | Json msg as string |
2693 ## Function: mr_api_send_text ##
2695 Send text to topic in mr-stub.
2698 | `<topic-url> <text-msg>` |
2700 | parameter | description |
2701 | --------- | ----------- |
2702 | `<topic-url>` | Topic url |
2703 | `<text-msg>` | Text (string) msg |
2707 ## Function: mr_api_send_json_file ##
2709 Send json to topic in mr-stub.
2712 | `<topic-url> <json-file>` |
2714 | parameter | description |
2715 | --------- | ----------- |
2716 | `<topic-url>` | Topic url |
2717 | `<json-file>` | Path to file with json msg as string |
2719 ## Function: mr_api_send_text_file ##
2721 Send text to topic in mr-stub.
2724 | `<topic-url> <text-file>` |
2726 | parameter | description |
2727 | --------- | ----------- |
2728 | `<topic-url>` | Topic url |
2729 | `<text-file>` | Path to file with text msg as string |
2731 ## Function: mr_api_generate_json_payload_file ##
2733 Create json file with dummy data for payload.
2736 | `<size-in-kb> <filename>` |
2738 | parameter | description |
2739 | --------- | ----------- |
2740 | `<size-in-kb>` | Generated size in kb |
2741 | `<filename>` | Path to output file |
2743 ## Function: mr_api_generate_text_payload_file ##
2745 Create file with dummy text data for payload.
2748 | `<size-in-kb> <filename>` |
2750 | parameter | description |
2751 | --------- | ----------- |
2752 | `<size-in-kb>` | Generated size in kb |
2753 | `<filename>` | Path to output file |
2755 # Description of functions in ngw_api_functions.sh #
2757 ## Function: use_gateway_http ##
2759 Use http for all calls to the gateway. This is set by default.
2764 ## Function: use_gateway_https ##
2766 Use https for all calls to the gateway.
2771 ## Function: set_gateway_debug ##
2773 Set debug level logging in the gateway
2778 ## Function: set_gateway_trace ##
2780 Set debug level logging in the trace
2785 ## Function: start_gateway ##
2787 Start the the gateway container in docker or kube depending on start mode
2792 ## Function: gateway_a1pms_get_status ##
2794 Sample test of a1pms api (status)
2795 Only response code tested - not payload
2798 | `<response-code>` |
2800 | parameter | description |
2801 | --------- | ----------- |
2802 | `<response-code>` | Expected http response code |
2804 ## Function: gateway_ics_get_types ##
2806 Sample test of ics api (get types)
2807 Only response code tested - not payload
2810 | `<response-code>` |
2812 | parameter | description |
2813 | --------- | ----------- |
2814 | `<response-code>` | Expected http response code |
2817 # Description of functions in prodstub_api_functions.sh #
2819 ## Function: use_prod_stub_http ##
2821 Use http for the API. The admin API is not affected. This is the default protocol.
2826 ## Function: use_prod_stub_https ##
2828 Use https for the API. The admin API is not affected.
2833 ## Function: start_prod_stub ##
2835 Start the Producer stub container in docker or kube depending on start mode
2840 ## Function: prodstub_arm_producer ##
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.
2846 | `<response-code> <producer-id> [<forced_response_code>]` |
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 |
2854 ## Function: prodstub_arm_job_create ##
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.
2860 | `<response-code> <job-id> [<forced_response_code>]` |
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 |
2868 ## Function: prodstub_arm_job_delete ##
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.
2874 | `<response-code> <job-id> [<forced_response_code>]` |
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 |
2882 ## Function: prodstub_arm_type ##
2884 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
2888 | `<response-code> <producer-id> <type-id>` |
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 |
2896 ## Function: prodstub_disarm_type ##
2898 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
2902 | `<response-code> <producer-id> <type-id>` |
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 |
2910 ## Function: prodstub_check_jobdata ##
2912 Check a job in the prodstub towards the list of provided parameters.
2916 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
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 |
2928 ## Function: prodstub_check_jobdata_2 ##
2930 Check a job in the prodstub towards the list of provided parameters.
2934 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
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 |
2946 ## Function: prodstub_check_jobdata_3 ##
2948 Check a job in the prodstub towards the list of provided parameters.
2952 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
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 |
2964 ## Function: prodstub_delete_jobdata ##
2966 Delete the job parameters, job data, for a job.
2970 | `<response-code> <producer-id> <job-id>` |
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 |
2978 ## Function: prodstub_equal ##
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.
2986 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
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 |
2994 # Description of functions in rc_api_function.sh #
2996 ## Function: use_rapp_catalogue_http ##
2998 Use http for the API. This is the default protocol.
3003 ## Function: use_rapp_catalogue_https ##
3005 Use https for the API.
3010 ## Function: start_rapp_catalogue ##
3012 Start the rapp catalogue container in docker or kube depending on start mode
3017 ## Function: rc_equal ##
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.
3025 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
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 |
3033 ## Function: rapp_cat_api_get_services ##
3035 Check all registered services.
3039 | `<response-code> [(<service-id> <version> <display-name> <description>)+ \| EMPTY ]` |
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 |
3050 ## Function: rapp_cat_api_put_service ##
3052 Register a services.
3056 | `<response-code> <service-id> <version> <display-name> <description>` |
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 |
3066 ## Function: rapp_cat_api_get_service ##
3068 Check a registered service.
3072 | `<response-code> <service-id> <version> <display-name> <description>` |
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 |
3082 ## Function: rapp_cat_api_delete_service ##
3084 Check a registered service.
3088 | `<response-code> <service-id>` |
3090 | parameter | description |
3091 | --------- | ----------- |
3092 | `<response-code>` | Expected http response code |
3093 | `<service-id>` | Id of the service |
3096 # Description of functions in ricmediatorsim_api_functions.sh #
3098 The functions below only use the admin interface of the ricmediator, no usage of the A1 interface.
3100 ## Function: use_ricmediator_simulator_http ##
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.
3107 ## Function: use_ricmediator_simulator_https ##
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.
3114 ## Function: start_ricmediator_simulators ##
3116 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
3119 | `ricsim_g1\|ricsim_g2\|ricsim_g3 <count> <interface-id>` |
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. |
3127 ## Function: get_kube_ricmediatorsim_host ##
3129 Translate ric name to kube host name.
3134 | parameter | description |
3135 | --------- | ----------- |
3136 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
3138 ## Function: nearsim_generate_policy_uuid ##
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.
3147 ## Function: ricmediatorsim_put_policy_type ##
3149 Loads a policy type to the simulator
3153 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
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 |
3162 ## Function: ricmediatorsim_delete_policy_type ##
3164 Deletes a policy type from the simulator
3168 | `<response-code> <ric-id> <policy_type_id>` |
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 |
3177 # Description of functions in ricsim_api_functions.sh #
3179 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
3181 ## Function: use_simulator_http ##
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.
3188 ## Function: use_simulator_https ##
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.
3195 ## Function: start_ric_simulators ##
3197 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
3200 | `ricsim_g1\|ricsim_g2\|ricsim_g3 <count> <interface-id>` |
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. |
3208 ## Function: get_kube_sim_host ##
3210 Translate ric name to kube host name.
3215 | parameter | description |
3216 | --------- | ----------- |
3217 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
3219 ## Function: sim_generate_policy_uuid ##
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.
3227 ## Function: sim_equal ##
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.
3236 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
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 |
3244 ## Function: sim_print ##
3246 Prints the value of a variable in the RIC simulator.
3247 See the 'a1-interface' repo for more details.
3251 | `<variable-name>` |
3253 | parameter | description |
3254 | --------- | ----------- |
3255 | `<variable-name>` | Variable name in the RIC simulator |
3257 ## Function: sim_contains_str ##
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.
3266 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
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 |
3274 ## Function: sim_put_policy_type ##
3276 Loads a policy type to the simulator
3280 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
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 |
3289 ## Function: sim_delete_policy_type ##
3291 Deletes a policy type from the simulator
3295 | `<response-code> <ric-id> <policy_type_id>` |
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 |
3303 ## Function: sim_post_delete_instances ##
3305 Deletes all instances (and status), for one ric
3309 | `<response-code> <ric-id>` |
3311 | parameter | description |
3312 | --------- | ----------- |
3313 | `<response-code>` | Expected http response code |
3314 | `<ric-id>` | Id of the ric |
3316 ## Function: sim_post_delete_all ##
3318 Deletes all types, instances (and status), for one ric
3322 | `<response-code> <ric-id>` |
3324 | parameter | description |
3325 | --------- | ----------- |
3326 | `<response-code>` | Expected http response code |
3327 | `<ric-id>` | Id of the ric |
3329 ## Function: sim_post_forcedresponse ##
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.
3336 | `<response-code> <ric-id> [<forced_response_code>]`|
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 |
3344 ## Function: sim_post_forcedelay ##
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.
3351 | `<response-code> <ric-id> [<delay-in-seconds>]`|
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 |
3359 # Description of functions in sdnc_api_functions.sh #
3361 The file contains a selection of the possible API tests towards the SDNC (a1-controller)
3363 ## Function: use_sdnc_http ##
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.
3370 ## Function: use_sdnc_https ##
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.
3377 ## Function: start_sdnc ##
3379 Start the SDNC A1 Controller container and its database container
3384 ## Function: stop_sdnc ##
3386 Stop the SDNC A1 Controller container and its database container
3391 ## Function: start_stopped_sdnc ##
3393 Start a previously stopped SDNC
3398 ## Function: check_sdnc_logs ##
3400 Check the SDNC log for any warnings and errors and print the count of each.
3405 ## Function: controller_api_get_A1_policy_ids ##
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.
3413 | `<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) \| ( STD <ric-id> [ <policy-id> [<policy-id>]* ]` |
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 |
3424 ## Function: controller_api_get_A1_policy_type ##
3426 Test of GET a policy type (OSC only)
3430 | `<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]` |
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 |
3440 ## Function: controller_api_delete_A1_policy ##
3442 Deletes a policy instance
3446 | `(STD <ric-id> <policy-id>) \| (OSC <ric-id> <policy-type-id> <policy-id>)` |
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 |
3458 ## Function: controller_api_put_A1_policy ##
3460 Creates a policy instance
3464 | `<response-code> (STD <ric-id> <policy-id> <template-file> ) \| (OSC <ric-id> <policy-type-id> <policy-id> <template-file>)` |
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 |
3476 ## Function: controller_api_get_A1_policy_status ##
3478 Checks the status of a policy
3482 | `<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) \| (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)` |
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 |
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
3505 http://www.apache.org/licenses/LICENSE-2.0
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.