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 ## Function: cr_api_check_all_ecs_events() ##
1043 Check the contents of all current status events for one id from ECS
1047 | `<response-code> <id> [ EMPTY \| ( <status> )+ ]` |
1049 | parameter | description |
1050 | --------- | ----------- |
1051 | `<response-code>` | Expected http response code |
1052 | `<id>` | Id of the callback destination |
1053 | `EMPTY` | Indicator for an empty list |
1054 | `<status>` | Status string |
1056 ## Function: cr_api_check_all_ecs_subscription_events() ##
1058 Check the contents of all current subscription events for one id from ECS
1062 | `<response-code> <id> [ EMPTY | ( <type-id> <schema> <registration-status> )+ ]` |
1064 | parameter | description |
1065 | --------- | ----------- |
1066 | `<response-code>` | Expected http response code |
1067 | `<id>` | Id of the callback destination |
1068 | `EMPTY` | Indicator for an empty list |
1069 | `<type-id>` | Id of the data type |
1070 | `<schema>` | Path to typeschema file |
1071 | `<registration-status>` | Status string |
1074 ## Function: cr_api_reset() ##
1076 Reset the callback receiver
1083 # Description of functions in ecs_api_functions.sh #
1085 ## Function: use_ecs_rest_http ##
1087 Use http for all API calls to the ECS. This is the default protocol.
1092 ## Function: use_ecs_rest_https ##
1094 Use https for all API calls to the ECS.
1099 ## Function: use_ecs_dmaap_http ##
1101 Send and recieve all API calls to the ECS over Dmaap via the MR using http.
1106 ## Function: use_ecs_dmaap_https ##
1108 Send and recieve all API calls to the ECS over Dmaap via the MR using https.
1113 ## Function: start_ecs ##
1115 Start the ECS container in docker or kube depending on running mode.
1120 ## Function: stop_ecs ##
1122 Stop the ECS container.
1127 ## Function: start_stopped_ecs ##
1129 Start a previously stopped ecs.
1134 ## Function: set_ecs_debug ##
1136 Configure the ECS log on debug level. The ECS must be running.
1141 ## Function: set_ecs_trace ##
1143 Configure the ECS log on trace level. The ECS must be running.
1148 ## Function: check_ecs_logs ##
1150 Check the ECS log for any warnings and errors and print the count of each.
1155 ## Function: ecs_equal ##
1157 Tests if a variable value in the ECS is equal to a target value.
1158 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1159 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.
1160 See the 'a1-interface' repo for more details.
1164 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1166 | parameter | description |
1167 | --------- | ----------- |
1168 | `<variable-name>` | Variable name in ecs |
1169 | `<target-value>` | Target value for the variable |
1170 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1172 ## Function: ecs_api_a1_get_job_ids() ##
1174 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs' and optional check of the array of returned job ids.
1175 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1176 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1180 | `<response-code> <type-id> <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
1182 | parameter | description |
1183 | --------- | ----------- |
1184 | `<response-code>` | Expected http response code |
1185 | `<type-id>` | Id of the EI type |
1186 | `<owner-id>` | Id of the job owner |
1187 | `NOOWNER` | No owner is given |
1188 | `<job-id>` | Id of the expected job |
1189 | `EMPTY` | The expected list of job id shall be empty |
1191 ## Function: ecs_api_a1_get_type() ##
1193 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}' and optional check of the returned schema.
1194 To test the response code only, provide the response code parameter as well as the type-id.
1195 To also test the response payload add a path to the expected schema file.
1199 | `<response-code> <type-id> [<schema-file>]` |
1201 | parameter | description |
1202 | --------- | ----------- |
1203 | `<response-code>` | Expected http response code |
1204 | `<type-id>` | Id of the EI type |
1205 | `<schema-file>` | Path to a schema file to compare with the returned schema |
1207 ## Function: ecs_api_a1_get_type_ids() ##
1209 Test of GET '/A1-EI​/v1​/eitypes' and optional check of returned list of type ids.
1210 To test the response code only, provide the response only.
1211 To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
1215 | `<response-code> [ (EMPTY \| [<type-id>]+) ]` |
1217 | parameter | description |
1218 | --------- | ----------- |
1219 | `<response-code>` | Expected http response code |
1220 | `EMPTY` | The expected list of type ids shall be empty |
1221 | `<type-id>` | Id of the EI type |
1223 ## Function: ecs_api_a1_get_job_status() ##
1225 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}​/status' and optional check of the returned status.
1226 To test the response code only, provide the response code, type id and job id.
1227 To also test the response payload add the expected status.
1231 | `<response-code> <type-id> <job-id> [<status>]` |
1233 | parameter | description |
1234 | --------- | ----------- |
1235 | `<response-code>` | Expected http response code |
1236 | `<type-id>` | Id of the EI type |
1237 | `<job-id>` | Id of the job |
1238 | `<status>` | Expected status |
1240 ## Function: ecs_api_a1_get_job() ##
1242 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}' and optional check of the returned job.
1243 To test the response code only, provide the response code, type id and job id.
1244 To also test the response payload add the remaining parameters.
1248 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1250 | parameter | description |
1251 | --------- | ----------- |
1252 | `<response-code>` | Expected http response code |
1253 | `<type-id>` | Id of the EI type |
1254 | `<job-id>` | Id of the job |
1255 | `<target-url>` | Expected target url for the job |
1256 | `<owner-id>` | Expected owner for the job |
1257 | `<template-job-file>` | Path to a job template for job parameters of the job |
1259 ## Function: ecs_api_a1_delete_job() ##
1261 Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1262 To test, provide all the specified parameters.
1266 | `<response-code> <type-id> <job-id>` |
1268 | parameter | description |
1269 | --------- | ----------- |
1270 | `<response-code>` | Expected http response code |
1271 | `<type-id>` | Id of the EI type |
1272 | `<job-id>` | Id of the job |
1274 ## Function: ecs_api_a1_put_job() ##
1276 Test of PUT '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1277 To test, provide all the specified parameters.
1281 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
1283 | parameter | description |
1284 | --------- | ----------- |
1285 | `<response-code>` | Expected http response code |
1286 | `<type-id>` | Id of the EI type |
1287 | `<job-id>` | Id of the job |
1288 | `<target-url>` | Target url for the job |
1289 | `<owner-id>` | Owner of the job |
1290 | `<template-job-file>` | Path to a job template for job parameters of the job |
1292 ## Function: ecs_api_edp_get_type_ids() ##
1294 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.
1295 To test the response code only, provide the response code.
1296 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1300 | `<response-code> [ EMPTY \| <type-id>+]` |
1302 | parameter | description |
1303 | --------- | ----------- |
1304 | `<response-code>` | Expected http response code |
1305 | `<type-id>` | Id of the type |
1306 | `EMPTY` | The expected list of type ids shall be empty |
1308 ## Function: ecs_api_edp_get_producer_status() ##
1310 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.
1311 To test the response code only, provide the response code and producer id.
1312 To also test the response payload add the expected status.
1316 | `<response-code> <producer-id> [<status>]` |
1318 | parameter | description |
1319 | --------- | ----------- |
1320 | `<response-code>` | Expected http response code |
1321 | `<producer-id>` | Id of the producer |
1322 | `<status>` | The expected status string |
1324 ## Function: ecs_api_edp_get_producer_ids() ##
1326 Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
1327 To test the response code only, provide the response.
1328 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).
1332 | `<response-code> [ EMPTY \| <producer-id>+]` |
1334 | parameter | description |
1335 | --------- | ----------- |
1336 | `<response-code>` | Expected http response code |
1337 | `<producer-id>` | Id of the producer |
1338 | `EMPTY` | The expected list of type ids shall be empty |
1340 ## Function: ecs_api_edp_get_producer_ids_2() ##
1342 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.
1343 To test the response code only, provide the response.
1344 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).
1348 | `<response-code> [ ( NOTYPE \| <type-id> ) [ EMPTY \| <producer-id>+]` |
1350 | parameter | description |
1351 | --------- | ----------- |
1352 | `<response-code>` | Expected http response code |
1353 | `<type-id>` | Id of the type |
1354 | `EMPTY` | No type given |
1355 | `<producer-id>` | Id of the producer |
1356 | `EMPTY` | The expected list of type ids shall be empty |
1358 ## Function: ecs_api_edp_get_type() ##
1360 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
1361 To test the response code only, provide the response and the type-id.
1362 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).
1366 | `<response-code> <type-id> [<job-schema-file> (EMPTY \| [<producer-id>]+)]` |
1368 | parameter | description |
1369 | --------- | ----------- |
1370 | `<response-code>` | Expected http response code |
1371 | `<type-id>` | Id of the type |
1372 | `<job-schema-file>` | Path to a job schema file |
1373 | `<producer-id>` | Id of the producer |
1374 | `EMPTY` | The expected list of type ids shall be empty |
1376 ## Function: ecs_api_edp_get_type_2() ##
1378 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.
1379 To test the response code only, provide the response and the type-id.
1380 To also test the response payload add a path to a job schema file.
1384 | `<response-code> <type-id> [<job-schema-file>]` |
1386 | parameter | description |
1387 | --------- | ----------- |
1388 | `<response-code>` | Expected http response code |
1389 | `<type-id>` | Id of the type |
1390 | `<job-schema-file>` | Path to a job schema file |
1391 | `EMPTY` | The expected list of type ids shall be empty |
1393 ## Function: ecs_api_edp_put_type_2() ##
1395 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.
1399 | `<response-code> <type-id> [<job-schema-file>]` |
1401 | parameter | description |
1402 | --------- | ----------- |
1403 | `<response-code>` | Expected http response code |
1404 | `<type-id>` | Id of the type |
1405 | `<job-schema-file>` | Path to a job schema file |
1406 | `EMPTY` | The expected list of type ids shall be empty |
1408 ## Function: ecs_api_edp_delete_type_2() ##
1410 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.
1414 | `<response-code> <type-id>` |
1416 | parameter | description |
1417 | --------- | ----------- |
1418 | `<response-code>` | Expected http response code |
1419 | `<type-id>` | Id of the type |
1421 ## Function: ecs_api_edp_get_producer() ##
1423 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
1424 To test the response code only, provide the response and the producer-id.
1425 To also test the response payload add the remaining parameters defining thee producer.
1429 | `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY\| [<type-id> <schema-file>]+) ]` |
1431 | parameter | description |
1432 | --------- | ----------- |
1433 | `<response-code>` | Expected http response code |
1434 | `<producer-id>` | Id of the producer |
1435 | `<create-callback>` | Callback for create job |
1436 | `<delete-callback>` | Callback for delete job |
1437 | `<supervision-callback>` | Callback for producer supervision |
1438 | `<type-id>` | Id of the type |
1439 | `<schema-file>` | Path to a schema file |
1440 | `EMPTY` | The expected list of type schema pairs shall be empty |
1442 ## Function: ecs_api_edp_get_producer_2() ##
1444 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.
1445 To test the response code only, provide the response and the producer-id.
1446 To also test the response payload add the remaining parameters defining thee producer.
1450 | `<response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY \| <type-id>+) ]` |
1452 | parameter | description |
1453 | --------- | ----------- |
1454 | `<response-code>` | Expected http response code |
1455 | `<producer-id>` | Id of the producer |
1456 | `<job-callback>` | Callback for the url |
1457 | `<supervision-callback>` | Callback for producer supervision |
1458 | `<type-id>` | Id of the type |
1459 | `EMPTY` | The expected list of types shall be empty |
1461 ## Function: ecs_api_edp_delete_producer() ##
1463 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version.
1464 To test, provide all parameters.
1468 | `<response-code> <producer-id>` |
1470 | parameter | description |
1471 | --------- | ----------- |
1472 | `<response-code>` | Expected http response code |
1473 | `<producer-id>` | Id of the producer |
1475 ## Function: ecs_api_edp_put_producer() ##
1477 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1478 To test, provide all parameters. The list of type/schema pair may be empty.
1482 | `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY \| [<type-id> <schema-file>]+)` |
1484 | parameter | description |
1485 | --------- | ----------- |
1486 | `<response-code>` | Expected http response code |
1487 | `<producer-id>` | Id of the producer |
1488 | `<job-callback>` | Callback for create/delete job |
1489 | `<supervision-callback>` | Callback for producer supervision |
1490 | `<type-id>` | Id of the type |
1491 | `<schema-file>` | Path to a schema file |
1492 | `EMPTY` | The list of type/schema pairs is empty |
1494 ## Function: ecs_api_edp_put_producer_2() ##
1496 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version.
1497 To test, provide all parameters. The list of type/schema pair may be empty.
1501 | `<response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE\|[<type-id>+]` |
1503 | parameter | description |
1504 | --------- | ----------- |
1505 | `<response-code>` | Expected http response code |
1506 | `<producer-id>` | Id of the producer |
1507 | `<job-callback>` | Callback for create/delete job |
1508 | `<supervision-callback>` | Callback for producer supervision |
1509 | `<type-id>` | Id of the type |
1510 | `NOTYPE` | The list of types is empty |
1512 ## Function: ecs_api_edp_get_producer_jobs() ##
1514 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
1515 To test the response code only, provide the response and the producer-id.
1516 To also test the response payload add the remaining parameters.
1520 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1522 | parameter | description |
1523 | --------- | ----------- |
1524 | `<response-code>` | Expected http response code |
1525 | `<producer-id>` | Id of the producer |
1526 | `<job-id>` | Id of the job |
1527 | `<type-id>` | Id of the EI type |
1528 | `<target-url>` | Target url for data delivery |
1529 | `<job-owner>` | Id of the job owner |
1530 | `<template-job-file>` | Path to a job template file |
1531 | `EMPTY` | The list of job/type/target/job-file tuples is empty |
1533 ## Function: ecs_api_edp_get_producer_jobs_2() ##
1535 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.
1536 To test the response code only, provide the response and the producer-id.
1537 To also test the response payload add the remaining parameters.
1541 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1543 | parameter | description |
1544 | --------- | ----------- |
1545 | `<response-code>` | Expected http response code |
1546 | `<producer-id>` | Id of the producer |
1547 | `<job-id>` | Id of the job |
1548 | `<type-id>` | Id of the type |
1549 | `<target-url>` | Target url for data delivery |
1550 | `<job-owner>` | Id of the job owner |
1551 | `<template-job-file>` | Path to a job template file |
1552 | `EMPTY` | The list of job/type/target/job-file tuples is empty |
1554 ## Function: ecs_api_service_status() ##
1556 Test of GET '/status'.
1560 | `<response-code>` |
1562 | parameter | description |
1563 | --------- | ----------- |
1564 | `<response-code>` | Expected http response code |
1566 ## Function: ecs_api_idc_get_type_ids() ##
1568 Test of GET '/data-consumer/v1/info-types' and an optional check of the returned list of type ids.
1569 To test the response code only, provide the response code.
1570 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1574 | `<response-code> [ EMPTY \| <type-id>+]` |
1576 | parameter | description |
1577 | --------- | ----------- |
1578 | `<response-code>` | Expected http response code |
1579 | `<type-id>` | Id of the Info type |
1580 | `EMPTY` | The expected list of type ids shall be empty |
1582 ## Function: ecs_api_idc_get_job_ids() ##
1584 Test of GET '/data-consumer/v1/info-jobs' and optional check of the array of returned job ids.
1585 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1586 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1590 | `<response-code> <type-id> <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
1592 | parameter | description |
1593 | --------- | ----------- |
1594 | `<response-code>` | Expected http response code |
1595 | `<type-id>` | Id of the Info type |
1596 | `<owner-id>` | Id of the job owner |
1597 | `NOOWNER` | No owner is given |
1598 | `<job-id>` | Id of the expected job |
1599 | `EMPTY` | The expected list of job id shall be empty |
1601 ## Function: ecs_api_idc_get_job() ##
1603 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}' and optional check of the returned job.
1604 To test the response code only, provide the response code, type id and job id.
1605 To also test the response payload add the remaining parameters.
1609 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1611 | parameter | description |
1612 | --------- | ----------- |
1613 | `<response-code>` | Expected http response code |
1614 | `<type-id>` | Id of the Info type |
1615 | `<job-id>` | Id of the job |
1616 | `<target-url>` | Expected target url for the job |
1617 | `<owner-id>` | Expected owner for the job |
1618 | `<template-job-file>` | Path to a job template for job parameters of the job |
1620 ## Function: ecs_api_idc_put_job() ##
1622 Test of PUT '​/data-consumer/v1/info-jobs/{infoJobId}'.
1623 To test, provide all the specified parameters.
1627 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file> [VALIDATE]` |
1629 | parameter | description |
1630 | --------- | ----------- |
1631 | `<response-code>` | Expected http response code |
1632 | `<type-id>` | Id of the Info type |
1633 | `<job-id>` | Id of the job |
1634 | `<target-url>` | Target url for the job |
1635 | `<owner-id>` | Owner of the job |
1636 | `<template-job-file>` | Path to a job template for job parameters of the job |
1637 | `VALIIDATE` | Indicator to preform type validation at creation |
1639 ## Function: ecs_api_idc_delete_job() ##
1641 Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1642 To test, provide all the specified parameters.
1646 | `<response-code> <type-id> <job-id>` |
1648 | parameter | description |
1649 | --------- | ----------- |
1650 | `<response-code>` | Expected http response code |
1651 | `<type-id>` | Id of the type |
1652 | `<job-id>` | Id of the job |
1654 ## Function: ecs_api_idc_get_type() ##
1656 Test of GET '/data-consumer/v1/info-types/{infoTypeId} and optional check of the returned schema.
1657 To test the response code only, provide the response code parameter as well as the type-id.
1658 To also test the response payload add a path to the expected schema file.
1662 | `<response-code> <type-id> [<schema-file>]` |
1664 | parameter | description |
1665 | --------- | ----------- |
1666 | `<response-code>` | Expected http response code |
1667 | `<type-id>` | Id of the Info type |
1668 | `<schema-file>` | Path to a schema file to compare with the returned schema |
1670 ## Function: ecs_api_idc_get_job_status() ##
1672 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' and optional check of the returned status and timeout.
1673 To test the response code only, provide the response code and job id.
1674 To also test the response payload add the expected status.
1678 | `<response-code> <job-id> [<status> [ <timeout>]]` |
1680 | parameter | description |
1681 | --------- | ----------- |
1682 | `<response-code>` | Expected http response code |
1683 | `<job-id>` | Id of the job |
1684 | `<status>` | Expected status |
1685 | `<timeout>` | Timeout |
1687 ## Function: ecs_api_idc_get_job_status2() ##
1689 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' with returned producers and optional check of the returned status and timeout.
1690 To test the response code only, provide the response code and job id.
1691 To also test the response payload add the expected status.
1695 | `<response-code> <job-id> [<status> EMPTYPROD|( <prod-count> <producer-id>+ ) [<timeout>]]` |
1697 | parameter | description |
1698 | --------- | ----------- |
1699 | `<response-code>` | Expected http response code |
1700 | `<job-id>` | Id of the job |
1701 | `<status>` | Expected status |
1702 | `<EMPTYPROD>` | Indicated for empty list of producer |
1703 | `<prod-count>` | Number of expected producer |
1704 | `<producer-id>` |Id of the producer |
1705 | `<timeout>` | Timeout |
1708 ## Function: ecs_api_idc_get_subscription_ids() ##
1709 Test of GET '/data-consumer/v1/info-type-subscription' with the returned list of subscription ids
1713 | `<response-code> <owner-id>|NOOWNER [ EMPTY | <subscription-id>+]` |
1715 | parameter | description |
1716 | --------- | ----------- |
1717 | `<response-code>` | Expected http response code |
1718 | `<owner-id>` | Id of the owner |
1719 | `<NOOWNER>` | Indicator for empty owner |
1720 | `<EMPTY>` | Indicated for empty list of subscription ids |
1721 | `<subscription-id>` |Id of the subscription |
1723 ## Function: ecs_api_idc_get_subscription() ##
1724 Test of GET '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
1728 | `<response-code> <subscription-id> [ <owner-id> <status-uri> ]` |
1730 | parameter | description |
1731 | --------- | ----------- |
1732 | `<response-code>` | Expected http response code |
1733 | `<subscription-id>` |Id of the subscription |
1734 | `<owner-id>` | Id of the owner |
1735 | `<status-uri>` | Url for status notifications |
1738 ## Function: ecs_api_idc_put_subscription() ##
1739 Test of PUT '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
1743 | `<response-code> <subscription-id> <owner-id> <status-uri>` |
1745 | parameter | description |
1746 | --------- | ----------- |
1747 | `<response-code>` | Expected http response code |
1748 | `<subscription-id>` |Id of the subscription |
1749 | `<owner-id>` | Id of the owner |
1750 | `<status-uri>` | Url for status notifications |
1752 ## Function: ecs_api_idc_delete_subscription() ##
1753 Test of DELETE /data-consumer/v1/info-type-subscription/{subscriptionId}
1757 | `<response-code> <subscription-id>` |
1759 | parameter | description |
1760 | --------- | ----------- |
1761 | `<response-code>` | Expected http response code |
1762 | `<subscription-id>` |Id of the subscription |
1765 ## Function: ecs_api_admin_reset() ##
1767 Test of GET '/status'.
1771 | `<response-code> [ <type> ]` |
1773 | parameter | description |
1774 | --------- | ----------- |
1775 | `<response-code>` | Expected http response code |
1776 | `<type>` | Type id, if the interface supports type in url |
1778 # Description of functions in gateway_api_functions.sh #
1780 ## Function: use_gateway_http ##
1782 Use http for all calls to the gateway. This is set by default.
1787 ## Function: use_gateway_https ##
1789 Use https for all calls to the gateway.
1794 ## Function: set_gateway_debug ##
1796 Set debug level logging in the gateway
1801 ## Function: set_gateway_trace ##
1803 Set debug level logging in the trace
1808 ## Function: start_gateway ##
1810 Start the the gateway container in docker or kube depending on start mode
1815 ## Function: gateway_pms_get_status ##
1817 Sample test of pms api (status)
1820 | `<response-code>` |
1822 | parameter | description |
1823 | --------- | ----------- |
1824 | `<response-code>` | Expected http response code |
1826 ## Function: gateway_ecs_get_types ##
1828 Sample test of ecs api (get types)
1829 Only response code tested - not payload
1832 | `<response-code>` |
1834 | parameter | description |
1835 | --------- | ----------- |
1836 | `<response-code>` | Expected http response code |
1838 # Description of functions in http_proxy_api_functions.sh #
1840 ## Function: use_http_proxy_http ##
1842 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.
1847 ## Function: use_http_proxy_https ##
1849 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.
1854 ## Function: start_http_proxy ##
1856 Start the http proxy container in docker or kube depending on running mode.
1861 # Description of functions in kube_proxy_api_functions.sh #
1863 ## Function: use_kube_proxy_http ##
1865 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.
1870 ## Function: use_kube_proxy_https ##
1872 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.
1877 ## Function: start_kube_proxy ##
1879 Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
1880 No proxy is started if the function is called in docker mode.
1885 # Description of functions in mr_api_functions.sh #
1887 ## Function: use_mr_http ##
1889 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.
1894 ## Function: use_mr_https ##
1896 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.
1901 ## Function: start_mr ##
1903 Start the Message Router stub interface container in docker or kube depending on start mode
1908 ## Function: mr_equal ##
1910 Tests if a variable value in the Message Router (MR) simulator is equal to a target value.
1911 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1912 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.
1913 See the 'mrstub' dir for more details.
1916 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1918 | parameter | description |
1919 | --------- | ----------- |
1920 | `<variable-name>` | Variable name in the MR |
1921 | `<target-value>` | Target value for the variable |
1922 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1924 ## Function: mr_greater ##
1926 Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
1927 Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than the target or not.
1928 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.
1929 See the 'mrstub' dir for more details.
1932 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1934 | parameter | description |
1935 | --------- | ----------- |
1936 | `<variable-name>` | Variable name in the MR |
1937 | `<target-value>` | Target value for the variable |
1938 | `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value |
1940 ## Function: mr_read ##
1942 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.
1943 See the 'mrstub' dir for more details.
1946 | `<variable-name>` |
1948 | parameter | description |
1949 | --------- | ----------- |
1950 | `<variable-name>` | Variable name in the MR |
1952 ## Function: mr_print ##
1954 Prints the value of a variable in the Message Router (MR) simulator.
1955 See the 'mrstub' dir for more details.
1958 | `<variable-name>` |
1960 | parameter | description |
1961 | --------- | ----------- |
1962 | `<variable-name>` | Variable name in the MR |
1964 # Description of functions in prodstub_api_functions.sh #
1966 ## Function: use_prod_stub_http ##
1968 Use http for the API. The admin API is not affected. This is the default protocol.
1973 ## Function: use_prod_stub_https ##
1975 Use https for the API. The admin API is not affected.
1980 ## Function: start_prod_stub ##
1982 Start the Producer stub container in docker or kube depending on start mode
1987 ## Function: prodstub_arm_producer() ##
1989 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
1993 | `<response-code> <producer-id> [<forced_response_code>]` |
1995 | parameter | description |
1996 | --------- | ----------- |
1997 | `<response-code>` | Expected http response code |
1998 | `<producer-id>` | Id of the producer |
1999 | `<forced_response_code>` | Forced response code for the producer callback url |
2001 ## Function: prodstub_arm_job_create() ##
2003 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.
2007 | `<response-code> <job-id> [<forced_response_code>]` |
2009 | parameter | description |
2010 | --------- | ----------- |
2011 | `<response-code>` | Expected http response code |
2012 | `<job-id>` | Id of the job |
2013 | `<forced_response_code>` | Forced response code for the create callback url |
2015 ## Function: prodstub_arm_job_delete() ##
2017 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.
2021 | `<response-code> <job-id> [<forced_response_code>]` |
2023 | parameter | description |
2024 | --------- | ----------- |
2025 | `<response-code>` | Expected http response code |
2026 | `<job-id>` | Id of the job |
2027 | `<forced_response_code>` | Forced response code for the delete callback url |
2029 ## Function: prodstub_arm_type() ##
2031 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
2035 | `<response-code> <producer-id> <type-id>` |
2037 | parameter | description |
2038 | --------- | ----------- |
2039 | `<response-code>` | Expected http response code |
2040 | `<producer-id>` | Id of the producer |
2041 | `<type-id>` | Id of the type |
2043 ## Function: prodstub_disarm_type() ##
2045 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
2049 | `<response-code> <producer-id> <type-id>` |
2051 | parameter | description |
2052 | --------- | ----------- |
2053 | `<response-code>` | Expected http response code |
2054 | `<producer-id>` | Id of the producer |
2055 | `<type-id>` | Id of the type |
2057 ## Function: prodstub_check_jobdata() ##
2059 Check a job in the prodstub towards the list of provided parameters.
2063 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2065 | parameter | description |
2066 | --------- | ----------- |
2067 | `<response-code>` | Expected http response code |
2068 | `<producer-id>` | Id of the producer |
2069 | `<job-id>` | Id of the job |
2070 | `<type-id>` | Id of the type |
2071 | `<target-url>` | Target url for data delivery |
2072 | `<job-owner>` | Id of the job owner |
2073 | `<template-job-file>` | Path to a job template file |
2075 ## Function: prodstub_check_jobdata_2() ##
2077 Check a job in the prodstub towards the list of provided parameters.
2081 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2083 | parameter | description |
2084 | --------- | ----------- |
2085 | `<response-code>` | Expected http response code |
2086 | `<producer-id>` | Id of the producer |
2087 | `<job-id>` | Id of the job |
2088 | `<type-id>` | Id of the type |
2089 | `<target-url>` | Target url for data delivery |
2090 | `<job-owner>` | Id of the job owner |
2091 | `<template-job-file>` | Path to a job template file |
2093 ## Function: prodstub_check_jobdata_3() ##
2095 Check a job in the prodstub towards the list of provided parameters.
2099 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2101 | parameter | description |
2102 | --------- | ----------- |
2103 | `<response-code>` | Expected http response code |
2104 | `<producer-id>` | Id of the producer |
2105 | `<job-id>` | Id of the job |
2106 | `<type-id>` | Id of the type |
2107 | `<target-url>` | Target url for data delivery |
2108 | `<job-owner>` | Id of the job owner |
2109 | `<template-job-file>` | Path to a job template file |
2111 ## Function: prodstub_delete_jobdata() ##
2113 Delete the job parameters, job data, for a job.
2117 | `<response-code> <producer-id> <job-id>` |
2119 | parameter | description |
2120 | --------- | ----------- |
2121 | `<response-code>` | Expected http response code |
2122 | `<producer-id>` | Id of the producer |
2123 | `<job-id>` | Id of the job |
2125 ## Function: prodstub_equal ##
2127 Tests if a variable value in the prodstub is equal to a target value.
2128 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2129 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.
2133 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2135 | parameter | description |
2136 | --------- | ----------- |
2137 | `<variable-name>` | Variable name in the prostub |
2138 | `<target-value>` | Target value for the variable |
2139 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2141 # Description of functions in rapp_catalogue_api_function.sh #
2143 ## Function: use_rapp_catalogue_http ##
2145 Use http for the API. This is the default protocol.
2150 ## Function: use_rapp_catalogue_https ##
2152 Use https for the API.
2157 ## Function: start_rapp_catalogue ##
2159 Start the rapp catalogue container in docker or kube depending on start mode
2164 ## Function: rc_equal ##
2166 Tests if a variable value in the RAPP Catalogue is equal to a target value.
2167 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2168 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.
2169 See the 'cr' dir for more details.
2172 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2174 | parameter | description |
2175 | --------- | ----------- |
2176 | `<variable-name>` | Variable name in the RC |
2177 | `<target-value>` | Target value for the variable |
2178 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2180 ## Function: rapp_cat_api_get_services() ##
2182 Check all registered services.
2186 | `<response-code> [(<service-id> <version> <display-name> <description>)+ \| EMPTY ]` |
2188 | parameter | description |
2189 | --------- | ----------- |
2190 | `<response-code>` | Expected http response code |
2191 | `<service-id>` | Id of the service |
2192 | `<version>` | Version of the service |
2193 | `<display-name>` | Dislay name of the service |
2194 | `<description>` | Description of the service |
2195 | `EMPTY` | Indicator for an empty list |
2197 ## Function: rapp_cat_api_put_service() ##
2199 Register a services.
2203 | `<response-code> <service-id> <version> <display-name> <description>` |
2205 | parameter | description |
2206 | --------- | ----------- |
2207 | `<response-code>` | Expected http response code |
2208 | `<service-id>` | Id of the service |
2209 | `<version>` | Version of the service |
2210 | `<display-name>` | Dislay name of the service |
2211 | `<description>` | Description of the service |
2213 ## Function: rapp_cat_api_get_service() ##
2215 Check a registered service.
2219 | `<response-code> <service-id> <version> <display-name> <description>` |
2221 | parameter | description |
2222 | --------- | ----------- |
2223 | `<response-code>` | Expected http response code |
2224 | `<service-id>` | Id of the service |
2225 | `<version>` | Version of the service |
2226 | `<display-name>` | Dislay name of the service |
2227 | `<description>` | Description of the service |
2229 ## Function: rapp_cat_api_delete_service() ##
2231 Check a registered service.
2235 | `<response-code> <service-id>` |
2237 | parameter | description |
2238 | --------- | ----------- |
2239 | `<response-code>` | Expected http response code |
2240 | `<service-id>` | Id of the service |
2242 # Description of functions in ricsimulator_api_functions.sh #
2244 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
2246 ## Function: use_simulator_http ##
2248 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.
2253 ## Function: use_simulator_https ##
2255 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.
2260 ## Function: start_ric_simulators ##
2262 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
2265 | `ricsim_g1\|ricsim_g2\|ricsim_g3 <count> <interface-id>` |
2267 | parameter | description |
2268 | --------- | ----------- |
2269 | `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 |
2270 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
2271 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
2273 ## Function: get_kube_sim_host ##
2275 Translate ric name to kube host name.
2280 | parameter | description |
2281 | --------- | ----------- |
2282 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
2284 ## Function: generate_policy_uuid ##
2286 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
2287 UUID is then automatically added to the policy id in GET/PUT/DELETE.
2292 ## Function: sim_equal ##
2294 Tests if a variable value in the RIC simulator is equal to a target value.
2295 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2296 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.
2297 See the 'a1-interface' repo for more details.
2301 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2303 | parameter | description |
2304 | --------- | ----------- |
2305 | `<variable-name>` | Variable name in the ric simulator |
2306 | `<target-value>` | Target value for the variable |
2307 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2309 ## Function: sim_print ##
2311 Prints the value of a variable in the RIC simulator.
2312 See the 'a1-interface' repo for more details.
2316 | `<variable-name>` |
2318 | parameter | description |
2319 | --------- | ----------- |
2320 | `<variable-name>` | Variable name in the RIC simulator |
2322 ## Function: sim_contains_str ##
2324 Tests if a variable value in the RIC simulator contains a target string.
2325 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
2326 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.
2327 See the 'a1-interface' repo for more details.
2331 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2333 | parameter | description |
2334 | --------- | ----------- |
2335 | `<variable-name>` | Variable name in the ric simulator |
2336 | `<target-value>` | Target substring for the variable |
2337 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2339 ## Function: sim_put_policy_type ##
2341 Loads a policy type to the simulator
2345 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
2347 | parameter | description |
2348 | --------- | ----------- |
2349 | `<response-code>` | Expected http response code |
2350 | `<ric-id>` | Id of the ric |
2351 | `<policy-type-id>` | Id of the policy type |
2352 | `<policy-type-file>` | Path to the schema file of the policy type |
2354 ## Function: sim_delete_policy_type ##
2356 Deletes a policy type from the simulator
2360 | `<response-code> <ric-id> <policy_type_id>` |
2362 | parameter | description |
2363 | --------- | ----------- |
2364 | `<response-code>` | Expected http response code |
2365 | `<ric-id>` | Id of the ric |
2366 | `<policy-type-id>` | Id of the policy type |
2368 ## Function: sim_post_delete_instances ##
2370 Deletes all instances (and status), for one ric
2374 | `<response-code> <ric-id>` |
2376 | parameter | description |
2377 | --------- | ----------- |
2378 | `<response-code>` | Expected http response code |
2379 | `<ric-id>` | Id of the ric |
2381 ## Function: sim_post_delete_all ##
2383 Deletes all types, instances (and status), for one ric
2387 | `<response-code> <ric-id>` |
2389 | parameter | description |
2390 | --------- | ----------- |
2391 | `<response-code>` | Expected http response code |
2392 | `<ric-id>` | Id of the ric |
2394 ## Function: sim_post_forcedresponse ##
2396 Sets (or resets) response code for next (one) A1 message, for one ric.
2397 The intention is to simulate error response on the A1 interface.
2401 | `<response-code> <ric-id> [<forced_response_code>]`|
2403 | parameter | description |
2404 | --------- | ----------- |
2405 | `<response-code>` | Expected http response code |
2406 | `<ric-id>` | Id of the ric |
2407 | `<forced_response_code>` | Http response code to send |
2409 ## Function: sim_post_forcedelay ##
2411 Sets (or resets) A1 response delay, for one ric
2412 The intention is to delay responses on the A1 interface. Setting remains until removed.
2416 | `<response-code> <ric-id> [<delay-in-seconds>]`|
2418 | parameter | description |
2419 | --------- | ----------- |
2420 | `<response-code>` | Expected http response code |
2421 | `<ric-id>` | Id of the ric |
2422 | `<delay-in-seconds>` | Delay in seconds. If omitted, the delay is removed |
2426 Copyright (C) 2020 Nordix Foundation. All rights reserved.
2427 Licensed under the Apache License, Version 2.0 (the "License");
2428 you may not use this file except in compliance with the License.
2429 You may obtain a copy of the License at
2431 http://www.apache.org/licenses/LICENSE-2.0
2433 Unless required by applicable law or agreed to in writing, software
2434 distributed under the License is distributed on an "AS IS" BASIS,
2435 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2436 See the License for the specific language governing permissions and
2437 limitations under the License.