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 agent 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 Adaptor Service.
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 `pa_api_functions.sh` \
93 Contains functions for adapting towards the Policy Management Service (PMS) 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>+] [--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 | `--image-repo` | Url to optional image repo. Only locally built images will be re-tagged and pushed to this repo |
194 | `-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' |
195 | `--cluster-timeout` | Optional timeout for cluster where it takes time to obtain external ip/host-name. Timeout in seconds |
196 | `--print-stats` | Prints the number of tests, failed tests, failed configuration and deviations after each individual test or config |
197 | `--override <file>` | Override setting from the file supplied by --env-file |
198 | `--pre-clean` | Clean kube resouces when running docker and vice versa |
199 | `--gen-stats` | Collect container/pod runtime statistics |
200 | `--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. |
201 | `--delete-containers` | Delete docker containers before starting tests - but only those created by the test scripts. Docker mode only. |
202 | `--endpoint-stats` | Collect http endpoint statistics |
203 | `help` | Print this info along with the test script description and the list of app short names supported |
205 ## Function: setup_testenvironment ##
207 Main function to setup the test environment before any tests are started.
208 Must be called right after sourcing all component scripts.
213 ## Function: print_result ##
215 Print a test report of an auto-test script.
220 ## Function: start_timer ##
222 Start a timer for time measurement. Only one timer can be running.
225 | `<timer-message-to-print>` |
226 | None - but any args will be printed (It is good practice to use same args for this function as for the `print_timer`) |
228 ## Function: print_timer ##
230 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.
235 ## Function: deviation ##
237 Mark a test as a deviation from the requirements. The list of deviations will be printed in the test report.
240 | `<deviation-message-to-print>` |
242 | parameter | description |
243 | --------- | ----------- |
244 | `<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 |
246 ## Function: clean_environment ##
248 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).
253 ## Function: auto_clean_containers ##
255 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.
260 ## Function: sleep_wait ##
262 Make the script sleep for a number of seconds.
265 | `<sleep-time-in-sec> [<any-text-in-quotes-to-be-printed>]` |
267 | parameter | description |
268 | --------- | ----------- |
269 | `<sleep-time-in-sec>` | Number of seconds to sleep |
270 | `<any-text-in-quotes-to-be-printed>` | Optional. The text will be printed, if present |
272 ## Function: store_logs ##
274 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.
277 | `<logfile-prefix>` |
279 | parameter | description |
280 | --------- | ----------- |
281 | `<logfile-prefix>` | Log file prefix |
283 # Description of functions in testsuite_common.sh #
285 ## Function: suite_setup ##
287 Sets up the test suite and prints out a heading.
294 Print out the overall result of the executed test cases.
299 # Description of functions in chartmus_api_function.sh #
301 ## Function: start_chart_museum ##
303 Start the Chart Museum
308 ## Function: chartmus_upload_test_chart ##
310 Upload a package chart to chartmusem
315 | parameter | description |
316 | --------- | ----------- |
317 | `<chart-name>` | Name of the chart to upload |
319 ## Function: chartmus_delete_test_chart ##
321 Delete a chart in chartmusem
324 | `<chart-name> [<version>]` |
326 | parameter | description |
327 | --------- | ----------- |
328 | `<chart-name>` | Name of the chart to delete |
329 | `<version>` | Chart version, default is 0.1.0 |
332 # Description of functions in consul_api_function.sh #
334 ## Function: consul_config_app ##
336 Function to load a json config from a file into consul for the Policy Agent
340 | `<json-config-file>` |
342 | parameter | description |
343 | --------- | ----------- |
344 | `<json-config-file>` | The path to the json file to be loaded to Consul/CBS |
346 ## Function: start_consul_cbs ##
348 Start the Consul and CBS containers
353 # Description of functions in cp_api_function.sh #
355 ## Function: use_control_panel_http ##
357 Set http as the protocol to use for all communication to the Control Panel
362 ## Function: use_control_panel_https ##
364 Set https as the protocol to use for all communication to the Control Panel
369 ## Function: start_control_panel ##
371 Start the Control Panel container
376 # Description of functions in cr_api_functions.sh #
378 ## Function: use_cr_http ##
380 Use http for getting event from CR. The admin API is not affected. This is the default.
385 ## Function: use_cr_https ##
387 Use https for getting event from CR. The admin API is not affected.
388 Note: Not yet used as callback event is not fully implemented/deciced.
393 ## Function: start_cr ##
395 Start the Callback Receiver container in docker or kube depending on start mode.
400 ## Function: cr_equal ##
402 Tests if a variable value in the Callback Receiver (CR) simulator is equal to a target value.
403 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
404 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.
405 See the 'cr' dir for more details.
408 | `<cr-path-id> <variable-name> <target-value> [ <timeout-in-sec> ]` |
410 | parameter | description |
411 | --------- | ----------- |
412 | `<cr-path-id>` | Variable index to CR |
413 | `<variable-name>` | Variable name in the CR |
414 | `<target-value>` | Target value for the variable |
415 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
417 ## Function: cr_greater_or_equal ##
418 Tests if a variable value in the Callback Receiver (CR) simulator is equal to or greater than a target value.
419 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.
420 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.
421 See the 'cr' dir for more details.
424 | `<cr-path-id> <variable-name> <target-value> [ <timeout-in-sec> ]` |
426 | parameter | description |
427 | --------- | ----------- |
428 | `<cr-path-id>` | Variable index to CR |
429 | `<variable-name>` | Variable name in the CR |
430 | `<target-value>` | Target value for the variable |
431 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
433 ## Function: cr_contains_str ##
435 Tests if a variable value in the CR contains a target string.
436 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
437 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.
438 See the 'a1-interface' repo for more details.
442 | `<cr-path-id> <variable-name> <target-value> [ <timeout-in-sec> ]` |
445 | parameter | description |
446 | --------- | ----------- |
447 | `<cr-path-id>` | Variable index to CR |
448 | `<variable-name>` | Variable name in the CR |
449 | `<target-value>` | Target substring for the variable |
450 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
452 ## Function: cr_read ##
454 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.
455 See the 'mrstub' dir for more details.
458 | `<cr-path-id> <variable-name>` |
460 | parameter | description |
461 | --------- | ----------- |
462 | `<cr-path-id>` | Variable index to CR |
463 | `<variable-name>` | Variable name in the CR |
465 ## Function: cr_delay_callback ##
467 Function to configure write delay on callbacks. Delay given in seconds. Setting remains until removed.
471 | `<response-code> <cr-path-id> [<delay-in-seconds>]`|
473 | parameter | description |
474 | --------- | ----------- |
475 | `<response-code>` | Expected http response code |
476 | `<cr-path-id>` | Variable index to CR |
477 | `<delay-in-seconds>` | Delay in seconds. If omitted, the delay is removed |
479 ## Function: cr_api_check_all_sync_events ##
481 Check the contents of all ric events received for a callback id.
485 | `<response-code> <cr-path-id> <id> [ EMPTY \| ( <ric-id> )+ ]` |
487 | parameter | description |
488 | --------- | ----------- |
489 | `<response-code>` | Expected http response code |
490 | `<cr-path-id>` | Variable index for CR |
491 | `<id>` | Id of the callback destination |
492 | `EMPTY` | Indicator for an empty list |
493 | `<ric-id>` | Id of the ric |
495 ## Function: cr_api_check_all_ics_events ##
497 Check the contents of all current status events for one id from ICS
501 | `<response-code> <cr-path-id> <id> [ EMPTY \| ( <status> )+ ]` |
503 | parameter | description |
504 | --------- | ----------- |
505 | `<response-code>` | Expected http response code |
506 | `<cr-path-id>` | Variable index for CR |
507 | `<id>` | Id of the callback destination |
508 | `EMPTY` | Indicator for an empty list |
509 | `<status>` | Status string |
511 ## Function: cr_api_check_all_ics_subscription_events ##
513 Check the contents of all current subscription events for one id from ICS
517 | `<response-code> <cr-path-id> <id> [ EMPTY | ( <type-id> <schema> <registration-status> )+ ]` |
519 | parameter | description |
520 | --------- | ----------- |
521 | `<response-code>` | Expected http response code |
522 | `<cr-path-id>` | Variable index for CR |
523 | `<id>` | Id of the callback destination |
524 | `EMPTY` | Indicator for an empty list |
525 | `<type-id>` | Id of the data type |
526 | `<schema>` | Path to typeschema file |
527 | `<registration-status>` | Status string |
529 ## Function: cr_api_reset ##
531 Reset the callback receiver
537 | parameter | description |
538 | --------- | ----------- |
539 | `<cr-path-id>` | Variable index for CR |
541 ## Function: cr_api_check_all_genric_json_events ##
543 Check the contents of all json events for path
547 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <json-msg>+ )` |
549 | parameter | description |
550 | --------- | ----------- |
551 | `<response-code>` | Expected http response code |
552 | `<cr-path-id>` | Variable index for CR |
553 | `<topic-url>` | Topic url |
554 | `EMPTY` | Indicator for an empty list |
555 | `json-msg` | Json msg string to compare with |
557 ## Function: cr_api_check_single_genric_json_event ##
559 Check a single (oldest) json event (or none if empty) for path
563 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <json-msg> )` |
565 | parameter | description |
566 | --------- | ----------- |
567 | `<response-code>` | Expected http response code |
568 | `<cr-path-id>` | Variable index for CR |
569 | `<topic-url>` | Topic url |
570 | `EMPTY` | Indicator for no msg |
571 | `json-msg` | Json msg string to compare with |
573 ## Function: cr_api_check_single_genric_event_md5 ##
575 Check a single (oldest) json in md5 format (or none if empty) for path.
576 Note that if a json message is given, it shall be compact, no ws except inside string.
577 The MD5 will generate different hash if whitespace is present or not in otherwise equivalent json.
581 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <data-msg> )` |
583 | parameter | description |
584 | --------- | ----------- |
585 | `<response-code>` | Expected http response code |
586 | `<cr-path-id>` | Variable index for CR |
587 | `<topic-url>` | Topic url |
588 | `EMPTY` | Indicator for no msg |
589 | `data-msg` | msg string to compare with |
591 ## Function: cr_api_check_single_genric_event_md5_file ##
593 Check a single (oldest) event in md5 format (or none if empty) for path.
594 Note that if a file with json message is given, the json shall be compact, no ws except inside string and not newlines.
595 The MD5 will generate different hash if ws/newlines is present or not in otherwise equivalent json
599 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <data-file> )` |
601 | parameter | description |
602 | --------- | ----------- |
603 | `<response-code>` | Expected http response code |
604 | `<cr-path-id>` | Variable index for CR |
605 | `<topic-url>` | Topic url |
606 | `EMPTY` | Indicator for no msg |
607 | `data-file` | path to file to compare with |
609 # Description of functions in dmaapadp_api_functions.sh #
611 ## Function: use_dmaapadp_http ##
613 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.
619 ## Function: use_dmaapadp_https ##
621 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.
627 ## Function: start_dmaapadp ##
629 Start the dmaap adator service container in docker or kube depending on running mode.
633 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
635 | parameter | description |
636 | --------- | ----------- |
637 | `PROXY` | Configure with http proxy, if proxy is started |
638 | `NOPROXY` | Configure without http proxy |
639 | `<config-file>`| Path to application.yaml |
640 | `<data-file>` | Optional path to application_configuration.json |
642 ## Function: set_dmaapadp_trace ##
644 Configure the dmaap adaptor service log on trace level. The app must be running.
649 # Description of functions in dmaapmed_api_functions.sh #
651 ## Function: use_dmaapmed_http ##
653 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.
659 ## Function: use_dmaapmed_https ##
661 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.
667 ## Function: start_dmaapmed ##
669 Start the dmaap mediator service container in docker or kube depending on running mode.
675 # Description of functions in httpproxy_api_functions.sh #
677 ## Function: use_http_proxy_http ##
679 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.
684 ## Function: use_http_proxy_https ##
686 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.
691 ## Function: start_http_proxy ##
693 Start the http proxy container in docker or kube depending on running mode.
698 # Description of functions in helmmanager_api_functions.sh #
700 ## Function: use_helm_manager_http ##
702 Use http for all API calls to the Helm Manager. This is the default protocol.
707 ## Function: use_helm_manager_https ##
709 Use https for all API calls to the Helm Manager.
714 ## Function: start_helm_manager ##
716 Start the Helm Manager container in docker or kube depending on running mode.
721 ## Function: helm_manager_api_get_charts ##
723 Get all charts and compare the expected contents.
726 | `<response-code> [ EMPTY | ( <chart> <version> <namespace> <release> <repo> )+ ]` |
728 | parameter | description |
729 | --------- | ----------- |
730 | `<response-code>` | Expected response code |
731 | `EMPTY` | Indicator for empty list |
732 | `<chart>`| Name of the chart |
733 | `<version>`| Version of the chart |
734 | `<namespace>`| Namespace to of the chart |
735 | `<release>`| Release name of the chart |
736 | `<repo>`| Repository of the chart |
738 ## Function: helm_manager_api_post_repo ##
740 Add repo to the helm manager.
743 | `<response-code> <repo-name> <repo-protocol> <repo-address> <repo-port>` |
745 | parameter | description |
746 | --------- | ----------- |
747 | `<response-code>` | Expected response code |
748 | `<repo-name>` | Name of the repo |
749 | `<repo-protocol>`| Protocol http or https |
750 | `<repo-address>`| Host name of the repo |
751 | `<repo-port>`| Host port of the repo |
753 ## Function: helm_manager_api_post_onboard_chart ##
755 Onboard a chart to the helm manager.
758 | `<response-code> <repo> <chart> <version> <release> <namespace>` |
760 | parameter | description |
761 | --------- | ----------- |
762 | `<response-code>` | Expected response code |
763 | `<repo>`| Target repo of the chart |
764 | `<chart>`| Name of the chart |
765 | `<version>`| Version of the chart |
766 | `<namespace>`| Namespace to of the chart |
767 | `<release>`| Release name of the chart |
769 ## Function: helm_manager_api_post_install_chart ##
771 Install an onboarded chart.
774 | `<response-code> <chart> <version>` |
776 | parameter | description |
777 | --------- | ----------- |
778 | `<response-code>` | Expected response code |
779 | `<chart>`| Name of the chart |
780 | `<version>`| Version of the chart |
782 ## Function: helm_manager_api_uninstall_chart ##
787 | `<response-code> <chart> <version>` |
789 | parameter | description |
790 | --------- | ----------- |
791 | `<response-code>` | Expected response code |
792 | `<chart>`| Name of the chart |
793 | `<version>`| Version of the chart |
795 ## Function: helm_manager_api_delete_chart ##
800 | `<response-code> <chart> <version>` |
802 | parameter | description |
803 | --------- | ----------- |
804 | `<response-code>` | Expected response code |
805 | `<chart>`| Name of the chart |
806 | `<version>`| Version of the chart |
808 ## Function: helm_manager_api_exec_add_repo ##
810 Add repo in helm manager by helm using exec.
813 | `<repo-name> <repo-url>` |
815 | parameter | description |
816 | --------- | ----------- |
817 | `<response-code>` | Expected response code |
818 | `<repo-name>`| Name of the repo |
819 | `<repo-url>`| Full url to the repo. Url must be accessible by the container |
822 # Description of functions in ics_api_functions.sh #
824 ## Function: use_ics_rest_http ##
826 Use http for all API calls to the ICS. This is the default protocol.
831 ## Function: use_ics_rest_https ##
833 Use https for all API calls to the ICS.
838 ## Function: use_ics_dmaap_http ##
840 Send and recieve all API calls to the ICS over Dmaap via the MR using http.
845 ## Function: use_ics_dmaap_https ##
847 Send and recieve all API calls to the ICS over Dmaap via the MR using https.
852 ## Function: start_ics ##
854 Start the ICS container in docker or kube depending on running mode.
857 | `PROXY|NOPROXY <config-file>` |
859 | parameter | description |
860 | --------- | ----------- |
861 | `PROXY` | Configure with http proxy, if proxy is started |
862 | `NOPROXY` | Configure without http proxy |
863 | `<config-file>`| Path to application.yaml |
865 ## Function: stop_ics ##
867 Stop the ICS container.
872 ## Function: start_stopped_ics ##
874 Start a previously stopped ics.
879 ## Function: set_ics_debug ##
881 Configure the ICS log on debug level. The ICS must be running.
886 ## Function: set_ics_trace ##
888 Configure the ICS log on trace level. The ICS must be running.
893 ## Function: use_ics_retries ##
895 Perform curl retries when making direct call to ICS for the specified http response codes
896 Speace separated list of http response codes
899 | `[<response-code>]*` |
901 | parameter | description |
902 | --------- | ----------- |
903 | `<response-code>` | Http response code to make retry for |
905 ## Function: check_ics_logs ##
907 Check the ICS log for any warnings and errors and print the count of each.
912 ## Function: ics_equal ##
914 Tests if a variable value in the ICS is equal to a target value.
915 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
916 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.
917 See the 'a1-interface' repo for more details.
921 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
923 | parameter | description |
924 | --------- | ----------- |
925 | `<variable-name>` | Variable name in ics |
926 | `<target-value>` | Target value for the variable |
927 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
929 ## Function: ics_api_a1_get_job_ids ##
931 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs' and optional check of the array of returned job ids.
932 To test the response code only, provide the response code parameter as well as a type id and an owner id.
933 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
937 | `<response-code> <type-id> <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
939 | parameter | description |
940 | --------- | ----------- |
941 | `<response-code>` | Expected http response code |
942 | `<type-id>` | Id of the EI type |
943 | `<owner-id>` | Id of the job owner |
944 | `NOOWNER` | No owner is given |
945 | `<job-id>` | Id of the expected job |
946 | `EMPTY` | The expected list of job id shall be empty |
948 ## Function: ics_api_a1_get_type ##
950 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}' and optional check of the returned schema.
951 To test the response code only, provide the response code parameter as well as the type-id.
952 To also test the response payload add a path to the expected schema file.
956 | `<response-code> <type-id> [<schema-file>]` |
958 | parameter | description |
959 | --------- | ----------- |
960 | `<response-code>` | Expected http response code |
961 | `<type-id>` | Id of the EI type |
962 | `<schema-file>` | Path to a schema file to compare with the returned schema |
964 ## Function: ics_api_a1_get_type_ids ##
966 Test of GET '/A1-EI/v1/eitypes' and optional check of returned list of type ids.
967 To test the response code only, provide the response only.
968 To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
972 | `<response-code> [ (EMPTY \| [<type-id>]+) ]` |
974 | parameter | description |
975 | --------- | ----------- |
976 | `<response-code>` | Expected http response code |
977 | `EMPTY` | The expected list of type ids shall be empty |
978 | `<type-id>` | Id of the EI type |
980 ## Function: ics_api_a1_get_job_status ##
982 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}/status' and optional check of the returned status.
983 To test the response code only, provide the response code, type id and job id.
984 To also test the response payload add the expected status.
988 | `<response-code> <type-id> <job-id> [<status>]` |
990 | parameter | description |
991 | --------- | ----------- |
992 | `<response-code>` | Expected http response code |
993 | `<type-id>` | Id of the EI type |
994 | `<job-id>` | Id of the job |
995 | `<status>` | Expected status |
997 ## Function: ics_api_a1_get_job ##
999 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}' and optional check of the returned job.
1000 To test the response code only, provide the response code, type id and job id.
1001 To also test the response payload add the remaining parameters.
1005 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1007 | parameter | description |
1008 | --------- | ----------- |
1009 | `<response-code>` | Expected http response code |
1010 | `<type-id>` | Id of the EI type |
1011 | `<job-id>` | Id of the job |
1012 | `<target-url>` | Expected target url for the job |
1013 | `<owner-id>` | Expected owner for the job |
1014 | `<template-job-file>` | Path to a job template for job parameters of the job |
1016 ## Function: ics_api_a1_delete_job ##
1018 Test of DELETE '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1019 To test, provide all the specified parameters.
1023 | `<response-code> <type-id> <job-id>` |
1025 | parameter | description |
1026 | --------- | ----------- |
1027 | `<response-code>` | Expected http response code |
1028 | `<type-id>` | Id of the EI type |
1029 | `<job-id>` | Id of the job |
1031 ## Function: ics_api_a1_put_job ##
1033 Test of PUT '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1034 To test, provide all the specified parameters.
1038 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
1040 | parameter | description |
1041 | --------- | ----------- |
1042 | `<response-code>` | Expected http response code |
1043 | `<type-id>` | Id of the EI type |
1044 | `<job-id>` | Id of the job |
1045 | `<target-url>` | Target url for the job |
1046 | `<owner-id>` | Owner of the job |
1047 | `<template-job-file>` | Path to a job template for job parameters of the job |
1049 ## Function: ics_api_edp_get_type_ids ##
1051 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.
1052 To test the response code only, provide the response code.
1053 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1057 | `<response-code> [ EMPTY \| <type-id>+]` |
1059 | parameter | description |
1060 | --------- | ----------- |
1061 | `<response-code>` | Expected http response code |
1062 | `<type-id>` | Id of the type |
1063 | `EMPTY` | The expected list of type ids shall be empty |
1065 ## Function: ics_api_edp_get_producer_status ##
1067 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.
1068 To test the response code only, provide the response code and producer id.
1069 To also test the response payload add the expected status.
1073 | `<response-code> <producer-id> [<status>]` |
1075 | parameter | description |
1076 | --------- | ----------- |
1077 | `<response-code>` | Expected http response code |
1078 | `<producer-id>` | Id of the producer |
1079 | `<status>` | The expected status string |
1081 ## Function: ics_api_edp_get_producer_ids ##
1083 Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
1084 To test the response code only, provide the response.
1085 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).
1089 | `<response-code> [ EMPTY \| <producer-id>+]` |
1091 | parameter | description |
1092 | --------- | ----------- |
1093 | `<response-code>` | Expected http response code |
1094 | `<producer-id>` | Id of the producer |
1095 | `EMPTY` | The expected list of type ids shall be empty |
1097 ## Function: ics_api_edp_get_producer_ids_2 ##
1099 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.
1100 To test the response code only, provide the response.
1101 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).
1105 | `<response-code> [ ( NOTYPE \| <type-id> ) [ EMPTY \| <producer-id>+]` |
1107 | parameter | description |
1108 | --------- | ----------- |
1109 | `<response-code>` | Expected http response code |
1110 | `<type-id>` | Id of the type |
1111 | `EMPTY` | No type given |
1112 | `<producer-id>` | Id of the producer |
1113 | `EMPTY` | The expected list of type ids shall be empty |
1115 ## Function: ics_api_edp_get_type ##
1117 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
1118 To test the response code only, provide the response and the type-id.
1119 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).
1123 | `<response-code> <type-id> [<job-schema-file> (EMPTY \| [<producer-id>]+)]` |
1125 | parameter | description |
1126 | --------- | ----------- |
1127 | `<response-code>` | Expected http response code |
1128 | `<type-id>` | Id of the type |
1129 | `<job-schema-file>` | Path to a job schema file |
1130 | `<producer-id>` | Id of the producer |
1131 | `EMPTY` | The expected list of type ids shall be empty |
1133 ## Function: ics_api_edp_get_type_2 ##
1135 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.
1136 To test the response code only, provide the response and the type-id.
1137 To also test the response payload add a path to a job schema file.
1141 | `<response-code> <type-id> [<job-schema-file>]` |
1143 | parameter | description |
1144 | --------- | ----------- |
1145 | `<response-code>` | Expected http response code |
1146 | `<type-id>` | Id of the type |
1147 | `<job-schema-file>` | Path to a job schema file |
1148 | `EMPTY` | The expected list of type ids shall be empty |
1150 ## Function: ics_api_edp_put_type_2 ##
1152 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.
1156 | `<response-code> <type-id> [<job-schema-file>]` |
1158 | parameter | description |
1159 | --------- | ----------- |
1160 | `<response-code>` | Expected http response code |
1161 | `<type-id>` | Id of the type |
1162 | `<job-schema-file>` | Path to a job schema file |
1163 | `EMPTY` | The expected list of type ids shall be empty |
1165 ## Function: ics_api_edp_delete_type_2 ##
1167 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.
1171 | `<response-code> <type-id>` |
1173 | parameter | description |
1174 | --------- | ----------- |
1175 | `<response-code>` | Expected http response code |
1176 | `<type-id>` | Id of the type |
1178 ## Function: ics_api_edp_get_producer ##
1180 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' 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> [<create-callback> <delete-callback> <supervision-callback> (EMPTY\| [<type-id> <schema-file>]+) ]` |
1188 | parameter | description |
1189 | --------- | ----------- |
1190 | `<response-code>` | Expected http response code |
1191 | `<producer-id>` | Id of the producer |
1192 | `<create-callback>` | Callback for create job |
1193 | `<delete-callback>` | Callback for delete job |
1194 | `<supervision-callback>` | Callback for producer supervision |
1195 | `<type-id>` | Id of the type |
1196 | `<schema-file>` | Path to a schema file |
1197 | `EMPTY` | The expected list of type schema pairs shall be empty |
1199 ## Function: ics_api_edp_get_producer_2 ##
1201 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.
1202 To test the response code only, provide the response and the producer-id.
1203 To also test the response payload add the remaining parameters defining thee producer.
1207 | `<response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY \| <type-id>+) ]` |
1209 | parameter | description |
1210 | --------- | ----------- |
1211 | `<response-code>` | Expected http response code |
1212 | `<producer-id>` | Id of the producer |
1213 | `<job-callback>` | Callback for the url |
1214 | `<supervision-callback>` | Callback for producer supervision |
1215 | `<type-id>` | Id of the type |
1216 | `EMPTY` | The expected list of types shall be empty |
1218 ## Function: ics_api_edp_delete_producer ##
1220 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version.
1221 To test, provide all parameters.
1225 | `<response-code> <producer-id>` |
1227 | parameter | description |
1228 | --------- | ----------- |
1229 | `<response-code>` | Expected http response code |
1230 | `<producer-id>` | Id of the producer |
1232 ## Function: ics_api_edp_put_producer ##
1234 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1235 To test, provide all parameters. The list of type/schema pair may be empty.
1239 | `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY \| [<type-id> <schema-file>]+)` |
1241 | parameter | description |
1242 | --------- | ----------- |
1243 | `<response-code>` | Expected http response code |
1244 | `<producer-id>` | Id of the producer |
1245 | `<job-callback>` | Callback for create/delete job |
1246 | `<supervision-callback>` | Callback for producer supervision |
1247 | `<type-id>` | Id of the type |
1248 | `<schema-file>` | Path to a schema file |
1249 | `EMPTY` | The list of type/schema pairs is empty |
1251 ## Function: ics_api_edp_put_producer_2 ##
1253 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version.
1254 To test, provide all parameters. The list of type/schema pair may be empty.
1258 | `<response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE\|[<type-id>+]` |
1260 | parameter | description |
1261 | --------- | ----------- |
1262 | `<response-code>` | Expected http response code |
1263 | `<producer-id>` | Id of the producer |
1264 | `<job-callback>` | Callback for create/delete job |
1265 | `<supervision-callback>` | Callback for producer supervision |
1266 | `<type-id>` | Id of the type |
1267 | `NOTYPE` | The list of types is empty |
1269 ## Function: ics_api_edp_get_producer_jobs ##
1271 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' 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 EI 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_edp_get_producer_jobs_2 ##
1292 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.
1293 To test the response code only, provide the response and the producer-id.
1294 To also test the response payload add the remaining parameters.
1298 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1300 | parameter | description |
1301 | --------- | ----------- |
1302 | `<response-code>` | Expected http response code |
1303 | `<producer-id>` | Id of the producer |
1304 | `<job-id>` | Id of the job |
1305 | `<type-id>` | Id of the type |
1306 | `<target-url>` | Target url for data delivery |
1307 | `<job-owner>` | Id of the job owner |
1308 | `<template-job-file>` | Path to a job template file |
1309 | `EMPTY` | The list of job/type/target/job-file tuples is empty |
1311 ## Function: ics_api_service_status ##
1313 Test of GET '/status'.
1317 | `<response-code>` |
1319 | parameter | description |
1320 | --------- | ----------- |
1321 | `<response-code>` | Expected http response code |
1323 ## Function: ics_api_idc_get_type_ids ##
1325 Test of GET '/data-consumer/v1/info-types' and an optional check of the returned list of type ids.
1326 To test the response code only, provide the response code.
1327 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1331 | `<response-code> [ EMPTY \| <type-id>+]` |
1333 | parameter | description |
1334 | --------- | ----------- |
1335 | `<response-code>` | Expected http response code |
1336 | `<type-id>` | Id of the Info type |
1337 | `EMPTY` | The expected list of type ids shall be empty |
1339 ## Function: ics_api_idc_get_job_ids ##
1341 Test of GET '/data-consumer/v1/info-jobs' and optional check of the array of returned job ids.
1342 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1343 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1347 | `<response-code> <type-id> <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
1349 | parameter | description |
1350 | --------- | ----------- |
1351 | `<response-code>` | Expected http response code |
1352 | `<type-id>` | Id of the Info type |
1353 | `<owner-id>` | Id of the job owner |
1354 | `NOOWNER` | No owner is given |
1355 | `<job-id>` | Id of the expected job |
1356 | `EMPTY` | The expected list of job id shall be empty |
1358 ## Function: ics_api_idc_get_job ##
1360 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}' and optional check of the returned job.
1361 To test the response code only, provide the response code, type id and job id.
1362 To also test the response payload add the remaining parameters.
1366 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1368 | parameter | description |
1369 | --------- | ----------- |
1370 | `<response-code>` | Expected http response code |
1371 | `<type-id>` | Id of the Info type |
1372 | `<job-id>` | Id of the job |
1373 | `<target-url>` | Expected target url for the job |
1374 | `<owner-id>` | Expected owner for the job |
1375 | `<template-job-file>` | Path to a job template for job parameters of the job |
1377 ## Function: ics_api_idc_put_job ##
1379 Test of PUT '/data-consumer/v1/info-jobs/{infoJobId}'.
1380 To test, provide all the specified parameters.
1384 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file> [VALIDATE]` |
1386 | parameter | description |
1387 | --------- | ----------- |
1388 | `<response-code>` | Expected http response code |
1389 | `<type-id>` | Id of the Info type |
1390 | `<job-id>` | Id of the job |
1391 | `<target-url>` | Target url for the job |
1392 | `<owner-id>` | Owner of the job |
1393 | `<template-job-file>` | Path to a job template for job parameters of the job |
1394 | `VALIIDATE` | Indicator to preform type validation at creation |
1396 ## Function: ics_api_idc_delete_job ##
1398 Test of DELETE '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1399 To test, provide all the specified parameters.
1403 | `<response-code> <type-id> <job-id>` |
1405 | parameter | description |
1406 | --------- | ----------- |
1407 | `<response-code>` | Expected http response code |
1408 | `<type-id>` | Id of the type |
1409 | `<job-id>` | Id of the job |
1411 ## Function: ics_api_idc_get_type ##
1413 Test of GET '/data-consumer/v1/info-types/{infoTypeId} and optional check of the returned schema.
1414 To test the response code only, provide the response code parameter as well as the type-id.
1415 To also test the response payload add a path to the expected schema file.
1419 | `<response-code> <type-id> [<schema-file>]` |
1421 | parameter | description |
1422 | --------- | ----------- |
1423 | `<response-code>` | Expected http response code |
1424 | `<type-id>` | Id of the Info type |
1425 | `<schema-file>` | Path to a schema file to compare with the returned schema |
1427 ## Function: ics_api_idc_get_job_status ##
1429 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' and optional check of the returned status and timeout.
1430 To test the response code only, provide the response code and job id.
1431 To also test the response payload add the expected status.
1435 | `<response-code> <job-id> [<status> [ <timeout>]]` |
1437 | parameter | description |
1438 | --------- | ----------- |
1439 | `<response-code>` | Expected http response code |
1440 | `<job-id>` | Id of the job |
1441 | `<status>` | Expected status |
1442 | `<timeout>` | Timeout |
1444 ## Function: ics_api_idc_get_job_status2 ##
1446 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' with returned producers and optional check of the returned status and timeout.
1447 To test the response code only, provide the response code and job id.
1448 To also test the response payload add the expected status.
1452 | `<response-code> <job-id> [<status> EMPTYPROD|( <prod-count> <producer-id>+ ) [<timeout>]]` |
1454 | parameter | description |
1455 | --------- | ----------- |
1456 | `<response-code>` | Expected http response code |
1457 | `<job-id>` | Id of the job |
1458 | `<status>` | Expected status |
1459 | `<EMPTYPROD>` | Indicated for empty list of producer |
1460 | `<prod-count>` | Number of expected producer |
1461 | `<producer-id>` |Id of the producer |
1462 | `<timeout>` | Timeout |
1465 ## Function: ics_api_idc_get_subscription_ids ##
1466 Test of GET '/data-consumer/v1/info-type-subscription' with the returned list of subscription ids
1470 | `<response-code> <owner-id>|NOOWNER [ EMPTY | <subscription-id>+]` |
1472 | parameter | description |
1473 | --------- | ----------- |
1474 | `<response-code>` | Expected http response code |
1475 | `<owner-id>` | Id of the owner |
1476 | `<NOOWNER>` | Indicator for empty owner |
1477 | `<EMPTY>` | Indicated for empty list of subscription ids |
1478 | `<subscription-id>` |Id of the subscription |
1480 ## Function: ics_api_idc_get_subscription ##
1481 Test of GET '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
1485 | `<response-code> <subscription-id> [ <owner-id> <status-uri> ]` |
1487 | parameter | description |
1488 | --------- | ----------- |
1489 | `<response-code>` | Expected http response code |
1490 | `<subscription-id>` |Id of the subscription |
1491 | `<owner-id>` | Id of the owner |
1492 | `<status-uri>` | Url for status notifications |
1495 ## Function: ics_api_idc_put_subscription ##
1496 Test of PUT '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
1500 | `<response-code> <subscription-id> <owner-id> <status-uri>` |
1502 | parameter | description |
1503 | --------- | ----------- |
1504 | `<response-code>` | Expected http response code |
1505 | `<subscription-id>` |Id of the subscription |
1506 | `<owner-id>` | Id of the owner |
1507 | `<status-uri>` | Url for status notifications |
1509 ## Function: ics_api_idc_delete_subscription ##
1510 Test of DELETE /data-consumer/v1/info-type-subscription/{subscriptionId}
1514 | `<response-code> <subscription-id>` |
1516 | parameter | description |
1517 | --------- | ----------- |
1518 | `<response-code>` | Expected http response code |
1519 | `<subscription-id>` |Id of the subscription |
1522 ## Function: ics_api_admin_reset ##
1524 Test of GET '/status'.
1528 | `<response-code> [ <type> ]` |
1530 | parameter | description |
1531 | --------- | ----------- |
1532 | `<response-code>` | Expected http response code |
1533 | `<type>` | Type id, if the interface supports type in url |
1535 ## Function: ics_kube_pvc_reset ##
1537 Admin reset to remove all data in ics; jobs, producers etc
1538 NOTE - only works in kubernetes and the pod should not be running
1544 # Description of functions in kafkapc_api_functions.sh #
1546 ## Function: use_kafkapc_http ##
1548 Use http for all calls to the KAFKAPC.
1553 ## Function: use_kafkapc_https ##
1555 Use https for all calls to the KAFKAPC.
1560 ## Function: start_kafkapc ##
1562 Start the KAFKAPC container in docker or kube depending on start mode
1567 ## Function: kafkapc_equal ##
1569 Tests if a variable value in the KAFKAPC is equal to a target value.
1570 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1571 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.
1572 See the 'mrstub' dir for more details.
1575 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1577 | parameter | description |
1578 | --------- | ----------- |
1579 | `<variable-name>` | Variable name in the KAFKAPC |
1580 | `<target-value>` | Target value for the variable |
1581 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1583 ## Function: kafkapc_api_reset ##
1585 Deep reset of KAFKAPC. Note that kafka itself is not affected, i.e. created topic still exist in kafka.
1590 ## Function: kafkapc_api_create_topic ##
1592 Create a topic in kafka via kafkapc.
1593 | `<response-code> <topic-name> <mime-type>` |
1595 | parameter | description |
1596 | --------- | ----------- |
1597 | `<response-code>` | Http response code |
1598 | `<topic-name>` | Name of the topic |
1599 | `<mime-type>` | Mime type of the data to send to the topic. Data on the topic is expected to be of this type |
1601 ## Function: kafkapc_api_get_topic ##
1603 Create a from kafkapc.
1604 | `<response-code> <topic-name> <mime-type>` |
1606 | parameter | description |
1607 | --------- | ----------- |
1608 | `<response-code>` | Http response code |
1609 | `<topic-name>` | Name of the topic |
1610 | `<mime-type>` | Mime type of the topic |
1612 ## Function: kafkapc_api_start_sending ##
1614 Start sending msg from the msg queue to kafka for a topic.
1615 | `<response-code> <topic-name>` |
1617 | parameter | description |
1618 | --------- | ----------- |
1619 | `<response-code>` | Http response code |
1620 | `<topic-name>` | Name of the topic |
1622 ## Function: kafkapc_api_start_receiving ##
1624 Start receiving msg from a kafka topic to the msg queue in kafkapc.
1625 | `<response-code> <topic-name>` |
1627 | parameter | description |
1628 | --------- | ----------- |
1629 | `<response-code>` | Http response code |
1630 | `<topic-name>` | Name of the topic |
1632 ## Function: kafkapc_api_stop_sending ##
1634 Stop sending msg from the msg queue to kafka for a topic.
1635 | `<response-code> <topic-name>` |
1637 | parameter | description |
1638 | --------- | ----------- |
1639 | `<response-code>` | Http response code |
1640 | `<topic-name>` | Name of the topic |
1642 ## Function: kafkapc_api_stop_receiving ##
1644 Stop receiving msg from a kafka topic to the msg queue in kafkapc.
1645 | `<response-code> <topic-name>` |
1647 | parameter | description |
1648 | --------- | ----------- |
1649 | `<response-code>` | Http response code |
1650 | `<topic-name>` | Name of the topic |
1652 ## Function: kafkapc_api_post_msg ##
1654 Send a message on a topic.
1657 | `<response-code> <topic> <mime-type> <msg>` |
1659 | parameter | description |
1660 | --------- | ----------- |
1661 | `<response-code>` | Http response code |
1662 | `<topic>` | Topic name |
1663 | `<mime-type>` | Mime type of the msg |
1664 | `<msg>` | String msg to send |
1666 ## Function: kafkapc_api_get_msg ##
1668 Get a message on a topic.
1671 | `<response-code> <topic> ([ <mime-type> <msg> ] | NOMSG )` |
1673 | parameter | description |
1674 | --------- | ----------- |
1675 | `<response-code>` | Http response code |
1676 | `<topic>` | Topic name |
1677 | `<mime-type>` | Mime type of the msg |
1678 | `<msg>` | String msg to receive |
1679 | `NOMSG` | Indicated for no msg |
1681 ## Function: kafkapc_api_post_msg_from_file ##
1683 Send a message in a file on a topic.
1686 | `<response-code> <topic> <mime-type> <file>` |
1688 | parameter | description |
1689 | --------- | ----------- |
1690 | `<response-code>` | Http response code |
1691 | `<topic>` | Topic name |
1692 | `<mime-type>` | Mime type of the msg |
1693 | `<file>` | Filepath to the string msg to send |
1695 ## Function: kafkapc_api_get_msg_from_file ##
1697 Get a message on a topic.
1700 | `<response-code> <topic> <mime-type> <file> ` |
1702 | parameter | description |
1703 | --------- | ----------- |
1704 | `<response-code>` | Http response code |
1705 | `<topic>` | Topic name |
1706 | `<mime-type>` | Mime type of the msg |
1707 | `<file>` | Filepath to the string msg to receive |
1709 ## Function: kafkapc_api_generate_json_payload_file ##
1711 Create json file with dummy data for payload.
1714 | `<size-in-kb> <filename>` |
1716 | parameter | description |
1717 | --------- | ----------- |
1718 | `<size-in-kb>` | Generated size in kb |
1719 | `<filename>` | Path to output file |
1721 ## Function: kafkapc_api_generate_text_payload_file ##
1723 Create file with dummy text data for payload.
1726 | `<size-in-kb> <filename>` |
1728 | parameter | description |
1729 | --------- | ----------- |
1730 | `<size-in-kb>` | Generated size in kb |
1731 | `<filename>` | Path to output file |
1733 # Description of functions in kubeproxy_api_functions.sh #
1735 ## Function: use_kube_proxy_http ##
1737 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.
1742 ## Function: use_kube_proxy_https ##
1744 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.
1749 ## Function: start_kube_proxy ##
1751 Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
1752 No proxy is started if the function is called in docker mode.
1757 # Description of functions in localhelm_api_functions.sh #
1759 ## Function: localhelm_create_test_chart ##
1761 Create a dummy chart using helm
1766 | parameter | description |
1767 | --------- | ----------- |
1768 | `chart-name` | Name of the chart |
1770 ## Function: localhelm_package_test_chart ##
1772 Package a dummy chart using helm
1777 | parameter | description |
1778 | --------- | ----------- |
1779 | `chart-name` | Name of the chart |
1781 ## Function: localhelm_installed_chart_release ##
1783 Check if a chart is installed or not using helm
1786 | `INSTALLED|NOTINSTALLED <release-name> <name-space> |
1788 | parameter | description |
1789 | --------- | ----------- |
1790 | `INSTALLED` | Expecting installed chart |
1791 | `NOTINSTALLED` | Expecting a not installed chart |
1792 | `release-name` | Name of the release |
1793 | `name-space` | Expected namespace |
1795 # Description of functions in mr_api_functions.sh #
1797 ## Function: use_mr_http ##
1799 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.
1804 ## Function: use_mr_https ##
1806 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.
1811 ## Function: start_mr ##
1813 Start the Message Router stub interface container in docker or kube depending on start mode
1818 ## Function: dmaap_api_print_topics ##
1820 Prints the current list of topics in DMAAP MR
1826 ## Function: mr_equal ##
1828 Tests if a variable value in the Message Router (MR) simulator is equal to a target value.
1829 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1830 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.
1831 See the 'mrstub' dir for more details.
1834 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1836 | parameter | description |
1837 | --------- | ----------- |
1838 | `<variable-name>` | Variable name in the MR |
1839 | `<target-value>` | Target value for the variable |
1840 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1842 ## Function: mr_greater ##
1844 Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
1845 Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than the target or not.
1846 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.
1847 See the 'mrstub' dir for more details.
1850 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1852 | parameter | description |
1853 | --------- | ----------- |
1854 | `<variable-name>` | Variable name in the MR |
1855 | `<target-value>` | Target value for the variable |
1856 | `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value |
1858 ## Function: mr_read ##
1860 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.
1861 See the 'mrstub' dir for more details.
1864 | `<variable-name>` |
1866 | parameter | description |
1867 | --------- | ----------- |
1868 | `<variable-name>` | Variable name in the MR |
1870 ## Function: mr_print ##
1872 Prints the value of a variable in the Message Router (MR) simulator.
1873 See the 'mrstub' dir for more details.
1876 | `<variable-name>` |
1878 | parameter | description |
1879 | --------- | ----------- |
1880 | `<variable-name>` | Variable name in the MR |
1882 ## Function: mr_api_send_json ##
1884 Send json to topic in mr-stub.
1887 | `<topic-url> <json-msg>` |
1889 | parameter | description |
1890 | --------- | ----------- |
1891 | `<topic-url>` | Topic url |
1892 | `<json-msg>` | Json msg as string |
1894 ## Function: mr_api_send_text ##
1896 Send text to topic in mr-stub.
1899 | `<topic-url> <text-msg>` |
1901 | parameter | description |
1902 | --------- | ----------- |
1903 | `<topic-url>` | Topic url |
1904 | `<text-msg>` | Text (string) msg |
1908 ## Function: mr_api_send_json_file ##
1910 Send json to topic in mr-stub.
1913 | `<topic-url> <json-file>` |
1915 | parameter | description |
1916 | --------- | ----------- |
1917 | `<topic-url>` | Topic url |
1918 | `<json-file>` | Path to file with json msg as string |
1920 ## Function: mr_api_send_text_file ##
1922 Send text to topic in mr-stub.
1925 | `<topic-url> <text-file>` |
1927 | parameter | description |
1928 | --------- | ----------- |
1929 | `<topic-url>` | Topic url |
1930 | `<text-file>` | Path to file with text msg as string |
1932 ## Function: mr_api_generate_json_payload_file ##
1934 Create json file with dummy data for payload.
1937 | `<size-in-kb> <filename>` |
1939 | parameter | description |
1940 | --------- | ----------- |
1941 | `<size-in-kb>` | Generated size in kb |
1942 | `<filename>` | Path to output file |
1944 ## Function: mr_api_generate_text_payload_file ##
1946 Create file with dummy text data for payload.
1949 | `<size-in-kb> <filename>` |
1951 | parameter | description |
1952 | --------- | ----------- |
1953 | `<size-in-kb>` | Generated size in kb |
1954 | `<filename>` | Path to output file |
1956 # Description of functions in ngw_api_functions.sh #
1958 ## Function: use_gateway_http ##
1960 Use http for all calls to the gateway. This is set by default.
1965 ## Function: use_gateway_https ##
1967 Use https for all calls to the gateway.
1972 ## Function: set_gateway_debug ##
1974 Set debug level logging in the gateway
1979 ## Function: set_gateway_trace ##
1981 Set debug level logging in the trace
1986 ## Function: start_gateway ##
1988 Start the the gateway container in docker or kube depending on start mode
1993 ## Function: gateway_pms_get_status ##
1995 Sample test of pms api (status)
1996 Only response code tested - not payload
1999 | `<response-code>` |
2001 | parameter | description |
2002 | --------- | ----------- |
2003 | `<response-code>` | Expected http response code |
2005 ## Function: gateway_ics_get_types ##
2007 Sample test of ics api (get types)
2008 Only response code tested - not payload
2011 | `<response-code>` |
2013 | parameter | description |
2014 | --------- | ----------- |
2015 | `<response-code>` | Expected http response code |
2017 # Description of functions in pa_api_functions.sh #
2021 Both PMS version 1 and 2 are supported. The version is controlled by the env variable `$PMS_VERSION` set in the test env file.
2022 For api function in version 2, an url prefix is added if configured.
2024 ## Function: use_agent_rest_http ##
2026 Use http for all API calls to the Policy Agent. This is the default.
2031 ## Function: use_agent_rest_https ##
2033 Use https for all API calls to the Policy Agent.
2038 ## Function: use_agent_dmaap_http ##
2040 Send and recieve all API calls to the Policy Agent over Dmaap via the MR over http.
2045 ## Function: use_agent_dmaap_https ##
2047 Send and recieve all API callss to the Policy Agent over Dmaap via the MR over https.
2052 ## Function: start_policy_agent ##
2054 Start the Policy Agent container or corresponding kube resources depending on docker/kube mode.
2057 | `<logfile-prefix>` |
2058 | (docker) `PROXY\|NOPROXY <config-file>` |
2059 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
2061 | parameter | description |
2062 | --------- | ----------- |
2063 | `PROXY` | Configure with http proxy, if proxy is started |
2064 | `NOPROXY` | Configure without http proxy |
2065 | `<config-file>`| Path to application.yaml |
2066 | `<data-file>` | Optional path to application_configuration.json |
2068 ## Function: stop_policy_agent ##
2070 Stop the pms container (docker) or scale it to zero (kubernetes).
2075 ## Function: start_stopped_policy_agent ##
2077 Start a previousely stopped pms container (docker) or scale it to 1 (kubernetes).
2082 ## Function: prepare_consul_config ##
2084 Function to prepare a Consul config based on the previously configured (and started simulators). Note that all simulator must be running and the test script has to configure if http or https shall be used for the components (this is done by the functions 'use_simulator_http', 'use_simulator_https', 'use_sdnc_http', 'use_sdnc_https', 'use_mr_http', 'use_mr_https')
2087 | `SDNC|NOSDNC <output-file>` |
2089 | parameter | description |
2090 | --------- | ----------- |
2091 | `SDNC` | Configure with controller |
2092 | `NOSDNC` | Configure without controller |
2093 | `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app' |
2095 ## Function: agent_load_config ##
2097 Load the config into a config map (kubernetes only).
2102 | parameter | description |
2103 | --------- | ----------- |
2104 | `<data-file>` | Path to application_configuration.json |
2106 ## Function: set_agent_debug ##
2108 Configure the Policy Agent log on debug level. The Policy Agent must be running.
2113 ## Function: set_agent_trace ##
2115 Configure the Policy Agent log on trace level. The Policy Agent must be running.
2120 ## Function: use_agent_retries ##
2122 Configure the Policy Agent to make upto 5 retries if an API calls return any of the specified http return codes.
2125 | `[<response-code>]*` |
2127 ## Function: check_policy_agent_logs ##
2129 Check the Policy Agent log for any warnings and errors and print the count of each.
2134 ## Function: api_equal ##
2136 Tests if the array length of a json array in the Policy Agent simulator is equal to a target value.
2137 Without the timeout, the test sets pass or fail immediately depending on if the array length is equal to the target or not.
2138 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.
2139 See the 'cr' dir for more details.
2143 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2145 | parameter | description |
2146 | --------- | ----------- |
2147 | `<variable-name>` | Relative url. Example 'json:policy_types' - checks the json array length of the url /policy_types |
2148 | `<target-value>` | Target value for the length |
2149 | `<timeout-in-sec>` | Max time to wait for the length to reach the target value |
2151 ## Function: api_get_policies ##
2153 Test of GET '/policies' or V2 GET '/v2/policy-instances' and optional check of the array of returned policies.
2154 To test the response code only, provide the response code parameter as well as the following three parameters.
2155 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.
2159 | `<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>]*]` |
2163 | `<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>]*]` |
2165 | parameter | description |
2166 | --------- | ----------- |
2167 | `<response-code>` | Expected http response code |
2168 | `<ric-id>` | Id of the ric |
2169 | `NORIC` | Indicator that no ric is provided |
2170 | `<service-id>` | Id of the service |
2171 | `NOSERVICE` | Indicator that no service id is provided |
2172 | `<policy-type-id>` | Id of the policy type |
2173 | `NOTYPE` | Indicator that no type id is provided |
2174 | `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
2175 | `<policy-id>` | Id of the policy |
2176 | `EMPTY` | Indicate for the special empty policy type |
2177 | `transient` | Transient, true or false |
2178 | `notification-url` | Url for notifications |
2179 | `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
2181 ## Function: api_get_policy ##
2183 Test of GET '/policy' or V2 GET '/v2/policies/{policy_id}' and optional check of the returned json payload.
2184 To test the the response code only, provide the expected response code and policy id.
2185 To test the contents of the returned json payload, add a path to the template file used when creating the policy.
2189 | `<response-code> <policy-id> [<template-file>]` |
2193 | `<response-code> <policy-id> [ <template-file> <service-name> <ric-id> <policytype-id>\|NOTYPE <transient> <notification-url>\|NOURL ]` |
2195 | parameter | description |
2196 | --------- | ----------- |
2197 | `<response-code>` | Expected http response code |
2198 | `<policy-id>` | Id of the policy |
2199 | `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
2200 | `<service-id>` | Id of the service |
2201 | `<ric-id>` | Id of the ric |
2202 | `<policy-type-id>` | Id of the policy type |
2203 | `NOTYPE` | Indicator that no type id is provided |
2204 | `transient` | Transient, true or false |
2205 | `notification-url` | Url for notifications |
2207 ## Function: api_put_policy ##
2209 Test of PUT '/policy' or V2 PUT '/policies'.
2210 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).
2214 | `<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]` |
2218 | `<response-code> <service-name> <ric-id> <policytype-id>\|NOTYPE <policy-id> <transient>\|NOTRANSIENT <notification-url>\|NOURL <template-file> [<count>]` |
2220 | parameter | description |
2221 | --------- | ----------- |
2222 | `<response-code>` | Expected http response code |
2223 | `<service-id>` | Id of the service |
2224 | `<ric-id>` | Id of the ric |
2225 | `<policy-type-id>` | Id of the policy type |
2226 | `<policy-id>` | Id of the policy. This value shall be a numeric value if more than one policy shall be created |
2227 | `transient>` | Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provided) |
2228 | `notification-url` | Url for notifications |
2229 |`NOURL`| Indicator for no url |
2230 | `<template-file>` | Path to the template file for the policy |
2231 | `<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 |
2233 ## Function: api_put_policy_batch ##
2235 This tests the same as function 'api_put_policy' except that all put requests are sent to dmaap in one go and then the responses are polled one by one.
2236 If the agent api is not configured to use dmaap (see 'use_agent_dmaap', 'use_agent_rest_http' and 'use_agent_rest_https'), an error message is printed.
2237 For arg list and parameters, see 'api_put_policy'.
2239 ## Function: api_put_policy_parallel ##
2241 This tests the same as function 'api_put_policy' except that the policy create is spread out over a number of processes and it only uses the agent rest API. The total number of policies created is determined by the product of the parameters 'number-of-rics' and 'count'. The parameter 'number-of-threads' shall be selected to be not evenly divisible by the product of the parameters 'number-of-rics' and 'count' - this is to ensure that one process does not handle the creation of all the policies in one ric.
2245 | `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <template-file> <count-per-ric> <number-of-threads>`
2249 | `<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>`
2251 | parameter | description |
2252 | --------- | ----------- |
2253 | `<response-code>` | Expected http response code |
2254 | `<service-id>` | Id of the service |
2255 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing |
2256 | `<number-of-rics>` | The number of rics, assuming the first index is '1'. The index is added to the 'ric-id-base' id |
2257 | `<policy-type-id>` | Id of the policy type |
2258 | `<policy-start-id>` | Id of the policy. This value shall be a numeric value and will be the id of the first policy |
2259 | `transient>` | Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provide) |
2260 | `notification-url` | Url for notifications |
2261 | `<template-file>` | Path to the template file for the policy |
2262 | `<count-per-ric>` | Number of policies per ric |
2263 | `<number-of-threads>` | Number of threads (processes) to run in parallel |
2265 ## Function: api_delete_policy ##
2267 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.
2271 | `<response-code> <policy-id> [<count>]`
2273 | parameter | description |
2274 | --------- | ----------- |
2275 | `<response-code>` | Expected http response code |
2276 | `<policy-id>` | Id of the policy |
2277 | `<count>` | An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
2279 ## Function: api_delete_policy_batch ##
2281 This tests the same as function 'api_delete_policy' except that all delete requests are sent to dmaap in one go and then the responses are polled one by one.
2282 If the agent api is not configured to used dmaap (see 'use_agent_dmaap', 'use_agent_rest_http' and 'use_agent_rest_https'), an error message is printed.
2283 For arg list and parameters, see 'api_delete_policy'.
2285 ## Function: api_delete_policy_parallel ##
2287 This tests the same as function 'api_delete_policy' except that the policy delete is spread out over a number of processes and it only uses the agent rest API. The total number of policies deleted is determined by the product of the parameters 'number-of-rics' and 'count'. The parameter 'number-of-threads' shall be selected to be not evenly divisible by the product of the parameters 'number-of-rics' and 'count' - this is to ensure that one process does not handle the deletion of all the policies in one ric.
2291 | `<response-code> <ric-id-base> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>`
2293 | parameter | description |
2294 | --------- | ----------- |
2295 | `<response-code>` | Expected http response code |
2296 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing |
2297 | `<number-of-rics>` | The number of rics, assuming the first index is '1' |
2298 | `<policy-start-id>` | Id of the policy. This value shall be a numeric value and will be the id of the first policy |
2299 | `<count-per-ric>` | Number of policies per ric |
2300 | `<number-of-threads>` | Number of threads (processes) to run in parallel |
2302 ## Function: api_get_policy_ids ##
2304 Test of GET '/policy_ids' or V2 GET '/v2/policies'.
2305 To test response code only, provide the response code parameter as well as the following three parameters.
2306 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.
2310 | `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <type-id>\|NOTYPE ([<policy-instance-id]*\|NOID)` |
2312 | parameter | description |
2313 | --------- | ----------- |
2314 | `<response-code>` | Expected http response code |
2315 | `<ric-id>` | Id of the ric |
2316 | `NORIC` | Indicator that no ric is provided |
2317 | `<service-id>` | Id of the service |
2318 | `NOSERVICE` | Indicator that no service id is provided |
2319 | `type-id>` | Id of the policy type |
2320 | `NOTYPE` | Indicator that no type id is provided |
2321 | `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
2322 | `<policy-instance-id>` | Id of the policy |
2324 ## Function: api_get_policy_schema ##
2326 Test of V2 GET '/v2/policy-types/{policyTypeId}' and optional check of the returned json schema.
2327 To test the response code only, provide the expected response code and policy type id.
2328 To test the contents of the returned json schema, add a path to a schema file to compare with.
2332 | `<response-code> <policy-type-id> [<schema-file>]` |
2334 | parameter | description |
2335 | --------- | ----------- |
2336 | `<response-code>` | Expected http response code |
2337 | `<policy-type-id>` | Id of the policy type |
2338 | `<schema-file>` | Path to the schema file for the policy type |
2340 ## Function: api_get_policy_schema ##
2342 Test of GET '/policy_schema' and optional check of the returned json schema.
2343 To test the response code only, provide the expected response code and policy type id.
2344 To test the contents of the returned json schema, add a path to a schema file to compare with.
2348 | `<response-code> <policy-type-id> [<schema-file>]` |
2350 | parameter | description |
2351 | --------- | ----------- |
2352 | `<response-code>` | Expected http response code |
2353 | `<policy-type-id>` | Id of the policy type |
2354 | `<schema-file>` | Path to the schema file for the policy type |
2356 ## Function: api_get_policy_schemas ##
2358 Test of GET '/policy_schemas' and optional check of the returned json schemas.
2359 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
2360 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)
2364 | `<response-code> <ric-id>\|NORIC [<schema-file>\|NOFILE]*` |
2366 | parameter | description |
2367 | --------- | ----------- |
2368 | `<response-code>` | Expected http response code |
2369 | `<ric-id>` | Id of the ric |
2370 | `NORIC` | No ric id given |
2371 | `<schema-file>` | Path to the schema file for the policy type |
2372 | `NOFILE` | Indicate the template for an empty type |
2374 ## Function: api_get_policy_status ##
2376 Test of GET '/policy_status' or V2 GET '/policies/{policy_id}/status'.
2380 | `<response-code> <policy-id> (STD\|STD2 <enforce-status>\|EMPTY [<reason>\|EMPTY])\|(OSC <instance-status> <has-been-deleted>)` |
2382 | parameter | description |
2383 | --------- | ----------- |
2384 | `<response-code>` | Expected http response code |
2385 | `<policy-id>` | Id of the policy |
2386 | `STD` | Indicator of status of Standarized A1 |
2387 | `STD2` | Indicator of status of Standarized A1 version 2 |
2388 | `<enforce-status>` | Enforcement status |
2389 | `<reason>` | Optional reason |
2390 | `EMPTY` | Indicator of empty string status or reason |
2391 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
2392 | `<instance-status>` | Instance status |
2393 | `<has-been-deleted>` | Deleted status, true or false |
2395 ## Function: api_get_policy_types ##
2397 Test of GET '/policy_types' or V2 GET '/v2/policy-types' and optional check of the returned ids.
2398 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
2399 To test the contents of the returned json payload, add the list of expected policy type id (or 'EMPTY' for the '{}' type)
2403 | `<response-code> [<ric-id>\|NORIC [<policy-type-id>\|EMPTY [<policy-type-id>]*]]` |
2405 | parameter | description |
2406 | --------- | ----------- |
2407 | `<response-code>` | Expected http response code |
2408 | `<ric-id>` | Id of the ric |
2409 | `NORIC` | No ric id given |
2410 | `<policy-type-id>` | Id of the policy type |
2411 | `EMPTY` | Indicate the empty type |
2413 ## Function: api_get_status ##
2415 Test of GET /status or V2 GET /status
2419 | `<response-code>` |
2421 | parameter | description |
2422 | --------- | ----------- |
2423 | `<response-code>` | Expected http response code |
2425 ## Function: api_get_ric ##
2427 Test of GET '/ric' or V2 GET '/v2/rics/ric'
2428 To test the response code only, provide the expected response code and managed element id.
2429 To test the returned ric id, provide the expected ric id.
2433 | `<reponse-code> <managed-element-id> [<ric-id>]` |
2437 | `<reponse-code> <management-element-id>\|NOME <ric-id>\|<NORIC> [<string-of-ricinfo>]` |
2439 | parameter | description |
2440 | --------- | ----------- |
2441 | `<response-code>` | Expected http response code |
2442 | `<managed-element-id>` | Id of the managed element |
2443 | `NOME` | Indicator for no ME |
2444 | `ric-id` | Id of the ric |
2445 | `NORIC` | Indicator no RIC |
2446 | `string-of-ricinfo` | String of ric info |
2448 ## Function: api_get_rics ##
2450 Test of GET '/rics' or V2 GET '/v2/rics' and optional check of the returned json payload (ricinfo).
2451 To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
2452 To test also the returned payload, add the formatted string of info in the returned payload.
2453 Format of ricinfo: <br>`<ric-id>:<list-of-mes>:<list-of-policy-type-ids>`<br>
2454 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_........."`
2458 | `<reponse-code> <policy-type-id>\|NOTYPE [<space-separate-string-of-ricinfo>]` |
2460 | parameter | description |
2461 | --------- | ----------- |
2462 | `<response-code>` | Expected http response code |
2463 | `<policy-type-id>` | Policy type id of the ric |
2464 | `NOTYPE>` | No type given |
2465 | `<space-separate-string-of-ricinfo>` | A space separated string of ric info - needs to be quoted |
2467 ## Function: api_put_service ##
2469 Test of PUT '/service' or V2 PUT '/service'.
2472 | `<response-code> <service-name> <keepalive-timeout> <callbackurl>` |
2474 | parameter | description |
2475 | --------- | ----------- |
2476 | `<response-code>` | Expected http response code |
2477 | `<service-name>` | Service name |
2478 | `<keepalive-timeout>` | Timeout value |
2479 | `<callbackurl>` | Callback url |
2481 ## Function: api_get_services ##
2483 Test of GET '/service' or V2 GET '/v2/services' and optional check of the returned json payload.
2484 To test only the response code, omit all parameters except the expected response code.
2485 To test the returned json, provide the parameters after the response code.
2489 | `<response-code> [ (<query-service-name> <target-service-name> <keepalive-timeout> <callbackurl>) \| (NOSERVICE <target-service-name> <keepalive-timeout> <callbackurl> [<target-service-name> <keepalive-timeout> <callbackurl>]* )]` |
2491 | parameter | description |
2492 | --------- | ----------- |
2493 | `<response-code>` | Expected http response code |
2494 | `<query-service-name>` | Service name for the query |
2495 | `<target-service-name>` | Target service name|
2496 | `<keepalive-timeout>` | Timeout value |
2497 | `<callbackurl>` | Callback url |
2498 | `NOSERVICE` | Indicator of no target service name |
2500 ## Function: api_get_service_ids ##
2502 Test of GET '/services' or V2 GET /'v2/services'. Only check of service ids.
2506 | `<response-code> [<service-name>]*` |
2508 | parameter | description |
2509 | --------- | ----------- |
2510 | `<response-code>` | Expected http response code |
2511 | `<service-name>` | Service name |
2513 ## Function: api_delete_services ##
2515 Test of DELETE '/services' or V2 DELETE '/v2/services/{serviceId}'
2519 | `<response-code> [<service-name>]*` |
2521 | parameter | description |
2522 | --------- | ----------- |
2523 | `<response-code>` | Expected http response code |
2524 | `<service-name>` | Service name |
2526 ## Function: api_put_services_keepalive ##
2528 Test of PUT '/services/keepalive' or V2 PUT '/v2/services/{service_id}/keepalive'
2532 | `<response-code> <service-name>` |
2534 | parameter | description |
2535 | --------- | ----------- |
2536 | `<response-code>` | Expected http response code |
2537 | `<service-name>` | Service name |
2539 ## Function: api_put_configuration ##
2541 Test of PUT '/v2/configuration'
2545 | `<response-code> <config-file>` |
2547 | parameter | description |
2548 | --------- | ----------- |
2549 | `<response-code>` | Expected http response code |
2550 | `<config-file>` | Path json config file |
2552 ## Function: api_get_configuration ##
2554 Test of GET '/v2/configuration'
2558 | `<response-code> [<config-file>]` |
2560 | parameter | description |
2561 | --------- | ----------- |
2562 | `<response-code>` | Expected http response code |
2563 | `<config-file>` | Path json config file to compare the retrieved config with |
2565 ## Function: pms_kube_pvc_reset ##
2566 Admin reset to remove all policies and services
2567 All types and instances etc are removed - types and instances in a1 sims need to be removed separately
2568 NOTE - only works in kubernetes and the pod should not be running
2575 # Description of functions in prodstub_api_functions.sh #
2577 ## Function: use_prod_stub_http ##
2579 Use http for the API. The admin API is not affected. This is the default protocol.
2584 ## Function: use_prod_stub_https ##
2586 Use https for the API. The admin API is not affected.
2591 ## Function: start_prod_stub ##
2593 Start the Producer stub container in docker or kube depending on start mode
2598 ## Function: prodstub_arm_producer ##
2600 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
2604 | `<response-code> <producer-id> [<forced_response_code>]` |
2606 | parameter | description |
2607 | --------- | ----------- |
2608 | `<response-code>` | Expected http response code |
2609 | `<producer-id>` | Id of the producer |
2610 | `<forced_response_code>` | Forced response code for the producer callback url |
2612 ## Function: prodstub_arm_job_create ##
2614 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.
2618 | `<response-code> <job-id> [<forced_response_code>]` |
2620 | parameter | description |
2621 | --------- | ----------- |
2622 | `<response-code>` | Expected http response code |
2623 | `<job-id>` | Id of the job |
2624 | `<forced_response_code>` | Forced response code for the create callback url |
2626 ## Function: prodstub_arm_job_delete ##
2628 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.
2632 | `<response-code> <job-id> [<forced_response_code>]` |
2634 | parameter | description |
2635 | --------- | ----------- |
2636 | `<response-code>` | Expected http response code |
2637 | `<job-id>` | Id of the job |
2638 | `<forced_response_code>` | Forced response code for the delete callback url |
2640 ## Function: prodstub_arm_type ##
2642 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
2646 | `<response-code> <producer-id> <type-id>` |
2648 | parameter | description |
2649 | --------- | ----------- |
2650 | `<response-code>` | Expected http response code |
2651 | `<producer-id>` | Id of the producer |
2652 | `<type-id>` | Id of the type |
2654 ## Function: prodstub_disarm_type ##
2656 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
2660 | `<response-code> <producer-id> <type-id>` |
2662 | parameter | description |
2663 | --------- | ----------- |
2664 | `<response-code>` | Expected http response code |
2665 | `<producer-id>` | Id of the producer |
2666 | `<type-id>` | Id of the type |
2668 ## Function: prodstub_check_jobdata ##
2670 Check a job in the prodstub towards the list of provided parameters.
2674 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2676 | parameter | description |
2677 | --------- | ----------- |
2678 | `<response-code>` | Expected http response code |
2679 | `<producer-id>` | Id of the producer |
2680 | `<job-id>` | Id of the job |
2681 | `<type-id>` | Id of the type |
2682 | `<target-url>` | Target url for data delivery |
2683 | `<job-owner>` | Id of the job owner |
2684 | `<template-job-file>` | Path to a job template file |
2686 ## Function: prodstub_check_jobdata_2 ##
2688 Check a job in the prodstub towards the list of provided parameters.
2692 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2694 | parameter | description |
2695 | --------- | ----------- |
2696 | `<response-code>` | Expected http response code |
2697 | `<producer-id>` | Id of the producer |
2698 | `<job-id>` | Id of the job |
2699 | `<type-id>` | Id of the type |
2700 | `<target-url>` | Target url for data delivery |
2701 | `<job-owner>` | Id of the job owner |
2702 | `<template-job-file>` | Path to a job template file |
2704 ## Function: prodstub_check_jobdata_3 ##
2706 Check a job in the prodstub towards the list of provided parameters.
2710 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2712 | parameter | description |
2713 | --------- | ----------- |
2714 | `<response-code>` | Expected http response code |
2715 | `<producer-id>` | Id of the producer |
2716 | `<job-id>` | Id of the job |
2717 | `<type-id>` | Id of the type |
2718 | `<target-url>` | Target url for data delivery |
2719 | `<job-owner>` | Id of the job owner |
2720 | `<template-job-file>` | Path to a job template file |
2722 ## Function: prodstub_delete_jobdata ##
2724 Delete the job parameters, job data, for a job.
2728 | `<response-code> <producer-id> <job-id>` |
2730 | parameter | description |
2731 | --------- | ----------- |
2732 | `<response-code>` | Expected http response code |
2733 | `<producer-id>` | Id of the producer |
2734 | `<job-id>` | Id of the job |
2736 ## Function: prodstub_equal ##
2738 Tests if a variable value in the prodstub is equal to a target value.
2739 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2740 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.
2744 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2746 | parameter | description |
2747 | --------- | ----------- |
2748 | `<variable-name>` | Variable name in the prostub |
2749 | `<target-value>` | Target value for the variable |
2750 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2752 # Description of functions in rc_api_function.sh #
2754 ## Function: use_rapp_catalogue_http ##
2756 Use http for the API. This is the default protocol.
2761 ## Function: use_rapp_catalogue_https ##
2763 Use https for the API.
2768 ## Function: start_rapp_catalogue ##
2770 Start the rapp catalogue container in docker or kube depending on start mode
2775 ## Function: rc_equal ##
2777 Tests if a variable value in the RAPP Catalogue is equal to a target value.
2778 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2779 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.
2780 See the 'cr' dir for more details.
2783 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2785 | parameter | description |
2786 | --------- | ----------- |
2787 | `<variable-name>` | Variable name in the RC |
2788 | `<target-value>` | Target value for the variable |
2789 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2791 ## Function: rapp_cat_api_get_services ##
2793 Check all registered services.
2797 | `<response-code> [(<service-id> <version> <display-name> <description>)+ \| EMPTY ]` |
2799 | parameter | description |
2800 | --------- | ----------- |
2801 | `<response-code>` | Expected http response code |
2802 | `<service-id>` | Id of the service |
2803 | `<version>` | Version of the service |
2804 | `<display-name>` | Dislay name of the service |
2805 | `<description>` | Description of the service |
2806 | `EMPTY` | Indicator for an empty list |
2808 ## Function: rapp_cat_api_put_service ##
2810 Register a services.
2814 | `<response-code> <service-id> <version> <display-name> <description>` |
2816 | parameter | description |
2817 | --------- | ----------- |
2818 | `<response-code>` | Expected http response code |
2819 | `<service-id>` | Id of the service |
2820 | `<version>` | Version of the service |
2821 | `<display-name>` | Dislay name of the service |
2822 | `<description>` | Description of the service |
2824 ## Function: rapp_cat_api_get_service ##
2826 Check a registered service.
2830 | `<response-code> <service-id> <version> <display-name> <description>` |
2832 | parameter | description |
2833 | --------- | ----------- |
2834 | `<response-code>` | Expected http response code |
2835 | `<service-id>` | Id of the service |
2836 | `<version>` | Version of the service |
2837 | `<display-name>` | Dislay name of the service |
2838 | `<description>` | Description of the service |
2840 ## Function: rapp_cat_api_delete_service ##
2842 Check a registered service.
2846 | `<response-code> <service-id>` |
2848 | parameter | description |
2849 | --------- | ----------- |
2850 | `<response-code>` | Expected http response code |
2851 | `<service-id>` | Id of the service |
2853 # Description of functions in ricsim_api_functions.sh #
2855 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
2857 ## Function: use_simulator_http ##
2859 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.
2864 ## Function: use_simulator_https ##
2866 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.
2871 ## Function: start_ric_simulators ##
2873 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
2876 | `ricsim_g1\|ricsim_g2\|ricsim_g3 <count> <interface-id>` |
2878 | parameter | description |
2879 | --------- | ----------- |
2880 | `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 |
2881 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
2882 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
2884 ## Function: get_kube_sim_host ##
2886 Translate ric name to kube host name.
2891 | parameter | description |
2892 | --------- | ----------- |
2893 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
2895 ## Function: generate_policy_uuid ##
2897 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
2898 UUID is then automatically added to the policy id in GET/PUT/DELETE.
2903 ## Function: sim_equal ##
2905 Tests if a variable value in the RIC simulator is equal to a target value.
2906 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2907 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.
2908 See the 'a1-interface' repo for more details.
2912 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2914 | parameter | description |
2915 | --------- | ----------- |
2916 | `<variable-name>` | Variable name in the ric simulator |
2917 | `<target-value>` | Target value for the variable |
2918 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2920 ## Function: sim_print ##
2922 Prints the value of a variable in the RIC simulator.
2923 See the 'a1-interface' repo for more details.
2927 | `<variable-name>` |
2929 | parameter | description |
2930 | --------- | ----------- |
2931 | `<variable-name>` | Variable name in the RIC simulator |
2933 ## Function: sim_contains_str ##
2935 Tests if a variable value in the RIC simulator contains a target string.
2936 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
2937 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.
2938 See the 'a1-interface' repo for more details.
2942 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2944 | parameter | description |
2945 | --------- | ----------- |
2946 | `<variable-name>` | Variable name in the ric simulator |
2947 | `<target-value>` | Target substring for the variable |
2948 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2950 ## Function: sim_put_policy_type ##
2952 Loads a policy type to the simulator
2956 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
2958 | parameter | description |
2959 | --------- | ----------- |
2960 | `<response-code>` | Expected http response code |
2961 | `<ric-id>` | Id of the ric |
2962 | `<policy-type-id>` | Id of the policy type |
2963 | `<policy-type-file>` | Path to the schema file of the policy type |
2965 ## Function: sim_delete_policy_type ##
2967 Deletes a policy type from the simulator
2971 | `<response-code> <ric-id> <policy_type_id>` |
2973 | parameter | description |
2974 | --------- | ----------- |
2975 | `<response-code>` | Expected http response code |
2976 | `<ric-id>` | Id of the ric |
2977 | `<policy-type-id>` | Id of the policy type |
2979 ## Function: sim_post_delete_instances ##
2981 Deletes all instances (and status), for one ric
2985 | `<response-code> <ric-id>` |
2987 | parameter | description |
2988 | --------- | ----------- |
2989 | `<response-code>` | Expected http response code |
2990 | `<ric-id>` | Id of the ric |
2992 ## Function: sim_post_delete_all ##
2994 Deletes all types, instances (and status), for one ric
2998 | `<response-code> <ric-id>` |
3000 | parameter | description |
3001 | --------- | ----------- |
3002 | `<response-code>` | Expected http response code |
3003 | `<ric-id>` | Id of the ric |
3005 ## Function: sim_post_forcedresponse ##
3007 Sets (or resets) response code for next (one) A1 message, for one ric.
3008 The intention is to simulate error response on the A1 interface.
3012 | `<response-code> <ric-id> [<forced_response_code>]`|
3014 | parameter | description |
3015 | --------- | ----------- |
3016 | `<response-code>` | Expected http response code |
3017 | `<ric-id>` | Id of the ric |
3018 | `<forced_response_code>` | Http response code to send |
3020 ## Function: sim_post_forcedelay ##
3022 Sets (or resets) A1 response delay, for one ric
3023 The intention is to delay responses on the A1 interface. Setting remains until removed.
3027 | `<response-code> <ric-id> [<delay-in-seconds>]`|
3029 | parameter | description |
3030 | --------- | ----------- |
3031 | `<response-code>` | Expected http response code |
3032 | `<ric-id>` | Id of the ric |
3033 | `<delay-in-seconds>` | Delay in seconds. If omitted, the delay is removed |
3035 # Description of functions in sdnc_api_functions.sh #
3037 The file contains a selection of the possible API tests towards the SDNC (a1-controller)
3039 ## Function: use_sdnc_http ##
3041 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.
3046 ## Function: use_sdnc_https ##
3048 Use https for all API calls towards the SDNC A1 Controller. Note that this function shall be called before preparing the config for Consul.
3053 ## Function: start_sdnc ##
3055 Start the SDNC A1 Controller container and its database container
3060 ## Function: stop_sdnc ##
3062 Stop the SDNC A1 Controller container and its database container
3067 ## Function: start_stopped_sdnc ##
3069 Start a previously stopped SDNC
3074 ## Function: check_sdnc_logs ##
3076 Check the SDNC log for any warnings and errors and print the count of each.
3081 ## Function: controller_api_get_A1_policy_ids ##
3083 Test of GET policy ids towards OSC or STD type simulator.
3084 To test response code only, provide the response code, 'OSC' + policy type or 'STD'
3085 To test the response payload, include the ids of the expexted response.
3089 | `<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) \| ( STD <ric-id> [ <policy-id> [<policy-id>]* ]` |
3091 | parameter | description |
3092 | --------- | ----------- |
3093 | `<response-code>` | Expected http response code |
3094 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
3095 | `<ric-id>` | Id of the ric |
3096 | `policy-type-id>` | Id of the policy type |
3097 | `<policy-id>` | Id of the policy |
3098 | `STD` | Indicator of status of Standarized A1 |
3100 ## Function: controller_api_get_A1_policy_type ##
3102 Test of GET a policy type (OSC only)
3106 | `<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]` |
3108 | parameter | description |
3109 | --------- | ----------- |
3110 | `<response-code>` | Expected http response code |
3111 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
3112 | `<ric-id>` | Id of the ric |
3113 | `policy-type-id>` | Id of the policy type |
3114 | `policy-type-file>` | Optional schema file to compare the returned type with |
3116 ## Function: controller_api_delete_A1_policy ##
3118 Deletes a policy instance
3122 | `(STD <ric-id> <policy-id>) \| (OSC <ric-id> <policy-type-id> <policy-id>)` |
3124 | parameter | description |
3125 | --------- | ----------- |
3126 | `<response-code>` | Expected http response code |
3127 | `STD` | Indicator of status of Standarized A1 |
3128 | `<ric-id>` | Id of the ric |
3129 | `<policy-id>` | Id of the policy |
3130 | `policy-type-id>` | Id of the policy type |
3131 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
3132 | `policy-type-file>` | Optional schema file to compare the returned type with |
3134 ## Function: controller_api_put_A1_policy ##
3136 Creates a policy instance
3140 | `<response-code> (STD <ric-id> <policy-id> <template-file> ) \| (OSC <ric-id> <policy-type-id> <policy-id> <template-file>)` |
3142 | parameter | description |
3143 | --------- | ----------- |
3144 | `<response-code>` | Expected http response code |
3145 | `STD` | Indicator of status of Standarized A1 |
3146 | `<ric-id>` | Id of the ric |
3147 | `<policy-id>` | Id of the policy |
3148 | `<template-file>` | Path to the template file of the policy|
3149 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
3150 | `<policy-type-id>` | Id of the policy type |
3152 ## Function: controller_api_get_A1_policy_status ##
3154 Checks the status of a policy
3158 | `<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) \| (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)` |
3160 | parameter | description |
3161 | --------- | ----------- |
3162 | `<response-code>` | Expected http response code |
3163 | `STD` | Indicator of status of Standarized A1 |
3164 | `<ric-id>` | Id of the ric |
3165 | `<policy-id>` | Id of the policy |
3166 | `<enforce-status>` | Enforcement status |
3167 | `<reason>` | Optional reason |
3168 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
3169 | `<policy-type-id>` | Id of the policy type |
3170 | `<instance-status>` | Instance status |
3171 | `<has-been-deleted>` | Deleted status, true or false |
3176 Copyright (C) 2020 Nordix Foundation. All rights reserved.
3177 Licensed under the Apache License, Version 2.0 (the "License");
3178 you may not use this file except in compliance with the License.
3179 You may obtain a copy of the License at
3181 http://www.apache.org/licenses/LICENSE-2.0
3183 Unless required by applicable law or agreed to in writing, software
3184 distributed under the License is distributed on an "AS IS" BASIS,
3185 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3186 See the License for the specific language governing permissions and
3187 limitations under the License.