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 Agent, A1 Controller and Ric (A1) simulator. The test environment supports both test with docker and kubernetes(still experimental)
4 Some of the scripts can also be used for other kinds of tests, for example basic tests.
6 ## Overview for common test scripts and files ##
8 `agent_api_functions.sh` \
9 Contains functions for adapting towards the Policy Management Service (PMS) API, also via dmaap (using a message-router stub interface)
12 A common curl based function for the agent and ecs apis. Also partly used for the Callback receiver and RAPP Catalogue apis.
15 Cleans all services, deployments, pods, replica set etc started by the test environment in kubernetes.
18 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'.
20 `consul_cbs_function.sh` \
21 Contains functions for managing Consul and CBS as well as create the configuration for the PMS.
23 `control_panel_api_function.sh` \
24 Contains functions for managing Control Panel.
26 `controller_api_functions.sh` \
27 Contains functions for adaping towards the A1-controller API.
29 `count_json_elements.py` \
30 A python script returning the number of items in a json array.
32 `cr_api_functions.sh` \
33 Contains functions for adapting towards the Callback receiver for checking received callback event.
35 `create_policies_process.py` \
36 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.
38 `create_rics_json.py` \
39 A python script to create a json file from a formatted string of ric info. Helper for the test enviroment.
41 `delete_policies_process.py` \
42 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.
45 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)
47 `ecs_api_functions.sh` \
48 Contains functions for adapting towards the ECS API
50 `extract_sdnc_reply.py` \
51 A python script to extract the information from an sdnc (A1 Controller) reply json. Helper for the test environment.
53 `gateway_api_functions.sh` \
54 Contains functions for managing the Non-RT RIC Gateway
56 `http_proxy_api_functions.sh` \
57 Contains functions for managing the Http Proxy
59 `kube_proxy_api_functions.sh` \
60 Contains functions for managing the Kube Proxy - to gain access to all services pod inside a kube cluster.
62 `mr_api_functions.sh` \
63 Contains functions for managing the MR Stub and the Dmaap Message Router
65 `prodstub_api_functions.sh` \
66 Contains functions for adapting towards the Producer stub interface - simulates a producer.
68 `rapp_catalogue_api_functions.sh` \
69 Contains functions for adapting towards the RAPP Catalogue.
71 `ricsimulator_api_functions.sh` \
72 Contains functions for adapting towards the RIC (A1) simulator admin API.
75 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.
76 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'.
78 `testcase_common.sh` \
79 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.
80 The included functions are described in detail further below.
82 `testsuite_common.sh` \
83 Common functions for running two or more auto test scripts as a suite.
85 ## Integration of a new applicaton ##
87 Integration a new application to the test environment involves the following steps.
89 * Choose a short name for the application. Should be a uppcase name. For example, the NonRTRIC Gateway has NGW as short name.
90 This short name shall be added to the testengine_config.sh. See that file for detailed instructions.
92 * Create a file in this directory using the pattern `<application-name>_api_functions.sh`.
93 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.
97 | __<app-short_name>_imagesetup |
98 | __<app-short_name>_imagepull |
99 | __<app-short_name>_imagebuild |
100 | __<app-short_name>_image_data |
101 | __<app-short_name>_kube_scale_zero |
102 | __<app-short_name>_kube_scale_zero_and_wait |
103 | __<app-short_name>_kube_delete_all |
105 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.
107 * 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.
109 * 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.
111 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.
113 | Label for docker compose | Description |
115 | nrttest_app | shall contain the application short name |
116 | nrttest_dp | shall be set by a variable containing the display name, a short textual description of the applicaion |
118 | Label for kubernetes resource | Description |
120 | autotest | shall contain the application short name |
122 * 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>`.
123 In addition, all other needed environment shall also be defined in these file.
125 # Description of functions in testcase_common.sh #
129 The script can be started with these arguments
133 | `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]` |
135 | parameter | description |
137 | `remote` | Use images from remote repositories. Can be overridden for individual images using the '--use_xxx' flags |
138 | `remote-remove` | Same as 'remote' but will also try to pull fresh images from remote repositories |
139 | `docker` | Use docker environment for test |
140 | `kuber` | Use kubernetes environment for test. Requires a kubernetes minikube installation |
141 | `--env-file` | The script will use the supplied file to read environment variables from |
142 | `release` | If this flag is given the script will use release version of the images |
143 | `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 |
144 | `--stop-at-error` | The script will stop when the first failed test or configuration |
145 | `--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). |
146 | `--use-local-image` | The script will use local images for the supplied apps, space separated list of app short names |
147 | `--use-snapshot-image` | The script will use images from the nexus snapshot repo for the supplied apps, space separated list of app short names |
148 | `--use-staging-image` | The script will use images from the nexus staging repo for the supplied apps, space separated list of app short names |
149 | `--use-release-image` | The script will use images from the nexus release repo for the supplied apps, space separated list of app short names |
150 | `--image-repo` | Url to optional image repo. Only locally built images will be re-tagged and pushed to this repo |
151 | `-repo-policy` | Policy controlling which images to re-tag and push to image repo in param --image-repo. Can be set to 'local' (push on locally built images) or 'remote' (push locally built images and images from nexus repo). Default is 'local' |
152 | `--cluster-timeout` | Optional timeout for cluster where it takes time to obtain external ip/host-name. Timeout in seconds |
153 | `--print-stats` | Prints the number of tests, failed tests, failed configuration and deviations after each individual test or config |
154 | `help` | Print this info along with the test script description and the list of app short names supported |
156 ## Function: setup_testenvironment ##
158 Main function to setup the test environment before any tests are started.
159 Must be called right after sourcing all component scripts.
164 ## Function: indent1 ##
166 Indent every line of a command output with one space char.
171 ## Function: indent2 ##
173 Indent every line of a command output with two space chars.
178 ## Function: print_result ##
180 Print a test report of an auto-test script.
185 ## Function: start_timer ##
187 Start a timer for time measurement. Only one timer can be running.
190 | None - but any args will be printed (It is good practice to use same args for this function as for the `print_timer`) |
192 ## Function: print_timer ##
194 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 args to the function will also be printed in the test report.
197 | `<timer-message-to-print>` |
199 | parameter | description |
200 | --------- | ----------- |
201 | `<timer-message-to-print>` | Any text message to be printed along with the timer result.(It is good practice to use same args for this function as for the `start_timer`) |
203 ## Function: print_and_reset_timer ##
205 Print the value of the timer (in seconds) previously started by 'start_timer'. Also reset the timer to 0. The result of the timer as well as the args to the function will also be printed in the test report.
208 | `<timer-message-to-print>` |
210 | parameter | description |
211 | --------- | ----------- |
212 | `<timer-message-to-print>` | Any text message to be printed along with the timer result.(It is good practice to use same args for this function as for the `start_timer`) |
214 ## Function: deviation ##
216 Mark a test as a deviation from the requirements. The list of deviations will be printed in the test report.
219 | `<deviation-message-to-print>` |
221 | parameter | description |
222 | --------- | ----------- |
223 | `<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 |
225 ## Function: clean_environment ##
227 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).
232 ## Function: auto_clean_containers ##
234 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.
239 ## Function: sleep_wait ##
241 Make the script sleep for a number of seconds.
244 | `<sleep-time-in-sec> [<any-text-in-quotes-to-be-printed>]` |
246 | parameter | description |
247 | --------- | ----------- |
248 | `<sleep-time-in-sec>` | Number of seconds to sleep |
249 | `<any-text-in-quotes-to-be-printed>` | Optional. The text will be printed, if present |
251 ## Function: check_control_panel_logs ##
253 Check the Control Panel log for any warnings and errors and print the count of each.
258 ## Function: store_logs ##
260 Take a snap-shot of all logs for all running containers 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.
263 | `<logfile-prefix>` |
265 | parameter | description |
266 | --------- | ----------- |
267 | `<logfile-prefix>` | Log file prefix |
269 # Description of functions in testsuite_common.sh #
271 ## Function: suite_setup ##
273 Sets up the test suite and prints out a heading.
280 Print out the overall result of the executed test cases.
285 # Description of functions in agent_api_functions.sh #
289 Both PMS version 1 and 2 are supported. The version is controlled by the env variable `$PMS_VERSION` set in the test env file.
290 For api function in version 2, an url prefix is added if configured.
292 ## Function: use_agent_rest_http ##
294 Use http for all API calls to the Policy Agent. This is the default.
299 ## Function: use_agent_rest_https ##
301 Use https for all API calls to the Policy Agent.
306 ## Function: use_agent_dmaap_http ##
308 Send and recieve all API calls to the Policy Agent over Dmaap via the MR over http.
313 ## Function: use_agent_dmaap_https ##
315 Send and recieve all API calls to the Policy Agent over Dmaap via the MR over https.
320 ## Function: start_policy_agent ##
322 Start the Policy Agent container or corresponding kube resources depending on docker/kube mode.
325 | `<logfile-prefix>` |
326 | (docker) `PROXY\|NOPROXY <config-file>` |
327 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
329 | parameter | description |
330 | --------- | ----------- |
331 | `PROXY` | Configure with http proxy, if proxy is started |
332 | `NOPROXY` | Configure without http proxy |
333 | `<config-file>`| Path to application.yaml |
334 | `<data-file>` | Optional path to application_configuration.json |
336 ## Function: agent_load_config ##
338 Load the config into a config map (kubernetes only).
343 | parameter | description |
344 | --------- | ----------- |
345 | `<data-file>` | Path to application_configuration.json |
347 ## Function: set_agent_debug ##
349 Configure the Policy Agent log on debug level. The Policy Agent must be running.
354 ## Function: set_agent_trace ##
356 Configure the Policy Agent log on trace level. The Policy Agent must be running.
361 ## Function: use_agent_retries ##
363 Configure the Policy Agent to make upto 5 retries if an API calls return any of the specified http return codes.
366 | `[<response-code>]*` |
368 ## Function: check_policy_agent_logs ##
370 Check the Policy Agent log for any warnings and errors and print the count of each.
375 ## Function: api_equal() ##
377 Tests if the array length of a json array in the Policy Agent simulator is equal to a target value.
378 Without the timeout, the test sets pass or fail immediately depending on if the array length is equal to the target or not.
379 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.
380 See the 'cr' dir for more details.
384 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
386 | parameter | description |
387 | --------- | ----------- |
388 | `<variable-name>` | Relative url. Example 'json:policy_types' - checks the json array length of the url /policy_types |
389 | `<target-value>` | Target value for the length |
390 | `<timeout-in-sec>` | Max time to wait for the length to reach the target value |
392 ## Function: api_get_policies() ##
394 Test of GET '/policies' or V2 GET '/v2/policy-instances' and optional check of the array of returned policies.
395 To test the response code only, provide the response code parameter as well as the following three parameters.
396 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.
400 | `<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>]*]` |
404 | `<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>]*]` |
406 | parameter | description |
407 | --------- | ----------- |
408 | `<response-code>` | Expected http response code |
409 | `<ric-id>` | Id of the ric |
410 | `NORIC` | Indicator that no ric is provided |
411 | `<service-id>` | Id of the service |
412 | `NOSERVICE` | Indicator that no service id is provided |
413 | `<policy-type-id>` | Id of the policy type |
414 | `NOTYPE` | Indicator that no type id is provided |
415 | `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
416 | `<policy-id>` | Id of the policy |
417 | `EMPTY` | Indicate for the special empty policy type |
418 | `transient` | Transient, true or false |
419 | `notification-url` | Url for notifications |
420 | `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
422 ## Function: api_get_policy() ##
424 Test of GET '/policy' or V2 GET '/v2/policies/{policy_id}' and optional check of the returned json payload.
425 To test the the response code only, provide the expected response code and policy id.
426 To test the contents of the returned json payload, add a path to the template file used when creating the policy.
430 | `<response-code> <policy-id> [<template-file>]` |
434 | `<response-code> <policy-id> [ <template-file> <service-name> <ric-id> <policytype-id>\|NOTYPE <transient> <notification-url>\|NOURL ]` |
436 | parameter | description |
437 | --------- | ----------- |
438 | `<response-code>` | Expected http response code |
439 | `<policy-id>` | Id of the policy |
440 | `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
441 | `<service-id>` | Id of the service |
442 | `<ric-id>` | Id of the ric |
443 | `<policy-type-id>` | Id of the policy type |
444 | `NOTYPE` | Indicator that no type id is provided |
445 | `transient` | Transient, true or false |
446 | `notification-url` | Url for notifications |
448 ## Function: api_put_policy() ##
450 Test of PUT '/policy' or V2 PUT '/policies'.
451 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).
455 | `<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]` |
459 | `<response-code> <service-name> <ric-id> <policytype-id>\|NOTYPE <policy-id> <transient>\|NOTRANSIENT <notification-url>\|NOURL <template-file> [<count>]` |
461 | parameter | description |
462 | --------- | ----------- |
463 | `<response-code>` | Expected http response code |
464 | `<service-id>` | Id of the service |
465 | `<ric-id>` | Id of the ric |
466 | `<policy-type-id>` | Id of the policy type |
467 | `<policy-id>` | Id of the policy. This value shall be a numeric value if more than one policy shall be created |
468 | `transient>` | Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provided) |
469 | `notification-url` | Url for notifications |
470 |`NOURL`| Indicator for no url |
471 | `<template-file>` | Path to the template file for the policy |
472 | `<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 |
474 ## Function: api_put_policy_batch() ##
476 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.
477 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.
478 For arg list and parameters, see 'api_put_policy'.
480 ## Function: api_put_policy_parallel() ##
482 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.
486 | `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <template-file> <count-per-ric> <number-of-threads>`
490 | `<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>`
492 | parameter | description |
493 | --------- | ----------- |
494 | `<response-code>` | Expected http response code |
495 | `<service-id>` | Id of the service |
496 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing |
497 | `<number-of-rics>` | The number of rics, assuming the first index is '1'. The index is added to the 'ric-id-base' id |
498 | `<policy-type-id>` | Id of the policy type |
499 | `<policy-start-id>` | Id of the policy. This value shall be a numeric value and will be the id of the first policy |
500 | `transient>` | Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provide) |
501 | `notification-url` | Url for notifications |
502 | `<template-file>` | Path to the template file for the policy |
503 | `<count-per-ric>` | Number of policies per ric |
504 | `<number-of-threads>` | Number of threads (processes) to run in parallel |
506 ## Function: api_delete_policy() ##
508 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.
512 | `<response-code> <policy-id> [<count>]`
514 | parameter | description |
515 | --------- | ----------- |
516 | `<response-code>` | Expected http response code |
517 | `<policy-id>` | Id of the policy |
518 | `<count>` | An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
520 ## Function: api_delete_policy_batch() ##
522 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.
523 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.
524 For arg list and parameters, see 'api_delete_policy'.
526 ## Function: api_delete_policy_parallel() ##
528 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.
532 | `<response-code> <ric-id-base> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>`
534 | parameter | description |
535 | --------- | ----------- |
536 | `<response-code>` | Expected http response code |
537 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing |
538 | `<number-of-rics>` | The number of rics, assuming the first index is '1' |
539 | `<policy-start-id>` | Id of the policy. This value shall be a numeric value and will be the id of the first policy |
540 | `<count-per-ric>` | Number of policies per ric |
541 | `<number-of-threads>` | Number of threads (processes) to run in parallel |
543 ## Function: api_get_policy_ids() ##
545 Test of GET '/policy_ids' or V2 GET '/v2/policies'.
546 To test response code only, provide the response code parameter as well as the following three parameters.
547 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.
551 | `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <type-id>\|NOTYPE ([<policy-instance-id]*\|NOID)` |
553 | parameter | description |
554 | --------- | ----------- |
555 | `<response-code>` | Expected http response code |
556 | `<ric-id>` | Id of the ric |
557 | `NORIC` | Indicator that no ric is provided |
558 | `<service-id>` | Id of the service |
559 | `NOSERVICE` | Indicator that no service id is provided |
560 | `type-id>` | Id of the policy type |
561 | `NOTYPE` | Indicator that no type id is provided |
562 | `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
563 | `<policy-instance-id>` | Id of the policy |
565 ## Function: api_get_policy_schema() ##
567 Test of V2 GET '/v2/policy-types/{policyTypeId}' and optional check of the returned json schema.
568 To test the response code only, provide the expected response code and policy type id.
569 To test the contents of the returned json schema, add a path to a schema file to compare with.
573 | `<response-code> <policy-type-id> [<schema-file>]` |
575 | parameter | description |
576 | --------- | ----------- |
577 | `<response-code>` | Expected http response code |
578 | `<policy-type-id>` | Id of the policy type |
579 | `<schema-file>` | Path to the schema file for the policy type |
581 ## Function: api_get_policy_schema() ##
583 Test of GET '/policy_schema' and optional check of the returned json schema.
584 To test the response code only, provide the expected response code and policy type id.
585 To test the contents of the returned json schema, add a path to a schema file to compare with.
589 | `<response-code> <policy-type-id> [<schema-file>]` |
591 | parameter | description |
592 | --------- | ----------- |
593 | `<response-code>` | Expected http response code |
594 | `<policy-type-id>` | Id of the policy type |
595 | `<schema-file>` | Path to the schema file for the policy type |
597 ## Function: api_get_policy_schemas() ##
599 Test of GET '/policy_schemas' and optional check of the returned json schemas.
600 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
601 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)
605 | `<response-code> <ric-id>\|NORIC [<schema-file>\|NOFILE]*` |
607 | parameter | description |
608 | --------- | ----------- |
609 | `<response-code>` | Expected http response code |
610 | `<ric-id>` | Id of the ric |
611 | `NORIC` | No ric id given |
612 | `<schema-file>` | Path to the schema file for the policy type |
613 | `NOFILE` | Indicate the template for an empty type |
615 ## Function: api_get_policy_status() ##
617 Test of GET '/policy_status' or V2 GET '/policies/{policy_id}/status'.
621 | `<response-code> <policy-id> (STD\|STD2 <enforce-status>\|EMPTY [<reason>\|EMPTY])\|(OSC <instance-status> <has-been-deleted>)` |
623 | parameter | description |
624 | --------- | ----------- |
625 | `<response-code>` | Expected http response code |
626 | `<policy-id>` | Id of the policy |
627 | `STD` | Indicator of status of Standarized A1 |
628 | `STD2` | Indicator of status of Standarized A1 version 2 |
629 | `<enforce-status>` | Enforcement status |
630 | `<reason>` | Optional reason |
631 | `EMPTY` | Indicator of empty string status or reason |
632 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
633 | `<instance-status>` | Instance status |
634 | `<has-been-deleted>` | Deleted status, true or false |
636 ## Function: api_get_policy_types() ##
638 Test of GET '/policy_types' or V2 GET '/v2/policy-types' and optional check of the returned ids.
639 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
640 To test the contents of the returned json payload, add the list of expected policy type id (or 'EMPTY' for the '{}' type)
644 | `<response-code> [<ric-id>\|NORIC [<policy-type-id>\|EMPTY [<policy-type-id>]*]]` |
646 | parameter | description |
647 | --------- | ----------- |
648 | `<response-code>` | Expected http response code |
649 | `<ric-id>` | Id of the ric |
650 | `NORIC` | No ric id given |
651 | `<policy-type-id>` | Id of the policy type |
652 | `EMPTY` | Indicate the empty type |
654 ## Function: api_get_status() ##
656 Test of GET /status or V2 GET /status
660 | `<response-code>` |
662 | parameter | description |
663 | --------- | ----------- |
664 | `<response-code>` | Expected http response code |
666 ## Function: api_get_ric() ##
668 Test of GET '/ric' or V2 GET '/v2/rics/ric'
669 To test the response code only, provide the expected response code and managed element id.
670 To test the returned ric id, provide the expected ric id.
674 | `<reponse-code> <managed-element-id> [<ric-id>]` |
678 | `<reponse-code> <management-element-id>\|NOME <ric-id>\|<NORIC> [<string-of-ricinfo>]` |
680 | parameter | description |
681 | --------- | ----------- |
682 | `<response-code>` | Expected http response code |
683 | `<managed-element-id>` | Id of the managed element |
684 | `NOME` | Indicator for no ME |
685 | `ric-id` | Id of the ric |
686 | `NORIC` | Indicator no RIC |
687 | `string-of-ricinfo` | String of ric info |
689 ## Function: api_get_rics() ##
691 Test of GET '/rics' or V2 GET '/v2/rics' and optional check of the returned json payload (ricinfo).
692 To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
693 To test also the returned payload, add the formatted string of info in the returned payload.
694 Format of ricinfo: <br>`<ric-id>:<list-of-mes>:<list-of-policy-type-ids>`<br>
695 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_........."`
699 | `<reponse-code> <policy-type-id>\|NOTYPE [<space-separate-string-of-ricinfo>]` |
701 | parameter | description |
702 | --------- | ----------- |
703 | `<response-code>` | Expected http response code |
704 | `<policy-type-id>` | Policy type id of the ric |
705 | `NOTYPE>` | No type given |
706 | `<space-separate-string-of-ricinfo>` | A space separated string of ric info - needs to be quoted |
708 ## Function: api_put_service() ##
710 Test of PUT '/service' or V2 PUT '/service'.
713 | `<response-code> <service-name> <keepalive-timeout> <callbackurl>` |
715 | parameter | description |
716 | --------- | ----------- |
717 | `<response-code>` | Expected http response code |
718 | `<service-name>` | Service name |
719 | `<keepalive-timeout>` | Timeout value |
720 | `<callbackurl>` | Callback url |
722 ## Function: api_get_services() ##
724 Test of GET '/service' or V2 GET '/v2/services' and optional check of the returned json payload.
725 To test only the response code, omit all parameters except the expected response code.
726 To test the returned json, provide the parameters after the response code.
730 | `<response-code> [ (<query-service-name> <target-service-name> <keepalive-timeout> <callbackurl>) \| (NOSERVICE <target-service-name> <keepalive-timeout> <callbackurl> [<target-service-name> <keepalive-timeout> <callbackurl>]* )]` |
732 | parameter | description |
733 | --------- | ----------- |
734 | `<response-code>` | Expected http response code |
735 | `<query-service-name>` | Service name for the query |
736 | `<target-service-name>` | Target service name|
737 | `<keepalive-timeout>` | Timeout value |
738 | `<callbackurl>` | Callback url |
739 | `NOSERVICE` | Indicator of no target service name |
741 ## Function: api_get_service_ids() ##
743 Test of GET '/services' or V2 GET /'v2/services'. Only check of service ids.
747 | `<response-code> [<service-name>]*` |
749 | parameter | description |
750 | --------- | ----------- |
751 | `<response-code>` | Expected http response code |
752 | `<service-name>` | Service name |
754 ## Function: api_delete_services() ##
756 Test of DELETE '/services' or V2 DELETE '/v2/services/{serviceId}'
760 | `<response-code> [<service-name>]*` |
762 | parameter | description |
763 | --------- | ----------- |
764 | `<response-code>` | Expected http response code |
765 | `<service-name>` | Service name |
767 ## Function: api_put_services_keepalive() ##
769 Test of PUT '/services/keepalive' or V2 PUT '/v2/services/{service_id}/keepalive'
773 | `<response-code> <service-name>` |
775 | parameter | description |
776 | --------- | ----------- |
777 | `<response-code>` | Expected http response code |
778 | `<service-name>` | Service name |
780 ## Function: api_put_configuration() ##
782 Test of PUT '/v2/configuration'
786 | `<response-code> <config-file>` |
788 | parameter | description |
789 | --------- | ----------- |
790 | `<response-code>` | Expected http response code |
791 | `<config-file>` | Path json config file |
793 ## Function: api_get_configuration() ##
795 Test of GET '/v2/configuration'
799 | `<response-code> [<config-file>]` |
801 | parameter | description |
802 | --------- | ----------- |
803 | `<response-code>` | Expected http response code |
804 | `<config-file>` | Path json config file to compare the retrieved config with |
806 # Description of functions in consul_cbs_function.sh #
808 ## Function: consul_config_app ##
810 Function to load a json config from a file into consul for the Policy Agent
814 | `<json-config-file>` |
816 | parameter | description |
817 | --------- | ----------- |
818 | `<json-config-file>` | The path to the json file to be loaded to Consul/CBS |
820 ## Function: prepare_consul_config ##
822 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')
825 | `<deviation-message-to-print>` |
827 | parameter | description |
828 | --------- | ----------- |
829 | `SDNC\|NOSDNC` | Configure based on a1-controller (SNDC) or without a controller/adapter (NOSDNC) |
830 | `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app' |
832 ## Function: start_consul_cbs ##
834 Start the Consul and CBS containers
839 # Description of functions in control_panel_api_function.sh #
841 ## Function: use_control_panel_http ##
843 Set http as the protocol to use for all communication to the Control Panel
848 ## Function: use_control_panel_https ##
850 Set https as the protocol to use for all communication to the Control Panel
855 ## Function: start_control_panel ##
857 Start the Control Panel container
862 # Description of functions in controller_api_functions.sh #
864 The file contains a selection of the possible API tests towards the a1-controller
866 ## Function: use_sdnc_http ##
868 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.
873 ## Function: use_sdnc_https ##
875 Use https for all API calls towards the SDNC A1 Controller. Note that this function shall be called before preparing the config for Consul.
880 ## Function: start_sdnc ##
882 Start the SDNC A1 Controller container and its database container
887 ## Function: check_sdnc_logs ##
889 Check the SDNC log for any warnings and errors and print the count of each.
894 ## Function: controller_api_get_A1_policy_ids ##
896 Test of GET policy ids towards OSC or STD type simulator.
897 To test response code only, provide the response code, 'OSC' + policy type or 'STD'
898 To test the response payload, include the ids of the expexted response.
902 | `<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) \| ( STD <ric-id> [ <policy-id> [<policy-id>]* ]` |
904 | parameter | description |
905 | --------- | ----------- |
906 | `<response-code>` | Expected http response code |
907 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
908 | `<ric-id>` | Id of the ric |
909 | `policy-type-id>` | Id of the policy type |
910 | `<policy-id>` | Id of the policy |
911 | `STD` | Indicator of status of Standarized A1 |
913 ## Function: controller_api_get_A1_policy_type ##
915 Test of GET a policy type (OSC only)
919 | `<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]` |
921 | parameter | description |
922 | --------- | ----------- |
923 | `<response-code>` | Expected http response code |
924 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
925 | `<ric-id>` | Id of the ric |
926 | `policy-type-id>` | Id of the policy type |
927 | `policy-type-file>` | Optional schema file to compare the returned type with |
929 ## Function: controller_api_delete_A1_policy ##
931 Deletes a policy instance
935 | `(STD <ric-id> <policy-id>) \| (OSC <ric-id> <policy-type-id> <policy-id>)` |
937 | parameter | description |
938 | --------- | ----------- |
939 | `<response-code>` | Expected http response code |
940 | `STD` | Indicator of status of Standarized A1 |
941 | `<ric-id>` | Id of the ric |
942 | `<policy-id>` | Id of the policy |
943 | `policy-type-id>` | Id of the policy type |
944 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
945 | `policy-type-file>` | Optional schema file to compare the returned type with |
947 ## Function: controller_api_put_A1_policy ##
949 Creates a policy instance
953 | `<response-code> (STD <ric-id> <policy-id> <template-file> ) \| (OSC <ric-id> <policy-type-id> <policy-id> <template-file>)` |
955 | parameter | description |
956 | --------- | ----------- |
957 | `<response-code>` | Expected http response code |
958 | `STD` | Indicator of status of Standarized A1 |
959 | `<ric-id>` | Id of the ric |
960 | `<policy-id>` | Id of the policy |
961 | `<template-file>` | Path to the template file of the policy|
962 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
963 | `<policy-type-id>` | Id of the policy type |
965 ## Function: controller_api_get_A1_policy_status ##
967 Checks the status of a policy
971 | `<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) \| (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)` |
973 | parameter | description |
974 | --------- | ----------- |
975 | `<response-code>` | Expected http response code |
976 | `STD` | Indicator of status of Standarized A1 |
977 | `<ric-id>` | Id of the ric |
978 | `<policy-id>` | Id of the policy |
979 | `<enforce-status>` | Enforcement status |
980 | `<reason>` | Optional reason |
981 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
982 | `<policy-type-id>` | Id of the policy type |
983 | `<instance-status>` | Instance status |
984 | `<has-been-deleted>` | Deleted status, true or false |
986 # Description of functions in cr_api_functions.sh #
988 ## Function: use_cr_http ##
990 Use http for getting event from CR. The admin API is not affected. This is the default.
995 ## Function: use_cr_https ##
997 Use https for getting event from CR. The admin API is not affected.
998 Note: Not yet used as callback event is not fully implemented/deciced.
1003 ## Function: start_cr ##
1005 Start the Callback Receiver container in docker or kube depending on start mode.
1010 ## Function: cr_equal ##
1012 Tests if a variable value in the Callback Receiver (CR) simulator is equal to a target value.
1013 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1014 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.
1015 See the 'cr' dir for more details.
1018 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1020 | parameter | description |
1021 | --------- | ----------- |
1022 | `<variable-name>` | Variable name in the CR |
1023 | `<target-value>` | Target value for the variable |
1024 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1026 ## Function: cr_api_check_all_sync_events() ##
1028 Check the contents of all ric events received for a callback id.
1032 | `<response-code> <id> [ EMPTY \| ( <ric-id> )+ ]` |
1034 | parameter | description |
1035 | --------- | ----------- |
1036 | `<response-code>` | Expected http response code |
1037 | `<id>` | Id of the callback destination |
1038 | `EMPTY` | Indicator for an empty list |
1039 | `<ric-id>` | Id of the ric |
1041 # Description of functions in ecs_api_functions.sh #
1043 ## Function: use_ecs_rest_http ##
1045 Use http for all API calls to the ECS. This is the default protocol.
1050 ## Function: use_ecs_rest_https ##
1052 Use https for all API calls to the ECS.
1057 ## Function: use_ecs_dmaap_http ##
1059 Send and recieve all API calls to the ECS over Dmaap via the MR using http.
1064 ## Function: use_ecs_dmaap_https ##
1066 Send and recieve all API calls to the ECS over Dmaap via the MR using https.
1071 ## Function: start_ecs ##
1073 Start the ECS container in docker or kube depending on running mode.
1078 ## Function: stop_ecs ##
1080 Stop the ECS container.
1085 ## Function: start_stopped_ecs ##
1087 Start a previously stopped ecs.
1092 ## Function: set_ecs_debug ##
1094 Configure the ECS log on debug level. The ECS must be running.
1099 ## Function: set_ecs_trace ##
1101 Configure the ECS log on trace level. The ECS must be running.
1106 ## Function: check_ecs_logs ##
1108 Check the ECS log for any warnings and errors and print the count of each.
1113 ## Function: ecs_equal ##
1115 Tests if a variable value in the ECS is equal to a target value.
1116 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1117 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.
1118 See the 'a1-interface' repo for more details.
1122 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1124 | parameter | description |
1125 | --------- | ----------- |
1126 | `<variable-name>` | Variable name in ecs |
1127 | `<target-value>` | Target value for the variable |
1128 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1130 ## Function: ecs_api_a1_get_job_ids() ##
1132 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs' and optional check of the array of returned job ids.
1133 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1134 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1138 | `<response-code> <type-id> <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
1140 | parameter | description |
1141 | --------- | ----------- |
1142 | `<response-code>` | Expected http response code |
1143 | `<type-id>` | Id of the EI type |
1144 | `<owner-id>` | Id of the job owner |
1145 | `NOOWNER` | No owner is given |
1146 | `<job-id>` | Id of the expected job |
1147 | `EMPTY` | The expected list of job id shall be empty |
1149 ## Function: ecs_api_a1_get_type() ##
1151 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}' and optional check of the returned schema.
1152 To test the response code only, provide the response code parameter as well as the type-id.
1153 To also test the response payload add a path to the expected schema file.
1157 | `<response-code> <type-id> [<schema-file>]` |
1159 | parameter | description |
1160 | --------- | ----------- |
1161 | `<response-code>` | Expected http response code |
1162 | `<type-id>` | Id of the EI type |
1163 | `<schema-file>` | Path to a schema file to compare with the returned schema |
1165 ## Function: ecs_api_a1_get_type_ids() ##
1167 Test of GET '/A1-EI​/v1​/eitypes' and optional check of returned list of type ids.
1168 To test the response code only, provide the response only.
1169 To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
1173 | `<response-code> [ (EMPTY \| [<type-id>]+) ]` |
1175 | parameter | description |
1176 | --------- | ----------- |
1177 | `<response-code>` | Expected http response code |
1178 | `EMPTY` | The expected list of type ids shall be empty |
1179 | `<type-id>` | Id of the EI type |
1181 ## Function: ecs_api_a1_get_job_status() ##
1183 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}​/status' and optional check of the returned status.
1184 To test the response code only, provide the response code, type id and job id.
1185 To also test the response payload add the expected status.
1189 | `<response-code> <type-id> <job-id> [<status>]` |
1191 | parameter | description |
1192 | --------- | ----------- |
1193 | `<response-code>` | Expected http response code |
1194 | `<type-id>` | Id of the EI type |
1195 | `<job-id>` | Id of the job |
1196 | `<status>` | Expected status |
1198 ## Function: ecs_api_a1_get_job() ##
1200 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}' and optional check of the returned job.
1201 To test the response code only, provide the response code, type id and job id.
1202 To also test the response payload add the remaining parameters.
1206 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1208 | parameter | description |
1209 | --------- | ----------- |
1210 | `<response-code>` | Expected http response code |
1211 | `<type-id>` | Id of the EI type |
1212 | `<job-id>` | Id of the job |
1213 | `<target-url>` | Expected target url for the job |
1214 | `<owner-id>` | Expected owner for the job |
1215 | `<template-job-file>` | Path to a job template for job parameters of the job |
1217 ## Function: ecs_api_a1_delete_job() ##
1219 Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1220 To test, provide all the specified parameters.
1224 | `<response-code> <type-id> <job-id>` |
1226 | parameter | description |
1227 | --------- | ----------- |
1228 | `<response-code>` | Expected http response code |
1229 | `<type-id>` | Id of the EI type |
1230 | `<job-id>` | Id of the job |
1232 ## Function: ecs_api_a1_put_job() ##
1234 Test of PUT '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1235 To test, provide all the specified parameters.
1239 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
1241 | parameter | description |
1242 | --------- | ----------- |
1243 | `<response-code>` | Expected http response code |
1244 | `<type-id>` | Id of the EI type |
1245 | `<job-id>` | Id of the job |
1246 | `<target-url>` | Target url for the job |
1247 | `<owner-id>` | Owner of the job |
1248 | `<template-job-file>` | Path to a job template for job parameters of the job |
1250 ## Function: ecs_api_edp_get_type_ids() ##
1252 Test of GET '/ei-producer/v1/eitypes' or '/data-producer/v1/info-types' depending on ecs version and an optional check of the returned list of type ids.
1253 To test the response code only, provide the response code.
1254 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1258 | `<response-code> [ EMPTY \| <type-id>+]` |
1260 | parameter | description |
1261 | --------- | ----------- |
1262 | `<response-code>` | Expected http response code |
1263 | `<type-id>` | Id of the type |
1264 | `EMPTY` | The expected list of type ids shall be empty |
1266 ## Function: ecs_api_edp_get_producer_status() ##
1268 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/status' or '/data-producer/v1/info-producers/{infoProducerId}/status' depending on ecs version and optional check of the returned status.
1269 To test the response code only, provide the response code and producer id.
1270 To also test the response payload add the expected status.
1274 | `<response-code> <producer-id> [<status>]` |
1276 | parameter | description |
1277 | --------- | ----------- |
1278 | `<response-code>` | Expected http response code |
1279 | `<producer-id>` | Id of the producer |
1280 | `<status>` | The expected status string |
1282 ## Function: ecs_api_edp_get_producer_ids() ##
1284 Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
1285 To test the response code only, provide the response.
1286 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).
1290 | `<response-code> [ EMPTY \| <producer-id>+]` |
1292 | parameter | description |
1293 | --------- | ----------- |
1294 | `<response-code>` | Expected http response code |
1295 | `<producer-id>` | Id of the producer |
1296 | `EMPTY` | The expected list of type ids shall be empty |
1298 ## Function: ecs_api_edp_get_producer_ids_2() ##
1300 Test of GET '/ei-producer/v1/eiproducers' or '/data-producer/v1/info-producers' depending on ecs version and optional check of the returned producer ids.
1301 To test the response code only, provide the response.
1302 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).
1306 | `<response-code> [ ( NOTYPE \| <type-id> ) [ EMPTY \| <producer-id>+]` |
1308 | parameter | description |
1309 | --------- | ----------- |
1310 | `<response-code>` | Expected http response code |
1311 | `<type-id>` | Id of the type |
1312 | `EMPTY` | No type given |
1313 | `<producer-id>` | Id of the producer |
1314 | `EMPTY` | The expected list of type ids shall be empty |
1316 ## Function: ecs_api_edp_get_type() ##
1318 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
1319 To test the response code only, provide the response and the type-id.
1320 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).
1324 | `<response-code> <type-id> [<job-schema-file> (EMPTY \| [<producer-id>]+)]` |
1326 | parameter | description |
1327 | --------- | ----------- |
1328 | `<response-code>` | Expected http response code |
1329 | `<type-id>` | Id of the type |
1330 | `<job-schema-file>` | Path to a job schema file |
1331 | `<producer-id>` | Id of the producer |
1332 | `EMPTY` | The expected list of type ids shall be empty |
1334 ## Function: ecs_api_edp_get_type_2() ##
1336 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ecs version and optional check of the returned type.
1337 To test the response code only, provide the response and the type-id.
1338 To also test the response payload add a path to a job schema file.
1342 | `<response-code> <type-id> [<job-schema-file>]` |
1344 | parameter | description |
1345 | --------- | ----------- |
1346 | `<response-code>` | Expected http response code |
1347 | `<type-id>` | Id of the type |
1348 | `<job-schema-file>` | Path to a job schema file |
1349 | `EMPTY` | The expected list of type ids shall be empty |
1351 ## Function: ecs_api_edp_put_type_2() ##
1353 Test of PUT '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ecs version and optional check of the returned type.
1357 | `<response-code> <type-id> [<job-schema-file>]` |
1359 | parameter | description |
1360 | --------- | ----------- |
1361 | `<response-code>` | Expected http response code |
1362 | `<type-id>` | Id of the type |
1363 | `<job-schema-file>` | Path to a job schema file |
1364 | `EMPTY` | The expected list of type ids shall be empty |
1366 ## Function: ecs_api_edp_delete_type_2() ##
1368 Test of DELETE '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ecs version and optional check of the returned type.
1372 | `<response-code> <type-id>` |
1374 | parameter | description |
1375 | --------- | ----------- |
1376 | `<response-code>` | Expected http response code |
1377 | `<type-id>` | Id of the type |
1379 ## Function: ecs_api_edp_get_producer() ##
1381 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
1382 To test the response code only, provide the response and the producer-id.
1383 To also test the response payload add the remaining parameters defining thee producer.
1387 | `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY\| [<type-id> <schema-file>]+) ]` |
1389 | parameter | description |
1390 | --------- | ----------- |
1391 | `<response-code>` | Expected http response code |
1392 | `<producer-id>` | Id of the producer |
1393 | `<create-callback>` | Callback for create job |
1394 | `<delete-callback>` | Callback for delete job |
1395 | `<supervision-callback>` | Callback for producer supervision |
1396 | `<type-id>` | Id of the type |
1397 | `<schema-file>` | Path to a schema file |
1398 | `EMPTY` | The expected list of type schema pairs shall be empty |
1400 ## Function: ecs_api_edp_get_producer_2() ##
1402 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version and optional check of the returned producer.
1403 To test the response code only, provide the response and the producer-id.
1404 To also test the response payload add the remaining parameters defining thee producer.
1408 | `<response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY \| <type-id>+) ]` |
1410 | parameter | description |
1411 | --------- | ----------- |
1412 | `<response-code>` | Expected http response code |
1413 | `<producer-id>` | Id of the producer |
1414 | `<job-callback>` | Callback for the url |
1415 | `<supervision-callback>` | Callback for producer supervision |
1416 | `<type-id>` | Id of the type |
1417 | `EMPTY` | The expected list of types shall be empty |
1419 ## Function: ecs_api_edp_delete_producer() ##
1421 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version.
1422 To test, provide all parameters.
1426 | `<response-code> <producer-id>` |
1428 | parameter | description |
1429 | --------- | ----------- |
1430 | `<response-code>` | Expected http response code |
1431 | `<producer-id>` | Id of the producer |
1433 ## Function: ecs_api_edp_put_producer() ##
1435 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1436 To test, provide all parameters. The list of type/schema pair may be empty.
1440 | `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY \| [<type-id> <schema-file>]+)` |
1442 | parameter | description |
1443 | --------- | ----------- |
1444 | `<response-code>` | Expected http response code |
1445 | `<producer-id>` | Id of the producer |
1446 | `<job-callback>` | Callback for create/delete job |
1447 | `<supervision-callback>` | Callback for producer supervision |
1448 | `<type-id>` | Id of the type |
1449 | `<schema-file>` | Path to a schema file |
1450 | `EMPTY` | The list of type/schema pairs is empty |
1452 ## Function: ecs_api_edp_put_producer_2() ##
1454 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version.
1455 To test, provide all parameters. The list of type/schema pair may be empty.
1459 | `<response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE\|[<type-id>+]` |
1461 | parameter | description |
1462 | --------- | ----------- |
1463 | `<response-code>` | Expected http response code |
1464 | `<producer-id>` | Id of the producer |
1465 | `<job-callback>` | Callback for create/delete job |
1466 | `<supervision-callback>` | Callback for producer supervision |
1467 | `<type-id>` | Id of the type |
1468 | `NOTYPE` | The list of types is empty |
1470 ## Function: ecs_api_edp_get_producer_jobs() ##
1472 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
1473 To test the response code only, provide the response and the producer-id.
1474 To also test the response payload add the remaining parameters.
1478 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1480 | parameter | description |
1481 | --------- | ----------- |
1482 | `<response-code>` | Expected http response code |
1483 | `<producer-id>` | Id of the producer |
1484 | `<job-id>` | Id of the job |
1485 | `<type-id>` | Id of the EI type |
1486 | `<target-url>` | Target url for data delivery |
1487 | `<job-owner>` | Id of the job owner |
1488 | `<template-job-file>` | Path to a job template file |
1489 | `EMPTY` | The list of job/type/target/job-file tuples is empty |
1491 ## Function: ecs_api_edp_get_producer_jobs_2() ##
1493 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' or '/data-producer/v1/info-producers/{infoProducerId}/info-jobs' depending on ecs version and optional check of the returned producer job.
1494 To test the response code only, provide the response and the producer-id.
1495 To also test the response payload add the remaining parameters.
1499 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1501 | parameter | description |
1502 | --------- | ----------- |
1503 | `<response-code>` | Expected http response code |
1504 | `<producer-id>` | Id of the producer |
1505 | `<job-id>` | Id of the job |
1506 | `<type-id>` | Id of the type |
1507 | `<target-url>` | Target url for data delivery |
1508 | `<job-owner>` | Id of the job owner |
1509 | `<template-job-file>` | Path to a job template file |
1510 | `EMPTY` | The list of job/type/target/job-file tuples is empty |
1512 ## Function: ecs_api_service_status() ##
1514 Test of GET '/status'.
1518 | `<response-code>` |
1520 | parameter | description |
1521 | --------- | ----------- |
1522 | `<response-code>` | Expected http response code |
1524 ## Function: ecs_api_idc_get_type_ids() ##
1526 Test of GET '/data-consumer/v1/info-types' and an optional check of the returned list of type ids.
1527 To test the response code only, provide the response code.
1528 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1532 | `<response-code> [ EMPTY \| <type-id>+]` |
1534 | parameter | description |
1535 | --------- | ----------- |
1536 | `<response-code>` | Expected http response code |
1537 | `<type-id>` | Id of the Info type |
1538 | `EMPTY` | The expected list of type ids shall be empty |
1540 ## Function: ecs_api_idc_get_job_ids() ##
1542 Test of GET '/data-consumer/v1/info-jobs' and optional check of the array of returned job ids.
1543 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1544 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1548 | `<response-code> <type-id> <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
1550 | parameter | description |
1551 | --------- | ----------- |
1552 | `<response-code>` | Expected http response code |
1553 | `<type-id>` | Id of the Info type |
1554 | `<owner-id>` | Id of the job owner |
1555 | `NOOWNER` | No owner is given |
1556 | `<job-id>` | Id of the expected job |
1557 | `EMPTY` | The expected list of job id shall be empty |
1559 ## Function: ecs_api_idc_get_job() ##
1561 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}' and optional check of the returned job.
1562 To test the response code only, provide the response code, type id and job id.
1563 To also test the response payload add the remaining parameters.
1567 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1569 | parameter | description |
1570 | --------- | ----------- |
1571 | `<response-code>` | Expected http response code |
1572 | `<type-id>` | Id of the Info type |
1573 | `<job-id>` | Id of the job |
1574 | `<target-url>` | Expected target url for the job |
1575 | `<owner-id>` | Expected owner for the job |
1576 | `<template-job-file>` | Path to a job template for job parameters of the job |
1578 ## Function: ecs_api_idc_put_job() ##
1580 Test of PUT '​/data-consumer/v1/info-jobs/{infoJobId}'.
1581 To test, provide all the specified parameters.
1585 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file> [VALIDATE]` |
1587 | parameter | description |
1588 | --------- | ----------- |
1589 | `<response-code>` | Expected http response code |
1590 | `<type-id>` | Id of the Info type |
1591 | `<job-id>` | Id of the job |
1592 | `<target-url>` | Target url for the job |
1593 | `<owner-id>` | Owner of the job |
1594 | `<template-job-file>` | Path to a job template for job parameters of the job |
1595 | `VALIIDATE` | Indicator to preform type validation at creation |
1597 ## Function: ecs_api_idc_delete_job() ##
1599 Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1600 To test, provide all the specified parameters.
1604 | `<response-code> <type-id> <job-id>` |
1606 | parameter | description |
1607 | --------- | ----------- |
1608 | `<response-code>` | Expected http response code |
1609 | `<type-id>` | Id of the type |
1610 | `<job-id>` | Id of the job |
1612 ## Function: ecs_api_idc_get_type() ##
1614 Test of GET '/data-consumer/v1/info-types/{infoTypeId} and optional check of the returned schema.
1615 To test the response code only, provide the response code parameter as well as the type-id.
1616 To also test the response payload add a path to the expected schema file.
1620 | `<response-code> <type-id> [<schema-file>]` |
1622 | parameter | description |
1623 | --------- | ----------- |
1624 | `<response-code>` | Expected http response code |
1625 | `<type-id>` | Id of the Info type |
1626 | `<schema-file>` | Path to a schema file to compare with the returned schema |
1628 ## Function: ecs_api_idc_get_job_status() ##
1630 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' and optional check of the returned status and timeout.
1631 To test the response code only, provide the response code and job id.
1632 To also test the response payload add the expected status.
1636 | `<response-code> <job-id> [<status> [ <timeout>]]` |
1638 | parameter | description |
1639 | --------- | ----------- |
1640 | `<response-code>` | Expected http response code |
1641 | `<job-id>` | Id of the job |
1642 | `<status>` | Expected status |
1643 | `<timeout>` | Timeout |
1645 ## Function: ecs_api_idc_get_job_status2() ##
1647 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' with returned producers and optional check of the returned status and timeout.
1648 To test the response code only, provide the response code and job id.
1649 To also test the response payload add the expected status.
1653 | `<response-code> <job-id> [<status> EMPTYPROD|( <prod-count> <producer-id>+ ) [<timeout>]]` |
1655 | parameter | description |
1656 | --------- | ----------- |
1657 | `<response-code>` | Expected http response code |
1658 | `<job-id>` | Id of the job |
1659 | `<status>` | Expected status |
1660 | `<EMPTYPROD>` | Indicated for empty list of producer |
1661 | `<prod-count>` | Number of expected producer |
1662 | `<producer-id>` |Id of the producer |
1663 | `<timeout>` | Timeout |
1665 ## Function: ecs_api_admin_reset() ##
1667 Test of GET '/status'.
1671 | `<response-code> [ <type> ]` |
1673 | parameter | description |
1674 | --------- | ----------- |
1675 | `<response-code>` | Expected http response code |
1676 | `<type>` | Type id, if the interface supports type in url |
1678 # Description of functions in gateway_api_functions.sh #
1680 ## Function: use_gateway_http ##
1682 Use http for all calls to the gateway. This is set by default.
1687 ## Function: use_gateway_https ##
1689 Use https for all calls to the gateway.
1694 ## Function: set_gateway_debug ##
1696 Set debug level logging in the gateway
1701 ## Function: set_gateway_trace ##
1703 Set debug level logging in the trace
1708 ## Function: start_gateway ##
1710 Start the the gateway container in docker or kube depending on start mode
1715 ## Function: gateway_pms_get_status ##
1717 Sample test of pms api (status)
1720 | `<response-code>` |
1722 | parameter | description |
1723 | --------- | ----------- |
1724 | `<response-code>` | Expected http response code |
1726 ## Function: gateway_ecs_get_types ##
1728 Sample test of ecs api (get types)
1729 Only response code tested - not payload
1732 | `<response-code>` |
1734 | parameter | description |
1735 | --------- | ----------- |
1736 | `<response-code>` | Expected http response code |
1738 # Description of functions in http_proxy_api_functions.sh #
1740 ## Function: use_http_proxy_http ##
1742 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.
1747 ## Function: use_http_proxy_https ##
1749 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.
1754 ## Function: start_http_proxy ##
1756 Start the http proxy container in docker or kube depending on running mode.
1761 # Description of functions in kube_proxy_api_functions.sh #
1763 ## Function: use_kube_proxy_http ##
1765 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.
1770 ## Function: use_kube_proxy_https ##
1772 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.
1777 ## Function: start_kube_proxy ##
1779 Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
1780 No proxy is started if the function is called in docker mode.
1785 # Description of functions in mr_api_functions.sh #
1787 ## Function: use_mr_http ##
1789 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.
1794 ## Function: use_mr_https ##
1796 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.
1801 ## Function: start_mr ##
1803 Start the Message Router stub interface container in docker or kube depending on start mode
1808 ## Function: mr_equal ##
1810 Tests if a variable value in the Message Router (MR) simulator is equal to a target value.
1811 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1812 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.
1813 See the 'mrstub' dir for more details.
1816 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1818 | parameter | description |
1819 | --------- | ----------- |
1820 | `<variable-name>` | Variable name in the MR |
1821 | `<target-value>` | Target value for the variable |
1822 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1824 ## Function: mr_greater ##
1826 Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
1827 Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than the target or not.
1828 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.
1829 See the 'mrstub' dir for more details.
1832 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1834 | parameter | description |
1835 | --------- | ----------- |
1836 | `<variable-name>` | Variable name in the MR |
1837 | `<target-value>` | Target value for the variable |
1838 | `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value |
1840 ## Function: mr_read ##
1842 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.
1843 See the 'mrstub' dir for more details.
1846 | `<variable-name>` |
1848 | parameter | description |
1849 | --------- | ----------- |
1850 | `<variable-name>` | Variable name in the MR |
1852 ## Function: mr_print ##
1854 Prints the value of a variable in the Message Router (MR) simulator.
1855 See the 'mrstub' dir for more details.
1858 | `<variable-name>` |
1860 | parameter | description |
1861 | --------- | ----------- |
1862 | `<variable-name>` | Variable name in the MR |
1864 # Description of functions in prodstub_api_functions.sh #
1866 ## Function: use_prod_stub_http ##
1868 Use http for the API. The admin API is not affected. This is the default protocol.
1873 ## Function: use_prod_stub_https ##
1875 Use https for the API. The admin API is not affected.
1880 ## Function: start_prod_stub ##
1882 Start the Producer stub container in docker or kube depending on start mode
1887 ## Function: prodstub_arm_producer() ##
1889 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
1893 | `<response-code> <producer-id> [<forced_response_code>]` |
1895 | parameter | description |
1896 | --------- | ----------- |
1897 | `<response-code>` | Expected http response code |
1898 | `<producer-id>` | Id of the producer |
1899 | `<forced_response_code>` | Forced response code for the producer callback url |
1901 ## Function: prodstub_arm_job_create() ##
1903 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.
1907 | `<response-code> <job-id> [<forced_response_code>]` |
1909 | parameter | description |
1910 | --------- | ----------- |
1911 | `<response-code>` | Expected http response code |
1912 | `<job-id>` | Id of the job |
1913 | `<forced_response_code>` | Forced response code for the create callback url |
1915 ## Function: prodstub_arm_job_delete() ##
1917 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.
1921 | `<response-code> <job-id> [<forced_response_code>]` |
1923 | parameter | description |
1924 | --------- | ----------- |
1925 | `<response-code>` | Expected http response code |
1926 | `<job-id>` | Id of the job |
1927 | `<forced_response_code>` | Forced response code for the delete callback url |
1929 ## Function: prodstub_arm_type() ##
1931 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
1935 | `<response-code> <producer-id> <type-id>` |
1937 | parameter | description |
1938 | --------- | ----------- |
1939 | `<response-code>` | Expected http response code |
1940 | `<producer-id>` | Id of the producer |
1941 | `<type-id>` | Id of the type |
1943 ## Function: prodstub_disarm_type() ##
1945 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
1949 | `<response-code> <producer-id> <type-id>` |
1951 | parameter | description |
1952 | --------- | ----------- |
1953 | `<response-code>` | Expected http response code |
1954 | `<producer-id>` | Id of the producer |
1955 | `<type-id>` | Id of the type |
1957 ## Function: prodstub_check_jobdata() ##
1959 Check a job in the prodstub towards the list of provided parameters.
1963 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
1965 | parameter | description |
1966 | --------- | ----------- |
1967 | `<response-code>` | Expected http response code |
1968 | `<producer-id>` | Id of the producer |
1969 | `<job-id>` | Id of the job |
1970 | `<type-id>` | Id of the type |
1971 | `<target-url>` | Target url for data delivery |
1972 | `<job-owner>` | Id of the job owner |
1973 | `<template-job-file>` | Path to a job template file |
1975 ## Function: prodstub_check_jobdata_2() ##
1977 Check a job in the prodstub towards the list of provided parameters.
1981 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
1983 | parameter | description |
1984 | --------- | ----------- |
1985 | `<response-code>` | Expected http response code |
1986 | `<producer-id>` | Id of the producer |
1987 | `<job-id>` | Id of the job |
1988 | `<type-id>` | Id of the type |
1989 | `<target-url>` | Target url for data delivery |
1990 | `<job-owner>` | Id of the job owner |
1991 | `<template-job-file>` | Path to a job template file |
1993 ## Function: prodstub_check_jobdata_3() ##
1995 Check a job in the prodstub towards the list of provided parameters.
1999 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2001 | parameter | description |
2002 | --------- | ----------- |
2003 | `<response-code>` | Expected http response code |
2004 | `<producer-id>` | Id of the producer |
2005 | `<job-id>` | Id of the job |
2006 | `<type-id>` | Id of the type |
2007 | `<target-url>` | Target url for data delivery |
2008 | `<job-owner>` | Id of the job owner |
2009 | `<template-job-file>` | Path to a job template file |
2011 ## Function: prodstub_delete_jobdata() ##
2013 Delete the job parameters, job data, for a job.
2017 | `<response-code> <producer-id> <job-id>` |
2019 | parameter | description |
2020 | --------- | ----------- |
2021 | `<response-code>` | Expected http response code |
2022 | `<producer-id>` | Id of the producer |
2023 | `<job-id>` | Id of the job |
2025 ## Function: prodstub_equal ##
2027 Tests if a variable value in the prodstub is equal to a target value.
2028 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2029 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.
2033 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2035 | parameter | description |
2036 | --------- | ----------- |
2037 | `<variable-name>` | Variable name in the prostub |
2038 | `<target-value>` | Target value for the variable |
2039 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2041 # Description of functions in rapp_catalogue_api_function.sh #
2043 ## Function: use_rapp_catalogue_http ##
2045 Use http for the API. This is the default protocol.
2050 ## Function: use_rapp_catalogue_https ##
2052 Use https for the API.
2057 ## Function: start_rapp_catalogue ##
2059 Start the rapp catalogue container in docker or kube depending on start mode
2064 ## Function: rc_equal ##
2066 Tests if a variable value in the RAPP Catalogue is equal to a target value.
2067 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2068 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.
2069 See the 'cr' dir for more details.
2072 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2074 | parameter | description |
2075 | --------- | ----------- |
2076 | `<variable-name>` | Variable name in the RC |
2077 | `<target-value>` | Target value for the variable |
2078 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2080 ## Function: rapp_cat_api_get_services() ##
2082 Check all registered services.
2086 | `<response-code> [(<service-id> <version> <display-name> <description>)+ \| EMPTY ]` |
2088 | parameter | description |
2089 | --------- | ----------- |
2090 | `<response-code>` | Expected http response code |
2091 | `<service-id>` | Id of the service |
2092 | `<version>` | Version of the service |
2093 | `<display-name>` | Dislay name of the service |
2094 | `<description>` | Description of the service |
2095 | `EMPTY` | Indicator for an empty list |
2097 ## Function: rapp_cat_api_put_service() ##
2099 Register a services.
2103 | `<response-code> <service-id> <version> <display-name> <description>` |
2105 | parameter | description |
2106 | --------- | ----------- |
2107 | `<response-code>` | Expected http response code |
2108 | `<service-id>` | Id of the service |
2109 | `<version>` | Version of the service |
2110 | `<display-name>` | Dislay name of the service |
2111 | `<description>` | Description of the service |
2113 ## Function: rapp_cat_api_get_service() ##
2115 Check a registered service.
2119 | `<response-code> <service-id> <version> <display-name> <description>` |
2121 | parameter | description |
2122 | --------- | ----------- |
2123 | `<response-code>` | Expected http response code |
2124 | `<service-id>` | Id of the service |
2125 | `<version>` | Version of the service |
2126 | `<display-name>` | Dislay name of the service |
2127 | `<description>` | Description of the service |
2129 ## Function: rapp_cat_api_delete_service() ##
2131 Check a registered service.
2135 | `<response-code> <service-id>` |
2137 | parameter | description |
2138 | --------- | ----------- |
2139 | `<response-code>` | Expected http response code |
2140 | `<service-id>` | Id of the service |
2142 # Description of functions in ricsimulator_api_functions.sh #
2144 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
2146 ## Function: use_simulator_http ##
2148 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.
2153 ## Function: use_simulator_https ##
2155 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.
2160 ## Function: start_ric_simulators ##
2162 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
2165 | `ricsim_g1\|ricsim_g2\|ricsim_g3 <count> <interface-id>` |
2167 | parameter | description |
2168 | --------- | ----------- |
2169 | `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 |
2170 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
2171 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
2173 ## Function: get_kube_sim_host ##
2175 Translate ric name to kube host name.
2180 | parameter | description |
2181 | --------- | ----------- |
2182 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
2184 ## Function: generate_policy_uuid ##
2186 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
2187 UUID is then automatically added to the policy id in GET/PUT/DELETE.
2192 ## Function: sim_equal ##
2194 Tests if a variable value in the RIC simulator is equal to a target value.
2195 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2196 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.
2197 See the 'a1-interface' repo for more details.
2201 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2203 | parameter | description |
2204 | --------- | ----------- |
2205 | `<variable-name>` | Variable name in the ric simulator |
2206 | `<target-value>` | Target value for the variable |
2207 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2209 ## Function: sim_print ##
2211 Prints the value of a variable in the RIC simulator.
2212 See the 'a1-interface' repo for more details.
2216 | `<variable-name>` |
2218 | parameter | description |
2219 | --------- | ----------- |
2220 | `<variable-name>` | Variable name in the RIC simulator |
2222 ## Function: sim_contains_str ##
2224 Tests if a variable value in the RIC simulator contains a target string.
2225 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
2226 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.
2227 See the 'a1-interface' repo for more details.
2231 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2233 | parameter | description |
2234 | --------- | ----------- |
2235 | `<variable-name>` | Variable name in the ric simulator |
2236 | `<target-value>` | Target substring for the variable |
2237 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2239 ## Function: sim_put_policy_type ##
2241 Loads a policy type to the simulator
2245 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
2247 | parameter | description |
2248 | --------- | ----------- |
2249 | `<response-code>` | Expected http response code |
2250 | `<ric-id>` | Id of the ric |
2251 | `<policy-type-id>` | Id of the policy type |
2252 | `<policy-type-file>` | Path to the schema file of the policy type |
2254 ## Function: sim_delete_policy_type ##
2256 Deletes a policy type from the simulator
2260 | `<response-code> <ric-id> <policy_type_id>` |
2262 | parameter | description |
2263 | --------- | ----------- |
2264 | `<response-code>` | Expected http response code |
2265 | `<ric-id>` | Id of the ric |
2266 | `<policy-type-id>` | Id of the policy type |
2268 ## Function: sim_post_delete_instances ##
2270 Deletes all instances (and status), for one ric
2274 | `<response-code> <ric-id>` |
2276 | parameter | description |
2277 | --------- | ----------- |
2278 | `<response-code>` | Expected http response code |
2279 | `<ric-id>` | Id of the ric |
2281 ## Function: sim_post_delete_all ##
2283 Deletes all types, instances (and status), for one ric
2287 | `<response-code> <ric-id>` |
2289 | parameter | description |
2290 | --------- | ----------- |
2291 | `<response-code>` | Expected http response code |
2292 | `<ric-id>` | Id of the ric |
2294 ## Function: sim_post_forcedresponse ##
2296 Sets (or resets) response code for next (one) A1 message, for one ric.
2297 The intention is to simulate error response on the A1 interface.
2301 | `<response-code> <ric-id> [<forced_response_code>]`|
2303 | parameter | description |
2304 | --------- | ----------- |
2305 | `<response-code>` | Expected http response code |
2306 | `<ric-id>` | Id of the ric |
2307 | `<forced_response_code>` | Http response code to send |
2309 ## Function: sim_post_forcedelay ##
2311 Sets (or resets) A1 response delay, for one ric
2312 The intention is to delay responses on the A1 interface. Setting remains until removed.
2316 | `<response-code> <ric-id> [<delay-in-seconds>]`|
2318 | parameter | description |
2319 | --------- | ----------- |
2320 | `<response-code>` | Expected http response code |
2321 | `<ric-id>` | Id of the ric |
2322 | `<delay-in-seconds>` | Delay in seconds. If omitted, the delay is removed |
2326 Copyright (C) 2020 Nordix Foundation. All rights reserved.
2327 Licensed under the Apache License, Version 2.0 (the "License");
2328 you may not use this file except in compliance with the License.
2329 You may obtain a copy of the License at
2331 http://www.apache.org/licenses/LICENSE-2.0
2333 Unless required by applicable law or agreed to in writing, software
2334 distributed under the License is distributed on an "AS IS" BASIS,
2335 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2336 See the License for the specific language governing permissions and
2337 limitations under the License.