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`.
15 Cleans all containers started by the test environment in docker.
18 Cleans all services, deployments, pods, replica set etc started by the test environment in kubernetes.
21 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'.
23 `consul_api_function.sh` \
24 Contains functions for managing Consul and CBS.
26 `count_json_elements.py` \
27 A python script calculate the length of json array or size of a json dictionary'.
29 `count_json_elements.py` \
30 A python script returning the number of items in a json array.
32 `cp_api_function.sh` \
33 Contains functions for managing the Control Panel.
35 `cr_api_functions.sh` \
36 Contains functions for adapting towards the Callback receiver for checking received callback events.
38 `create_policies_process.py` \
39 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.
41 `create_rics_json.py` \
42 A python script to create a json file from a formatted string of ric info. Helper for the test enviroment.
44 `delete_policies_process.py` \
45 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.
47 `dmaapadp_api_function.sh`
48 Contains funnctions for managing the Dmaap Adaptor Service.
50 `dmaapmed_api_function.sh`
51 Contains funnctions for managing the Dmaap Mediator Service.
53 `dmaapmr_api_function.sh`
54 All functions are implemented in `mr_api_functions.sh`.
57 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)
59 `extract_sdnc_reply.py` \
60 A python script to extract the information from an sdnc (A1 Controller) reply json. Helper for the test environment.
63 This script collects container statistics to a file. Works both in docker and kubernetes (only for docker runtime).
65 `http_proxy_api_functions.sh` \
66 Contains functions for managing the Http Proxy.
68 `ics_api_functions.sh` \
69 Contains functions for adapting towards the Information Coordinator Service API.
71 `kafkapc_api_functions.sh` \
72 Contains functions for managing the kafka producer/consumer. Kafka is started by the dmaap message router component.
74 `kube_proxy_api_functions.sh` \
75 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.
77 `mr_api_functions.sh` \
78 Contains functions for managing the MR Stub and the Dmaap Message Router
80 `ngw_api_functions.sh` \
81 Contains functions for managing the Non-RT RIC Gateway
83 `pa_api_functions.sh` \
84 Contains functions for adapting towards the Policy Management Service (PMS) API, also via dmaap (using a message-router stub interface)
86 `prodstub_api_functions.sh` \
87 Contains functions for adapting towards the Producer stub interface - simulates a producer.
89 `pvccleaner_api_functions.sh` \
90 Contains functions for managing the PVC Cleaner (used for reset mounted volumes in kubernetes).
92 `rc_api_functions.sh` \
93 Contains functions for adapting towards the RAPP Catalogue.
95 `ricsim_api_functions.sh` \
96 Contains functions for adapting towards the RIC (A1) simulator admin API.
98 `sdnc_api_functions.sh` \
99 Contains functions for adaping towards the SDNC (used as an A1 controller).
102 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.
103 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'.
105 `testcase_common.sh` \
106 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.
107 The included functions are described in detail further below.
109 `testengine_config.sh` \
110 Configuration file to setup the applications (components and simulators) the test enviroment handles.
112 `testsuite_common.sh` \
113 Common functions for running two or more auto test scripts as a suite.
115 ## Integration of a new applicaton ##
117 Integration a new application to the test environment involves the following steps.
119 * Choose a short name for the application. Should be a uppcase name. For example, the NonRTRIC Gateway has NGW as short name.
120 This short name shall be added to the testengine_config.sh. See that file for detailed instructions.
122 * Create a file in this directory using the pattern `<application-name>_api_functions.sh`.
123 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.
127 | __<app-short_name>_imagesetup |
128 | __<app-short_name>_imagepull |
129 | __<app-short_name>_imagebuild |
130 | __<app-short_name>_image_data |
131 | __<app-short_name>_kube_scale_zero |
132 | __<app-short_name>_kube_scale_zero_and_wait |
133 | __<app-short_name>_kube_delete_all |
134 | __<app-short_name>_store_docker_logs |
135 | __<app-short_name>_initial_setup |
136 | __<app-short_name>_statisics_setup |
138 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.
140 * 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.
142 * 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.
144 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.
146 | Label for docker compose | Description |
148 | nrttest_app | shall contain the application short name |
149 | nrttest_dp | shall be set by a variable containing the display name, a short textual description of the applicaion |
151 | Label for kubernetes resource | Description |
153 | autotest | shall contain the application short name |
155 * 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>`.
156 In addition, all other needed environment shall also be defined in these file.
158 # Description of functions in testcase_common.sh #
162 The script can be started with these arguments
166 | `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]` |
168 | parameter | description |
170 | `remote` | Use images from remote repositories. Can be overridden for individual images using the '--use_xxx' flags |
171 | `remote-remove` | Same as 'remote' but will also try to pull fresh images from remote repositories |
172 | `docker` | Use docker environment for test |
173 | `kuber` | Use kubernetes environment for test. Requires a kubernetes minikube installation |
174 | `--env-file` | The script will use the supplied file to read environment variables from |
175 | `release` | If this flag is given the script will use release version of the images |
176 | `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 |
177 | `--stop-at-error` | The script will stop when the first failed test or configuration |
178 | `--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). |
179 | `--use-local-image` | The script will use local images for the supplied apps, space separated list of app short names |
180 | `--use-snapshot-image` | The script will use images from the nexus snapshot repo for the supplied apps, space separated list of app short names |
181 | `--use-staging-image` | The script will use images from the nexus staging repo for the supplied apps, space separated list of app short names |
182 | `--use-release-image` | The script will use images from the nexus release repo for the supplied apps, space separated list of app short names |
183 | `--image-repo` | Url to optional image repo. Only locally built images will be re-tagged and pushed to this repo |
184 | `-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' |
185 | `--cluster-timeout` | Optional timeout for cluster where it takes time to obtain external ip/host-name. Timeout in seconds |
186 | `--print-stats` | Prints the number of tests, failed tests, failed configuration and deviations after each individual test or config |
187 | `--override <file>` | Override setting from the file supplied by --env-file |
188 | `--pre-clean` | Clean kube resouces when running docker and vice versa |
189 | `--gen-stats` | Collect container/pod runtime statistics |
190 | `help` | Print this info along with the test script description and the list of app short names supported |
192 ## Function: setup_testenvironment ##
194 Main function to setup the test environment before any tests are started.
195 Must be called right after sourcing all component scripts.
200 ## Function: print_result ##
202 Print a test report of an auto-test script.
207 ## Function: start_timer ##
209 Start a timer for time measurement. Only one timer can be running.
212 | `<timer-message-to-print>` |
213 | None - but any args will be printed (It is good practice to use same args for this function as for the `print_timer`) |
215 ## Function: print_timer ##
217 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.
222 ## Function: deviation ##
224 Mark a test as a deviation from the requirements. The list of deviations will be printed in the test report.
227 | `<deviation-message-to-print>` |
229 | parameter | description |
230 | --------- | ----------- |
231 | `<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 |
233 ## Function: clean_environment ##
235 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).
240 ## Function: auto_clean_containers ##
242 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.
247 ## Function: sleep_wait ##
249 Make the script sleep for a number of seconds.
252 | `<sleep-time-in-sec> [<any-text-in-quotes-to-be-printed>]` |
254 | parameter | description |
255 | --------- | ----------- |
256 | `<sleep-time-in-sec>` | Number of seconds to sleep |
257 | `<any-text-in-quotes-to-be-printed>` | Optional. The text will be printed, if present |
259 ## Function: store_logs ##
261 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.
264 | `<logfile-prefix>` |
266 | parameter | description |
267 | --------- | ----------- |
268 | `<logfile-prefix>` | Log file prefix |
270 # Description of functions in testsuite_common.sh #
272 ## Function: suite_setup ##
274 Sets up the test suite and prints out a heading.
281 Print out the overall result of the executed test cases.
286 # Description of functions in consul_api_function.sh #
288 ## Function: consul_config_app ##
290 Function to load a json config from a file into consul for the Policy Agent
294 | `<json-config-file>` |
296 | parameter | description |
297 | --------- | ----------- |
298 | `<json-config-file>` | The path to the json file to be loaded to Consul/CBS |
300 ## Function: start_consul_cbs ##
302 Start the Consul and CBS containers
307 # Description of functions in cp_api_function.sh #
309 ## Function: use_control_panel_http ##
311 Set http as the protocol to use for all communication to the Control Panel
316 ## Function: use_control_panel_https ##
318 Set https as the protocol to use for all communication to the Control Panel
323 ## Function: start_control_panel ##
325 Start the Control Panel container
330 # Description of functions in cr_api_functions.sh #
332 ## Function: use_cr_http ##
334 Use http for getting event from CR. The admin API is not affected. This is the default.
339 ## Function: use_cr_https ##
341 Use https for getting event from CR. The admin API is not affected.
342 Note: Not yet used as callback event is not fully implemented/deciced.
347 ## Function: start_cr ##
349 Start the Callback Receiver container in docker or kube depending on start mode.
354 ## Function: cr_equal ##
356 Tests if a variable value in the Callback Receiver (CR) simulator is equal to a target value.
357 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
358 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.
359 See the 'cr' dir for more details.
362 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
364 | parameter | description |
365 | --------- | ----------- |
366 | `<variable-name>` | Variable name in the CR |
367 | `<target-value>` | Target value for the variable |
368 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
370 ## Function: cr_contains_str ##
372 Tests if a variable value in the CR contains a target string.
373 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
374 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.
375 See the 'a1-interface' repo for more details.
379 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
382 | parameter | description |
383 | --------- | ----------- |
384 | `<variable-name>` | Variable name in the CR |
385 | `<target-value>` | Target substring for the variable |
386 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
388 ## Function: cr_read ##
390 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.
391 See the 'mrstub' dir for more details.
394 | `<variable-name>` |
396 | parameter | description |
397 | --------- | ----------- |
398 | `<variable-name>` | Variable name in the CR |
400 ## Function: cr_delay_callback ##
402 Function to configure write delay on callbacks. Delay given in seconds. Setting remains until removed.
406 | `<response-code> <cr-path-id> [<delay-in-seconds>]`|
408 | parameter | description |
409 | --------- | ----------- |
410 | `<response-code>` | Expected http response code |
411 | `<cr-path-id>` | Variable index to CR |
412 | `<delay-in-seconds>` | Delay in seconds. If omitted, the delay is removed |
414 ## Function: cr_api_check_all_sync_events ##
416 Check the contents of all ric events received for a callback id.
420 | `<response-code> <id> [ EMPTY \| ( <ric-id> )+ ]` |
422 | parameter | description |
423 | --------- | ----------- |
424 | `<response-code>` | Expected http response code |
425 | `<id>` | Id of the callback destination |
426 | `EMPTY` | Indicator for an empty list |
427 | `<ric-id>` | Id of the ric |
429 ## Function: cr_api_check_all_ics_events ##
431 Check the contents of all current status events for one id from ICS
435 | `<response-code> <id> [ EMPTY \| ( <status> )+ ]` |
437 | parameter | description |
438 | --------- | ----------- |
439 | `<response-code>` | Expected http response code |
440 | `<id>` | Id of the callback destination |
441 | `EMPTY` | Indicator for an empty list |
442 | `<status>` | Status string |
444 ## Function: cr_api_check_all_ics_subscription_events ##
446 Check the contents of all current subscription events for one id from ICS
450 | `<response-code> <id> [ EMPTY | ( <type-id> <schema> <registration-status> )+ ]` |
452 | parameter | description |
453 | --------- | ----------- |
454 | `<response-code>` | Expected http response code |
455 | `<id>` | Id of the callback destination |
456 | `EMPTY` | Indicator for an empty list |
457 | `<type-id>` | Id of the data type |
458 | `<schema>` | Path to typeschema file |
459 | `<registration-status>` | Status string |
461 ## Function: cr_api_reset ##
463 Reset the callback receiver
469 ## Function: cr_api_check_all_genric_json_events ##
471 Check the contents of all json events for path
475 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <json-msg>+ )` |
477 | parameter | description |
478 | --------- | ----------- |
479 | `<response-code>` | Expected http response code |
480 | `<cr-path-id>` | Variable index for CR |
481 | `<topic-url>` | Topic url |
482 | `EMPTY` | Indicator for an empty list |
483 | `json-msg` | Json msg string to compare with |
485 ## Function: cr_api_check_single_genric_json_event ##
487 Check a single (oldest) json event (or none if empty) for path
491 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <json-msg> )` |
493 | parameter | description |
494 | --------- | ----------- |
495 | `<response-code>` | Expected http response code |
496 | `<cr-path-id>` | Variable index for CR |
497 | `<topic-url>` | Topic url |
498 | `EMPTY` | Indicator for no msg |
499 | `json-msg` | Json msg string to compare with |
501 ## Function: cr_api_check_single_genric_event_md5 ##
503 Check a single (oldest) json in md5 format (or none if empty) for path.
504 Note that if a json message is given, it shall be compact, no ws except inside string.
505 The MD5 will generate different hash if whitespace is present or not in otherwise equivalent json.
509 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <data-msg> )` |
511 | parameter | description |
512 | --------- | ----------- |
513 | `<response-code>` | Expected http response code |
514 | `<cr-path-id>` | Variable index for CR |
515 | `<topic-url>` | Topic url |
516 | `EMPTY` | Indicator for no msg |
517 | `data-msg` | msg string to compare with |
519 ## Function: cr_api_check_single_genric_event_md5_file ##
521 Check a single (oldest) event in md5 format (or none if empty) for path.
522 Note that if a file with json message is given, the json shall be compact, no ws except inside string and not newlines.
523 The MD5 will generate different hash if ws/newlines is present or not in otherwise equivalent json
527 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <data-file> )` |
529 | parameter | description |
530 | --------- | ----------- |
531 | `<response-code>` | Expected http response code |
532 | `<cr-path-id>` | Variable index for CR |
533 | `<topic-url>` | Topic url |
534 | `EMPTY` | Indicator for no msg |
535 | `data-file` | path to file to compare with |
537 # Description of functions in dmaapadp_api_functions.sh #
539 ## Function: use_dmaapadp_http ##
541 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.
547 ## Function: use_dmaapadp_https ##
549 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.
555 ## Function: start_dmaapadp ##
557 Start the dmaap adator service container in docker or kube depending on running mode.
561 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
563 | parameter | description |
564 | --------- | ----------- |
565 | `PROXY` | Configure with http proxy, if proxy is started |
566 | `NOPROXY` | Configure without http proxy |
567 | `<config-file>`| Path to application.yaml |
568 | `<data-file>` | Optional path to application_configuration.json |
570 ## Function: set_dmaapadp_trace ##
572 Configure the dmaap adaptor service log on trace level. The app must be running.
577 # Description of functions in dmaapmed_api_functions.sh #
579 ## Function: use_dmaapmed_http ##
581 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.
587 ## Function: use_dmaapmed_https ##
589 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.
595 ## Function: start_dmaapmed ##
597 Start the dmaap mediator service container in docker or kube depending on running mode.
603 # Description of functions in httpproxy_api_functions.sh #
605 ## Function: use_http_proxy_http ##
607 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.
612 ## Function: use_http_proxy_https ##
614 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.
619 ## Function: start_http_proxy ##
621 Start the http proxy container in docker or kube depending on running mode.
626 # Description of functions in ics_api_functions.sh #
628 ## Function: use_ics_rest_http ##
630 Use http for all API calls to the ICS. This is the default protocol.
635 ## Function: use_ics_rest_https ##
637 Use https for all API calls to the ICS.
642 ## Function: use_ics_dmaap_http ##
644 Send and recieve all API calls to the ICS over Dmaap via the MR using http.
649 ## Function: use_ics_dmaap_https ##
651 Send and recieve all API calls to the ICS over Dmaap via the MR using https.
656 ## Function: start_ics ##
658 Start the ICS container in docker or kube depending on running mode.
661 | `PROXY|NOPROXY <config-file>` |
663 | parameter | description |
664 | --------- | ----------- |
665 | `PROXY` | Configure with http proxy, if proxy is started |
666 | `NOPROXY` | Configure without http proxy |
667 | `<config-file>`| Path to application.yaml |
669 ## Function: stop_ics ##
671 Stop the ICS container.
676 ## Function: start_stopped_ics ##
678 Start a previously stopped ics.
683 ## Function: set_ics_debug ##
685 Configure the ICS log on debug level. The ICS must be running.
690 ## Function: set_ics_trace ##
692 Configure the ICS log on trace level. The ICS must be running.
697 ## Function: use_ics_retries ##
699 Perform curl retries when making direct call to ICS for the specified http response codes
700 Speace separated list of http response codes
703 | `[<response-code>]*` |
705 | parameter | description |
706 | --------- | ----------- |
707 | `<response-code>` | Http response code to make retry for |
709 ## Function: check_ics_logs ##
711 Check the ICS log for any warnings and errors and print the count of each.
716 ## Function: ics_equal ##
718 Tests if a variable value in the ICS is equal to a target value.
719 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
720 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.
721 See the 'a1-interface' repo for more details.
725 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
727 | parameter | description |
728 | --------- | ----------- |
729 | `<variable-name>` | Variable name in ics |
730 | `<target-value>` | Target value for the variable |
731 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
733 ## Function: ics_api_a1_get_job_ids ##
735 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs' and optional check of the array of returned job ids.
736 To test the response code only, provide the response code parameter as well as a type id and an owner id.
737 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
741 | `<response-code> <type-id> <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
743 | parameter | description |
744 | --------- | ----------- |
745 | `<response-code>` | Expected http response code |
746 | `<type-id>` | Id of the EI type |
747 | `<owner-id>` | Id of the job owner |
748 | `NOOWNER` | No owner is given |
749 | `<job-id>` | Id of the expected job |
750 | `EMPTY` | The expected list of job id shall be empty |
752 ## Function: ics_api_a1_get_type ##
754 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}' and optional check of the returned schema.
755 To test the response code only, provide the response code parameter as well as the type-id.
756 To also test the response payload add a path to the expected schema file.
760 | `<response-code> <type-id> [<schema-file>]` |
762 | parameter | description |
763 | --------- | ----------- |
764 | `<response-code>` | Expected http response code |
765 | `<type-id>` | Id of the EI type |
766 | `<schema-file>` | Path to a schema file to compare with the returned schema |
768 ## Function: ics_api_a1_get_type_ids ##
770 Test of GET '/A1-EI/v1/eitypes' and optional check of returned list of type ids.
771 To test the response code only, provide the response only.
772 To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
776 | `<response-code> [ (EMPTY \| [<type-id>]+) ]` |
778 | parameter | description |
779 | --------- | ----------- |
780 | `<response-code>` | Expected http response code |
781 | `EMPTY` | The expected list of type ids shall be empty |
782 | `<type-id>` | Id of the EI type |
784 ## Function: ics_api_a1_get_job_status ##
786 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}/status' and optional check of the returned status.
787 To test the response code only, provide the response code, type id and job id.
788 To also test the response payload add the expected status.
792 | `<response-code> <type-id> <job-id> [<status>]` |
794 | parameter | description |
795 | --------- | ----------- |
796 | `<response-code>` | Expected http response code |
797 | `<type-id>` | Id of the EI type |
798 | `<job-id>` | Id of the job |
799 | `<status>` | Expected status |
801 ## Function: ics_api_a1_get_job ##
803 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}' and optional check of the returned job.
804 To test the response code only, provide the response code, type id and job id.
805 To also test the response payload add the remaining parameters.
809 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
811 | parameter | description |
812 | --------- | ----------- |
813 | `<response-code>` | Expected http response code |
814 | `<type-id>` | Id of the EI type |
815 | `<job-id>` | Id of the job |
816 | `<target-url>` | Expected target url for the job |
817 | `<owner-id>` | Expected owner for the job |
818 | `<template-job-file>` | Path to a job template for job parameters of the job |
820 ## Function: ics_api_a1_delete_job ##
822 Test of DELETE '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
823 To test, provide all the specified parameters.
827 | `<response-code> <type-id> <job-id>` |
829 | parameter | description |
830 | --------- | ----------- |
831 | `<response-code>` | Expected http response code |
832 | `<type-id>` | Id of the EI type |
833 | `<job-id>` | Id of the job |
835 ## Function: ics_api_a1_put_job ##
837 Test of PUT '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
838 To test, provide all the specified parameters.
842 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
844 | parameter | description |
845 | --------- | ----------- |
846 | `<response-code>` | Expected http response code |
847 | `<type-id>` | Id of the EI type |
848 | `<job-id>` | Id of the job |
849 | `<target-url>` | Target url for the job |
850 | `<owner-id>` | Owner of the job |
851 | `<template-job-file>` | Path to a job template for job parameters of the job |
853 ## Function: ics_api_edp_get_type_ids ##
855 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.
856 To test the response code only, provide the response code.
857 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
861 | `<response-code> [ EMPTY \| <type-id>+]` |
863 | parameter | description |
864 | --------- | ----------- |
865 | `<response-code>` | Expected http response code |
866 | `<type-id>` | Id of the type |
867 | `EMPTY` | The expected list of type ids shall be empty |
869 ## Function: ics_api_edp_get_producer_status ##
871 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.
872 To test the response code only, provide the response code and producer id.
873 To also test the response payload add the expected status.
877 | `<response-code> <producer-id> [<status>]` |
879 | parameter | description |
880 | --------- | ----------- |
881 | `<response-code>` | Expected http response code |
882 | `<producer-id>` | Id of the producer |
883 | `<status>` | The expected status string |
885 ## Function: ics_api_edp_get_producer_ids ##
887 Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
888 To test the response code only, provide the response.
889 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).
893 | `<response-code> [ EMPTY \| <producer-id>+]` |
895 | parameter | description |
896 | --------- | ----------- |
897 | `<response-code>` | Expected http response code |
898 | `<producer-id>` | Id of the producer |
899 | `EMPTY` | The expected list of type ids shall be empty |
901 ## Function: ics_api_edp_get_producer_ids_2 ##
903 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.
904 To test the response code only, provide the response.
905 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).
909 | `<response-code> [ ( NOTYPE \| <type-id> ) [ EMPTY \| <producer-id>+]` |
911 | parameter | description |
912 | --------- | ----------- |
913 | `<response-code>` | Expected http response code |
914 | `<type-id>` | Id of the type |
915 | `EMPTY` | No type given |
916 | `<producer-id>` | Id of the producer |
917 | `EMPTY` | The expected list of type ids shall be empty |
919 ## Function: ics_api_edp_get_type ##
921 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
922 To test the response code only, provide the response and the type-id.
923 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).
927 | `<response-code> <type-id> [<job-schema-file> (EMPTY \| [<producer-id>]+)]` |
929 | parameter | description |
930 | --------- | ----------- |
931 | `<response-code>` | Expected http response code |
932 | `<type-id>` | Id of the type |
933 | `<job-schema-file>` | Path to a job schema file |
934 | `<producer-id>` | Id of the producer |
935 | `EMPTY` | The expected list of type ids shall be empty |
937 ## Function: ics_api_edp_get_type_2 ##
939 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.
940 To test the response code only, provide the response and the type-id.
941 To also test the response payload add a path to a job schema file.
945 | `<response-code> <type-id> [<job-schema-file>]` |
947 | parameter | description |
948 | --------- | ----------- |
949 | `<response-code>` | Expected http response code |
950 | `<type-id>` | Id of the type |
951 | `<job-schema-file>` | Path to a job schema file |
952 | `EMPTY` | The expected list of type ids shall be empty |
954 ## Function: ics_api_edp_put_type_2 ##
956 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.
960 | `<response-code> <type-id> [<job-schema-file>]` |
962 | parameter | description |
963 | --------- | ----------- |
964 | `<response-code>` | Expected http response code |
965 | `<type-id>` | Id of the type |
966 | `<job-schema-file>` | Path to a job schema file |
967 | `EMPTY` | The expected list of type ids shall be empty |
969 ## Function: ics_api_edp_delete_type_2 ##
971 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.
975 | `<response-code> <type-id>` |
977 | parameter | description |
978 | --------- | ----------- |
979 | `<response-code>` | Expected http response code |
980 | `<type-id>` | Id of the type |
982 ## Function: ics_api_edp_get_producer ##
984 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
985 To test the response code only, provide the response and the producer-id.
986 To also test the response payload add the remaining parameters defining thee producer.
990 | `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY\| [<type-id> <schema-file>]+) ]` |
992 | parameter | description |
993 | --------- | ----------- |
994 | `<response-code>` | Expected http response code |
995 | `<producer-id>` | Id of the producer |
996 | `<create-callback>` | Callback for create job |
997 | `<delete-callback>` | Callback for delete job |
998 | `<supervision-callback>` | Callback for producer supervision |
999 | `<type-id>` | Id of the type |
1000 | `<schema-file>` | Path to a schema file |
1001 | `EMPTY` | The expected list of type schema pairs shall be empty |
1003 ## Function: ics_api_edp_get_producer_2 ##
1005 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.
1006 To test the response code only, provide the response and the producer-id.
1007 To also test the response payload add the remaining parameters defining thee producer.
1011 | `<response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY \| <type-id>+) ]` |
1013 | parameter | description |
1014 | --------- | ----------- |
1015 | `<response-code>` | Expected http response code |
1016 | `<producer-id>` | Id of the producer |
1017 | `<job-callback>` | Callback for the url |
1018 | `<supervision-callback>` | Callback for producer supervision |
1019 | `<type-id>` | Id of the type |
1020 | `EMPTY` | The expected list of types shall be empty |
1022 ## Function: ics_api_edp_delete_producer ##
1024 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version.
1025 To test, provide all parameters.
1029 | `<response-code> <producer-id>` |
1031 | parameter | description |
1032 | --------- | ----------- |
1033 | `<response-code>` | Expected http response code |
1034 | `<producer-id>` | Id of the producer |
1036 ## Function: ics_api_edp_put_producer ##
1038 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1039 To test, provide all parameters. The list of type/schema pair may be empty.
1043 | `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY \| [<type-id> <schema-file>]+)` |
1045 | parameter | description |
1046 | --------- | ----------- |
1047 | `<response-code>` | Expected http response code |
1048 | `<producer-id>` | Id of the producer |
1049 | `<job-callback>` | Callback for create/delete job |
1050 | `<supervision-callback>` | Callback for producer supervision |
1051 | `<type-id>` | Id of the type |
1052 | `<schema-file>` | Path to a schema file |
1053 | `EMPTY` | The list of type/schema pairs is empty |
1055 ## Function: ics_api_edp_put_producer_2 ##
1057 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version.
1058 To test, provide all parameters. The list of type/schema pair may be empty.
1062 | `<response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE\|[<type-id>+]` |
1064 | parameter | description |
1065 | --------- | ----------- |
1066 | `<response-code>` | Expected http response code |
1067 | `<producer-id>` | Id of the producer |
1068 | `<job-callback>` | Callback for create/delete job |
1069 | `<supervision-callback>` | Callback for producer supervision |
1070 | `<type-id>` | Id of the type |
1071 | `NOTYPE` | The list of types is empty |
1073 ## Function: ics_api_edp_get_producer_jobs ##
1075 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
1076 To test the response code only, provide the response and the producer-id.
1077 To also test the response payload add the remaining parameters.
1081 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1083 | parameter | description |
1084 | --------- | ----------- |
1085 | `<response-code>` | Expected http response code |
1086 | `<producer-id>` | Id of the producer |
1087 | `<job-id>` | Id of the job |
1088 | `<type-id>` | Id of the EI type |
1089 | `<target-url>` | Target url for data delivery |
1090 | `<job-owner>` | Id of the job owner |
1091 | `<template-job-file>` | Path to a job template file |
1092 | `EMPTY` | The list of job/type/target/job-file tuples is empty |
1094 ## Function: ics_api_edp_get_producer_jobs_2 ##
1096 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.
1097 To test the response code only, provide the response and the producer-id.
1098 To also test the response payload add the remaining parameters.
1102 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1104 | parameter | description |
1105 | --------- | ----------- |
1106 | `<response-code>` | Expected http response code |
1107 | `<producer-id>` | Id of the producer |
1108 | `<job-id>` | Id of the job |
1109 | `<type-id>` | Id of the type |
1110 | `<target-url>` | Target url for data delivery |
1111 | `<job-owner>` | Id of the job owner |
1112 | `<template-job-file>` | Path to a job template file |
1113 | `EMPTY` | The list of job/type/target/job-file tuples is empty |
1115 ## Function: ics_api_service_status ##
1117 Test of GET '/status'.
1121 | `<response-code>` |
1123 | parameter | description |
1124 | --------- | ----------- |
1125 | `<response-code>` | Expected http response code |
1127 ## Function: ics_api_idc_get_type_ids ##
1129 Test of GET '/data-consumer/v1/info-types' and an optional check of the returned list of type ids.
1130 To test the response code only, provide the response code.
1131 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1135 | `<response-code> [ EMPTY \| <type-id>+]` |
1137 | parameter | description |
1138 | --------- | ----------- |
1139 | `<response-code>` | Expected http response code |
1140 | `<type-id>` | Id of the Info type |
1141 | `EMPTY` | The expected list of type ids shall be empty |
1143 ## Function: ics_api_idc_get_job_ids ##
1145 Test of GET '/data-consumer/v1/info-jobs' and optional check of the array of returned job ids.
1146 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1147 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1151 | `<response-code> <type-id> <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
1153 | parameter | description |
1154 | --------- | ----------- |
1155 | `<response-code>` | Expected http response code |
1156 | `<type-id>` | Id of the Info type |
1157 | `<owner-id>` | Id of the job owner |
1158 | `NOOWNER` | No owner is given |
1159 | `<job-id>` | Id of the expected job |
1160 | `EMPTY` | The expected list of job id shall be empty |
1162 ## Function: ics_api_idc_get_job ##
1164 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}' and optional check of the returned job.
1165 To test the response code only, provide the response code, type id and job id.
1166 To also test the response payload add the remaining parameters.
1170 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1172 | parameter | description |
1173 | --------- | ----------- |
1174 | `<response-code>` | Expected http response code |
1175 | `<type-id>` | Id of the Info type |
1176 | `<job-id>` | Id of the job |
1177 | `<target-url>` | Expected target url for the job |
1178 | `<owner-id>` | Expected owner for the job |
1179 | `<template-job-file>` | Path to a job template for job parameters of the job |
1181 ## Function: ics_api_idc_put_job ##
1183 Test of PUT '/data-consumer/v1/info-jobs/{infoJobId}'.
1184 To test, provide all the specified parameters.
1188 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file> [VALIDATE]` |
1190 | parameter | description |
1191 | --------- | ----------- |
1192 | `<response-code>` | Expected http response code |
1193 | `<type-id>` | Id of the Info type |
1194 | `<job-id>` | Id of the job |
1195 | `<target-url>` | Target url for the job |
1196 | `<owner-id>` | Owner of the job |
1197 | `<template-job-file>` | Path to a job template for job parameters of the job |
1198 | `VALIIDATE` | Indicator to preform type validation at creation |
1200 ## Function: ics_api_idc_delete_job ##
1202 Test of DELETE '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1203 To test, provide all the specified parameters.
1207 | `<response-code> <type-id> <job-id>` |
1209 | parameter | description |
1210 | --------- | ----------- |
1211 | `<response-code>` | Expected http response code |
1212 | `<type-id>` | Id of the type |
1213 | `<job-id>` | Id of the job |
1215 ## Function: ics_api_idc_get_type ##
1217 Test of GET '/data-consumer/v1/info-types/{infoTypeId} and optional check of the returned schema.
1218 To test the response code only, provide the response code parameter as well as the type-id.
1219 To also test the response payload add a path to the expected schema file.
1223 | `<response-code> <type-id> [<schema-file>]` |
1225 | parameter | description |
1226 | --------- | ----------- |
1227 | `<response-code>` | Expected http response code |
1228 | `<type-id>` | Id of the Info type |
1229 | `<schema-file>` | Path to a schema file to compare with the returned schema |
1231 ## Function: ics_api_idc_get_job_status ##
1233 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' and optional check of the returned status and timeout.
1234 To test the response code only, provide the response code and job id.
1235 To also test the response payload add the expected status.
1239 | `<response-code> <job-id> [<status> [ <timeout>]]` |
1241 | parameter | description |
1242 | --------- | ----------- |
1243 | `<response-code>` | Expected http response code |
1244 | `<job-id>` | Id of the job |
1245 | `<status>` | Expected status |
1246 | `<timeout>` | Timeout |
1248 ## Function: ics_api_idc_get_job_status2 ##
1250 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' with returned producers and optional check of the returned status and timeout.
1251 To test the response code only, provide the response code and job id.
1252 To also test the response payload add the expected status.
1256 | `<response-code> <job-id> [<status> EMPTYPROD|( <prod-count> <producer-id>+ ) [<timeout>]]` |
1258 | parameter | description |
1259 | --------- | ----------- |
1260 | `<response-code>` | Expected http response code |
1261 | `<job-id>` | Id of the job |
1262 | `<status>` | Expected status |
1263 | `<EMPTYPROD>` | Indicated for empty list of producer |
1264 | `<prod-count>` | Number of expected producer |
1265 | `<producer-id>` |Id of the producer |
1266 | `<timeout>` | Timeout |
1269 ## Function: ics_api_idc_get_subscription_ids ##
1270 Test of GET '/data-consumer/v1/info-type-subscription' with the returned list of subscription ids
1274 | `<response-code> <owner-id>|NOOWNER [ EMPTY | <subscription-id>+]` |
1276 | parameter | description |
1277 | --------- | ----------- |
1278 | `<response-code>` | Expected http response code |
1279 | `<owner-id>` | Id of the owner |
1280 | `<NOOWNER>` | Indicator for empty owner |
1281 | `<EMPTY>` | Indicated for empty list of subscription ids |
1282 | `<subscription-id>` |Id of the subscription |
1284 ## Function: ics_api_idc_get_subscription ##
1285 Test of GET '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
1289 | `<response-code> <subscription-id> [ <owner-id> <status-uri> ]` |
1291 | parameter | description |
1292 | --------- | ----------- |
1293 | `<response-code>` | Expected http response code |
1294 | `<subscription-id>` |Id of the subscription |
1295 | `<owner-id>` | Id of the owner |
1296 | `<status-uri>` | Url for status notifications |
1299 ## Function: ics_api_idc_put_subscription ##
1300 Test of PUT '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
1304 | `<response-code> <subscription-id> <owner-id> <status-uri>` |
1306 | parameter | description |
1307 | --------- | ----------- |
1308 | `<response-code>` | Expected http response code |
1309 | `<subscription-id>` |Id of the subscription |
1310 | `<owner-id>` | Id of the owner |
1311 | `<status-uri>` | Url for status notifications |
1313 ## Function: ics_api_idc_delete_subscription ##
1314 Test of DELETE /data-consumer/v1/info-type-subscription/{subscriptionId}
1318 | `<response-code> <subscription-id>` |
1320 | parameter | description |
1321 | --------- | ----------- |
1322 | `<response-code>` | Expected http response code |
1323 | `<subscription-id>` |Id of the subscription |
1326 ## Function: ics_api_admin_reset ##
1328 Test of GET '/status'.
1332 | `<response-code> [ <type> ]` |
1334 | parameter | description |
1335 | --------- | ----------- |
1336 | `<response-code>` | Expected http response code |
1337 | `<type>` | Type id, if the interface supports type in url |
1339 ## Function: ics_kube_pvc_reset ##
1341 Admin reset to remove all data in ics; jobs, producers etc
1342 NOTE - only works in kubernetes and the pod should not be running
1348 # Description of functions in kafkapc_api_functions.sh #
1350 ## Function: use_kafkapc_http ##
1352 Use http for all calls to the KAFKAPC.
1357 ## Function: use_kafkapc_https ##
1359 Use https for all calls to the KAFKAPC.
1364 ## Function: start_kafkapc ##
1366 Start the KAFKAPC container in docker or kube depending on start mode
1371 ## Function: kafkapc_equal ##
1373 Tests if a variable value in the KAFKAPC is equal to a target value.
1374 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1375 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.
1376 See the 'mrstub' dir for more details.
1379 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1381 | parameter | description |
1382 | --------- | ----------- |
1383 | `<variable-name>` | Variable name in the KAFKAPC |
1384 | `<target-value>` | Target value for the variable |
1385 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1387 ## Function: kafkapc_api_reset ##
1389 Deep reset of KAFKAPC. Note that kafka itself is not affected, i.e. created topic still exist in kafka.
1394 ## Function: kafkapc_api_create_topic ##
1396 Create a topic in kafka via kafkapc.
1397 | `<response-code> <topic-name> <mime-type>` |
1399 | parameter | description |
1400 | --------- | ----------- |
1401 | `<response-code>` | Http response code |
1402 | `<topic-name>` | Name of the topic |
1403 | `<mime-type>` | Mime type of the data to send to the topic. Data on the topic is expected to be of this type |
1405 ## Function: kafkapc_api_get_topic ##
1407 Create a from kafkapc.
1408 | `<response-code> <topic-name> <mime-type>` |
1410 | parameter | description |
1411 | --------- | ----------- |
1412 | `<response-code>` | Http response code |
1413 | `<topic-name>` | Name of the topic |
1414 | `<mime-type>` | Mime type of the topic |
1416 ## Function: kafkapc_api_start_sending ##
1418 Start sending msg from the msg queue to kafka for a topic.
1419 | `<response-code> <topic-name>` |
1421 | parameter | description |
1422 | --------- | ----------- |
1423 | `<response-code>` | Http response code |
1424 | `<topic-name>` | Name of the topic |
1426 ## Function: kafkapc_api_start_receiving ##
1428 Start receiving msg from a kafka topic to the msg queue in kafkapc.
1429 | `<response-code> <topic-name>` |
1431 | parameter | description |
1432 | --------- | ----------- |
1433 | `<response-code>` | Http response code |
1434 | `<topic-name>` | Name of the topic |
1436 ## Function: kafkapc_api_stop_sending ##
1438 Stop sending msg from the msg queue to kafka for a topic.
1439 | `<response-code> <topic-name>` |
1441 | parameter | description |
1442 | --------- | ----------- |
1443 | `<response-code>` | Http response code |
1444 | `<topic-name>` | Name of the topic |
1446 ## Function: kafkapc_api_stop_receiving ##
1448 Stop receiving msg from a kafka topic to the msg queue in kafkapc.
1449 | `<response-code> <topic-name>` |
1451 | parameter | description |
1452 | --------- | ----------- |
1453 | `<response-code>` | Http response code |
1454 | `<topic-name>` | Name of the topic |
1456 ## Function: kafkapc_api_post_msg ##
1458 Send a message on a topic.
1461 | `<response-code> <topic> <mime-type> <msg>` |
1463 | parameter | description |
1464 | --------- | ----------- |
1465 | `<response-code>` | Http response code |
1466 | `<topic>` | Topic name |
1467 | `<mime-type>` | Mime type of the msg |
1468 | `<msg>` | String msg to send |
1470 ## Function: kafkapc_api_get_msg ##
1472 Get a message on a topic.
1475 | `<response-code> <topic> ([ <mime-type> <msg> ] | NOMSG )` |
1477 | parameter | description |
1478 | --------- | ----------- |
1479 | `<response-code>` | Http response code |
1480 | `<topic>` | Topic name |
1481 | `<mime-type>` | Mime type of the msg |
1482 | `<msg>` | String msg to receive |
1483 | `NOMSG` | Indicated for no msg |
1485 ## Function: kafkapc_api_post_msg_from_file ##
1487 Send a message in a file on a topic.
1490 | `<response-code> <topic> <mime-type> <file>` |
1492 | parameter | description |
1493 | --------- | ----------- |
1494 | `<response-code>` | Http response code |
1495 | `<topic>` | Topic name |
1496 | `<mime-type>` | Mime type of the msg |
1497 | `<file>` | Filepath to the string msg to send |
1499 ## Function: kafkapc_api_get_msg_from_file ##
1501 Get a message on a topic.
1504 | `<response-code> <topic> <mime-type> <file> ` |
1506 | parameter | description |
1507 | --------- | ----------- |
1508 | `<response-code>` | Http response code |
1509 | `<topic>` | Topic name |
1510 | `<mime-type>` | Mime type of the msg |
1511 | `<file>` | Filepath to the string msg to receive |
1513 ## Function: kafkapc_api_generate_json_payload_file ##
1515 Create json file with dummy data for payload.
1518 | `<size-in-kb> <filename>` |
1520 | parameter | description |
1521 | --------- | ----------- |
1522 | `<size-in-kb>` | Generated size in kb |
1523 | `<filename>` | Path to output file |
1525 ## Function: kafkapc_api_generate_text_payload_file ##
1527 Create file with dummy text data for payload.
1530 | `<size-in-kb> <filename>` |
1532 | parameter | description |
1533 | --------- | ----------- |
1534 | `<size-in-kb>` | Generated size in kb |
1535 | `<filename>` | Path to output file |
1537 # Description of functions in kubeproxy_api_functions.sh #
1539 ## Function: use_kube_proxy_http ##
1541 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.
1546 ## Function: use_kube_proxy_https ##
1548 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.
1553 ## Function: start_kube_proxy ##
1555 Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
1556 No proxy is started if the function is called in docker mode.
1561 # Description of functions in mr_api_functions.sh #
1563 ## Function: use_mr_http ##
1565 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.
1570 ## Function: use_mr_https ##
1572 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.
1577 ## Function: start_mr ##
1579 Start the Message Router stub interface container in docker or kube depending on start mode
1584 ## Function: dmaap_api_print_topics ##
1586 Prints the current list of topics in DMAAP MR
1592 ## Function: mr_equal ##
1594 Tests if a variable value in the Message Router (MR) simulator is equal to a target value.
1595 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1596 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.
1597 See the 'mrstub' dir for more details.
1600 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1602 | parameter | description |
1603 | --------- | ----------- |
1604 | `<variable-name>` | Variable name in the MR |
1605 | `<target-value>` | Target value for the variable |
1606 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1608 ## Function: mr_greater ##
1610 Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
1611 Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than the target or not.
1612 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.
1613 See the 'mrstub' dir for more details.
1616 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1618 | parameter | description |
1619 | --------- | ----------- |
1620 | `<variable-name>` | Variable name in the MR |
1621 | `<target-value>` | Target value for the variable |
1622 | `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value |
1624 ## Function: mr_read ##
1626 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.
1627 See the 'mrstub' dir for more details.
1630 | `<variable-name>` |
1632 | parameter | description |
1633 | --------- | ----------- |
1634 | `<variable-name>` | Variable name in the MR |
1636 ## Function: mr_print ##
1638 Prints the value of a variable in the Message Router (MR) simulator.
1639 See the 'mrstub' dir for more details.
1642 | `<variable-name>` |
1644 | parameter | description |
1645 | --------- | ----------- |
1646 | `<variable-name>` | Variable name in the MR |
1648 ## Function: mr_api_send_json ##
1650 Send json to topic in mr-stub.
1653 | `<topic-url> <json-msg>` |
1655 | parameter | description |
1656 | --------- | ----------- |
1657 | `<topic-url>` | Topic url |
1658 | `<json-msg>` | Json msg as string |
1660 ## Function: mr_api_send_text ##
1662 Send text to topic in mr-stub.
1665 | `<topic-url> <text-msg>` |
1667 | parameter | description |
1668 | --------- | ----------- |
1669 | `<topic-url>` | Topic url |
1670 | `<text-msg>` | Text (string) msg |
1674 ## Function: mr_api_send_json_file ##
1676 Send json to topic in mr-stub.
1679 | `<topic-url> <json-file>` |
1681 | parameter | description |
1682 | --------- | ----------- |
1683 | `<topic-url>` | Topic url |
1684 | `<json-file>` | Path to file with json msg as string |
1686 ## Function: mr_api_send_text_file ##
1688 Send text to topic in mr-stub.
1691 | `<topic-url> <text-file>` |
1693 | parameter | description |
1694 | --------- | ----------- |
1695 | `<topic-url>` | Topic url |
1696 | `<text-file>` | Path to file with text msg as string |
1698 ## Function: mr_api_generate_json_payload_file ##
1700 Create json file with dummy data for payload.
1703 | `<size-in-kb> <filename>` |
1705 | parameter | description |
1706 | --------- | ----------- |
1707 | `<size-in-kb>` | Generated size in kb |
1708 | `<filename>` | Path to output file |
1710 ## Function: mr_api_generate_text_payload_file ##
1712 Create file with dummy text data for payload.
1715 | `<size-in-kb> <filename>` |
1717 | parameter | description |
1718 | --------- | ----------- |
1719 | `<size-in-kb>` | Generated size in kb |
1720 | `<filename>` | Path to output file |
1722 # Description of functions in ngw_api_functions.sh #
1724 ## Function: use_gateway_http ##
1726 Use http for all calls to the gateway. This is set by default.
1731 ## Function: use_gateway_https ##
1733 Use https for all calls to the gateway.
1738 ## Function: set_gateway_debug ##
1740 Set debug level logging in the gateway
1745 ## Function: set_gateway_trace ##
1747 Set debug level logging in the trace
1752 ## Function: start_gateway ##
1754 Start the the gateway container in docker or kube depending on start mode
1759 ## Function: gateway_pms_get_status ##
1761 Sample test of pms api (status)
1762 Only response code tested - not payload
1765 | `<response-code>` |
1767 | parameter | description |
1768 | --------- | ----------- |
1769 | `<response-code>` | Expected http response code |
1771 ## Function: gateway_ics_get_types ##
1773 Sample test of ics api (get types)
1774 Only response code tested - not payload
1777 | `<response-code>` |
1779 | parameter | description |
1780 | --------- | ----------- |
1781 | `<response-code>` | Expected http response code |
1783 # Description of functions in pa_api_functions.sh #
1787 Both PMS version 1 and 2 are supported. The version is controlled by the env variable `$PMS_VERSION` set in the test env file.
1788 For api function in version 2, an url prefix is added if configured.
1790 ## Function: use_agent_rest_http ##
1792 Use http for all API calls to the Policy Agent. This is the default.
1797 ## Function: use_agent_rest_https ##
1799 Use https for all API calls to the Policy Agent.
1804 ## Function: use_agent_dmaap_http ##
1806 Send and recieve all API calls to the Policy Agent over Dmaap via the MR over http.
1811 ## Function: use_agent_dmaap_https ##
1813 Send and recieve all API callss to the Policy Agent over Dmaap via the MR over https.
1818 ## Function: start_policy_agent ##
1820 Start the Policy Agent container or corresponding kube resources depending on docker/kube mode.
1823 | `<logfile-prefix>` |
1824 | (docker) `PROXY\|NOPROXY <config-file>` |
1825 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
1827 | parameter | description |
1828 | --------- | ----------- |
1829 | `PROXY` | Configure with http proxy, if proxy is started |
1830 | `NOPROXY` | Configure without http proxy |
1831 | `<config-file>`| Path to application.yaml |
1832 | `<data-file>` | Optional path to application_configuration.json |
1834 ## Function: stop_policy_agent ##
1836 Stop the pms container (docker) or scale it to zero (kubernetes).
1841 ## Function: start_stopped_policy_agent ##
1843 Start a previousely stopped pms container (docker) or scale it to 1 (kubernetes).
1848 ## Function: prepare_consul_config ##
1850 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')
1853 | `SDNC|NOSDNC <output-file>` |
1855 | parameter | description |
1856 | --------- | ----------- |
1857 | `SDNC` | Configure with controller |
1858 | `NOSDNC` | Configure without controller |
1859 | `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app' |
1861 ## Function: agent_load_config ##
1863 Load the config into a config map (kubernetes only).
1868 | parameter | description |
1869 | --------- | ----------- |
1870 | `<data-file>` | Path to application_configuration.json |
1872 ## Function: set_agent_debug ##
1874 Configure the Policy Agent log on debug level. The Policy Agent must be running.
1879 ## Function: set_agent_trace ##
1881 Configure the Policy Agent log on trace level. The Policy Agent must be running.
1886 ## Function: use_agent_retries ##
1888 Configure the Policy Agent to make upto 5 retries if an API calls return any of the specified http return codes.
1891 | `[<response-code>]*` |
1893 ## Function: check_policy_agent_logs ##
1895 Check the Policy Agent log for any warnings and errors and print the count of each.
1900 ## Function: api_equal ##
1902 Tests if the array length of a json array in the Policy Agent simulator is equal to a target value.
1903 Without the timeout, the test sets pass or fail immediately depending on if the array length is equal to the target or not.
1904 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.
1905 See the 'cr' dir for more details.
1909 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1911 | parameter | description |
1912 | --------- | ----------- |
1913 | `<variable-name>` | Relative url. Example 'json:policy_types' - checks the json array length of the url /policy_types |
1914 | `<target-value>` | Target value for the length |
1915 | `<timeout-in-sec>` | Max time to wait for the length to reach the target value |
1917 ## Function: api_get_policies ##
1919 Test of GET '/policies' or V2 GET '/v2/policy-instances' and optional check of the array of returned policies.
1920 To test the response code only, provide the response code parameter as well as the following three parameters.
1921 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.
1925 | `<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>]*]` |
1929 | `<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>]*]` |
1931 | parameter | description |
1932 | --------- | ----------- |
1933 | `<response-code>` | Expected http response code |
1934 | `<ric-id>` | Id of the ric |
1935 | `NORIC` | Indicator that no ric is provided |
1936 | `<service-id>` | Id of the service |
1937 | `NOSERVICE` | Indicator that no service id is provided |
1938 | `<policy-type-id>` | Id of the policy type |
1939 | `NOTYPE` | Indicator that no type id is provided |
1940 | `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
1941 | `<policy-id>` | Id of the policy |
1942 | `EMPTY` | Indicate for the special empty policy type |
1943 | `transient` | Transient, true or false |
1944 | `notification-url` | Url for notifications |
1945 | `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
1947 ## Function: api_get_policy ##
1949 Test of GET '/policy' or V2 GET '/v2/policies/{policy_id}' and optional check of the returned json payload.
1950 To test the the response code only, provide the expected response code and policy id.
1951 To test the contents of the returned json payload, add a path to the template file used when creating the policy.
1955 | `<response-code> <policy-id> [<template-file>]` |
1959 | `<response-code> <policy-id> [ <template-file> <service-name> <ric-id> <policytype-id>\|NOTYPE <transient> <notification-url>\|NOURL ]` |
1961 | parameter | description |
1962 | --------- | ----------- |
1963 | `<response-code>` | Expected http response code |
1964 | `<policy-id>` | Id of the policy |
1965 | `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
1966 | `<service-id>` | Id of the service |
1967 | `<ric-id>` | Id of the ric |
1968 | `<policy-type-id>` | Id of the policy type |
1969 | `NOTYPE` | Indicator that no type id is provided |
1970 | `transient` | Transient, true or false |
1971 | `notification-url` | Url for notifications |
1973 ## Function: api_put_policy ##
1975 Test of PUT '/policy' or V2 PUT '/policies'.
1976 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).
1980 | `<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]` |
1984 | `<response-code> <service-name> <ric-id> <policytype-id>\|NOTYPE <policy-id> <transient>\|NOTRANSIENT <notification-url>\|NOURL <template-file> [<count>]` |
1986 | parameter | description |
1987 | --------- | ----------- |
1988 | `<response-code>` | Expected http response code |
1989 | `<service-id>` | Id of the service |
1990 | `<ric-id>` | Id of the ric |
1991 | `<policy-type-id>` | Id of the policy type |
1992 | `<policy-id>` | Id of the policy. This value shall be a numeric value if more than one policy shall be created |
1993 | `transient>` | Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provided) |
1994 | `notification-url` | Url for notifications |
1995 |`NOURL`| Indicator for no url |
1996 | `<template-file>` | Path to the template file for the policy |
1997 | `<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 |
1999 ## Function: api_put_policy_batch ##
2001 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.
2002 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.
2003 For arg list and parameters, see 'api_put_policy'.
2005 ## Function: api_put_policy_parallel ##
2007 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.
2011 | `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <template-file> <count-per-ric> <number-of-threads>`
2015 | `<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>`
2017 | parameter | description |
2018 | --------- | ----------- |
2019 | `<response-code>` | Expected http response code |
2020 | `<service-id>` | Id of the service |
2021 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing |
2022 | `<number-of-rics>` | The number of rics, assuming the first index is '1'. The index is added to the 'ric-id-base' id |
2023 | `<policy-type-id>` | Id of the policy type |
2024 | `<policy-start-id>` | Id of the policy. This value shall be a numeric value and will be the id of the first policy |
2025 | `transient>` | Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provide) |
2026 | `notification-url` | Url for notifications |
2027 | `<template-file>` | Path to the template file for the policy |
2028 | `<count-per-ric>` | Number of policies per ric |
2029 | `<number-of-threads>` | Number of threads (processes) to run in parallel |
2031 ## Function: api_delete_policy ##
2033 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.
2037 | `<response-code> <policy-id> [<count>]`
2039 | parameter | description |
2040 | --------- | ----------- |
2041 | `<response-code>` | Expected http response code |
2042 | `<policy-id>` | Id of the policy |
2043 | `<count>` | An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
2045 ## Function: api_delete_policy_batch ##
2047 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.
2048 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.
2049 For arg list and parameters, see 'api_delete_policy'.
2051 ## Function: api_delete_policy_parallel ##
2053 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.
2057 | `<response-code> <ric-id-base> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>`
2059 | parameter | description |
2060 | --------- | ----------- |
2061 | `<response-code>` | Expected http response code |
2062 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing |
2063 | `<number-of-rics>` | The number of rics, assuming the first index is '1' |
2064 | `<policy-start-id>` | Id of the policy. This value shall be a numeric value and will be the id of the first policy |
2065 | `<count-per-ric>` | Number of policies per ric |
2066 | `<number-of-threads>` | Number of threads (processes) to run in parallel |
2068 ## Function: api_get_policy_ids ##
2070 Test of GET '/policy_ids' or V2 GET '/v2/policies'.
2071 To test response code only, provide the response code parameter as well as the following three parameters.
2072 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.
2076 | `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <type-id>\|NOTYPE ([<policy-instance-id]*\|NOID)` |
2078 | parameter | description |
2079 | --------- | ----------- |
2080 | `<response-code>` | Expected http response code |
2081 | `<ric-id>` | Id of the ric |
2082 | `NORIC` | Indicator that no ric is provided |
2083 | `<service-id>` | Id of the service |
2084 | `NOSERVICE` | Indicator that no service id is provided |
2085 | `type-id>` | Id of the policy type |
2086 | `NOTYPE` | Indicator that no type id is provided |
2087 | `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
2088 | `<policy-instance-id>` | Id of the policy |
2090 ## Function: api_get_policy_schema ##
2092 Test of V2 GET '/v2/policy-types/{policyTypeId}' and optional check of the returned json schema.
2093 To test the response code only, provide the expected response code and policy type id.
2094 To test the contents of the returned json schema, add a path to a schema file to compare with.
2098 | `<response-code> <policy-type-id> [<schema-file>]` |
2100 | parameter | description |
2101 | --------- | ----------- |
2102 | `<response-code>` | Expected http response code |
2103 | `<policy-type-id>` | Id of the policy type |
2104 | `<schema-file>` | Path to the schema file for the policy type |
2106 ## Function: api_get_policy_schema ##
2108 Test of GET '/policy_schema' and optional check of the returned json schema.
2109 To test the response code only, provide the expected response code and policy type id.
2110 To test the contents of the returned json schema, add a path to a schema file to compare with.
2114 | `<response-code> <policy-type-id> [<schema-file>]` |
2116 | parameter | description |
2117 | --------- | ----------- |
2118 | `<response-code>` | Expected http response code |
2119 | `<policy-type-id>` | Id of the policy type |
2120 | `<schema-file>` | Path to the schema file for the policy type |
2122 ## Function: api_get_policy_schemas ##
2124 Test of GET '/policy_schemas' and optional check of the returned json schemas.
2125 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
2126 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)
2130 | `<response-code> <ric-id>\|NORIC [<schema-file>\|NOFILE]*` |
2132 | parameter | description |
2133 | --------- | ----------- |
2134 | `<response-code>` | Expected http response code |
2135 | `<ric-id>` | Id of the ric |
2136 | `NORIC` | No ric id given |
2137 | `<schema-file>` | Path to the schema file for the policy type |
2138 | `NOFILE` | Indicate the template for an empty type |
2140 ## Function: api_get_policy_status ##
2142 Test of GET '/policy_status' or V2 GET '/policies/{policy_id}/status'.
2146 | `<response-code> <policy-id> (STD\|STD2 <enforce-status>\|EMPTY [<reason>\|EMPTY])\|(OSC <instance-status> <has-been-deleted>)` |
2148 | parameter | description |
2149 | --------- | ----------- |
2150 | `<response-code>` | Expected http response code |
2151 | `<policy-id>` | Id of the policy |
2152 | `STD` | Indicator of status of Standarized A1 |
2153 | `STD2` | Indicator of status of Standarized A1 version 2 |
2154 | `<enforce-status>` | Enforcement status |
2155 | `<reason>` | Optional reason |
2156 | `EMPTY` | Indicator of empty string status or reason |
2157 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
2158 | `<instance-status>` | Instance status |
2159 | `<has-been-deleted>` | Deleted status, true or false |
2161 ## Function: api_get_policy_types ##
2163 Test of GET '/policy_types' or V2 GET '/v2/policy-types' and optional check of the returned ids.
2164 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
2165 To test the contents of the returned json payload, add the list of expected policy type id (or 'EMPTY' for the '{}' type)
2169 | `<response-code> [<ric-id>\|NORIC [<policy-type-id>\|EMPTY [<policy-type-id>]*]]` |
2171 | parameter | description |
2172 | --------- | ----------- |
2173 | `<response-code>` | Expected http response code |
2174 | `<ric-id>` | Id of the ric |
2175 | `NORIC` | No ric id given |
2176 | `<policy-type-id>` | Id of the policy type |
2177 | `EMPTY` | Indicate the empty type |
2179 ## Function: api_get_status ##
2181 Test of GET /status or V2 GET /status
2185 | `<response-code>` |
2187 | parameter | description |
2188 | --------- | ----------- |
2189 | `<response-code>` | Expected http response code |
2191 ## Function: api_get_ric ##
2193 Test of GET '/ric' or V2 GET '/v2/rics/ric'
2194 To test the response code only, provide the expected response code and managed element id.
2195 To test the returned ric id, provide the expected ric id.
2199 | `<reponse-code> <managed-element-id> [<ric-id>]` |
2203 | `<reponse-code> <management-element-id>\|NOME <ric-id>\|<NORIC> [<string-of-ricinfo>]` |
2205 | parameter | description |
2206 | --------- | ----------- |
2207 | `<response-code>` | Expected http response code |
2208 | `<managed-element-id>` | Id of the managed element |
2209 | `NOME` | Indicator for no ME |
2210 | `ric-id` | Id of the ric |
2211 | `NORIC` | Indicator no RIC |
2212 | `string-of-ricinfo` | String of ric info |
2214 ## Function: api_get_rics ##
2216 Test of GET '/rics' or V2 GET '/v2/rics' and optional check of the returned json payload (ricinfo).
2217 To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
2218 To test also the returned payload, add the formatted string of info in the returned payload.
2219 Format of ricinfo: <br>`<ric-id>:<list-of-mes>:<list-of-policy-type-ids>`<br>
2220 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_........."`
2224 | `<reponse-code> <policy-type-id>\|NOTYPE [<space-separate-string-of-ricinfo>]` |
2226 | parameter | description |
2227 | --------- | ----------- |
2228 | `<response-code>` | Expected http response code |
2229 | `<policy-type-id>` | Policy type id of the ric |
2230 | `NOTYPE>` | No type given |
2231 | `<space-separate-string-of-ricinfo>` | A space separated string of ric info - needs to be quoted |
2233 ## Function: api_put_service ##
2235 Test of PUT '/service' or V2 PUT '/service'.
2238 | `<response-code> <service-name> <keepalive-timeout> <callbackurl>` |
2240 | parameter | description |
2241 | --------- | ----------- |
2242 | `<response-code>` | Expected http response code |
2243 | `<service-name>` | Service name |
2244 | `<keepalive-timeout>` | Timeout value |
2245 | `<callbackurl>` | Callback url |
2247 ## Function: api_get_services ##
2249 Test of GET '/service' or V2 GET '/v2/services' and optional check of the returned json payload.
2250 To test only the response code, omit all parameters except the expected response code.
2251 To test the returned json, provide the parameters after the response code.
2255 | `<response-code> [ (<query-service-name> <target-service-name> <keepalive-timeout> <callbackurl>) \| (NOSERVICE <target-service-name> <keepalive-timeout> <callbackurl> [<target-service-name> <keepalive-timeout> <callbackurl>]* )]` |
2257 | parameter | description |
2258 | --------- | ----------- |
2259 | `<response-code>` | Expected http response code |
2260 | `<query-service-name>` | Service name for the query |
2261 | `<target-service-name>` | Target service name|
2262 | `<keepalive-timeout>` | Timeout value |
2263 | `<callbackurl>` | Callback url |
2264 | `NOSERVICE` | Indicator of no target service name |
2266 ## Function: api_get_service_ids ##
2268 Test of GET '/services' or V2 GET /'v2/services'. Only check of service ids.
2272 | `<response-code> [<service-name>]*` |
2274 | parameter | description |
2275 | --------- | ----------- |
2276 | `<response-code>` | Expected http response code |
2277 | `<service-name>` | Service name |
2279 ## Function: api_delete_services ##
2281 Test of DELETE '/services' or V2 DELETE '/v2/services/{serviceId}'
2285 | `<response-code> [<service-name>]*` |
2287 | parameter | description |
2288 | --------- | ----------- |
2289 | `<response-code>` | Expected http response code |
2290 | `<service-name>` | Service name |
2292 ## Function: api_put_services_keepalive ##
2294 Test of PUT '/services/keepalive' or V2 PUT '/v2/services/{service_id}/keepalive'
2298 | `<response-code> <service-name>` |
2300 | parameter | description |
2301 | --------- | ----------- |
2302 | `<response-code>` | Expected http response code |
2303 | `<service-name>` | Service name |
2305 ## Function: api_put_configuration ##
2307 Test of PUT '/v2/configuration'
2311 | `<response-code> <config-file>` |
2313 | parameter | description |
2314 | --------- | ----------- |
2315 | `<response-code>` | Expected http response code |
2316 | `<config-file>` | Path json config file |
2318 ## Function: api_get_configuration ##
2320 Test of GET '/v2/configuration'
2324 | `<response-code> [<config-file>]` |
2326 | parameter | description |
2327 | --------- | ----------- |
2328 | `<response-code>` | Expected http response code |
2329 | `<config-file>` | Path json config file to compare the retrieved config with |
2331 ## Function: pms_kube_pvc_reset ##
2332 Admin reset to remove all policies and services
2333 All types and instances etc are removed - types and instances in a1 sims need to be removed separately
2334 NOTE - only works in kubernetes and the pod should not be running
2341 # Description of functions in prodstub_api_functions.sh #
2343 ## Function: use_prod_stub_http ##
2345 Use http for the API. The admin API is not affected. This is the default protocol.
2350 ## Function: use_prod_stub_https ##
2352 Use https for the API. The admin API is not affected.
2357 ## Function: start_prod_stub ##
2359 Start the Producer stub container in docker or kube depending on start mode
2364 ## Function: prodstub_arm_producer ##
2366 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
2370 | `<response-code> <producer-id> [<forced_response_code>]` |
2372 | parameter | description |
2373 | --------- | ----------- |
2374 | `<response-code>` | Expected http response code |
2375 | `<producer-id>` | Id of the producer |
2376 | `<forced_response_code>` | Forced response code for the producer callback url |
2378 ## Function: prodstub_arm_job_create ##
2380 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.
2384 | `<response-code> <job-id> [<forced_response_code>]` |
2386 | parameter | description |
2387 | --------- | ----------- |
2388 | `<response-code>` | Expected http response code |
2389 | `<job-id>` | Id of the job |
2390 | `<forced_response_code>` | Forced response code for the create callback url |
2392 ## Function: prodstub_arm_job_delete ##
2394 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.
2398 | `<response-code> <job-id> [<forced_response_code>]` |
2400 | parameter | description |
2401 | --------- | ----------- |
2402 | `<response-code>` | Expected http response code |
2403 | `<job-id>` | Id of the job |
2404 | `<forced_response_code>` | Forced response code for the delete callback url |
2406 ## Function: prodstub_arm_type ##
2408 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
2412 | `<response-code> <producer-id> <type-id>` |
2414 | parameter | description |
2415 | --------- | ----------- |
2416 | `<response-code>` | Expected http response code |
2417 | `<producer-id>` | Id of the producer |
2418 | `<type-id>` | Id of the type |
2420 ## Function: prodstub_disarm_type ##
2422 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
2426 | `<response-code> <producer-id> <type-id>` |
2428 | parameter | description |
2429 | --------- | ----------- |
2430 | `<response-code>` | Expected http response code |
2431 | `<producer-id>` | Id of the producer |
2432 | `<type-id>` | Id of the type |
2434 ## Function: prodstub_check_jobdata ##
2436 Check a job in the prodstub towards the list of provided parameters.
2440 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2442 | parameter | description |
2443 | --------- | ----------- |
2444 | `<response-code>` | Expected http response code |
2445 | `<producer-id>` | Id of the producer |
2446 | `<job-id>` | Id of the job |
2447 | `<type-id>` | Id of the type |
2448 | `<target-url>` | Target url for data delivery |
2449 | `<job-owner>` | Id of the job owner |
2450 | `<template-job-file>` | Path to a job template file |
2452 ## Function: prodstub_check_jobdata_2 ##
2454 Check a job in the prodstub towards the list of provided parameters.
2458 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2460 | parameter | description |
2461 | --------- | ----------- |
2462 | `<response-code>` | Expected http response code |
2463 | `<producer-id>` | Id of the producer |
2464 | `<job-id>` | Id of the job |
2465 | `<type-id>` | Id of the type |
2466 | `<target-url>` | Target url for data delivery |
2467 | `<job-owner>` | Id of the job owner |
2468 | `<template-job-file>` | Path to a job template file |
2470 ## Function: prodstub_check_jobdata_3 ##
2472 Check a job in the prodstub towards the list of provided parameters.
2476 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2478 | parameter | description |
2479 | --------- | ----------- |
2480 | `<response-code>` | Expected http response code |
2481 | `<producer-id>` | Id of the producer |
2482 | `<job-id>` | Id of the job |
2483 | `<type-id>` | Id of the type |
2484 | `<target-url>` | Target url for data delivery |
2485 | `<job-owner>` | Id of the job owner |
2486 | `<template-job-file>` | Path to a job template file |
2488 ## Function: prodstub_delete_jobdata ##
2490 Delete the job parameters, job data, for a job.
2494 | `<response-code> <producer-id> <job-id>` |
2496 | parameter | description |
2497 | --------- | ----------- |
2498 | `<response-code>` | Expected http response code |
2499 | `<producer-id>` | Id of the producer |
2500 | `<job-id>` | Id of the job |
2502 ## Function: prodstub_equal ##
2504 Tests if a variable value in the prodstub is equal to a target value.
2505 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2506 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.
2510 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2512 | parameter | description |
2513 | --------- | ----------- |
2514 | `<variable-name>` | Variable name in the prostub |
2515 | `<target-value>` | Target value for the variable |
2516 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2518 # Description of functions in rc_api_function.sh #
2520 ## Function: use_rapp_catalogue_http ##
2522 Use http for the API. This is the default protocol.
2527 ## Function: use_rapp_catalogue_https ##
2529 Use https for the API.
2534 ## Function: start_rapp_catalogue ##
2536 Start the rapp catalogue container in docker or kube depending on start mode
2541 ## Function: rc_equal ##
2543 Tests if a variable value in the RAPP Catalogue is equal to a target value.
2544 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2545 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.
2546 See the 'cr' dir for more details.
2549 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2551 | parameter | description |
2552 | --------- | ----------- |
2553 | `<variable-name>` | Variable name in the RC |
2554 | `<target-value>` | Target value for the variable |
2555 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2557 ## Function: rapp_cat_api_get_services ##
2559 Check all registered services.
2563 | `<response-code> [(<service-id> <version> <display-name> <description>)+ \| EMPTY ]` |
2565 | parameter | description |
2566 | --------- | ----------- |
2567 | `<response-code>` | Expected http response code |
2568 | `<service-id>` | Id of the service |
2569 | `<version>` | Version of the service |
2570 | `<display-name>` | Dislay name of the service |
2571 | `<description>` | Description of the service |
2572 | `EMPTY` | Indicator for an empty list |
2574 ## Function: rapp_cat_api_put_service ##
2576 Register a services.
2580 | `<response-code> <service-id> <version> <display-name> <description>` |
2582 | parameter | description |
2583 | --------- | ----------- |
2584 | `<response-code>` | Expected http response code |
2585 | `<service-id>` | Id of the service |
2586 | `<version>` | Version of the service |
2587 | `<display-name>` | Dislay name of the service |
2588 | `<description>` | Description of the service |
2590 ## Function: rapp_cat_api_get_service ##
2592 Check a registered service.
2596 | `<response-code> <service-id> <version> <display-name> <description>` |
2598 | parameter | description |
2599 | --------- | ----------- |
2600 | `<response-code>` | Expected http response code |
2601 | `<service-id>` | Id of the service |
2602 | `<version>` | Version of the service |
2603 | `<display-name>` | Dislay name of the service |
2604 | `<description>` | Description of the service |
2606 ## Function: rapp_cat_api_delete_service ##
2608 Check a registered service.
2612 | `<response-code> <service-id>` |
2614 | parameter | description |
2615 | --------- | ----------- |
2616 | `<response-code>` | Expected http response code |
2617 | `<service-id>` | Id of the service |
2619 # Description of functions in ricsim_api_functions.sh #
2621 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
2623 ## Function: use_simulator_http ##
2625 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.
2630 ## Function: use_simulator_https ##
2632 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.
2637 ## Function: start_ric_simulators ##
2639 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
2642 | `ricsim_g1\|ricsim_g2\|ricsim_g3 <count> <interface-id>` |
2644 | parameter | description |
2645 | --------- | ----------- |
2646 | `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 |
2647 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
2648 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
2650 ## Function: get_kube_sim_host ##
2652 Translate ric name to kube host name.
2657 | parameter | description |
2658 | --------- | ----------- |
2659 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
2661 ## Function: generate_policy_uuid ##
2663 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
2664 UUID is then automatically added to the policy id in GET/PUT/DELETE.
2669 ## Function: sim_equal ##
2671 Tests if a variable value in the RIC simulator is equal to a target value.
2672 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2673 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.
2674 See the 'a1-interface' repo for more details.
2678 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2680 | parameter | description |
2681 | --------- | ----------- |
2682 | `<variable-name>` | Variable name in the ric simulator |
2683 | `<target-value>` | Target value for the variable |
2684 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2686 ## Function: sim_print ##
2688 Prints the value of a variable in the RIC simulator.
2689 See the 'a1-interface' repo for more details.
2693 | `<variable-name>` |
2695 | parameter | description |
2696 | --------- | ----------- |
2697 | `<variable-name>` | Variable name in the RIC simulator |
2699 ## Function: sim_contains_str ##
2701 Tests if a variable value in the RIC simulator contains a target string.
2702 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
2703 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.
2704 See the 'a1-interface' repo for more details.
2708 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2710 | parameter | description |
2711 | --------- | ----------- |
2712 | `<variable-name>` | Variable name in the ric simulator |
2713 | `<target-value>` | Target substring for the variable |
2714 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2716 ## Function: sim_put_policy_type ##
2718 Loads a policy type to the simulator
2722 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
2724 | parameter | description |
2725 | --------- | ----------- |
2726 | `<response-code>` | Expected http response code |
2727 | `<ric-id>` | Id of the ric |
2728 | `<policy-type-id>` | Id of the policy type |
2729 | `<policy-type-file>` | Path to the schema file of the policy type |
2731 ## Function: sim_delete_policy_type ##
2733 Deletes a policy type from the simulator
2737 | `<response-code> <ric-id> <policy_type_id>` |
2739 | parameter | description |
2740 | --------- | ----------- |
2741 | `<response-code>` | Expected http response code |
2742 | `<ric-id>` | Id of the ric |
2743 | `<policy-type-id>` | Id of the policy type |
2745 ## Function: sim_post_delete_instances ##
2747 Deletes all instances (and status), for one ric
2751 | `<response-code> <ric-id>` |
2753 | parameter | description |
2754 | --------- | ----------- |
2755 | `<response-code>` | Expected http response code |
2756 | `<ric-id>` | Id of the ric |
2758 ## Function: sim_post_delete_all ##
2760 Deletes all types, instances (and status), for one ric
2764 | `<response-code> <ric-id>` |
2766 | parameter | description |
2767 | --------- | ----------- |
2768 | `<response-code>` | Expected http response code |
2769 | `<ric-id>` | Id of the ric |
2771 ## Function: sim_post_forcedresponse ##
2773 Sets (or resets) response code for next (one) A1 message, for one ric.
2774 The intention is to simulate error response on the A1 interface.
2778 | `<response-code> <ric-id> [<forced_response_code>]`|
2780 | parameter | description |
2781 | --------- | ----------- |
2782 | `<response-code>` | Expected http response code |
2783 | `<ric-id>` | Id of the ric |
2784 | `<forced_response_code>` | Http response code to send |
2786 ## Function: sim_post_forcedelay ##
2788 Sets (or resets) A1 response delay, for one ric
2789 The intention is to delay responses on the A1 interface. Setting remains until removed.
2793 | `<response-code> <ric-id> [<delay-in-seconds>]`|
2795 | parameter | description |
2796 | --------- | ----------- |
2797 | `<response-code>` | Expected http response code |
2798 | `<ric-id>` | Id of the ric |
2799 | `<delay-in-seconds>` | Delay in seconds. If omitted, the delay is removed |
2801 # Description of functions in sdnc_api_functions.sh #
2803 The file contains a selection of the possible API tests towards the SDNC (a1-controller)
2805 ## Function: use_sdnc_http ##
2807 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.
2812 ## Function: use_sdnc_https ##
2814 Use https for all API calls towards the SDNC A1 Controller. Note that this function shall be called before preparing the config for Consul.
2819 ## Function: start_sdnc ##
2821 Start the SDNC A1 Controller container and its database container
2826 ## Function: stop_sdnc ##
2828 Stop the SDNC A1 Controller container and its database container
2833 ## Function: start_stopped_sdnc ##
2835 Start a previously stopped SDNC
2840 ## Function: check_sdnc_logs ##
2842 Check the SDNC log for any warnings and errors and print the count of each.
2847 ## Function: controller_api_get_A1_policy_ids ##
2849 Test of GET policy ids towards OSC or STD type simulator.
2850 To test response code only, provide the response code, 'OSC' + policy type or 'STD'
2851 To test the response payload, include the ids of the expexted response.
2855 | `<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) \| ( STD <ric-id> [ <policy-id> [<policy-id>]* ]` |
2857 | parameter | description |
2858 | --------- | ----------- |
2859 | `<response-code>` | Expected http response code |
2860 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
2861 | `<ric-id>` | Id of the ric |
2862 | `policy-type-id>` | Id of the policy type |
2863 | `<policy-id>` | Id of the policy |
2864 | `STD` | Indicator of status of Standarized A1 |
2866 ## Function: controller_api_get_A1_policy_type ##
2868 Test of GET a policy type (OSC only)
2872 | `<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]` |
2874 | parameter | description |
2875 | --------- | ----------- |
2876 | `<response-code>` | Expected http response code |
2877 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
2878 | `<ric-id>` | Id of the ric |
2879 | `policy-type-id>` | Id of the policy type |
2880 | `policy-type-file>` | Optional schema file to compare the returned type with |
2882 ## Function: controller_api_delete_A1_policy ##
2884 Deletes a policy instance
2888 | `(STD <ric-id> <policy-id>) \| (OSC <ric-id> <policy-type-id> <policy-id>)` |
2890 | parameter | description |
2891 | --------- | ----------- |
2892 | `<response-code>` | Expected http response code |
2893 | `STD` | Indicator of status of Standarized A1 |
2894 | `<ric-id>` | Id of the ric |
2895 | `<policy-id>` | Id of the policy |
2896 | `policy-type-id>` | Id of the policy type |
2897 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
2898 | `policy-type-file>` | Optional schema file to compare the returned type with |
2900 ## Function: controller_api_put_A1_policy ##
2902 Creates a policy instance
2906 | `<response-code> (STD <ric-id> <policy-id> <template-file> ) \| (OSC <ric-id> <policy-type-id> <policy-id> <template-file>)` |
2908 | parameter | description |
2909 | --------- | ----------- |
2910 | `<response-code>` | Expected http response code |
2911 | `STD` | Indicator of status of Standarized A1 |
2912 | `<ric-id>` | Id of the ric |
2913 | `<policy-id>` | Id of the policy |
2914 | `<template-file>` | Path to the template file of the policy|
2915 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
2916 | `<policy-type-id>` | Id of the policy type |
2918 ## Function: controller_api_get_A1_policy_status ##
2920 Checks the status of a policy
2924 | `<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) \| (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)` |
2926 | parameter | description |
2927 | --------- | ----------- |
2928 | `<response-code>` | Expected http response code |
2929 | `STD` | Indicator of status of Standarized A1 |
2930 | `<ric-id>` | Id of the ric |
2931 | `<policy-id>` | Id of the policy |
2932 | `<enforce-status>` | Enforcement status |
2933 | `<reason>` | Optional reason |
2934 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
2935 | `<policy-type-id>` | Id of the policy type |
2936 | `<instance-status>` | Instance status |
2937 | `<has-been-deleted>` | Deleted status, true or false |
2942 Copyright (C) 2020 Nordix Foundation. All rights reserved.
2943 Licensed under the Apache License, Version 2.0 (the "License");
2944 you may not use this file except in compliance with the License.
2945 You may obtain a copy of the License at
2947 http://www.apache.org/licenses/LICENSE-2.0
2949 Unless required by applicable law or agreed to in writing, software
2950 distributed under the License is distributed on an "AS IS" BASIS,
2951 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2952 See the License for the specific language governing permissions and
2953 limitations under the License.