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 Managerment 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 ##
9 A common curl based function for the a1pms and ics apis. Also partly used for the Callback receiver and RAPP Catalogue apis.
11 `cbs_api_function.sh` \
12 All functions are implemented in `consul_api_function.sh`.
14 `chartmus_api_functions.sh` \
15 Contains functions for managing a Chartmuseum instance.
18 Cleans all containers started by the test environment in docker.
21 Cleans all services, deployments, pods, replica set etc started by the test environment in kubernetes.
24 A python script to compare two json obects for equality. Note that the comparsion always sort json-arrays before comparing (that is, it does not care about the order of items within the array). In addition, the target json object may specify individual parameter values where equality is 'dont care'.
26 `consul_api_function.sh` \
27 Contains functions for managing Consul and CBS.
29 `count_json_elements.py` \
30 A python script calculate the length of json array or size of a json dictionary'.
32 `count_json_elements.py` \
33 A python script returning the number of items in a json array.
35 `cp_api_function.sh` \
36 Contains functions for managing the Control Panel.
38 `cr_api_functions.sh` \
39 Contains functions for adapting towards the Callback receiver for checking received callback events.
41 `create_policies_process.py` \
42 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.
44 `create_rics_json.py` \
45 A python script to create a json file from a formatted string of ric info. Helper for the test enviroment.
47 `delete_policies_process.py` \
48 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.
50 `dmaapadp_api_function.sh`
51 Contains funnctions for managing the Dmaap Adapter.
53 `dmaapmed_api_function.sh`
54 Contains funnctions for managing the Dmaap Mediator Service.
56 `dmaapmr_api_function.sh`
57 All functions are implemented in `mr_api_functions.sh`.
60 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)
62 `extract_sdnc_reply.py` \
63 A python script to extract the information from an sdnc (A1 Controller) reply json. Helper for the test environment.
66 This script collects container statistics to a file. Works both in docker and kubernetes (only for docker runtime).
68 `helmmanager_api_functions.sh` \
69 Contains functions for managing and testing of the Helm Manager.
71 `http_proxy_api_functions.sh` \
72 Contains functions for managing the Http Proxy.
74 `ics_api_functions.sh` \
75 Contains functions for adapting towards the Information Coordinator Service API.
77 `kafkapc_api_functions.sh` \
78 Contains functions for managing the kafka producer/consumer. Kafka is started by the dmaap message router component.
80 `kube_proxy_api_functions.sh` \
81 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.
83 `localhelm_api_functions.sh` \
84 Contains functions for helm access on localhost.
86 `mr_api_functions.sh` \
87 Contains functions for managing the MR Stub and the Dmaap Message Router
89 `ngw_api_functions.sh` \
90 Contains functions for managing the Non-RT RIC Gateway
92 `a1pms_api_functions.sh` \
93 Contains functions for adapting towards the Policy Management Service (A1PMS) API, also via dmaap (using a message-router stub interface)
95 `prodstub_api_functions.sh` \
96 Contains functions for adapting towards the Producer stub interface - simulates a producer.
98 `pvccleaner_api_functions.sh` \
99 Contains functions for managing the PVC Cleaner (used for reset mounted volumes in kubernetes).
101 `rc_api_functions.sh` \
102 Contains functions for adapting towards the RAPP Catalogue.
104 `ricsim_api_functions.sh` \
105 Contains functions for adapting towards the RIC (A1) simulator admin API.
107 `sdnc_api_functions.sh` \
108 Contains functions for adaping towards the SDNC (used as an A1 controller).
111 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.
112 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'.
114 `testcase_common.sh` \
115 Common functions for auto test cases in the auto-test dir. This script is the foundation of test auto environment which sets up images and enviroment variables needed by this script as well as the script adapting to the APIs.
116 The included functions are described in detail further below.
118 `testengine_config.sh` \
119 Configuration file to setup the applications (components and simulators) the test enviroment handles.
121 `testsuite_common.sh` \
122 Common functions for running two or more auto test scripts as a suite.
124 ## Integration of a new applicaton ##
126 Integration a new application to the test environment involves the following steps.
128 * Choose a short name for the application. Should be a uppcase name. For example, the NonRTRIC Gateway has NGW as short name.
129 This short name shall be added to the testengine_config.sh. See that file for detailed instructions.
131 * Create a file in this directory using the pattern `<application-name>_api_functions.sh`.
132 This file must implement the following functions used by the test engine. Note that functions must include the application short name in the function name. If the application does not run in kubernetes, then the last three functions in the list can be omitted.
136 | __<app-short_name>_imagesetup |
137 | __<app-short_name>_imagepull |
138 | __<app-short_name>_imagebuild |
139 | __<app-short_name>_image_data |
140 | __<app-short_name>_kube_scale_zero |
141 | __<app-short_name>_kube_scale_zero_and_wait |
142 | __<app-short_name>_kube_delete_all |
143 | __<app-short_name>_store_docker_logs |
144 | __<app-short_name>_initial_setup |
145 | __<app-short_name>_statisics_setup |
146 | __<app-short_name>_test_requirements |
148 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.
150 * Add the application variables to api_curl.sh. This file contains a generic function to make rest calls to an api. It also supports switching betweeen direct rest calls or rest calls via messsage router.
152 * 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.
154 All docker-compose files and all kubernetes resource files need to defined special lables. These lables are used by the test enginge to identify containers and resources started and used by the test engine.
156 | Label for docker compose | Description |
158 | nrttest_app | shall contain the application short name |
159 | nrttest_dp | shall be set by a variable containing the display name, a short textual description of the applicaion |
161 | Label for kubernetes resource | Description |
163 | autotest | shall contain the application short name |
165 * 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>`.
166 In addition, all other needed environment shall also be defined in these file.
168 # Description of functions in testcase_common.sh #
172 The script can be started with these arguments
176 | `remote\|remote-remove docker\|kube --env-file <environment-filename> [release] [auto-clean] [--stop-at-error] [--ricsim-prefix <prefix> ] [--use-local-image <app-nam>+] [--use-snapshot-image <app-nam>+] [--use-staging-image <app-nam>+] [--use-release-image <app-nam>+] [--use-external-image <app-nam>+] [--image-repo <repo-address>] [--repo-policy local\|remote] [--cluster-timeout <timeout-in-seconds>] [--print-stats]` |
178 | parameter | description |
180 | `remote` | Use images from remote repositories. Can be overridden for individual images using the '--use_xxx' flags |
181 | `remote-remove` | Same as 'remote' but will also try to pull fresh images from remote repositories |
182 | `docker` | Use docker environment for test |
183 | `kuber` | Use kubernetes environment for test. Requires a kubernetes minikube installation |
184 | `--env-file` | The script will use the supplied file to read environment variables from |
185 | `release` | If this flag is given the script will use release version of the images |
186 | `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 |
187 | `--stop-at-error` | The script will stop when the first failed test or configuration |
188 | `--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). |
189 | `--use-local-image` | The script will use local images for the supplied apps, space separated list of app short names |
190 | `--use-snapshot-image` | The script will use images from the nexus snapshot repo for the supplied apps, space separated list of app short names |
191 | `--use-staging-image` | The script will use images from the nexus staging repo for the supplied apps, space separated list of app short names |
192 | `--use-release-image` | The script will use images from the nexus release repo for the supplied apps, space separated list of app short names |
193 | `--use-external-image` | The script will use images from an external repo for the supplied apps, space separated list of app short names |
194 | `--image-repo` | Url to optional image repo. Only locally built images will be re-tagged and pushed to this repo |
195 | `-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' |
196 | `--cluster-timeout` | Optional timeout for cluster where it takes time to obtain external ip/host-name. Timeout in seconds |
197 | `--print-stats` | Prints the number of tests, failed tests, failed configuration and deviations after each individual test or config |
198 | `--override <file>` | Override setting from the file supplied by --env-file |
199 | `--pre-clean` | Clean kube resouces when running docker and vice versa |
200 | `--gen-stats` | Collect container/pod runtime statistics |
201 | `--delete-namespaces` | Delete kubernetes namespaces before starting tests - but only those created by the test scripts. Kube mode only. Ignored if running with prestarted apps. |
202 | `--delete-containers` | Delete docker containers before starting tests - but only those created by the test scripts. Docker mode only. |
203 | `--endpoint-stats` | Collect http endpoint statistics |
204 | `help` | Print this info along with the test script description and the list of app short names supported |
206 ## Function: setup_testenvironment ##
208 Main function to setup the test environment before any tests are started.
209 Must be called right after sourcing all component scripts.
214 ## Function: print_result ##
216 Print a test report of an auto-test script.
221 ## Function: start_timer ##
223 Start a timer for time measurement. Only one timer can be running.
226 | `<timer-message-to-print>` |
227 | None - but any args will be printed (It is good practice to use same args for this function as for the `print_timer`) |
229 ## Function: print_timer ##
231 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.
236 ## Function: deviation ##
238 Mark a test as a deviation from the requirements. The list of deviations will be printed in the test report.
241 | `<deviation-message-to-print>` |
243 | parameter | description |
244 | --------- | ----------- |
245 | `<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 |
247 ## Function: clean_environment ##
249 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).
254 ## Function: auto_clean_containers ##
256 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.
261 ## Function: sleep_wait ##
263 Make the script sleep for a number of seconds.
266 | `<sleep-time-in-sec> [<any-text-in-quotes-to-be-printed>]` |
268 | parameter | description |
269 | --------- | ----------- |
270 | `<sleep-time-in-sec>` | Number of seconds to sleep |
271 | `<any-text-in-quotes-to-be-printed>` | Optional. The text will be printed, if present |
273 ## Function: store_logs ##
275 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.
278 | `<logfile-prefix>` |
280 | parameter | description |
281 | --------- | ----------- |
282 | `<logfile-prefix>` | Log file prefix |
284 # Description of functions in testsuite_common.sh #
286 ## Function: suite_setup ##
288 Sets up the test suite and prints out a heading.
295 Print out the overall result of the executed test cases.
300 # Description of functions in chartmus_api_function.sh #
302 ## Function: start_chart_museum ##
304 Start the Chart Museum
309 ## Function: chartmus_upload_test_chart ##
311 Upload a package chart to chartmusem
316 | parameter | description |
317 | --------- | ----------- |
318 | `<chart-name>` | Name of the chart to upload |
320 ## Function: chartmus_delete_test_chart ##
322 Delete a chart in chartmusem
325 | `<chart-name> [<version>]` |
327 | parameter | description |
328 | --------- | ----------- |
329 | `<chart-name>` | Name of the chart to delete |
330 | `<version>` | Chart version, default is 0.1.0 |
332 # Description of functions in cp_api_function.sh #
334 ## Function: use_control_panel_http ##
336 Set http as the protocol to use for all communication to the Control Panel
341 ## Function: use_control_panel_https ##
343 Set https as the protocol to use for all communication to the Control Panel
348 ## Function: start_control_panel ##
350 Start the Control Panel container
355 # Description of functions in cr_api_functions.sh #
357 ## Function: use_cr_http ##
359 Use http for getting event from CR. The admin API is not affected. This is the default.
364 ## Function: use_cr_https ##
366 Use https for getting event from CR. The admin API is not affected.
367 Note: Not yet used as callback event is not fully implemented/deciced.
372 ## Function: start_cr ##
374 Start the Callback Receiver container in docker or kube depending on start mode.
379 ## Function: cr_equal ##
381 Tests if a variable value in the Callback Receiver (CR) simulator is equal to a target value.
382 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
383 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.
384 See the 'cr' dir for more details.
387 | `<cr-path-id> <variable-name> <target-value> [ <timeout-in-sec> ]` |
389 | parameter | description |
390 | --------- | ----------- |
391 | `<cr-path-id>` | Variable index to CR |
392 | `<variable-name>` | Variable name in the CR |
393 | `<target-value>` | Target value for the variable |
394 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
396 ## Function: cr_greater_or_equal ##
397 Tests if a variable value in the Callback Receiver (CR) simulator is equal to or greater than a target value.
398 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.
399 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.
400 See the 'cr' dir for more details.
403 | `<cr-path-id> <variable-name> <target-value> [ <timeout-in-sec> ]` |
405 | parameter | description |
406 | --------- | ----------- |
407 | `<cr-path-id>` | Variable index to CR |
408 | `<variable-name>` | Variable name in the CR |
409 | `<target-value>` | Target value for the variable |
410 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
412 ## Function: cr_contains_str ##
414 Tests if a variable value in the CR contains a target string.
415 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
416 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.
417 See the 'a1-interface' repo for more details.
421 | `<cr-path-id> <variable-name> <target-value> [ <timeout-in-sec> ]` |
424 | parameter | description |
425 | --------- | ----------- |
426 | `<cr-path-id>` | Variable index to CR |
427 | `<variable-name>` | Variable name in the CR |
428 | `<target-value>` | Target substring for the variable |
429 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
431 ## Function: cr_read ##
433 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.
434 See the 'mrstub' dir for more details.
437 | `<cr-path-id> <variable-name>` |
439 | parameter | description |
440 | --------- | ----------- |
441 | `<cr-path-id>` | Variable index to CR |
442 | `<variable-name>` | Variable name in the CR |
444 ## Function: cr_delay_callback ##
446 Function to configure write delay on callbacks. Delay given in seconds. Setting remains until removed.
450 | `<response-code> <cr-path-id> [<delay-in-seconds>]`|
452 | parameter | description |
453 | --------- | ----------- |
454 | `<response-code>` | Expected http response code |
455 | `<cr-path-id>` | Variable index to CR |
456 | `<delay-in-seconds>` | Delay in seconds. If omitted, the delay is removed |
458 ## Function: cr_api_check_all_sync_events ##
460 Check the contents of all ric events received for a callback id.
464 | `<response-code> <cr-path-id> <id> [ EMPTY \| ( <ric-id> )+ ]` |
466 | parameter | description |
467 | --------- | ----------- |
468 | `<response-code>` | Expected http response code |
469 | `<cr-path-id>` | Variable index for CR |
470 | `<id>` | Id of the callback destination |
471 | `EMPTY` | Indicator for an empty list |
472 | `<ric-id>` | Id of the ric |
474 ## Function: cr_api_check_all_ics_events ##
476 Check the contents of all current status events for one id from ICS
480 | `<response-code> <cr-path-id> <id> [ EMPTY \| ( <status> )+ ]` |
482 | parameter | description |
483 | --------- | ----------- |
484 | `<response-code>` | Expected http response code |
485 | `<cr-path-id>` | Variable index for CR |
486 | `<id>` | Id of the callback destination |
487 | `EMPTY` | Indicator for an empty list |
488 | `<status>` | Status string |
490 ## Function: cr_api_check_all_ics_subscription_events ##
492 Check the contents of all current subscription events for one id from ICS
496 | `<response-code> <cr-path-id> <id> [ EMPTY | ( <type-id> <schema> <registration-status> )+ ]` |
498 | parameter | description |
499 | --------- | ----------- |
500 | `<response-code>` | Expected http response code |
501 | `<cr-path-id>` | Variable index for CR |
502 | `<id>` | Id of the callback destination |
503 | `EMPTY` | Indicator for an empty list |
504 | `<type-id>` | Id of the data type |
505 | `<schema>` | Path to typeschema file |
506 | `<registration-status>` | Status string |
508 ## Function: cr_api_reset ##
510 Reset the callback receiver
516 | parameter | description |
517 | --------- | ----------- |
518 | `<cr-path-id>` | Variable index for CR |
520 ## Function: cr_api_check_all_genric_json_events ##
522 Check the contents of all json events for path
526 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <json-msg>+ )` |
528 | parameter | description |
529 | --------- | ----------- |
530 | `<response-code>` | Expected http response code |
531 | `<cr-path-id>` | Variable index for CR |
532 | `<topic-url>` | Topic url |
533 | `EMPTY` | Indicator for an empty list |
534 | `json-msg` | Json msg string to compare with |
536 ## Function: cr_api_check_single_genric_json_event ##
538 Check a single (oldest) json event (or none if empty) for path
542 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <json-msg> )` |
544 | parameter | description |
545 | --------- | ----------- |
546 | `<response-code>` | Expected http response code |
547 | `<cr-path-id>` | Variable index for CR |
548 | `<topic-url>` | Topic url |
549 | `EMPTY` | Indicator for no msg |
550 | `json-msg` | Json msg string to compare with |
552 ## Function: cr_api_check_single_genric_event_md5 ##
554 Check a single (oldest) json in md5 format (or none if empty) for path.
555 Note that if a json message is given, it shall be compact, no ws except inside string.
556 The MD5 will generate different hash if whitespace is present or not in otherwise equivalent json.
560 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <data-msg> )` |
562 | parameter | description |
563 | --------- | ----------- |
564 | `<response-code>` | Expected http response code |
565 | `<cr-path-id>` | Variable index for CR |
566 | `<topic-url>` | Topic url |
567 | `EMPTY` | Indicator for no msg |
568 | `data-msg` | msg string to compare with |
570 ## Function: cr_api_check_single_genric_event_md5_file ##
572 Check a single (oldest) event in md5 format (or none if empty) for path.
573 Note that if a file with json message is given, the json shall be compact, no ws except inside string and not newlines.
574 The MD5 will generate different hash if ws/newlines is present or not in otherwise equivalent json
578 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <data-file> )` |
580 | parameter | description |
581 | --------- | ----------- |
582 | `<response-code>` | Expected http response code |
583 | `<cr-path-id>` | Variable index for CR |
584 | `<topic-url>` | Topic url |
585 | `EMPTY` | Indicator for no msg |
586 | `data-file` | path to file to compare with |
588 # Description of functions in dmaapadp_api_functions.sh #
590 ## Function: use_dmaapadp_http ##
592 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.
598 ## Function: use_dmaapadp_https ##
600 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.
606 ## Function: start_dmaapadp ##
608 Start the dmaap adator service container in docker or kube depending on running mode.
612 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
614 | parameter | description |
615 | --------- | ----------- |
616 | `PROXY` | Configure with http proxy, if proxy is started |
617 | `NOPROXY` | Configure without http proxy |
618 | `<config-file>`| Path to application.yaml |
619 | `<data-file>` | Optional path to application_configuration.json |
621 ## Function: set_dmaapadp_trace ##
623 Configure the dmaap adaptor service log on trace level. The app must be running.
628 # Description of functions in dmaapmed_api_functions.sh #
630 ## Function: use_dmaapmed_http ##
632 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.
638 ## Function: use_dmaapmed_https ##
640 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.
646 ## Function: start_dmaapmed ##
648 Start the dmaap mediator service container in docker or kube depending on running mode.
654 # Description of functions in httpproxy_api_functions.sh #
656 ## Function: use_http_proxy_http ##
658 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.
663 ## Function: use_http_proxy_https ##
665 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.
670 ## Function: start_http_proxy ##
672 Start the http proxy container in docker or kube depending on running mode.
677 # Description of functions in helmmanager_api_functions.sh #
679 ## Function: use_helm_manager_http ##
681 Use http for all API calls to the Helm Manager. This is the default protocol.
686 ## Function: use_helm_manager_https ##
688 Use https for all API calls to the Helm Manager.
693 ## Function: start_helm_manager ##
695 Start the Helm Manager container in docker or kube depending on running mode.
700 ## Function: helm_manager_api_get_charts ##
702 Get all charts and compare the expected contents.
705 | `<response-code> [ EMPTY | ( <chart> <version> <namespace> <release> <repo> )+ ]` |
707 | parameter | description |
708 | --------- | ----------- |
709 | `<response-code>` | Expected response code |
710 | `EMPTY` | Indicator for empty list |
711 | `<chart>`| Name of the chart |
712 | `<version>`| Version of the chart |
713 | `<namespace>`| Namespace to of the chart |
714 | `<release>`| Release name of the chart |
715 | `<repo>`| Repository of the chart |
717 ## Function: helm_manager_api_post_repo ##
719 Add repo to the helm manager.
722 | `<response-code> <repo-name> <repo-protocol> <repo-address> <repo-port>` |
724 | parameter | description |
725 | --------- | ----------- |
726 | `<response-code>` | Expected response code |
727 | `<repo-name>` | Name of the repo |
728 | `<repo-protocol>`| Protocol http or https |
729 | `<repo-address>`| Host name of the repo |
730 | `<repo-port>`| Host port of the repo |
732 ## Function: helm_manager_api_post_onboard_chart ##
734 Onboard a chart to the helm manager.
737 | `<response-code> <repo> <chart> <version> <release> <namespace>` |
739 | parameter | description |
740 | --------- | ----------- |
741 | `<response-code>` | Expected response code |
742 | `<repo>`| Target repo of the chart |
743 | `<chart>`| Name of the chart |
744 | `<version>`| Version of the chart |
745 | `<namespace>`| Namespace to of the chart |
746 | `<release>`| Release name of the chart |
748 ## Function: helm_manager_api_post_install_chart ##
750 Install an onboarded chart.
753 | `<response-code> <chart> <version>` |
755 | parameter | description |
756 | --------- | ----------- |
757 | `<response-code>` | Expected response code |
758 | `<chart>`| Name of the chart |
759 | `<version>`| Version of the chart |
761 ## Function: helm_manager_api_uninstall_chart ##
766 | `<response-code> <chart> <version>` |
768 | parameter | description |
769 | --------- | ----------- |
770 | `<response-code>` | Expected response code |
771 | `<chart>`| Name of the chart |
772 | `<version>`| Version of the chart |
774 ## Function: helm_manager_api_delete_chart ##
779 | `<response-code> <chart> <version>` |
781 | parameter | description |
782 | --------- | ----------- |
783 | `<response-code>` | Expected response code |
784 | `<chart>`| Name of the chart |
785 | `<version>`| Version of the chart |
787 ## Function: helm_manager_api_exec_add_repo ##
789 Add repo in helm manager by helm using exec.
792 | `<repo-name> <repo-url>` |
794 | parameter | description |
795 | --------- | ----------- |
796 | `<response-code>` | Expected response code |
797 | `<repo-name>`| Name of the repo |
798 | `<repo-url>`| Full url to the repo. Url must be accessible by the container |
801 # Description of functions in ics_api_functions.sh #
803 ## Function: use_ics_rest_http ##
805 Use http for all API calls to the ICS. This is the default protocol.
810 ## Function: use_ics_rest_https ##
812 Use https for all API calls to the ICS.
817 ## Function: use_ics_dmaap_http ##
819 Send and recieve all API calls to the ICS over Dmaap via the MR using http.
824 ## Function: use_ics_dmaap_https ##
826 Send and recieve all API calls to the ICS over Dmaap via the MR using https.
831 ## Function: start_ics ##
833 Start the ICS container in docker or kube depending on running mode.
836 | `PROXY|NOPROXY <config-file>` |
838 | parameter | description |
839 | --------- | ----------- |
840 | `PROXY` | Configure with http proxy, if proxy is started |
841 | `NOPROXY` | Configure without http proxy |
842 | `<config-file>`| Path to application.yaml |
844 ## Function: stop_ics ##
846 Stop the ICS container.
851 ## Function: start_stopped_ics ##
853 Start a previously stopped ics.
858 ## Function: set_ics_debug ##
860 Configure the ICS log on debug level. The ICS must be running.
865 ## Function: set_ics_trace ##
867 Configure the ICS log on trace level. The ICS must be running.
872 ## Function: use_ics_retries ##
874 Perform curl retries when making direct call to ICS for the specified http response codes
875 Speace separated list of http response codes
878 | `[<response-code>]*` |
880 | parameter | description |
881 | --------- | ----------- |
882 | `<response-code>` | Http response code to make retry for |
884 ## Function: check_ics_logs ##
886 Check the ICS log for any warnings and errors and print the count of each.
891 ## Function: ics_equal ##
893 Tests if a variable value in the ICS is equal to a target value.
894 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
895 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.
896 See the 'a1-interface' repo for more details.
900 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
902 | parameter | description |
903 | --------- | ----------- |
904 | `<variable-name>` | Variable name in ics |
905 | `<target-value>` | Target value for the variable |
906 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
908 ## Function: ics_api_a1_get_job_ids ##
910 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs' and optional check of the array of returned job ids.
911 To test the response code only, provide the response code parameter as well as a type id and an owner id.
912 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
916 | `<response-code> <type-id> <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
918 | parameter | description |
919 | --------- | ----------- |
920 | `<response-code>` | Expected http response code |
921 | `<type-id>` | Id of the EI type |
922 | `<owner-id>` | Id of the job owner |
923 | `NOOWNER` | No owner is given |
924 | `<job-id>` | Id of the expected job |
925 | `EMPTY` | The expected list of job id shall be empty |
927 ## Function: ics_api_a1_get_type ##
929 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}' and optional check of the returned schema.
930 To test the response code only, provide the response code parameter as well as the type-id.
931 To also test the response payload add a path to the expected schema file.
935 | `<response-code> <type-id> [<schema-file>]` |
937 | parameter | description |
938 | --------- | ----------- |
939 | `<response-code>` | Expected http response code |
940 | `<type-id>` | Id of the EI type |
941 | `<schema-file>` | Path to a schema file to compare with the returned schema |
943 ## Function: ics_api_a1_get_type_ids ##
945 Test of GET '/A1-EI/v1/eitypes' and optional check of returned list of type ids.
946 To test the response code only, provide the response only.
947 To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
951 | `<response-code> [ (EMPTY \| [<type-id>]+) ]` |
953 | parameter | description |
954 | --------- | ----------- |
955 | `<response-code>` | Expected http response code |
956 | `EMPTY` | The expected list of type ids shall be empty |
957 | `<type-id>` | Id of the EI type |
959 ## Function: ics_api_a1_get_job_status ##
961 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}/status' and optional check of the returned status.
962 To test the response code only, provide the response code, type id and job id.
963 To also test the response payload add the expected status.
967 | `<response-code> <type-id> <job-id> [<status>]` |
969 | parameter | description |
970 | --------- | ----------- |
971 | `<response-code>` | Expected http response code |
972 | `<type-id>` | Id of the EI type |
973 | `<job-id>` | Id of the job |
974 | `<status>` | Expected status |
976 ## Function: ics_api_a1_get_job ##
978 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}' and optional check of the returned job.
979 To test the response code only, provide the response code, type id and job id.
980 To also test the response payload add the remaining parameters.
984 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
986 | parameter | description |
987 | --------- | ----------- |
988 | `<response-code>` | Expected http response code |
989 | `<type-id>` | Id of the EI type |
990 | `<job-id>` | Id of the job |
991 | `<target-url>` | Expected target url for the job |
992 | `<owner-id>` | Expected owner for the job |
993 | `<template-job-file>` | Path to a job template for job parameters of the job |
995 ## Function: ics_api_a1_delete_job ##
997 Test of DELETE '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
998 To test, provide all the specified parameters.
1002 | `<response-code> <type-id> <job-id>` |
1004 | parameter | description |
1005 | --------- | ----------- |
1006 | `<response-code>` | Expected http response code |
1007 | `<type-id>` | Id of the EI type |
1008 | `<job-id>` | Id of the job |
1010 ## Function: ics_api_a1_put_job ##
1012 Test of PUT '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1013 To test, provide all the specified parameters.
1017 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
1019 | parameter | description |
1020 | --------- | ----------- |
1021 | `<response-code>` | Expected http response code |
1022 | `<type-id>` | Id of the EI type |
1023 | `<job-id>` | Id of the job |
1024 | `<target-url>` | Target url for the job |
1025 | `<owner-id>` | Owner of the job |
1026 | `<template-job-file>` | Path to a job template for job parameters of the job |
1028 ## Function: ics_api_edp_get_type_ids ##
1030 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.
1031 To test the response code only, provide the response code.
1032 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1036 | `<response-code> [ EMPTY \| <type-id>+]` |
1038 | parameter | description |
1039 | --------- | ----------- |
1040 | `<response-code>` | Expected http response code |
1041 | `<type-id>` | Id of the type |
1042 | `EMPTY` | The expected list of type ids shall be empty |
1044 ## Function: ics_api_edp_get_producer_status ##
1046 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.
1047 To test the response code only, provide the response code and producer id.
1048 To also test the response payload add the expected status.
1052 | `<response-code> <producer-id> [<status>]` |
1054 | parameter | description |
1055 | --------- | ----------- |
1056 | `<response-code>` | Expected http response code |
1057 | `<producer-id>` | Id of the producer |
1058 | `<status>` | The expected status string |
1060 ## Function: ics_api_edp_get_producer_ids ##
1062 Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
1063 To test the response code only, provide the response.
1064 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).
1068 | `<response-code> [ EMPTY \| <producer-id>+]` |
1070 | parameter | description |
1071 | --------- | ----------- |
1072 | `<response-code>` | Expected http response code |
1073 | `<producer-id>` | Id of the producer |
1074 | `EMPTY` | The expected list of type ids shall be empty |
1076 ## Function: ics_api_edp_get_producer_ids_2 ##
1078 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.
1079 To test the response code only, provide the response.
1080 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).
1084 | `<response-code> [ ( NOTYPE \| <type-id> ) [ EMPTY \| <producer-id>+]` |
1086 | parameter | description |
1087 | --------- | ----------- |
1088 | `<response-code>` | Expected http response code |
1089 | `<type-id>` | Id of the type |
1090 | `EMPTY` | No type given |
1091 | `<producer-id>` | Id of the producer |
1092 | `EMPTY` | The expected list of type ids shall be empty |
1094 ## Function: ics_api_edp_get_type ##
1096 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
1097 To test the response code only, provide the response and the type-id.
1098 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).
1102 | `<response-code> <type-id> [<job-schema-file> (EMPTY \| [<producer-id>]+)]` |
1104 | parameter | description |
1105 | --------- | ----------- |
1106 | `<response-code>` | Expected http response code |
1107 | `<type-id>` | Id of the type |
1108 | `<job-schema-file>` | Path to a job schema file |
1109 | `<producer-id>` | Id of the producer |
1110 | `EMPTY` | The expected list of type ids shall be empty |
1112 ## Function: ics_api_edp_get_type_2 ##
1114 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.
1115 To test the response code only, provide the response and the type-id.
1116 To also test the response payload add a path to a job schema file.
1120 | `<response-code> <type-id> [<job-schema-file>]` |
1122 | parameter | description |
1123 | --------- | ----------- |
1124 | `<response-code>` | Expected http response code |
1125 | `<type-id>` | Id of the type |
1126 | `<job-schema-file>` | Path to a job schema file |
1127 | `EMPTY` | The expected list of type ids shall be empty |
1129 ## Function: ics_api_edp_put_type_2 ##
1131 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.
1135 | `<response-code> <type-id> [<job-schema-file>]` |
1137 | parameter | description |
1138 | --------- | ----------- |
1139 | `<response-code>` | Expected http response code |
1140 | `<type-id>` | Id of the type |
1141 | `<job-schema-file>` | Path to a job schema file |
1142 | `EMPTY` | The expected list of type ids shall be empty |
1144 ## Function: ics_api_edp_delete_type_2 ##
1146 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.
1150 | `<response-code> <type-id>` |
1152 | parameter | description |
1153 | --------- | ----------- |
1154 | `<response-code>` | Expected http response code |
1155 | `<type-id>` | Id of the type |
1157 ## Function: ics_api_edp_get_producer ##
1159 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
1160 To test the response code only, provide the response and the producer-id.
1161 To also test the response payload add the remaining parameters defining thee producer.
1165 | `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY\| [<type-id> <schema-file>]+) ]` |
1167 | parameter | description |
1168 | --------- | ----------- |
1169 | `<response-code>` | Expected http response code |
1170 | `<producer-id>` | Id of the producer |
1171 | `<create-callback>` | Callback for create job |
1172 | `<delete-callback>` | Callback for delete job |
1173 | `<supervision-callback>` | Callback for producer supervision |
1174 | `<type-id>` | Id of the type |
1175 | `<schema-file>` | Path to a schema file |
1176 | `EMPTY` | The expected list of type schema pairs shall be empty |
1178 ## Function: ics_api_edp_get_producer_2 ##
1180 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.
1181 To test the response code only, provide the response and the producer-id.
1182 To also test the response payload add the remaining parameters defining thee producer.
1186 | `<response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY \| <type-id>+) ]` |
1188 | parameter | description |
1189 | --------- | ----------- |
1190 | `<response-code>` | Expected http response code |
1191 | `<producer-id>` | Id of the producer |
1192 | `<job-callback>` | Callback for the url |
1193 | `<supervision-callback>` | Callback for producer supervision |
1194 | `<type-id>` | Id of the type |
1195 | `EMPTY` | The expected list of types shall be empty |
1197 ## Function: ics_api_edp_delete_producer ##
1199 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version.
1200 To test, provide all parameters.
1204 | `<response-code> <producer-id>` |
1206 | parameter | description |
1207 | --------- | ----------- |
1208 | `<response-code>` | Expected http response code |
1209 | `<producer-id>` | Id of the producer |
1211 ## Function: ics_api_edp_put_producer ##
1213 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1214 To test, provide all parameters. The list of type/schema pair may be empty.
1218 | `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY \| [<type-id> <schema-file>]+)` |
1220 | parameter | description |
1221 | --------- | ----------- |
1222 | `<response-code>` | Expected http response code |
1223 | `<producer-id>` | Id of the producer |
1224 | `<job-callback>` | Callback for create/delete job |
1225 | `<supervision-callback>` | Callback for producer supervision |
1226 | `<type-id>` | Id of the type |
1227 | `<schema-file>` | Path to a schema file |
1228 | `EMPTY` | The list of type/schema pairs is empty |
1230 ## Function: ics_api_edp_put_producer_2 ##
1232 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version.
1233 To test, provide all parameters. The list of type/schema pair may be empty.
1237 | `<response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE\|[<type-id>+]` |
1239 | parameter | description |
1240 | --------- | ----------- |
1241 | `<response-code>` | Expected http response code |
1242 | `<producer-id>` | Id of the producer |
1243 | `<job-callback>` | Callback for create/delete job |
1244 | `<supervision-callback>` | Callback for producer supervision |
1245 | `<type-id>` | Id of the type |
1246 | `NOTYPE` | The list of types is empty |
1248 ## Function: ics_api_edp_get_producer_jobs ##
1250 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
1251 To test the response code only, provide the response and the producer-id.
1252 To also test the response payload add the remaining parameters.
1256 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1258 | parameter | description |
1259 | --------- | ----------- |
1260 | `<response-code>` | Expected http response code |
1261 | `<producer-id>` | Id of the producer |
1262 | `<job-id>` | Id of the job |
1263 | `<type-id>` | Id of the EI type |
1264 | `<target-url>` | Target url for data delivery |
1265 | `<job-owner>` | Id of the job owner |
1266 | `<template-job-file>` | Path to a job template file |
1267 | `EMPTY` | The list of job/type/target/job-file tuples is empty |
1269 ## Function: ics_api_edp_get_producer_jobs_2 ##
1271 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.
1272 To test the response code only, provide the response and the producer-id.
1273 To also test the response payload add the remaining parameters.
1277 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1279 | parameter | description |
1280 | --------- | ----------- |
1281 | `<response-code>` | Expected http response code |
1282 | `<producer-id>` | Id of the producer |
1283 | `<job-id>` | Id of the job |
1284 | `<type-id>` | Id of the type |
1285 | `<target-url>` | Target url for data delivery |
1286 | `<job-owner>` | Id of the job owner |
1287 | `<template-job-file>` | Path to a job template file |
1288 | `EMPTY` | The list of job/type/target/job-file tuples is empty |
1290 ## Function: ics_api_service_status ##
1292 Test of GET '/status'.
1296 | `<response-code>` |
1298 | parameter | description |
1299 | --------- | ----------- |
1300 | `<response-code>` | Expected http response code |
1302 ## Function: ics_api_idc_get_type_ids ##
1304 Test of GET '/data-consumer/v1/info-types' and an optional check of the returned list of type ids.
1305 To test the response code only, provide the response code.
1306 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1310 | `<response-code> [ EMPTY \| <type-id>+]` |
1312 | parameter | description |
1313 | --------- | ----------- |
1314 | `<response-code>` | Expected http response code |
1315 | `<type-id>` | Id of the Info type |
1316 | `EMPTY` | The expected list of type ids shall be empty |
1318 ## Function: ics_api_idc_get_job_ids ##
1320 Test of GET '/data-consumer/v1/info-jobs' and optional check of the array of returned job ids.
1321 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1322 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1326 | `<response-code> <type-id> <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
1328 | parameter | description |
1329 | --------- | ----------- |
1330 | `<response-code>` | Expected http response code |
1331 | `<type-id>` | Id of the Info type |
1332 | `<owner-id>` | Id of the job owner |
1333 | `NOOWNER` | No owner is given |
1334 | `<job-id>` | Id of the expected job |
1335 | `EMPTY` | The expected list of job id shall be empty |
1337 ## Function: ics_api_idc_get_job ##
1339 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}' and optional check of the returned job.
1340 To test the response code only, provide the response code, type id and job id.
1341 To also test the response payload add the remaining parameters.
1345 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1347 | parameter | description |
1348 | --------- | ----------- |
1349 | `<response-code>` | Expected http response code |
1350 | `<type-id>` | Id of the Info type |
1351 | `<job-id>` | Id of the job |
1352 | `<target-url>` | Expected target url for the job |
1353 | `<owner-id>` | Expected owner for the job |
1354 | `<template-job-file>` | Path to a job template for job parameters of the job |
1356 ## Function: ics_api_idc_put_job ##
1358 Test of PUT '/data-consumer/v1/info-jobs/{infoJobId}'.
1359 To test, provide all the specified parameters.
1363 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file> [VALIDATE]` |
1365 | parameter | description |
1366 | --------- | ----------- |
1367 | `<response-code>` | Expected http response code |
1368 | `<type-id>` | Id of the Info type |
1369 | `<job-id>` | Id of the job |
1370 | `<target-url>` | Target url for the job |
1371 | `<owner-id>` | Owner of the job |
1372 | `<template-job-file>` | Path to a job template for job parameters of the job |
1373 | `VALIIDATE` | Indicator to preform type validation at creation |
1375 ## Function: ics_api_idc_delete_job ##
1377 Test of DELETE '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1378 To test, provide all the specified parameters.
1382 | `<response-code> <type-id> <job-id>` |
1384 | parameter | description |
1385 | --------- | ----------- |
1386 | `<response-code>` | Expected http response code |
1387 | `<type-id>` | Id of the type |
1388 | `<job-id>` | Id of the job |
1390 ## Function: ics_api_idc_get_type ##
1392 Test of GET '/data-consumer/v1/info-types/{infoTypeId} and optional check of the returned schema.
1393 To test the response code only, provide the response code parameter as well as the type-id.
1394 To also test the response payload add a path to the expected schema file.
1398 | `<response-code> <type-id> [<schema-file>]` |
1400 | parameter | description |
1401 | --------- | ----------- |
1402 | `<response-code>` | Expected http response code |
1403 | `<type-id>` | Id of the Info type |
1404 | `<schema-file>` | Path to a schema file to compare with the returned schema |
1406 ## Function: ics_api_idc_get_job_status ##
1408 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' and optional check of the returned status and timeout.
1409 To test the response code only, provide the response code and job id.
1410 To also test the response payload add the expected status.
1414 | `<response-code> <job-id> [<status> [ <timeout>]]` |
1416 | parameter | description |
1417 | --------- | ----------- |
1418 | `<response-code>` | Expected http response code |
1419 | `<job-id>` | Id of the job |
1420 | `<status>` | Expected status |
1421 | `<timeout>` | Timeout |
1423 ## Function: ics_api_idc_get_job_status2 ##
1425 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' with returned producers and optional check of the returned status and timeout.
1426 To test the response code only, provide the response code and job id.
1427 To also test the response payload add the expected status.
1431 | `<response-code> <job-id> [<status> EMPTYPROD|( <prod-count> <producer-id>+ ) [<timeout>]]` |
1433 | parameter | description |
1434 | --------- | ----------- |
1435 | `<response-code>` | Expected http response code |
1436 | `<job-id>` | Id of the job |
1437 | `<status>` | Expected status |
1438 | `<EMPTYPROD>` | Indicated for empty list of producer |
1439 | `<prod-count>` | Number of expected producer |
1440 | `<producer-id>` |Id of the producer |
1441 | `<timeout>` | Timeout |
1444 ## Function: ics_api_idc_get_subscription_ids ##
1445 Test of GET '/data-consumer/v1/info-type-subscription' with the returned list of subscription ids
1449 | `<response-code> <owner-id>|NOOWNER [ EMPTY | <subscription-id>+]` |
1451 | parameter | description |
1452 | --------- | ----------- |
1453 | `<response-code>` | Expected http response code |
1454 | `<owner-id>` | Id of the owner |
1455 | `<NOOWNER>` | Indicator for empty owner |
1456 | `<EMPTY>` | Indicated for empty list of subscription ids |
1457 | `<subscription-id>` |Id of the subscription |
1459 ## Function: ics_api_idc_get_subscription ##
1460 Test of GET '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
1464 | `<response-code> <subscription-id> [ <owner-id> <status-uri> ]` |
1466 | parameter | description |
1467 | --------- | ----------- |
1468 | `<response-code>` | Expected http response code |
1469 | `<subscription-id>` |Id of the subscription |
1470 | `<owner-id>` | Id of the owner |
1471 | `<status-uri>` | Url for status notifications |
1474 ## Function: ics_api_idc_put_subscription ##
1475 Test of PUT '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
1479 | `<response-code> <subscription-id> <owner-id> <status-uri>` |
1481 | parameter | description |
1482 | --------- | ----------- |
1483 | `<response-code>` | Expected http response code |
1484 | `<subscription-id>` |Id of the subscription |
1485 | `<owner-id>` | Id of the owner |
1486 | `<status-uri>` | Url for status notifications |
1488 ## Function: ics_api_idc_delete_subscription ##
1489 Test of DELETE /data-consumer/v1/info-type-subscription/{subscriptionId}
1493 | `<response-code> <subscription-id>` |
1495 | parameter | description |
1496 | --------- | ----------- |
1497 | `<response-code>` | Expected http response code |
1498 | `<subscription-id>` |Id of the subscription |
1501 ## Function: ics_api_admin_reset ##
1503 Test of GET '/status'.
1507 | `<response-code> [ <type> ]` |
1509 | parameter | description |
1510 | --------- | ----------- |
1511 | `<response-code>` | Expected http response code |
1512 | `<type>` | Type id, if the interface supports type in url |
1514 ## Function: ics_kube_pvc_reset ##
1516 Admin reset to remove all data in ics; jobs, producers etc
1517 NOTE - only works in kubernetes and the pod should not be running
1523 # Description of functions in kafkapc_api_functions.sh #
1525 ## Function: use_kafkapc_http ##
1527 Use http for all calls to the KAFKAPC.
1532 ## Function: use_kafkapc_https ##
1534 Use https for all calls to the KAFKAPC.
1539 ## Function: start_kafkapc ##
1541 Start the KAFKAPC container in docker or kube depending on start mode
1546 ## Function: kafkapc_equal ##
1548 Tests if a variable value in the KAFKAPC is equal to a target value.
1549 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1550 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.
1551 See the 'mrstub' dir for more details.
1554 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1556 | parameter | description |
1557 | --------- | ----------- |
1558 | `<variable-name>` | Variable name in the KAFKAPC |
1559 | `<target-value>` | Target value for the variable |
1560 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1562 ## Function: kafkapc_api_reset ##
1564 Deep reset of KAFKAPC. Note that kafka itself is not affected, i.e. created topic still exist in kafka.
1569 ## Function: kafkapc_api_create_topic ##
1571 Create a topic in kafka via kafkapc.
1572 | `<response-code> <topic-name> <mime-type>` |
1574 | parameter | description |
1575 | --------- | ----------- |
1576 | `<response-code>` | Http response code |
1577 | `<topic-name>` | Name of the topic |
1578 | `<mime-type>` | Mime type of the data to send to the topic. Data on the topic is expected to be of this type |
1580 ## Function: kafkapc_api_get_topic ##
1582 Create a from kafkapc.
1583 | `<response-code> <topic-name> <mime-type>` |
1585 | parameter | description |
1586 | --------- | ----------- |
1587 | `<response-code>` | Http response code |
1588 | `<topic-name>` | Name of the topic |
1589 | `<mime-type>` | Mime type of the topic |
1591 ## Function: kafkapc_api_start_sending ##
1593 Start sending msg from the msg queue to kafka for a topic.
1594 | `<response-code> <topic-name>` |
1596 | parameter | description |
1597 | --------- | ----------- |
1598 | `<response-code>` | Http response code |
1599 | `<topic-name>` | Name of the topic |
1601 ## Function: kafkapc_api_start_receiving ##
1603 Start receiving msg from a kafka topic to the msg queue in kafkapc.
1604 | `<response-code> <topic-name>` |
1606 | parameter | description |
1607 | --------- | ----------- |
1608 | `<response-code>` | Http response code |
1609 | `<topic-name>` | Name of the topic |
1611 ## Function: kafkapc_api_stop_sending ##
1613 Stop sending msg from the msg queue to kafka for a topic.
1614 | `<response-code> <topic-name>` |
1616 | parameter | description |
1617 | --------- | ----------- |
1618 | `<response-code>` | Http response code |
1619 | `<topic-name>` | Name of the topic |
1621 ## Function: kafkapc_api_stop_receiving ##
1623 Stop receiving msg from a kafka topic to the msg queue in kafkapc.
1624 | `<response-code> <topic-name>` |
1626 | parameter | description |
1627 | --------- | ----------- |
1628 | `<response-code>` | Http response code |
1629 | `<topic-name>` | Name of the topic |
1631 ## Function: kafkapc_api_post_msg ##
1633 Send a message on a topic.
1636 | `<response-code> <topic> <mime-type> <msg>` |
1638 | parameter | description |
1639 | --------- | ----------- |
1640 | `<response-code>` | Http response code |
1641 | `<topic>` | Topic name |
1642 | `<mime-type>` | Mime type of the msg |
1643 | `<msg>` | String msg to send |
1645 ## Function: kafkapc_api_get_msg ##
1647 Get a message on a topic.
1650 | `<response-code> <topic> ([ <mime-type> <msg> ] | NOMSG )` |
1652 | parameter | description |
1653 | --------- | ----------- |
1654 | `<response-code>` | Http response code |
1655 | `<topic>` | Topic name |
1656 | `<mime-type>` | Mime type of the msg |
1657 | `<msg>` | String msg to receive |
1658 | `NOMSG` | Indicated for no msg |
1660 ## Function: kafkapc_api_post_msg_from_file ##
1662 Send a message in a file on a topic.
1665 | `<response-code> <topic> <mime-type> <file>` |
1667 | parameter | description |
1668 | --------- | ----------- |
1669 | `<response-code>` | Http response code |
1670 | `<topic>` | Topic name |
1671 | `<mime-type>` | Mime type of the msg |
1672 | `<file>` | Filepath to the string msg to send |
1674 ## Function: kafkapc_api_get_msg_from_file ##
1676 Get a message on a topic.
1679 | `<response-code> <topic> <mime-type> <file> ` |
1681 | parameter | description |
1682 | --------- | ----------- |
1683 | `<response-code>` | Http response code |
1684 | `<topic>` | Topic name |
1685 | `<mime-type>` | Mime type of the msg |
1686 | `<file>` | Filepath to the string msg to receive |
1688 ## Function: kafkapc_api_generate_json_payload_file ##
1690 Create json file with dummy data for payload.
1693 | `<size-in-kb> <filename>` |
1695 | parameter | description |
1696 | --------- | ----------- |
1697 | `<size-in-kb>` | Generated size in kb |
1698 | `<filename>` | Path to output file |
1700 ## Function: kafkapc_api_generate_text_payload_file ##
1702 Create file with dummy text data for payload.
1705 | `<size-in-kb> <filename>` |
1707 | parameter | description |
1708 | --------- | ----------- |
1709 | `<size-in-kb>` | Generated size in kb |
1710 | `<filename>` | Path to output file |
1712 # Description of functions in kubeproxy_api_functions.sh #
1714 ## Function: use_kube_proxy_http ##
1716 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.
1721 ## Function: use_kube_proxy_https ##
1723 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.
1728 ## Function: start_kube_proxy ##
1730 Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
1731 No proxy is started if the function is called in docker mode.
1736 # Description of functions in localhelm_api_functions.sh #
1738 ## Function: localhelm_create_test_chart ##
1740 Create a dummy chart using helm
1745 | parameter | description |
1746 | --------- | ----------- |
1747 | `chart-name` | Name of the chart |
1749 ## Function: localhelm_package_test_chart ##
1751 Package a dummy chart using helm
1756 | parameter | description |
1757 | --------- | ----------- |
1758 | `chart-name` | Name of the chart |
1760 ## Function: localhelm_installed_chart_release ##
1762 Check if a chart is installed or not using helm
1765 | `INSTALLED|NOTINSTALLED <release-name> <name-space> |
1767 | parameter | description |
1768 | --------- | ----------- |
1769 | `INSTALLED` | Expecting installed chart |
1770 | `NOTINSTALLED` | Expecting a not installed chart |
1771 | `release-name` | Name of the release |
1772 | `name-space` | Expected namespace |
1774 # Description of functions in mr_api_functions.sh #
1776 ## Function: use_mr_http ##
1778 Use http for all Dmaap calls to the MR. This is the default. The admin API is not affected. Note that this function shall be called before preparing the config for Consul.
1783 ## Function: use_mr_https ##
1785 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.
1790 ## Function: start_mr ##
1792 Start the Message Router stub interface container in docker or kube depending on start mode
1797 ## Function: dmaap_api_print_topics ##
1799 Prints the current list of topics in DMAAP MR
1805 ## Function: mr_equal ##
1807 Tests if a variable value in the Message Router (MR) simulator is equal to a target value.
1808 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1809 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.
1810 See the 'mrstub' dir for more details.
1813 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1815 | parameter | description |
1816 | --------- | ----------- |
1817 | `<variable-name>` | Variable name in the MR |
1818 | `<target-value>` | Target value for the variable |
1819 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1821 ## Function: mr_greater ##
1823 Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
1824 Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than the target or not.
1825 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.
1826 See the 'mrstub' dir for more details.
1829 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1831 | parameter | description |
1832 | --------- | ----------- |
1833 | `<variable-name>` | Variable name in the MR |
1834 | `<target-value>` | Target value for the variable |
1835 | `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value |
1837 ## Function: mr_read ##
1839 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.
1840 See the 'mrstub' dir for more details.
1843 | `<variable-name>` |
1845 | parameter | description |
1846 | --------- | ----------- |
1847 | `<variable-name>` | Variable name in the MR |
1849 ## Function: mr_print ##
1851 Prints the value of a variable in the Message Router (MR) simulator.
1852 See the 'mrstub' dir for more details.
1855 | `<variable-name>` |
1857 | parameter | description |
1858 | --------- | ----------- |
1859 | `<variable-name>` | Variable name in the MR |
1861 ## Function: mr_api_send_json ##
1863 Send json to topic in mr-stub.
1866 | `<topic-url> <json-msg>` |
1868 | parameter | description |
1869 | --------- | ----------- |
1870 | `<topic-url>` | Topic url |
1871 | `<json-msg>` | Json msg as string |
1873 ## Function: mr_api_send_text ##
1875 Send text to topic in mr-stub.
1878 | `<topic-url> <text-msg>` |
1880 | parameter | description |
1881 | --------- | ----------- |
1882 | `<topic-url>` | Topic url |
1883 | `<text-msg>` | Text (string) msg |
1887 ## Function: mr_api_send_json_file ##
1889 Send json to topic in mr-stub.
1892 | `<topic-url> <json-file>` |
1894 | parameter | description |
1895 | --------- | ----------- |
1896 | `<topic-url>` | Topic url |
1897 | `<json-file>` | Path to file with json msg as string |
1899 ## Function: mr_api_send_text_file ##
1901 Send text to topic in mr-stub.
1904 | `<topic-url> <text-file>` |
1906 | parameter | description |
1907 | --------- | ----------- |
1908 | `<topic-url>` | Topic url |
1909 | `<text-file>` | Path to file with text msg as string |
1911 ## Function: mr_api_generate_json_payload_file ##
1913 Create json file with dummy data for payload.
1916 | `<size-in-kb> <filename>` |
1918 | parameter | description |
1919 | --------- | ----------- |
1920 | `<size-in-kb>` | Generated size in kb |
1921 | `<filename>` | Path to output file |
1923 ## Function: mr_api_generate_text_payload_file ##
1925 Create file with dummy text data for payload.
1928 | `<size-in-kb> <filename>` |
1930 | parameter | description |
1931 | --------- | ----------- |
1932 | `<size-in-kb>` | Generated size in kb |
1933 | `<filename>` | Path to output file |
1935 # Description of functions in ngw_api_functions.sh #
1937 ## Function: use_gateway_http ##
1939 Use http for all calls to the gateway. This is set by default.
1944 ## Function: use_gateway_https ##
1946 Use https for all calls to the gateway.
1951 ## Function: set_gateway_debug ##
1953 Set debug level logging in the gateway
1958 ## Function: set_gateway_trace ##
1960 Set debug level logging in the trace
1965 ## Function: start_gateway ##
1967 Start the the gateway container in docker or kube depending on start mode
1972 ## Function: gateway_a1pms_get_status ##
1974 Sample test of a1pms api (status)
1975 Only response code tested - not payload
1978 | `<response-code>` |
1980 | parameter | description |
1981 | --------- | ----------- |
1982 | `<response-code>` | Expected http response code |
1984 ## Function: gateway_ics_get_types ##
1986 Sample test of ics api (get types)
1987 Only response code tested - not payload
1990 | `<response-code>` |
1992 | parameter | description |
1993 | --------- | ----------- |
1994 | `<response-code>` | Expected http response code |
1996 # Description of functions in a1pms_api_functions.sh #
2000 Both A1PMS version 1 and 2 are supported. The version is controlled by the env variable `$A1PMS_VERSION` set in the test env file.
2001 For api function in version 2, an url prefix is added if configured.
2003 ## Function: use_a1pms_rest_http ##
2005 Use http for all API calls to the A1PMS. This is the default.
2010 ## Function: use_a1pms_rest_https ##
2012 Use https for all API calls to the A1PMS.
2017 ## Function: use_a1pms_dmaap_http ##
2019 Send and recieve all API calls to the A1PMS over Dmaap via the MR over http.
2024 ## Function: use_a1pms_dmaap_https ##
2026 Send and recieve all API callss to the A1PMS over Dmaap via the MR over https.
2031 ## Function: start_a1pms ##
2033 Start the A1PMS container or corresponding kube resources depending on docker/kube mode.
2036 | `<logfile-prefix>` |
2037 | (docker) `PROXY\|NOPROXY <config-file>` |
2038 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
2040 | parameter | description |
2041 | --------- | ----------- |
2042 | `PROXY` | Configure with http proxy, if proxy is started |
2043 | `NOPROXY` | Configure without http proxy |
2044 | `<config-file>`| Path to application.yaml |
2045 | `<data-file>` | Optional path to application_configuration.json |
2047 ## Function: stop_a1pms ##
2049 Stop the a1pms container (docker) or scale it to zero (kubernetes).
2054 ## Function: start_stopped_a1pms ##
2056 Start a previousely stopped a1pms container (docker) or scale it to 1 (kubernetes).
2061 ## Function: prepare_a1pms_config ##
2063 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')
2066 | `SDNC|NOSDNC <output-file>` |
2068 | parameter | description |
2069 | --------- | ----------- |
2070 | `SDNC` | Configure with controller |
2071 | `NOSDNC` | Configure without controller |
2072 | `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app' |
2074 ## Function: a1pms_load_config ##
2076 Load the config into a config map (kubernetes only).
2081 | parameter | description |
2082 | --------- | ----------- |
2083 | `<data-file>` | Path to application_configuration.json |
2085 ## Function: set_a1pms_debug ##
2087 Configure the A1PMS log on debug level. The A1PMS must be running.
2092 ## Function: set_a1pms_trace ##
2094 Configure the A1PMS log on trace level. The A1PMS must be running.
2099 ## Function: use_a1pms_retries ##
2101 Configure the A1PMS to make upto 5 retries if an API calls return any of the specified http return codes.
2104 | `[<response-code>]*` |
2106 ## Function: check_a1pms_logs ##
2108 Check the A1PMS log for any warnings and errors and print the count of each.
2113 ## Function: a1pms_equal ##
2115 Tests if the array length of a json array in the A1PMS simulator is equal to a target value.
2116 Without the timeout, the test sets pass or fail immediately depending on if the array length is equal to the target or not.
2117 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.
2118 See the 'cr' dir for more details.
2122 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2124 | parameter | description |
2125 | --------- | ----------- |
2126 | `<variable-name>` | Relative url. Example 'json:policy_types' - checks the json array length of the url /policy_types |
2127 | `<target-value>` | Target value for the length |
2128 | `<timeout-in-sec>` | Max time to wait for the length to reach the target value |
2130 ## Function: a1pms_api_get_policies ##
2132 Test of GET '/policies' or V2 GET '/v2/policy-instances' and optional check of the array of returned policies.
2133 To test the response code only, provide the response code parameter as well as the following three parameters.
2134 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.
2138 | `<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>]*]` |
2142 | `<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>]*]` |
2144 | parameter | description |
2145 | --------- | ----------- |
2146 | `<response-code>` | Expected http response code |
2147 | `<ric-id>` | Id of the ric |
2148 | `NORIC` | Indicator that no ric is provided |
2149 | `<service-id>` | Id of the service |
2150 | `NOSERVICE` | Indicator that no service id is provided |
2151 | `<policy-type-id>` | Id of the policy type |
2152 | `NOTYPE` | Indicator that no type id is provided |
2153 | `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
2154 | `<policy-id>` | Id of the policy |
2155 | `EMPTY` | Indicate for the special empty policy type |
2156 | `transient` | Transient, true or false |
2157 | `notification-url` | Url for notifications |
2158 | `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
2160 ## Function: a1pms_api_get_policy ##
2162 Test of GET '/policy' or V2 GET '/v2/policies/{policy_id}' and optional check of the returned json payload.
2163 To test the the response code only, provide the expected response code and policy id.
2164 To test the contents of the returned json payload, add a path to the template file used when creating the policy.
2168 | `<response-code> <policy-id> [<template-file>]` |
2172 | `<response-code> <policy-id> [ <template-file> <service-name> <ric-id> <policytype-id>\|NOTYPE <transient> <notification-url>\|NOURL ]` |
2174 | parameter | description |
2175 | --------- | ----------- |
2176 | `<response-code>` | Expected http response code |
2177 | `<policy-id>` | Id of the policy |
2178 | `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
2179 | `<service-id>` | Id of the service |
2180 | `<ric-id>` | Id of the ric |
2181 | `<policy-type-id>` | Id of the policy type |
2182 | `NOTYPE` | Indicator that no type id is provided |
2183 | `transient` | Transient, true or false |
2184 | `notification-url` | Url for notifications |
2186 ## Function: a1pms_api_put_policy ##
2188 Test of PUT '/policy' or V2 PUT '/policies'.
2189 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).
2193 | `<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]` |
2197 | `<response-code> <service-name> <ric-id> <policytype-id>\|NOTYPE <policy-id> <transient>\|NOTRANSIENT <notification-url>\|NOURL <template-file> [<count>]` |
2199 | parameter | description |
2200 | --------- | ----------- |
2201 | `<response-code>` | Expected http response code |
2202 | `<service-id>` | Id of the service |
2203 | `<ric-id>` | Id of the ric |
2204 | `<policy-type-id>` | Id of the policy type |
2205 | `<policy-id>` | Id of the policy. This value shall be a numeric value if more than one policy shall be created |
2206 | `transient>` | Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provided) |
2207 | `notification-url` | Url for notifications |
2208 |`NOURL`| Indicator for no url |
2209 | `<template-file>` | Path to the template file for the policy |
2210 | `<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 |
2212 ## Function: a1pms_api_put_policy_batch ##
2214 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.
2215 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.
2216 For arg list and parameters, see 'a1pms_api_put_policy'.
2218 ## Function: a1pms_api_put_policy_parallel ##
2220 This tests the same as function 'a1pms_api_put_policy' except that the policy create 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' shall be selected to be not evenly divisible by the product of the parameters 'number-of-rics' and 'count' - this is to ensure that one process does not handle the creation of all the policies in one ric.
2224 | `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <template-file> <count-per-ric> <number-of-threads>`
2228 | `<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>`
2230 | parameter | description |
2231 | --------- | ----------- |
2232 | `<response-code>` | Expected http response code |
2233 | `<service-id>` | Id of the service |
2234 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing |
2235 | `<number-of-rics>` | The number of rics, assuming the first index is '1'. The index is added to the 'ric-id-base' id |
2236 | `<policy-type-id>` | Id of the policy type |
2237 | `<policy-start-id>` | Id of the policy. This value shall be a numeric value and will be the id of the first policy |
2238 | `transient>` | Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provide) |
2239 | `notification-url` | Url for notifications |
2240 | `<template-file>` | Path to the template file for the policy |
2241 | `<count-per-ric>` | Number of policies per ric |
2242 | `<number-of-threads>` | Number of threads (processes) to run in parallel |
2244 ## Function: a1pms_api_delete_policy ##
2246 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.
2250 | `<response-code> <policy-id> [<count>]`
2252 | parameter | description |
2253 | --------- | ----------- |
2254 | `<response-code>` | Expected http response code |
2255 | `<policy-id>` | Id of the policy |
2256 | `<count>` | An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
2258 ## Function: a1pms_api_delete_policy_batch ##
2260 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.
2261 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.
2262 For arg list and parameters, see 'a1pms_api_delete_policy'.
2264 ## Function: a1pms_api_delete_policy_parallel ##
2266 This tests the same as function 'a1pms_api_delete_policy' except that the policy delete 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.
2270 | `<response-code> <ric-id-base> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>`
2272 | parameter | description |
2273 | --------- | ----------- |
2274 | `<response-code>` | Expected http response code |
2275 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing |
2276 | `<number-of-rics>` | The number of rics, assuming the first index is '1' |
2277 | `<policy-start-id>` | Id of the policy. This value shall be a numeric value and will be the id of the first policy |
2278 | `<count-per-ric>` | Number of policies per ric |
2279 | `<number-of-threads>` | Number of threads (processes) to run in parallel |
2281 ## Function: a1pms_api_get_policy_ids ##
2283 Test of GET '/policy_ids' or V2 GET '/v2/policies'.
2284 To test response code only, provide the response code parameter as well as the following three parameters.
2285 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.
2289 | `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <type-id>\|NOTYPE ([<policy-instance-id]*\|NOID)` |
2291 | parameter | description |
2292 | --------- | ----------- |
2293 | `<response-code>` | Expected http response code |
2294 | `<ric-id>` | Id of the ric |
2295 | `NORIC` | Indicator that no ric is provided |
2296 | `<service-id>` | Id of the service |
2297 | `NOSERVICE` | Indicator that no service id is provided |
2298 | `type-id>` | Id of the policy type |
2299 | `NOTYPE` | Indicator that no type id is provided |
2300 | `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
2301 | `<policy-instance-id>` | Id of the policy |
2303 ## Function: a1pms_api_get_policy_schema ##
2305 Test of V2 GET '/v2/policy-types/{policyTypeId}' and optional check of the returned json schema.
2306 To test the response code only, provide the expected response code and policy type id.
2307 To test the contents of the returned json schema, add a path to a schema file to compare with.
2311 | `<response-code> <policy-type-id> [<schema-file>]` |
2313 | parameter | description |
2314 | --------- | ----------- |
2315 | `<response-code>` | Expected http response code |
2316 | `<policy-type-id>` | Id of the policy type |
2317 | `<schema-file>` | Path to the schema file for the policy type |
2319 ## Function: a1pms_api_get_policy_schema ##
2321 Test of GET '/policy_schema' and optional check of the returned json schema.
2322 To test the response code only, provide the expected response code and policy type id.
2323 To test the contents of the returned json schema, add a path to a schema file to compare with.
2327 | `<response-code> <policy-type-id> [<schema-file>]` |
2329 | parameter | description |
2330 | --------- | ----------- |
2331 | `<response-code>` | Expected http response code |
2332 | `<policy-type-id>` | Id of the policy type |
2333 | `<schema-file>` | Path to the schema file for the policy type |
2335 ## Function: a1pms_api_get_policy_schemas ##
2337 Test of GET '/policy_schemas' and optional check of the returned json schemas.
2338 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
2339 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)
2343 | `<response-code> <ric-id>\|NORIC [<schema-file>\|NOFILE]*` |
2345 | parameter | description |
2346 | --------- | ----------- |
2347 | `<response-code>` | Expected http response code |
2348 | `<ric-id>` | Id of the ric |
2349 | `NORIC` | No ric id given |
2350 | `<schema-file>` | Path to the schema file for the policy type |
2351 | `NOFILE` | Indicate the template for an empty type |
2353 ## Function: a1pms_api_get_policy_status ##
2355 Test of GET '/policy_status' or V2 GET '/policies/{policy_id}/status'.
2359 | `<response-code> <policy-id> (STD\|STD2 <enforce-status>\|EMPTY [<reason>\|EMPTY])\|(OSC <instance-status> <has-been-deleted>)` |
2361 | parameter | description |
2362 | --------- | ----------- |
2363 | `<response-code>` | Expected http response code |
2364 | `<policy-id>` | Id of the policy |
2365 | `STD` | Indicator of status of Standarized A1 |
2366 | `STD2` | Indicator of status of Standarized A1 version 2 |
2367 | `<enforce-status>` | Enforcement status |
2368 | `<reason>` | Optional reason |
2369 | `EMPTY` | Indicator of empty string status or reason |
2370 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
2371 | `<instance-status>` | Instance status |
2372 | `<has-been-deleted>` | Deleted status, true or false |
2374 ## Function: a1pms_api_get_policy_types ##
2376 Test of GET '/policy_types' or V2 GET '/v2/policy-types' and optional check of the returned ids.
2377 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
2378 To test the contents of the returned json payload, add the list of expected policy type id (or 'EMPTY' for the '{}' type)
2382 | `<response-code> [<ric-id>\|NORIC [<policy-type-id>\|EMPTY [<policy-type-id>]*]]` |
2384 | parameter | description |
2385 | --------- | ----------- |
2386 | `<response-code>` | Expected http response code |
2387 | `<ric-id>` | Id of the ric |
2388 | `NORIC` | No ric id given |
2389 | `<policy-type-id>` | Id of the policy type |
2390 | `EMPTY` | Indicate the empty type |
2392 ## Function: a1pms_api_get_status ##
2394 Test of GET /status or V2 GET /status
2398 | `<response-code>` |
2400 | parameter | description |
2401 | --------- | ----------- |
2402 | `<response-code>` | Expected http response code |
2404 ## Function: a1pms_api_get_ric ##
2406 Test of GET '/ric' or V2 GET '/v2/rics/ric'
2407 To test the response code only, provide the expected response code and managed element id.
2408 To test the returned ric id, provide the expected ric id.
2412 | `<reponse-code> <managed-element-id> [<ric-id>]` |
2416 | `<reponse-code> <management-element-id>\|NOME <ric-id>\|<NORIC> [<string-of-ricinfo>]` |
2418 | parameter | description |
2419 | --------- | ----------- |
2420 | `<response-code>` | Expected http response code |
2421 | `<managed-element-id>` | Id of the managed element |
2422 | `NOME` | Indicator for no ME |
2423 | `ric-id` | Id of the ric |
2424 | `NORIC` | Indicator no RIC |
2425 | `string-of-ricinfo` | String of ric info |
2427 ## Function: a1pms_api_get_rics ##
2429 Test of GET '/rics' or V2 GET '/v2/rics' and optional check of the returned json payload (ricinfo).
2430 To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
2431 To test also the returned payload, add the formatted string of info in the returned payload.
2432 Format of ricinfo: <br>`<ric-id>:<list-of-mes>:<list-of-policy-type-ids>`<br>
2433 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_........."`
2437 | `<reponse-code> <policy-type-id>\|NOTYPE [<space-separate-string-of-ricinfo>]` |
2439 | parameter | description |
2440 | --------- | ----------- |
2441 | `<response-code>` | Expected http response code |
2442 | `<policy-type-id>` | Policy type id of the ric |
2443 | `NOTYPE>` | No type given |
2444 | `<space-separate-string-of-ricinfo>` | A space separated string of ric info - needs to be quoted |
2446 ## Function: a1pms_api_put_service ##
2448 Test of PUT '/service' or V2 PUT '/service'.
2451 | `<response-code> <service-name> <keepalive-timeout> <callbackurl>` |
2453 | parameter | description |
2454 | --------- | ----------- |
2455 | `<response-code>` | Expected http response code |
2456 | `<service-name>` | Service name |
2457 | `<keepalive-timeout>` | Timeout value |
2458 | `<callbackurl>` | Callback url |
2460 ## Function: a1pms_api_get_services ##
2462 Test of GET '/service' or V2 GET '/v2/services' and optional check of the returned json payload.
2463 To test only the response code, omit all parameters except the expected response code.
2464 To test the returned json, provide the parameters after the response code.
2468 | `<response-code> [ (<query-service-name> <target-service-name> <keepalive-timeout> <callbackurl>) \| (NOSERVICE <target-service-name> <keepalive-timeout> <callbackurl> [<target-service-name> <keepalive-timeout> <callbackurl>]* )]` |
2470 | parameter | description |
2471 | --------- | ----------- |
2472 | `<response-code>` | Expected http response code |
2473 | `<query-service-name>` | Service name for the query |
2474 | `<target-service-name>` | Target service name|
2475 | `<keepalive-timeout>` | Timeout value |
2476 | `<callbackurl>` | Callback url |
2477 | `NOSERVICE` | Indicator of no target service name |
2479 ## Function: a1pms_api_get_service_ids ##
2481 Test of GET '/services' or V2 GET /'v2/services'. Only check of service ids.
2485 | `<response-code> [<service-name>]*` |
2487 | parameter | description |
2488 | --------- | ----------- |
2489 | `<response-code>` | Expected http response code |
2490 | `<service-name>` | Service name |
2492 ## Function: a1pms_api_delete_services ##
2494 Test of DELETE '/services' or V2 DELETE '/v2/services/{serviceId}'
2498 | `<response-code> [<service-name>]*` |
2500 | parameter | description |
2501 | --------- | ----------- |
2502 | `<response-code>` | Expected http response code |
2503 | `<service-name>` | Service name |
2505 ## Function: a1pms_api_put_services_keepalive ##
2507 Test of PUT '/services/keepalive' or V2 PUT '/v2/services/{service_id}/keepalive'
2511 | `<response-code> <service-name>` |
2513 | parameter | description |
2514 | --------- | ----------- |
2515 | `<response-code>` | Expected http response code |
2516 | `<service-name>` | Service name |
2518 ## Function: a1pms_api_put_configuration ##
2520 Test of PUT '/v2/configuration'
2524 | `<response-code> <config-file>` |
2526 | parameter | description |
2527 | --------- | ----------- |
2528 | `<response-code>` | Expected http response code |
2529 | `<config-file>` | Path json config file |
2531 ## Function: a1pms_api_get_configuration ##
2533 Test of GET '/v2/configuration'
2537 | `<response-code> [<config-file>]` |
2539 | parameter | description |
2540 | --------- | ----------- |
2541 | `<response-code>` | Expected http response code |
2542 | `<config-file>` | Path json config file to compare the retrieved config with |
2544 ## Function: a1pms_kube_pvc_reset ##
2545 Admin reset to remove all policies and services
2546 All types and instances etc are removed - types and instances in a1 sims need to be removed separately
2547 NOTE - only works in kubernetes and the pod should not be running
2554 # Description of functions in prodstub_api_functions.sh #
2556 ## Function: use_prod_stub_http ##
2558 Use http for the API. The admin API is not affected. This is the default protocol.
2563 ## Function: use_prod_stub_https ##
2565 Use https for the API. The admin API is not affected.
2570 ## Function: start_prod_stub ##
2572 Start the Producer stub container in docker or kube depending on start mode
2577 ## Function: prodstub_arm_producer ##
2579 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
2583 | `<response-code> <producer-id> [<forced_response_code>]` |
2585 | parameter | description |
2586 | --------- | ----------- |
2587 | `<response-code>` | Expected http response code |
2588 | `<producer-id>` | Id of the producer |
2589 | `<forced_response_code>` | Forced response code for the producer callback url |
2591 ## Function: prodstub_arm_job_create ##
2593 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.
2597 | `<response-code> <job-id> [<forced_response_code>]` |
2599 | parameter | description |
2600 | --------- | ----------- |
2601 | `<response-code>` | Expected http response code |
2602 | `<job-id>` | Id of the job |
2603 | `<forced_response_code>` | Forced response code for the create callback url |
2605 ## Function: prodstub_arm_job_delete ##
2607 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.
2611 | `<response-code> <job-id> [<forced_response_code>]` |
2613 | parameter | description |
2614 | --------- | ----------- |
2615 | `<response-code>` | Expected http response code |
2616 | `<job-id>` | Id of the job |
2617 | `<forced_response_code>` | Forced response code for the delete callback url |
2619 ## Function: prodstub_arm_type ##
2621 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
2625 | `<response-code> <producer-id> <type-id>` |
2627 | parameter | description |
2628 | --------- | ----------- |
2629 | `<response-code>` | Expected http response code |
2630 | `<producer-id>` | Id of the producer |
2631 | `<type-id>` | Id of the type |
2633 ## Function: prodstub_disarm_type ##
2635 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
2639 | `<response-code> <producer-id> <type-id>` |
2641 | parameter | description |
2642 | --------- | ----------- |
2643 | `<response-code>` | Expected http response code |
2644 | `<producer-id>` | Id of the producer |
2645 | `<type-id>` | Id of the type |
2647 ## Function: prodstub_check_jobdata ##
2649 Check a job in the prodstub towards the list of provided parameters.
2653 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2655 | parameter | description |
2656 | --------- | ----------- |
2657 | `<response-code>` | Expected http response code |
2658 | `<producer-id>` | Id of the producer |
2659 | `<job-id>` | Id of the job |
2660 | `<type-id>` | Id of the type |
2661 | `<target-url>` | Target url for data delivery |
2662 | `<job-owner>` | Id of the job owner |
2663 | `<template-job-file>` | Path to a job template file |
2665 ## Function: prodstub_check_jobdata_2 ##
2667 Check a job in the prodstub towards the list of provided parameters.
2671 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2673 | parameter | description |
2674 | --------- | ----------- |
2675 | `<response-code>` | Expected http response code |
2676 | `<producer-id>` | Id of the producer |
2677 | `<job-id>` | Id of the job |
2678 | `<type-id>` | Id of the type |
2679 | `<target-url>` | Target url for data delivery |
2680 | `<job-owner>` | Id of the job owner |
2681 | `<template-job-file>` | Path to a job template file |
2683 ## Function: prodstub_check_jobdata_3 ##
2685 Check a job in the prodstub towards the list of provided parameters.
2689 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2691 | parameter | description |
2692 | --------- | ----------- |
2693 | `<response-code>` | Expected http response code |
2694 | `<producer-id>` | Id of the producer |
2695 | `<job-id>` | Id of the job |
2696 | `<type-id>` | Id of the type |
2697 | `<target-url>` | Target url for data delivery |
2698 | `<job-owner>` | Id of the job owner |
2699 | `<template-job-file>` | Path to a job template file |
2701 ## Function: prodstub_delete_jobdata ##
2703 Delete the job parameters, job data, for a job.
2707 | `<response-code> <producer-id> <job-id>` |
2709 | parameter | description |
2710 | --------- | ----------- |
2711 | `<response-code>` | Expected http response code |
2712 | `<producer-id>` | Id of the producer |
2713 | `<job-id>` | Id of the job |
2715 ## Function: prodstub_equal ##
2717 Tests if a variable value in the prodstub is equal to a target value.
2718 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2719 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.
2723 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2725 | parameter | description |
2726 | --------- | ----------- |
2727 | `<variable-name>` | Variable name in the prostub |
2728 | `<target-value>` | Target value for the variable |
2729 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2731 # Description of functions in rc_api_function.sh #
2733 ## Function: use_rapp_catalogue_http ##
2735 Use http for the API. This is the default protocol.
2740 ## Function: use_rapp_catalogue_https ##
2742 Use https for the API.
2747 ## Function: start_rapp_catalogue ##
2749 Start the rapp catalogue container in docker or kube depending on start mode
2754 ## Function: rc_equal ##
2756 Tests if a variable value in the RAPP Catalogue is equal to a target value.
2757 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2758 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.
2759 See the 'cr' dir for more details.
2762 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2764 | parameter | description |
2765 | --------- | ----------- |
2766 | `<variable-name>` | Variable name in the RC |
2767 | `<target-value>` | Target value for the variable |
2768 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2770 ## Function: rapp_cat_api_get_services ##
2772 Check all registered services.
2776 | `<response-code> [(<service-id> <version> <display-name> <description>)+ \| EMPTY ]` |
2778 | parameter | description |
2779 | --------- | ----------- |
2780 | `<response-code>` | Expected http response code |
2781 | `<service-id>` | Id of the service |
2782 | `<version>` | Version of the service |
2783 | `<display-name>` | Dislay name of the service |
2784 | `<description>` | Description of the service |
2785 | `EMPTY` | Indicator for an empty list |
2787 ## Function: rapp_cat_api_put_service ##
2789 Register a services.
2793 | `<response-code> <service-id> <version> <display-name> <description>` |
2795 | parameter | description |
2796 | --------- | ----------- |
2797 | `<response-code>` | Expected http response code |
2798 | `<service-id>` | Id of the service |
2799 | `<version>` | Version of the service |
2800 | `<display-name>` | Dislay name of the service |
2801 | `<description>` | Description of the service |
2803 ## Function: rapp_cat_api_get_service ##
2805 Check a registered service.
2809 | `<response-code> <service-id> <version> <display-name> <description>` |
2811 | parameter | description |
2812 | --------- | ----------- |
2813 | `<response-code>` | Expected http response code |
2814 | `<service-id>` | Id of the service |
2815 | `<version>` | Version of the service |
2816 | `<display-name>` | Dislay name of the service |
2817 | `<description>` | Description of the service |
2819 ## Function: rapp_cat_api_delete_service ##
2821 Check a registered service.
2825 | `<response-code> <service-id>` |
2827 | parameter | description |
2828 | --------- | ----------- |
2829 | `<response-code>` | Expected http response code |
2830 | `<service-id>` | Id of the service |
2832 # Description of functions in ricsim_api_functions.sh #
2834 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
2836 ## Function: use_simulator_http ##
2838 Use http for all API calls (A1) toward the simulator. This is the default. Admin API calls to the simulator are not affected. Note that this function shall be called before preparing the config for Consul.
2843 ## Function: use_simulator_https ##
2845 Use https for all API calls (A1) toward the simulator. Admin API calls to the simulator are not affected. Note that this function shall be called before preparing the config for Consul.
2850 ## Function: start_ric_simulators ##
2852 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
2855 | `ricsim_g1\|ricsim_g2\|ricsim_g3 <count> <interface-id>` |
2857 | parameter | description |
2858 | --------- | ----------- |
2859 | `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 |
2860 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
2861 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
2863 ## Function: get_kube_sim_host ##
2865 Translate ric name to kube host name.
2870 | parameter | description |
2871 | --------- | ----------- |
2872 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
2874 ## Function: generate_policy_uuid ##
2876 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
2877 UUID is then automatically added to the policy id in GET/PUT/DELETE.
2882 ## Function: sim_equal ##
2884 Tests if a variable value in the RIC simulator is equal to a target value.
2885 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2886 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.
2887 See the 'a1-interface' repo for more details.
2891 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2893 | parameter | description |
2894 | --------- | ----------- |
2895 | `<variable-name>` | Variable name in the ric simulator |
2896 | `<target-value>` | Target value for the variable |
2897 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2899 ## Function: sim_print ##
2901 Prints the value of a variable in the RIC simulator.
2902 See the 'a1-interface' repo for more details.
2906 | `<variable-name>` |
2908 | parameter | description |
2909 | --------- | ----------- |
2910 | `<variable-name>` | Variable name in the RIC simulator |
2912 ## Function: sim_contains_str ##
2914 Tests if a variable value in the RIC simulator contains a target string.
2915 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
2916 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.
2917 See the 'a1-interface' repo for more details.
2921 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2923 | parameter | description |
2924 | --------- | ----------- |
2925 | `<variable-name>` | Variable name in the ric simulator |
2926 | `<target-value>` | Target substring for the variable |
2927 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2929 ## Function: sim_put_policy_type ##
2931 Loads a policy type to the simulator
2935 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
2937 | parameter | description |
2938 | --------- | ----------- |
2939 | `<response-code>` | Expected http response code |
2940 | `<ric-id>` | Id of the ric |
2941 | `<policy-type-id>` | Id of the policy type |
2942 | `<policy-type-file>` | Path to the schema file of the policy type |
2944 ## Function: sim_delete_policy_type ##
2946 Deletes a policy type from the simulator
2950 | `<response-code> <ric-id> <policy_type_id>` |
2952 | parameter | description |
2953 | --------- | ----------- |
2954 | `<response-code>` | Expected http response code |
2955 | `<ric-id>` | Id of the ric |
2956 | `<policy-type-id>` | Id of the policy type |
2958 ## Function: sim_post_delete_instances ##
2960 Deletes all instances (and status), for one ric
2964 | `<response-code> <ric-id>` |
2966 | parameter | description |
2967 | --------- | ----------- |
2968 | `<response-code>` | Expected http response code |
2969 | `<ric-id>` | Id of the ric |
2971 ## Function: sim_post_delete_all ##
2973 Deletes all types, instances (and status), for one ric
2977 | `<response-code> <ric-id>` |
2979 | parameter | description |
2980 | --------- | ----------- |
2981 | `<response-code>` | Expected http response code |
2982 | `<ric-id>` | Id of the ric |
2984 ## Function: sim_post_forcedresponse ##
2986 Sets (or resets) response code for next (one) A1 message, for one ric.
2987 The intention is to simulate error response on the A1 interface.
2991 | `<response-code> <ric-id> [<forced_response_code>]`|
2993 | parameter | description |
2994 | --------- | ----------- |
2995 | `<response-code>` | Expected http response code |
2996 | `<ric-id>` | Id of the ric |
2997 | `<forced_response_code>` | Http response code to send |
2999 ## Function: sim_post_forcedelay ##
3001 Sets (or resets) A1 response delay, for one ric
3002 The intention is to delay responses on the A1 interface. Setting remains until removed.
3006 | `<response-code> <ric-id> [<delay-in-seconds>]`|
3008 | parameter | description |
3009 | --------- | ----------- |
3010 | `<response-code>` | Expected http response code |
3011 | `<ric-id>` | Id of the ric |
3012 | `<delay-in-seconds>` | Delay in seconds. If omitted, the delay is removed |
3014 # Description of functions in sdnc_api_functions.sh #
3016 The file contains a selection of the possible API tests towards the SDNC (a1-controller)
3018 ## Function: use_sdnc_http ##
3020 Use http for all API calls towards the SDNC A1 Controller. This is the default. Note that this function shall be called before preparing the config for Consul.
3025 ## Function: use_sdnc_https ##
3027 Use https for all API calls towards the SDNC A1 Controller. Note that this function shall be called before preparing the config for Consul.
3032 ## Function: start_sdnc ##
3034 Start the SDNC A1 Controller container and its database container
3039 ## Function: stop_sdnc ##
3041 Stop the SDNC A1 Controller container and its database container
3046 ## Function: start_stopped_sdnc ##
3048 Start a previously stopped SDNC
3053 ## Function: check_sdnc_logs ##
3055 Check the SDNC log for any warnings and errors and print the count of each.
3060 ## Function: controller_api_get_A1_policy_ids ##
3062 Test of GET policy ids towards OSC or STD type simulator.
3063 To test response code only, provide the response code, 'OSC' + policy type or 'STD'
3064 To test the response payload, include the ids of the expexted response.
3068 | `<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) \| ( STD <ric-id> [ <policy-id> [<policy-id>]* ]` |
3070 | parameter | description |
3071 | --------- | ----------- |
3072 | `<response-code>` | Expected http response code |
3073 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
3074 | `<ric-id>` | Id of the ric |
3075 | `policy-type-id>` | Id of the policy type |
3076 | `<policy-id>` | Id of the policy |
3077 | `STD` | Indicator of status of Standarized A1 |
3079 ## Function: controller_api_get_A1_policy_type ##
3081 Test of GET a policy type (OSC only)
3085 | `<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]` |
3087 | parameter | description |
3088 | --------- | ----------- |
3089 | `<response-code>` | Expected http response code |
3090 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
3091 | `<ric-id>` | Id of the ric |
3092 | `policy-type-id>` | Id of the policy type |
3093 | `policy-type-file>` | Optional schema file to compare the returned type with |
3095 ## Function: controller_api_delete_A1_policy ##
3097 Deletes a policy instance
3101 | `(STD <ric-id> <policy-id>) \| (OSC <ric-id> <policy-type-id> <policy-id>)` |
3103 | parameter | description |
3104 | --------- | ----------- |
3105 | `<response-code>` | Expected http response code |
3106 | `STD` | Indicator of status of Standarized A1 |
3107 | `<ric-id>` | Id of the ric |
3108 | `<policy-id>` | Id of the policy |
3109 | `policy-type-id>` | Id of the policy type |
3110 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
3111 | `policy-type-file>` | Optional schema file to compare the returned type with |
3113 ## Function: controller_api_put_A1_policy ##
3115 Creates a policy instance
3119 | `<response-code> (STD <ric-id> <policy-id> <template-file> ) \| (OSC <ric-id> <policy-type-id> <policy-id> <template-file>)` |
3121 | parameter | description |
3122 | --------- | ----------- |
3123 | `<response-code>` | Expected http response code |
3124 | `STD` | Indicator of status of Standarized A1 |
3125 | `<ric-id>` | Id of the ric |
3126 | `<policy-id>` | Id of the policy |
3127 | `<template-file>` | Path to the template file of the policy|
3128 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
3129 | `<policy-type-id>` | Id of the policy type |
3131 ## Function: controller_api_get_A1_policy_status ##
3133 Checks the status of a policy
3137 | `<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) \| (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)` |
3139 | parameter | description |
3140 | --------- | ----------- |
3141 | `<response-code>` | Expected http response code |
3142 | `STD` | Indicator of status of Standarized A1 |
3143 | `<ric-id>` | Id of the ric |
3144 | `<policy-id>` | Id of the policy |
3145 | `<enforce-status>` | Enforcement status |
3146 | `<reason>` | Optional reason |
3147 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
3148 | `<policy-type-id>` | Id of the policy type |
3149 | `<instance-status>` | Instance status |
3150 | `<has-been-deleted>` | Deleted status, true or false |
3155 Copyright (C) 2020 Nordix Foundation. All rights reserved.
3156 Licensed under the Apache License, Version 2.0 (the "License");
3157 you may not use this file except in compliance with the License.
3158 You may obtain a copy of the License at
3160 http://www.apache.org/licenses/LICENSE-2.0
3162 Unless required by applicable law or agreed to in writing, software
3163 distributed under the License is distributed on an "AS IS" BASIS,
3164 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3165 See the License for the specific language governing permissions and
3166 limitations under the License.