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 | `--override <file>` | Override setting from the file supplied by --env-file |
155 | `--pre-clean` | Clean kube resouces when running docker and vice versa |
156 | `--gen-stats` | Collect container/pod runtime statistics |
157 | `help` | Print this info along with the test script description and the list of app short names supported |
159 ## Function: setup_testenvironment ##
161 Main function to setup the test environment before any tests are started.
162 Must be called right after sourcing all component scripts.
167 ## Function: indent1 ##
169 Indent every line of a command output with one space char.
174 ## Function: indent2 ##
176 Indent every line of a command output with two space chars.
181 ## Function: print_result ##
183 Print a test report of an auto-test script.
188 ## Function: start_timer ##
190 Start a timer for time measurement. Only one timer can be running.
193 | None - but any args will be printed (It is good practice to use same args for this function as for the `print_timer`) |
195 ## Function: print_timer ##
197 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.
200 | `<timer-message-to-print>` |
202 | parameter | description |
203 | --------- | ----------- |
204 | `<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`) |
206 ## Function: print_and_reset_timer ##
208 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.
211 | `<timer-message-to-print>` |
213 | parameter | description |
214 | --------- | ----------- |
215 | `<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`) |
217 ## Function: deviation ##
219 Mark a test as a deviation from the requirements. The list of deviations will be printed in the test report.
222 | `<deviation-message-to-print>` |
224 | parameter | description |
225 | --------- | ----------- |
226 | `<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 |
228 ## Function: clean_environment ##
230 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).
235 ## Function: auto_clean_containers ##
237 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.
242 ## Function: sleep_wait ##
244 Make the script sleep for a number of seconds.
247 | `<sleep-time-in-sec> [<any-text-in-quotes-to-be-printed>]` |
249 | parameter | description |
250 | --------- | ----------- |
251 | `<sleep-time-in-sec>` | Number of seconds to sleep |
252 | `<any-text-in-quotes-to-be-printed>` | Optional. The text will be printed, if present |
254 ## Function: check_control_panel_logs ##
256 Check the Control Panel log for any warnings and errors and print the count of each.
261 ## Function: store_logs ##
263 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.
266 | `<logfile-prefix>` |
268 | parameter | description |
269 | --------- | ----------- |
270 | `<logfile-prefix>` | Log file prefix |
272 # Description of functions in testsuite_common.sh #
274 ## Function: suite_setup ##
276 Sets up the test suite and prints out a heading.
283 Print out the overall result of the executed test cases.
288 # Description of functions in agent_api_functions.sh #
292 Both PMS version 1 and 2 are supported. The version is controlled by the env variable `$PMS_VERSION` set in the test env file.
293 For api function in version 2, an url prefix is added if configured.
295 ## Function: use_agent_rest_http ##
297 Use http for all API calls to the Policy Agent. This is the default.
302 ## Function: use_agent_rest_https ##
304 Use https for all API calls to the Policy Agent.
309 ## Function: use_agent_dmaap_http ##
311 Send and recieve all API calls to the Policy Agent over Dmaap via the MR over http.
316 ## Function: use_agent_dmaap_https ##
318 Send and recieve all API calls to the Policy Agent over Dmaap via the MR over https.
323 ## Function: start_policy_agent ##
325 Start the Policy Agent container or corresponding kube resources depending on docker/kube mode.
328 | `<logfile-prefix>` |
329 | (docker) `PROXY\|NOPROXY <config-file>` |
330 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
332 | parameter | description |
333 | --------- | ----------- |
334 | `PROXY` | Configure with http proxy, if proxy is started |
335 | `NOPROXY` | Configure without http proxy |
336 | `<config-file>`| Path to application.yaml |
337 | `<data-file>` | Optional path to application_configuration.json |
339 ## Function: agent_load_config ##
341 Load the config into a config map (kubernetes only).
346 | parameter | description |
347 | --------- | ----------- |
348 | `<data-file>` | Path to application_configuration.json |
350 ## Function: set_agent_debug ##
352 Configure the Policy Agent log on debug level. The Policy Agent must be running.
357 ## Function: set_agent_trace ##
359 Configure the Policy Agent log on trace level. The Policy Agent must be running.
364 ## Function: use_agent_retries ##
366 Configure the Policy Agent to make upto 5 retries if an API calls return any of the specified http return codes.
369 | `[<response-code>]*` |
371 ## Function: check_policy_agent_logs ##
373 Check the Policy Agent log for any warnings and errors and print the count of each.
378 ## Function: api_equal() ##
380 Tests if the array length of a json array in the Policy Agent simulator is equal to a target value.
381 Without the timeout, the test sets pass or fail immediately depending on if the array length is equal to the target or not.
382 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.
383 See the 'cr' dir for more details.
387 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
389 | parameter | description |
390 | --------- | ----------- |
391 | `<variable-name>` | Relative url. Example 'json:policy_types' - checks the json array length of the url /policy_types |
392 | `<target-value>` | Target value for the length |
393 | `<timeout-in-sec>` | Max time to wait for the length to reach the target value |
395 ## Function: api_get_policies() ##
397 Test of GET '/policies' or V2 GET '/v2/policy-instances' and optional check of the array of returned policies.
398 To test the response code only, provide the response code parameter as well as the following three parameters.
399 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.
403 | `<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>]*]` |
407 | `<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>]*]` |
409 | parameter | description |
410 | --------- | ----------- |
411 | `<response-code>` | Expected http response code |
412 | `<ric-id>` | Id of the ric |
413 | `NORIC` | Indicator that no ric is provided |
414 | `<service-id>` | Id of the service |
415 | `NOSERVICE` | Indicator that no service id is provided |
416 | `<policy-type-id>` | Id of the policy type |
417 | `NOTYPE` | Indicator that no type id is provided |
418 | `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
419 | `<policy-id>` | Id of the policy |
420 | `EMPTY` | Indicate for the special empty policy type |
421 | `transient` | Transient, true or false |
422 | `notification-url` | Url for notifications |
423 | `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
425 ## Function: api_get_policy() ##
427 Test of GET '/policy' or V2 GET '/v2/policies/{policy_id}' and optional check of the returned json payload.
428 To test the the response code only, provide the expected response code and policy id.
429 To test the contents of the returned json payload, add a path to the template file used when creating the policy.
433 | `<response-code> <policy-id> [<template-file>]` |
437 | `<response-code> <policy-id> [ <template-file> <service-name> <ric-id> <policytype-id>\|NOTYPE <transient> <notification-url>\|NOURL ]` |
439 | parameter | description |
440 | --------- | ----------- |
441 | `<response-code>` | Expected http response code |
442 | `<policy-id>` | Id of the policy |
443 | `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
444 | `<service-id>` | Id of the service |
445 | `<ric-id>` | Id of the ric |
446 | `<policy-type-id>` | Id of the policy type |
447 | `NOTYPE` | Indicator that no type id is provided |
448 | `transient` | Transient, true or false |
449 | `notification-url` | Url for notifications |
451 ## Function: api_put_policy() ##
453 Test of PUT '/policy' or V2 PUT '/policies'.
454 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).
458 | `<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]` |
462 | `<response-code> <service-name> <ric-id> <policytype-id>\|NOTYPE <policy-id> <transient>\|NOTRANSIENT <notification-url>\|NOURL <template-file> [<count>]` |
464 | parameter | description |
465 | --------- | ----------- |
466 | `<response-code>` | Expected http response code |
467 | `<service-id>` | Id of the service |
468 | `<ric-id>` | Id of the ric |
469 | `<policy-type-id>` | Id of the policy type |
470 | `<policy-id>` | Id of the policy. This value shall be a numeric value if more than one policy shall be created |
471 | `transient>` | Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provided) |
472 | `notification-url` | Url for notifications |
473 |`NOURL`| Indicator for no url |
474 | `<template-file>` | Path to the template file for the policy |
475 | `<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 |
477 ## Function: api_put_policy_batch() ##
479 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.
480 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.
481 For arg list and parameters, see 'api_put_policy'.
483 ## Function: api_put_policy_parallel() ##
485 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.
489 | `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <template-file> <count-per-ric> <number-of-threads>`
493 | `<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>`
495 | parameter | description |
496 | --------- | ----------- |
497 | `<response-code>` | Expected http response code |
498 | `<service-id>` | Id of the service |
499 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing |
500 | `<number-of-rics>` | The number of rics, assuming the first index is '1'. The index is added to the 'ric-id-base' id |
501 | `<policy-type-id>` | Id of the policy type |
502 | `<policy-start-id>` | Id of the policy. This value shall be a numeric value and will be the id of the first policy |
503 | `transient>` | Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provide) |
504 | `notification-url` | Url for notifications |
505 | `<template-file>` | Path to the template file for the policy |
506 | `<count-per-ric>` | Number of policies per ric |
507 | `<number-of-threads>` | Number of threads (processes) to run in parallel |
509 ## Function: api_delete_policy() ##
511 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.
515 | `<response-code> <policy-id> [<count>]`
517 | parameter | description |
518 | --------- | ----------- |
519 | `<response-code>` | Expected http response code |
520 | `<policy-id>` | Id of the policy |
521 | `<count>` | An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
523 ## Function: api_delete_policy_batch() ##
525 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.
526 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.
527 For arg list and parameters, see 'api_delete_policy'.
529 ## Function: api_delete_policy_parallel() ##
531 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.
535 | `<response-code> <ric-id-base> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>`
537 | parameter | description |
538 | --------- | ----------- |
539 | `<response-code>` | Expected http response code |
540 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing |
541 | `<number-of-rics>` | The number of rics, assuming the first index is '1' |
542 | `<policy-start-id>` | Id of the policy. This value shall be a numeric value and will be the id of the first policy |
543 | `<count-per-ric>` | Number of policies per ric |
544 | `<number-of-threads>` | Number of threads (processes) to run in parallel |
546 ## Function: api_get_policy_ids() ##
548 Test of GET '/policy_ids' or V2 GET '/v2/policies'.
549 To test response code only, provide the response code parameter as well as the following three parameters.
550 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.
554 | `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <type-id>\|NOTYPE ([<policy-instance-id]*\|NOID)` |
556 | parameter | description |
557 | --------- | ----------- |
558 | `<response-code>` | Expected http response code |
559 | `<ric-id>` | Id of the ric |
560 | `NORIC` | Indicator that no ric is provided |
561 | `<service-id>` | Id of the service |
562 | `NOSERVICE` | Indicator that no service id is provided |
563 | `type-id>` | Id of the policy type |
564 | `NOTYPE` | Indicator that no type id is provided |
565 | `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
566 | `<policy-instance-id>` | Id of the policy |
568 ## Function: api_get_policy_schema() ##
570 Test of V2 GET '/v2/policy-types/{policyTypeId}' and optional check of the returned json schema.
571 To test the response code only, provide the expected response code and policy type id.
572 To test the contents of the returned json schema, add a path to a schema file to compare with.
576 | `<response-code> <policy-type-id> [<schema-file>]` |
578 | parameter | description |
579 | --------- | ----------- |
580 | `<response-code>` | Expected http response code |
581 | `<policy-type-id>` | Id of the policy type |
582 | `<schema-file>` | Path to the schema file for the policy type |
584 ## Function: api_get_policy_schema() ##
586 Test of GET '/policy_schema' and optional check of the returned json schema.
587 To test the response code only, provide the expected response code and policy type id.
588 To test the contents of the returned json schema, add a path to a schema file to compare with.
592 | `<response-code> <policy-type-id> [<schema-file>]` |
594 | parameter | description |
595 | --------- | ----------- |
596 | `<response-code>` | Expected http response code |
597 | `<policy-type-id>` | Id of the policy type |
598 | `<schema-file>` | Path to the schema file for the policy type |
600 ## Function: api_get_policy_schemas() ##
602 Test of GET '/policy_schemas' and optional check of the returned json schemas.
603 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
604 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)
608 | `<response-code> <ric-id>\|NORIC [<schema-file>\|NOFILE]*` |
610 | parameter | description |
611 | --------- | ----------- |
612 | `<response-code>` | Expected http response code |
613 | `<ric-id>` | Id of the ric |
614 | `NORIC` | No ric id given |
615 | `<schema-file>` | Path to the schema file for the policy type |
616 | `NOFILE` | Indicate the template for an empty type |
618 ## Function: api_get_policy_status() ##
620 Test of GET '/policy_status' or V2 GET '/policies/{policy_id}/status'.
624 | `<response-code> <policy-id> (STD\|STD2 <enforce-status>\|EMPTY [<reason>\|EMPTY])\|(OSC <instance-status> <has-been-deleted>)` |
626 | parameter | description |
627 | --------- | ----------- |
628 | `<response-code>` | Expected http response code |
629 | `<policy-id>` | Id of the policy |
630 | `STD` | Indicator of status of Standarized A1 |
631 | `STD2` | Indicator of status of Standarized A1 version 2 |
632 | `<enforce-status>` | Enforcement status |
633 | `<reason>` | Optional reason |
634 | `EMPTY` | Indicator of empty string status or reason |
635 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
636 | `<instance-status>` | Instance status |
637 | `<has-been-deleted>` | Deleted status, true or false |
639 ## Function: api_get_policy_types() ##
641 Test of GET '/policy_types' or V2 GET '/v2/policy-types' and optional check of the returned ids.
642 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
643 To test the contents of the returned json payload, add the list of expected policy type id (or 'EMPTY' for the '{}' type)
647 | `<response-code> [<ric-id>\|NORIC [<policy-type-id>\|EMPTY [<policy-type-id>]*]]` |
649 | parameter | description |
650 | --------- | ----------- |
651 | `<response-code>` | Expected http response code |
652 | `<ric-id>` | Id of the ric |
653 | `NORIC` | No ric id given |
654 | `<policy-type-id>` | Id of the policy type |
655 | `EMPTY` | Indicate the empty type |
657 ## Function: api_get_status() ##
659 Test of GET /status or V2 GET /status
663 | `<response-code>` |
665 | parameter | description |
666 | --------- | ----------- |
667 | `<response-code>` | Expected http response code |
669 ## Function: api_get_ric() ##
671 Test of GET '/ric' or V2 GET '/v2/rics/ric'
672 To test the response code only, provide the expected response code and managed element id.
673 To test the returned ric id, provide the expected ric id.
677 | `<reponse-code> <managed-element-id> [<ric-id>]` |
681 | `<reponse-code> <management-element-id>\|NOME <ric-id>\|<NORIC> [<string-of-ricinfo>]` |
683 | parameter | description |
684 | --------- | ----------- |
685 | `<response-code>` | Expected http response code |
686 | `<managed-element-id>` | Id of the managed element |
687 | `NOME` | Indicator for no ME |
688 | `ric-id` | Id of the ric |
689 | `NORIC` | Indicator no RIC |
690 | `string-of-ricinfo` | String of ric info |
692 ## Function: api_get_rics() ##
694 Test of GET '/rics' or V2 GET '/v2/rics' and optional check of the returned json payload (ricinfo).
695 To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
696 To test also the returned payload, add the formatted string of info in the returned payload.
697 Format of ricinfo: <br>`<ric-id>:<list-of-mes>:<list-of-policy-type-ids>`<br>
698 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_........."`
702 | `<reponse-code> <policy-type-id>\|NOTYPE [<space-separate-string-of-ricinfo>]` |
704 | parameter | description |
705 | --------- | ----------- |
706 | `<response-code>` | Expected http response code |
707 | `<policy-type-id>` | Policy type id of the ric |
708 | `NOTYPE>` | No type given |
709 | `<space-separate-string-of-ricinfo>` | A space separated string of ric info - needs to be quoted |
711 ## Function: api_put_service() ##
713 Test of PUT '/service' or V2 PUT '/service'.
716 | `<response-code> <service-name> <keepalive-timeout> <callbackurl>` |
718 | parameter | description |
719 | --------- | ----------- |
720 | `<response-code>` | Expected http response code |
721 | `<service-name>` | Service name |
722 | `<keepalive-timeout>` | Timeout value |
723 | `<callbackurl>` | Callback url |
725 ## Function: api_get_services() ##
727 Test of GET '/service' or V2 GET '/v2/services' and optional check of the returned json payload.
728 To test only the response code, omit all parameters except the expected response code.
729 To test the returned json, provide the parameters after the response code.
733 | `<response-code> [ (<query-service-name> <target-service-name> <keepalive-timeout> <callbackurl>) \| (NOSERVICE <target-service-name> <keepalive-timeout> <callbackurl> [<target-service-name> <keepalive-timeout> <callbackurl>]* )]` |
735 | parameter | description |
736 | --------- | ----------- |
737 | `<response-code>` | Expected http response code |
738 | `<query-service-name>` | Service name for the query |
739 | `<target-service-name>` | Target service name|
740 | `<keepalive-timeout>` | Timeout value |
741 | `<callbackurl>` | Callback url |
742 | `NOSERVICE` | Indicator of no target service name |
744 ## Function: api_get_service_ids() ##
746 Test of GET '/services' or V2 GET /'v2/services'. Only check of service ids.
750 | `<response-code> [<service-name>]*` |
752 | parameter | description |
753 | --------- | ----------- |
754 | `<response-code>` | Expected http response code |
755 | `<service-name>` | Service name |
757 ## Function: api_delete_services() ##
759 Test of DELETE '/services' or V2 DELETE '/v2/services/{serviceId}'
763 | `<response-code> [<service-name>]*` |
765 | parameter | description |
766 | --------- | ----------- |
767 | `<response-code>` | Expected http response code |
768 | `<service-name>` | Service name |
770 ## Function: api_put_services_keepalive() ##
772 Test of PUT '/services/keepalive' or V2 PUT '/v2/services/{service_id}/keepalive'
776 | `<response-code> <service-name>` |
778 | parameter | description |
779 | --------- | ----------- |
780 | `<response-code>` | Expected http response code |
781 | `<service-name>` | Service name |
783 ## Function: api_put_configuration() ##
785 Test of PUT '/v2/configuration'
789 | `<response-code> <config-file>` |
791 | parameter | description |
792 | --------- | ----------- |
793 | `<response-code>` | Expected http response code |
794 | `<config-file>` | Path json config file |
796 ## Function: api_get_configuration() ##
798 Test of GET '/v2/configuration'
802 | `<response-code> [<config-file>]` |
804 | parameter | description |
805 | --------- | ----------- |
806 | `<response-code>` | Expected http response code |
807 | `<config-file>` | Path json config file to compare the retrieved config with |
809 # Description of functions in consul_cbs_function.sh #
811 ## Function: consul_config_app ##
813 Function to load a json config from a file into consul for the Policy Agent
817 | `<json-config-file>` |
819 | parameter | description |
820 | --------- | ----------- |
821 | `<json-config-file>` | The path to the json file to be loaded to Consul/CBS |
823 ## Function: prepare_consul_config ##
825 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')
828 | `<deviation-message-to-print>` |
830 | parameter | description |
831 | --------- | ----------- |
832 | `SDNC\|NOSDNC` | Configure based on a1-controller (SNDC) or without a controller/adapter (NOSDNC) |
833 | `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app' |
835 ## Function: start_consul_cbs ##
837 Start the Consul and CBS containers
842 # Description of functions in control_panel_api_function.sh #
844 ## Function: use_control_panel_http ##
846 Set http as the protocol to use for all communication to the Control Panel
851 ## Function: use_control_panel_https ##
853 Set https as the protocol to use for all communication to the Control Panel
858 ## Function: start_control_panel ##
860 Start the Control Panel container
865 # Description of functions in controller_api_functions.sh #
867 The file contains a selection of the possible API tests towards the a1-controller
869 ## Function: use_sdnc_http ##
871 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.
876 ## Function: use_sdnc_https ##
878 Use https for all API calls towards the SDNC A1 Controller. Note that this function shall be called before preparing the config for Consul.
883 ## Function: start_sdnc ##
885 Start the SDNC A1 Controller container and its database container
890 ## Function: check_sdnc_logs ##
892 Check the SDNC log for any warnings and errors and print the count of each.
897 ## Function: controller_api_get_A1_policy_ids ##
899 Test of GET policy ids towards OSC or STD type simulator.
900 To test response code only, provide the response code, 'OSC' + policy type or 'STD'
901 To test the response payload, include the ids of the expexted response.
905 | `<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) \| ( STD <ric-id> [ <policy-id> [<policy-id>]* ]` |
907 | parameter | description |
908 | --------- | ----------- |
909 | `<response-code>` | Expected http response code |
910 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
911 | `<ric-id>` | Id of the ric |
912 | `policy-type-id>` | Id of the policy type |
913 | `<policy-id>` | Id of the policy |
914 | `STD` | Indicator of status of Standarized A1 |
916 ## Function: controller_api_get_A1_policy_type ##
918 Test of GET a policy type (OSC only)
922 | `<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]` |
924 | parameter | description |
925 | --------- | ----------- |
926 | `<response-code>` | Expected http response code |
927 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
928 | `<ric-id>` | Id of the ric |
929 | `policy-type-id>` | Id of the policy type |
930 | `policy-type-file>` | Optional schema file to compare the returned type with |
932 ## Function: controller_api_delete_A1_policy ##
934 Deletes a policy instance
938 | `(STD <ric-id> <policy-id>) \| (OSC <ric-id> <policy-type-id> <policy-id>)` |
940 | parameter | description |
941 | --------- | ----------- |
942 | `<response-code>` | Expected http response code |
943 | `STD` | Indicator of status of Standarized A1 |
944 | `<ric-id>` | Id of the ric |
945 | `<policy-id>` | Id of the policy |
946 | `policy-type-id>` | Id of the policy type |
947 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
948 | `policy-type-file>` | Optional schema file to compare the returned type with |
950 ## Function: controller_api_put_A1_policy ##
952 Creates a policy instance
956 | `<response-code> (STD <ric-id> <policy-id> <template-file> ) \| (OSC <ric-id> <policy-type-id> <policy-id> <template-file>)` |
958 | parameter | description |
959 | --------- | ----------- |
960 | `<response-code>` | Expected http response code |
961 | `STD` | Indicator of status of Standarized A1 |
962 | `<ric-id>` | Id of the ric |
963 | `<policy-id>` | Id of the policy |
964 | `<template-file>` | Path to the template file of the policy|
965 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
966 | `<policy-type-id>` | Id of the policy type |
968 ## Function: controller_api_get_A1_policy_status ##
970 Checks the status of a policy
974 | `<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) \| (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)` |
976 | parameter | description |
977 | --------- | ----------- |
978 | `<response-code>` | Expected http response code |
979 | `STD` | Indicator of status of Standarized A1 |
980 | `<ric-id>` | Id of the ric |
981 | `<policy-id>` | Id of the policy |
982 | `<enforce-status>` | Enforcement status |
983 | `<reason>` | Optional reason |
984 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
985 | `<policy-type-id>` | Id of the policy type |
986 | `<instance-status>` | Instance status |
987 | `<has-been-deleted>` | Deleted status, true or false |
989 # Description of functions in cr_api_functions.sh #
991 ## Function: use_cr_http ##
993 Use http for getting event from CR. The admin API is not affected. This is the default.
998 ## Function: use_cr_https ##
1000 Use https for getting event from CR. The admin API is not affected.
1001 Note: Not yet used as callback event is not fully implemented/deciced.
1006 ## Function: start_cr ##
1008 Start the Callback Receiver container in docker or kube depending on start mode.
1013 ## Function: cr_equal ##
1015 Tests if a variable value in the Callback Receiver (CR) simulator is equal to a target value.
1016 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1017 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.
1018 See the 'cr' dir for more details.
1021 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1023 | parameter | description |
1024 | --------- | ----------- |
1025 | `<variable-name>` | Variable name in the CR |
1026 | `<target-value>` | Target value for the variable |
1027 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1029 ## Function: cr_api_check_all_sync_events() ##
1031 Check the contents of all ric events received for a callback id.
1035 | `<response-code> <id> [ EMPTY \| ( <ric-id> )+ ]` |
1037 | parameter | description |
1038 | --------- | ----------- |
1039 | `<response-code>` | Expected http response code |
1040 | `<id>` | Id of the callback destination |
1041 | `EMPTY` | Indicator for an empty list |
1042 | `<ric-id>` | Id of the ric |
1044 ## Function: cr_api_check_all_ecs_events() ##
1046 Check the contents of all current status events for one id from ECS
1050 | `<response-code> <id> [ EMPTY \| ( <status> )+ ]` |
1052 | parameter | description |
1053 | --------- | ----------- |
1054 | `<response-code>` | Expected http response code |
1055 | `<id>` | Id of the callback destination |
1056 | `EMPTY` | Indicator for an empty list |
1057 | `<status>` | Status string |
1059 ## Function: cr_api_check_all_ecs_subscription_events() ##
1061 Check the contents of all current subscription events for one id from ECS
1065 | `<response-code> <id> [ EMPTY | ( <type-id> <schema> <registration-status> )+ ]` |
1067 | parameter | description |
1068 | --------- | ----------- |
1069 | `<response-code>` | Expected http response code |
1070 | `<id>` | Id of the callback destination |
1071 | `EMPTY` | Indicator for an empty list |
1072 | `<type-id>` | Id of the data type |
1073 | `<schema>` | Path to typeschema file |
1074 | `<registration-status>` | Status string |
1077 ## Function: cr_api_reset() ##
1079 Reset the callback receiver
1086 # Description of functions in ecs_api_functions.sh #
1088 ## Function: use_ecs_rest_http ##
1090 Use http for all API calls to the ECS. This is the default protocol.
1095 ## Function: use_ecs_rest_https ##
1097 Use https for all API calls to the ECS.
1102 ## Function: use_ecs_dmaap_http ##
1104 Send and recieve all API calls to the ECS over Dmaap via the MR using http.
1109 ## Function: use_ecs_dmaap_https ##
1111 Send and recieve all API calls to the ECS over Dmaap via the MR using https.
1116 ## Function: start_ecs ##
1118 Start the ECS container in docker or kube depending on running mode.
1123 ## Function: stop_ecs ##
1125 Stop the ECS container.
1130 ## Function: start_stopped_ecs ##
1132 Start a previously stopped ecs.
1137 ## Function: set_ecs_debug ##
1139 Configure the ECS log on debug level. The ECS must be running.
1144 ## Function: set_ecs_trace ##
1146 Configure the ECS log on trace level. The ECS must be running.
1151 ## Function: check_ecs_logs ##
1153 Check the ECS log for any warnings and errors and print the count of each.
1158 ## Function: ecs_equal ##
1160 Tests if a variable value in the ECS is equal to a target value.
1161 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1162 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.
1163 See the 'a1-interface' repo for more details.
1167 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1169 | parameter | description |
1170 | --------- | ----------- |
1171 | `<variable-name>` | Variable name in ecs |
1172 | `<target-value>` | Target value for the variable |
1173 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1175 ## Function: ecs_api_a1_get_job_ids() ##
1177 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs' and optional check of the array of returned job ids.
1178 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1179 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1183 | `<response-code> <type-id> <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
1185 | parameter | description |
1186 | --------- | ----------- |
1187 | `<response-code>` | Expected http response code |
1188 | `<type-id>` | Id of the EI type |
1189 | `<owner-id>` | Id of the job owner |
1190 | `NOOWNER` | No owner is given |
1191 | `<job-id>` | Id of the expected job |
1192 | `EMPTY` | The expected list of job id shall be empty |
1194 ## Function: ecs_api_a1_get_type() ##
1196 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}' and optional check of the returned schema.
1197 To test the response code only, provide the response code parameter as well as the type-id.
1198 To also test the response payload add a path to the expected schema file.
1202 | `<response-code> <type-id> [<schema-file>]` |
1204 | parameter | description |
1205 | --------- | ----------- |
1206 | `<response-code>` | Expected http response code |
1207 | `<type-id>` | Id of the EI type |
1208 | `<schema-file>` | Path to a schema file to compare with the returned schema |
1210 ## Function: ecs_api_a1_get_type_ids() ##
1212 Test of GET '/A1-EI​/v1​/eitypes' and optional check of returned list of type ids.
1213 To test the response code only, provide the response only.
1214 To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
1218 | `<response-code> [ (EMPTY \| [<type-id>]+) ]` |
1220 | parameter | description |
1221 | --------- | ----------- |
1222 | `<response-code>` | Expected http response code |
1223 | `EMPTY` | The expected list of type ids shall be empty |
1224 | `<type-id>` | Id of the EI type |
1226 ## Function: ecs_api_a1_get_job_status() ##
1228 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}​/status' and optional check of the returned status.
1229 To test the response code only, provide the response code, type id and job id.
1230 To also test the response payload add the expected status.
1234 | `<response-code> <type-id> <job-id> [<status>]` |
1236 | parameter | description |
1237 | --------- | ----------- |
1238 | `<response-code>` | Expected http response code |
1239 | `<type-id>` | Id of the EI type |
1240 | `<job-id>` | Id of the job |
1241 | `<status>` | Expected status |
1243 ## Function: ecs_api_a1_get_job() ##
1245 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}' and optional check of the returned job.
1246 To test the response code only, provide the response code, type id and job id.
1247 To also test the response payload add the remaining parameters.
1251 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1253 | parameter | description |
1254 | --------- | ----------- |
1255 | `<response-code>` | Expected http response code |
1256 | `<type-id>` | Id of the EI type |
1257 | `<job-id>` | Id of the job |
1258 | `<target-url>` | Expected target url for the job |
1259 | `<owner-id>` | Expected owner for the job |
1260 | `<template-job-file>` | Path to a job template for job parameters of the job |
1262 ## Function: ecs_api_a1_delete_job() ##
1264 Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1265 To test, provide all the specified parameters.
1269 | `<response-code> <type-id> <job-id>` |
1271 | parameter | description |
1272 | --------- | ----------- |
1273 | `<response-code>` | Expected http response code |
1274 | `<type-id>` | Id of the EI type |
1275 | `<job-id>` | Id of the job |
1277 ## Function: ecs_api_a1_put_job() ##
1279 Test of PUT '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1280 To test, provide all the specified parameters.
1284 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
1286 | parameter | description |
1287 | --------- | ----------- |
1288 | `<response-code>` | Expected http response code |
1289 | `<type-id>` | Id of the EI type |
1290 | `<job-id>` | Id of the job |
1291 | `<target-url>` | Target url for the job |
1292 | `<owner-id>` | Owner of the job |
1293 | `<template-job-file>` | Path to a job template for job parameters of the job |
1295 ## Function: ecs_api_edp_get_type_ids() ##
1297 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.
1298 To test the response code only, provide the response code.
1299 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1303 | `<response-code> [ EMPTY \| <type-id>+]` |
1305 | parameter | description |
1306 | --------- | ----------- |
1307 | `<response-code>` | Expected http response code |
1308 | `<type-id>` | Id of the type |
1309 | `EMPTY` | The expected list of type ids shall be empty |
1311 ## Function: ecs_api_edp_get_producer_status() ##
1313 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.
1314 To test the response code only, provide the response code and producer id.
1315 To also test the response payload add the expected status.
1319 | `<response-code> <producer-id> [<status>]` |
1321 | parameter | description |
1322 | --------- | ----------- |
1323 | `<response-code>` | Expected http response code |
1324 | `<producer-id>` | Id of the producer |
1325 | `<status>` | The expected status string |
1327 ## Function: ecs_api_edp_get_producer_ids() ##
1329 Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
1330 To test the response code only, provide the response.
1331 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).
1335 | `<response-code> [ EMPTY \| <producer-id>+]` |
1337 | parameter | description |
1338 | --------- | ----------- |
1339 | `<response-code>` | Expected http response code |
1340 | `<producer-id>` | Id of the producer |
1341 | `EMPTY` | The expected list of type ids shall be empty |
1343 ## Function: ecs_api_edp_get_producer_ids_2() ##
1345 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.
1346 To test the response code only, provide the response.
1347 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).
1351 | `<response-code> [ ( NOTYPE \| <type-id> ) [ EMPTY \| <producer-id>+]` |
1353 | parameter | description |
1354 | --------- | ----------- |
1355 | `<response-code>` | Expected http response code |
1356 | `<type-id>` | Id of the type |
1357 | `EMPTY` | No type given |
1358 | `<producer-id>` | Id of the producer |
1359 | `EMPTY` | The expected list of type ids shall be empty |
1361 ## Function: ecs_api_edp_get_type() ##
1363 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
1364 To test the response code only, provide the response and the type-id.
1365 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).
1369 | `<response-code> <type-id> [<job-schema-file> (EMPTY \| [<producer-id>]+)]` |
1371 | parameter | description |
1372 | --------- | ----------- |
1373 | `<response-code>` | Expected http response code |
1374 | `<type-id>` | Id of the type |
1375 | `<job-schema-file>` | Path to a job schema file |
1376 | `<producer-id>` | Id of the producer |
1377 | `EMPTY` | The expected list of type ids shall be empty |
1379 ## Function: ecs_api_edp_get_type_2() ##
1381 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.
1382 To test the response code only, provide the response and the type-id.
1383 To also test the response payload add a path to a job schema file.
1387 | `<response-code> <type-id> [<job-schema-file>]` |
1389 | parameter | description |
1390 | --------- | ----------- |
1391 | `<response-code>` | Expected http response code |
1392 | `<type-id>` | Id of the type |
1393 | `<job-schema-file>` | Path to a job schema file |
1394 | `EMPTY` | The expected list of type ids shall be empty |
1396 ## Function: ecs_api_edp_put_type_2() ##
1398 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.
1402 | `<response-code> <type-id> [<job-schema-file>]` |
1404 | parameter | description |
1405 | --------- | ----------- |
1406 | `<response-code>` | Expected http response code |
1407 | `<type-id>` | Id of the type |
1408 | `<job-schema-file>` | Path to a job schema file |
1409 | `EMPTY` | The expected list of type ids shall be empty |
1411 ## Function: ecs_api_edp_delete_type_2() ##
1413 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.
1417 | `<response-code> <type-id>` |
1419 | parameter | description |
1420 | --------- | ----------- |
1421 | `<response-code>` | Expected http response code |
1422 | `<type-id>` | Id of the type |
1424 ## Function: ecs_api_edp_get_producer() ##
1426 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
1427 To test the response code only, provide the response and the producer-id.
1428 To also test the response payload add the remaining parameters defining thee producer.
1432 | `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY\| [<type-id> <schema-file>]+) ]` |
1434 | parameter | description |
1435 | --------- | ----------- |
1436 | `<response-code>` | Expected http response code |
1437 | `<producer-id>` | Id of the producer |
1438 | `<create-callback>` | Callback for create job |
1439 | `<delete-callback>` | Callback for delete job |
1440 | `<supervision-callback>` | Callback for producer supervision |
1441 | `<type-id>` | Id of the type |
1442 | `<schema-file>` | Path to a schema file |
1443 | `EMPTY` | The expected list of type schema pairs shall be empty |
1445 ## Function: ecs_api_edp_get_producer_2() ##
1447 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.
1448 To test the response code only, provide the response and the producer-id.
1449 To also test the response payload add the remaining parameters defining thee producer.
1453 | `<response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY \| <type-id>+) ]` |
1455 | parameter | description |
1456 | --------- | ----------- |
1457 | `<response-code>` | Expected http response code |
1458 | `<producer-id>` | Id of the producer |
1459 | `<job-callback>` | Callback for the url |
1460 | `<supervision-callback>` | Callback for producer supervision |
1461 | `<type-id>` | Id of the type |
1462 | `EMPTY` | The expected list of types shall be empty |
1464 ## Function: ecs_api_edp_delete_producer() ##
1466 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version.
1467 To test, provide all parameters.
1471 | `<response-code> <producer-id>` |
1473 | parameter | description |
1474 | --------- | ----------- |
1475 | `<response-code>` | Expected http response code |
1476 | `<producer-id>` | Id of the producer |
1478 ## Function: ecs_api_edp_put_producer() ##
1480 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1481 To test, provide all parameters. The list of type/schema pair may be empty.
1485 | `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY \| [<type-id> <schema-file>]+)` |
1487 | parameter | description |
1488 | --------- | ----------- |
1489 | `<response-code>` | Expected http response code |
1490 | `<producer-id>` | Id of the producer |
1491 | `<job-callback>` | Callback for create/delete job |
1492 | `<supervision-callback>` | Callback for producer supervision |
1493 | `<type-id>` | Id of the type |
1494 | `<schema-file>` | Path to a schema file |
1495 | `EMPTY` | The list of type/schema pairs is empty |
1497 ## Function: ecs_api_edp_put_producer_2() ##
1499 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version.
1500 To test, provide all parameters. The list of type/schema pair may be empty.
1504 | `<response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE\|[<type-id>+]` |
1506 | parameter | description |
1507 | --------- | ----------- |
1508 | `<response-code>` | Expected http response code |
1509 | `<producer-id>` | Id of the producer |
1510 | `<job-callback>` | Callback for create/delete job |
1511 | `<supervision-callback>` | Callback for producer supervision |
1512 | `<type-id>` | Id of the type |
1513 | `NOTYPE` | The list of types is empty |
1515 ## Function: ecs_api_edp_get_producer_jobs() ##
1517 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
1518 To test the response code only, provide the response and the producer-id.
1519 To also test the response payload add the remaining parameters.
1523 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1525 | parameter | description |
1526 | --------- | ----------- |
1527 | `<response-code>` | Expected http response code |
1528 | `<producer-id>` | Id of the producer |
1529 | `<job-id>` | Id of the job |
1530 | `<type-id>` | Id of the EI type |
1531 | `<target-url>` | Target url for data delivery |
1532 | `<job-owner>` | Id of the job owner |
1533 | `<template-job-file>` | Path to a job template file |
1534 | `EMPTY` | The list of job/type/target/job-file tuples is empty |
1536 ## Function: ecs_api_edp_get_producer_jobs_2() ##
1538 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.
1539 To test the response code only, provide the response and the producer-id.
1540 To also test the response payload add the remaining parameters.
1544 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1546 | parameter | description |
1547 | --------- | ----------- |
1548 | `<response-code>` | Expected http response code |
1549 | `<producer-id>` | Id of the producer |
1550 | `<job-id>` | Id of the job |
1551 | `<type-id>` | Id of the type |
1552 | `<target-url>` | Target url for data delivery |
1553 | `<job-owner>` | Id of the job owner |
1554 | `<template-job-file>` | Path to a job template file |
1555 | `EMPTY` | The list of job/type/target/job-file tuples is empty |
1557 ## Function: ecs_api_service_status() ##
1559 Test of GET '/status'.
1563 | `<response-code>` |
1565 | parameter | description |
1566 | --------- | ----------- |
1567 | `<response-code>` | Expected http response code |
1569 ## Function: ecs_api_idc_get_type_ids() ##
1571 Test of GET '/data-consumer/v1/info-types' and an optional check of the returned list of type ids.
1572 To test the response code only, provide the response code.
1573 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1577 | `<response-code> [ EMPTY \| <type-id>+]` |
1579 | parameter | description |
1580 | --------- | ----------- |
1581 | `<response-code>` | Expected http response code |
1582 | `<type-id>` | Id of the Info type |
1583 | `EMPTY` | The expected list of type ids shall be empty |
1585 ## Function: ecs_api_idc_get_job_ids() ##
1587 Test of GET '/data-consumer/v1/info-jobs' and optional check of the array of returned job ids.
1588 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1589 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1593 | `<response-code> <type-id> <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
1595 | parameter | description |
1596 | --------- | ----------- |
1597 | `<response-code>` | Expected http response code |
1598 | `<type-id>` | Id of the Info type |
1599 | `<owner-id>` | Id of the job owner |
1600 | `NOOWNER` | No owner is given |
1601 | `<job-id>` | Id of the expected job |
1602 | `EMPTY` | The expected list of job id shall be empty |
1604 ## Function: ecs_api_idc_get_job() ##
1606 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}' and optional check of the returned job.
1607 To test the response code only, provide the response code, type id and job id.
1608 To also test the response payload add the remaining parameters.
1612 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1614 | parameter | description |
1615 | --------- | ----------- |
1616 | `<response-code>` | Expected http response code |
1617 | `<type-id>` | Id of the Info type |
1618 | `<job-id>` | Id of the job |
1619 | `<target-url>` | Expected target url for the job |
1620 | `<owner-id>` | Expected owner for the job |
1621 | `<template-job-file>` | Path to a job template for job parameters of the job |
1623 ## Function: ecs_api_idc_put_job() ##
1625 Test of PUT '​/data-consumer/v1/info-jobs/{infoJobId}'.
1626 To test, provide all the specified parameters.
1630 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file> [VALIDATE]` |
1632 | parameter | description |
1633 | --------- | ----------- |
1634 | `<response-code>` | Expected http response code |
1635 | `<type-id>` | Id of the Info type |
1636 | `<job-id>` | Id of the job |
1637 | `<target-url>` | Target url for the job |
1638 | `<owner-id>` | Owner of the job |
1639 | `<template-job-file>` | Path to a job template for job parameters of the job |
1640 | `VALIIDATE` | Indicator to preform type validation at creation |
1642 ## Function: ecs_api_idc_delete_job() ##
1644 Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1645 To test, provide all the specified parameters.
1649 | `<response-code> <type-id> <job-id>` |
1651 | parameter | description |
1652 | --------- | ----------- |
1653 | `<response-code>` | Expected http response code |
1654 | `<type-id>` | Id of the type |
1655 | `<job-id>` | Id of the job |
1657 ## Function: ecs_api_idc_get_type() ##
1659 Test of GET '/data-consumer/v1/info-types/{infoTypeId} and optional check of the returned schema.
1660 To test the response code only, provide the response code parameter as well as the type-id.
1661 To also test the response payload add a path to the expected schema file.
1665 | `<response-code> <type-id> [<schema-file>]` |
1667 | parameter | description |
1668 | --------- | ----------- |
1669 | `<response-code>` | Expected http response code |
1670 | `<type-id>` | Id of the Info type |
1671 | `<schema-file>` | Path to a schema file to compare with the returned schema |
1673 ## Function: ecs_api_idc_get_job_status() ##
1675 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' and optional check of the returned status and timeout.
1676 To test the response code only, provide the response code and job id.
1677 To also test the response payload add the expected status.
1681 | `<response-code> <job-id> [<status> [ <timeout>]]` |
1683 | parameter | description |
1684 | --------- | ----------- |
1685 | `<response-code>` | Expected http response code |
1686 | `<job-id>` | Id of the job |
1687 | `<status>` | Expected status |
1688 | `<timeout>` | Timeout |
1690 ## Function: ecs_api_idc_get_job_status2() ##
1692 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' with returned producers and optional check of the returned status and timeout.
1693 To test the response code only, provide the response code and job id.
1694 To also test the response payload add the expected status.
1698 | `<response-code> <job-id> [<status> EMPTYPROD|( <prod-count> <producer-id>+ ) [<timeout>]]` |
1700 | parameter | description |
1701 | --------- | ----------- |
1702 | `<response-code>` | Expected http response code |
1703 | `<job-id>` | Id of the job |
1704 | `<status>` | Expected status |
1705 | `<EMPTYPROD>` | Indicated for empty list of producer |
1706 | `<prod-count>` | Number of expected producer |
1707 | `<producer-id>` |Id of the producer |
1708 | `<timeout>` | Timeout |
1711 ## Function: ecs_api_idc_get_subscription_ids() ##
1712 Test of GET '/data-consumer/v1/info-type-subscription' with the returned list of subscription ids
1716 | `<response-code> <owner-id>|NOOWNER [ EMPTY | <subscription-id>+]` |
1718 | parameter | description |
1719 | --------- | ----------- |
1720 | `<response-code>` | Expected http response code |
1721 | `<owner-id>` | Id of the owner |
1722 | `<NOOWNER>` | Indicator for empty owner |
1723 | `<EMPTY>` | Indicated for empty list of subscription ids |
1724 | `<subscription-id>` |Id of the subscription |
1726 ## Function: ecs_api_idc_get_subscription() ##
1727 Test of GET '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
1731 | `<response-code> <subscription-id> [ <owner-id> <status-uri> ]` |
1733 | parameter | description |
1734 | --------- | ----------- |
1735 | `<response-code>` | Expected http response code |
1736 | `<subscription-id>` |Id of the subscription |
1737 | `<owner-id>` | Id of the owner |
1738 | `<status-uri>` | Url for status notifications |
1741 ## Function: ecs_api_idc_put_subscription() ##
1742 Test of PUT '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
1746 | `<response-code> <subscription-id> <owner-id> <status-uri>` |
1748 | parameter | description |
1749 | --------- | ----------- |
1750 | `<response-code>` | Expected http response code |
1751 | `<subscription-id>` |Id of the subscription |
1752 | `<owner-id>` | Id of the owner |
1753 | `<status-uri>` | Url for status notifications |
1755 ## Function: ecs_api_idc_delete_subscription() ##
1756 Test of DELETE /data-consumer/v1/info-type-subscription/{subscriptionId}
1760 | `<response-code> <subscription-id>` |
1762 | parameter | description |
1763 | --------- | ----------- |
1764 | `<response-code>` | Expected http response code |
1765 | `<subscription-id>` |Id of the subscription |
1768 ## Function: ecs_api_admin_reset() ##
1770 Test of GET '/status'.
1774 | `<response-code> [ <type> ]` |
1776 | parameter | description |
1777 | --------- | ----------- |
1778 | `<response-code>` | Expected http response code |
1779 | `<type>` | Type id, if the interface supports type in url |
1781 # Description of functions in gateway_api_functions.sh #
1783 ## Function: use_gateway_http ##
1785 Use http for all calls to the gateway. This is set by default.
1790 ## Function: use_gateway_https ##
1792 Use https for all calls to the gateway.
1797 ## Function: set_gateway_debug ##
1799 Set debug level logging in the gateway
1804 ## Function: set_gateway_trace ##
1806 Set debug level logging in the trace
1811 ## Function: start_gateway ##
1813 Start the the gateway container in docker or kube depending on start mode
1818 ## Function: gateway_pms_get_status ##
1820 Sample test of pms api (status)
1823 | `<response-code>` |
1825 | parameter | description |
1826 | --------- | ----------- |
1827 | `<response-code>` | Expected http response code |
1829 ## Function: gateway_ecs_get_types ##
1831 Sample test of ecs api (get types)
1832 Only response code tested - not payload
1835 | `<response-code>` |
1837 | parameter | description |
1838 | --------- | ----------- |
1839 | `<response-code>` | Expected http response code |
1841 # Description of functions in http_proxy_api_functions.sh #
1843 ## Function: use_http_proxy_http ##
1845 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.
1850 ## Function: use_http_proxy_https ##
1852 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.
1857 ## Function: start_http_proxy ##
1859 Start the http proxy container in docker or kube depending on running mode.
1864 # Description of functions in kube_proxy_api_functions.sh #
1866 ## Function: use_kube_proxy_http ##
1868 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.
1873 ## Function: use_kube_proxy_https ##
1875 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.
1880 ## Function: start_kube_proxy ##
1882 Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
1883 No proxy is started if the function is called in docker mode.
1888 # Description of functions in mr_api_functions.sh #
1890 ## Function: use_mr_http ##
1892 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.
1897 ## Function: use_mr_https ##
1899 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.
1904 ## Function: start_mr ##
1906 Start the Message Router stub interface container in docker or kube depending on start mode
1911 ## Function: mr_equal ##
1913 Tests if a variable value in the Message Router (MR) simulator is equal to a target value.
1914 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1915 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.
1916 See the 'mrstub' dir for more details.
1919 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1921 | parameter | description |
1922 | --------- | ----------- |
1923 | `<variable-name>` | Variable name in the MR |
1924 | `<target-value>` | Target value for the variable |
1925 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1927 ## Function: mr_greater ##
1929 Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
1930 Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than the target or not.
1931 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.
1932 See the 'mrstub' dir for more details.
1935 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1937 | parameter | description |
1938 | --------- | ----------- |
1939 | `<variable-name>` | Variable name in the MR |
1940 | `<target-value>` | Target value for the variable |
1941 | `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value |
1943 ## Function: mr_read ##
1945 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.
1946 See the 'mrstub' dir for more details.
1949 | `<variable-name>` |
1951 | parameter | description |
1952 | --------- | ----------- |
1953 | `<variable-name>` | Variable name in the MR |
1955 ## Function: mr_print ##
1957 Prints the value of a variable in the Message Router (MR) simulator.
1958 See the 'mrstub' dir for more details.
1961 | `<variable-name>` |
1963 | parameter | description |
1964 | --------- | ----------- |
1965 | `<variable-name>` | Variable name in the MR |
1967 # Description of functions in prodstub_api_functions.sh #
1969 ## Function: use_prod_stub_http ##
1971 Use http for the API. The admin API is not affected. This is the default protocol.
1976 ## Function: use_prod_stub_https ##
1978 Use https for the API. The admin API is not affected.
1983 ## Function: start_prod_stub ##
1985 Start the Producer stub container in docker or kube depending on start mode
1990 ## Function: prodstub_arm_producer() ##
1992 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
1996 | `<response-code> <producer-id> [<forced_response_code>]` |
1998 | parameter | description |
1999 | --------- | ----------- |
2000 | `<response-code>` | Expected http response code |
2001 | `<producer-id>` | Id of the producer |
2002 | `<forced_response_code>` | Forced response code for the producer callback url |
2004 ## Function: prodstub_arm_job_create() ##
2006 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.
2010 | `<response-code> <job-id> [<forced_response_code>]` |
2012 | parameter | description |
2013 | --------- | ----------- |
2014 | `<response-code>` | Expected http response code |
2015 | `<job-id>` | Id of the job |
2016 | `<forced_response_code>` | Forced response code for the create callback url |
2018 ## Function: prodstub_arm_job_delete() ##
2020 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.
2024 | `<response-code> <job-id> [<forced_response_code>]` |
2026 | parameter | description |
2027 | --------- | ----------- |
2028 | `<response-code>` | Expected http response code |
2029 | `<job-id>` | Id of the job |
2030 | `<forced_response_code>` | Forced response code for the delete callback url |
2032 ## Function: prodstub_arm_type() ##
2034 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
2038 | `<response-code> <producer-id> <type-id>` |
2040 | parameter | description |
2041 | --------- | ----------- |
2042 | `<response-code>` | Expected http response code |
2043 | `<producer-id>` | Id of the producer |
2044 | `<type-id>` | Id of the type |
2046 ## Function: prodstub_disarm_type() ##
2048 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
2052 | `<response-code> <producer-id> <type-id>` |
2054 | parameter | description |
2055 | --------- | ----------- |
2056 | `<response-code>` | Expected http response code |
2057 | `<producer-id>` | Id of the producer |
2058 | `<type-id>` | Id of the type |
2060 ## Function: prodstub_check_jobdata() ##
2062 Check a job in the prodstub towards the list of provided parameters.
2066 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2068 | parameter | description |
2069 | --------- | ----------- |
2070 | `<response-code>` | Expected http response code |
2071 | `<producer-id>` | Id of the producer |
2072 | `<job-id>` | Id of the job |
2073 | `<type-id>` | Id of the type |
2074 | `<target-url>` | Target url for data delivery |
2075 | `<job-owner>` | Id of the job owner |
2076 | `<template-job-file>` | Path to a job template file |
2078 ## Function: prodstub_check_jobdata_2() ##
2080 Check a job in the prodstub towards the list of provided parameters.
2084 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2086 | parameter | description |
2087 | --------- | ----------- |
2088 | `<response-code>` | Expected http response code |
2089 | `<producer-id>` | Id of the producer |
2090 | `<job-id>` | Id of the job |
2091 | `<type-id>` | Id of the type |
2092 | `<target-url>` | Target url for data delivery |
2093 | `<job-owner>` | Id of the job owner |
2094 | `<template-job-file>` | Path to a job template file |
2096 ## Function: prodstub_check_jobdata_3() ##
2098 Check a job in the prodstub towards the list of provided parameters.
2102 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2104 | parameter | description |
2105 | --------- | ----------- |
2106 | `<response-code>` | Expected http response code |
2107 | `<producer-id>` | Id of the producer |
2108 | `<job-id>` | Id of the job |
2109 | `<type-id>` | Id of the type |
2110 | `<target-url>` | Target url for data delivery |
2111 | `<job-owner>` | Id of the job owner |
2112 | `<template-job-file>` | Path to a job template file |
2114 ## Function: prodstub_delete_jobdata() ##
2116 Delete the job parameters, job data, for a job.
2120 | `<response-code> <producer-id> <job-id>` |
2122 | parameter | description |
2123 | --------- | ----------- |
2124 | `<response-code>` | Expected http response code |
2125 | `<producer-id>` | Id of the producer |
2126 | `<job-id>` | Id of the job |
2128 ## Function: prodstub_equal ##
2130 Tests if a variable value in the prodstub is equal to a target value.
2131 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2132 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.
2136 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2138 | parameter | description |
2139 | --------- | ----------- |
2140 | `<variable-name>` | Variable name in the prostub |
2141 | `<target-value>` | Target value for the variable |
2142 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2144 # Description of functions in rapp_catalogue_api_function.sh #
2146 ## Function: use_rapp_catalogue_http ##
2148 Use http for the API. This is the default protocol.
2153 ## Function: use_rapp_catalogue_https ##
2155 Use https for the API.
2160 ## Function: start_rapp_catalogue ##
2162 Start the rapp catalogue container in docker or kube depending on start mode
2167 ## Function: rc_equal ##
2169 Tests if a variable value in the RAPP Catalogue is equal to a target value.
2170 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2171 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.
2172 See the 'cr' dir for more details.
2175 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2177 | parameter | description |
2178 | --------- | ----------- |
2179 | `<variable-name>` | Variable name in the RC |
2180 | `<target-value>` | Target value for the variable |
2181 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2183 ## Function: rapp_cat_api_get_services() ##
2185 Check all registered services.
2189 | `<response-code> [(<service-id> <version> <display-name> <description>)+ \| EMPTY ]` |
2191 | parameter | description |
2192 | --------- | ----------- |
2193 | `<response-code>` | Expected http response code |
2194 | `<service-id>` | Id of the service |
2195 | `<version>` | Version of the service |
2196 | `<display-name>` | Dislay name of the service |
2197 | `<description>` | Description of the service |
2198 | `EMPTY` | Indicator for an empty list |
2200 ## Function: rapp_cat_api_put_service() ##
2202 Register a services.
2206 | `<response-code> <service-id> <version> <display-name> <description>` |
2208 | parameter | description |
2209 | --------- | ----------- |
2210 | `<response-code>` | Expected http response code |
2211 | `<service-id>` | Id of the service |
2212 | `<version>` | Version of the service |
2213 | `<display-name>` | Dislay name of the service |
2214 | `<description>` | Description of the service |
2216 ## Function: rapp_cat_api_get_service() ##
2218 Check a registered service.
2222 | `<response-code> <service-id> <version> <display-name> <description>` |
2224 | parameter | description |
2225 | --------- | ----------- |
2226 | `<response-code>` | Expected http response code |
2227 | `<service-id>` | Id of the service |
2228 | `<version>` | Version of the service |
2229 | `<display-name>` | Dislay name of the service |
2230 | `<description>` | Description of the service |
2232 ## Function: rapp_cat_api_delete_service() ##
2234 Check a registered service.
2238 | `<response-code> <service-id>` |
2240 | parameter | description |
2241 | --------- | ----------- |
2242 | `<response-code>` | Expected http response code |
2243 | `<service-id>` | Id of the service |
2245 # Description of functions in ricsimulator_api_functions.sh #
2247 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
2249 ## Function: use_simulator_http ##
2251 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.
2256 ## Function: use_simulator_https ##
2258 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.
2263 ## Function: start_ric_simulators ##
2265 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
2268 | `ricsim_g1\|ricsim_g2\|ricsim_g3 <count> <interface-id>` |
2270 | parameter | description |
2271 | --------- | ----------- |
2272 | `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 |
2273 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
2274 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
2276 ## Function: get_kube_sim_host ##
2278 Translate ric name to kube host name.
2283 | parameter | description |
2284 | --------- | ----------- |
2285 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
2287 ## Function: generate_policy_uuid ##
2289 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
2290 UUID is then automatically added to the policy id in GET/PUT/DELETE.
2295 ## Function: sim_equal ##
2297 Tests if a variable value in the RIC simulator is equal to a target value.
2298 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2299 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.
2300 See the 'a1-interface' repo for more details.
2304 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2306 | parameter | description |
2307 | --------- | ----------- |
2308 | `<variable-name>` | Variable name in the ric simulator |
2309 | `<target-value>` | Target value for the variable |
2310 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2312 ## Function: sim_print ##
2314 Prints the value of a variable in the RIC simulator.
2315 See the 'a1-interface' repo for more details.
2319 | `<variable-name>` |
2321 | parameter | description |
2322 | --------- | ----------- |
2323 | `<variable-name>` | Variable name in the RIC simulator |
2325 ## Function: sim_contains_str ##
2327 Tests if a variable value in the RIC simulator contains a target string.
2328 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
2329 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.
2330 See the 'a1-interface' repo for more details.
2334 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2336 | parameter | description |
2337 | --------- | ----------- |
2338 | `<variable-name>` | Variable name in the ric simulator |
2339 | `<target-value>` | Target substring for the variable |
2340 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
2342 ## Function: sim_put_policy_type ##
2344 Loads a policy type to the simulator
2348 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
2350 | parameter | description |
2351 | --------- | ----------- |
2352 | `<response-code>` | Expected http response code |
2353 | `<ric-id>` | Id of the ric |
2354 | `<policy-type-id>` | Id of the policy type |
2355 | `<policy-type-file>` | Path to the schema file of the policy type |
2357 ## Function: sim_delete_policy_type ##
2359 Deletes a policy type from the simulator
2363 | `<response-code> <ric-id> <policy_type_id>` |
2365 | parameter | description |
2366 | --------- | ----------- |
2367 | `<response-code>` | Expected http response code |
2368 | `<ric-id>` | Id of the ric |
2369 | `<policy-type-id>` | Id of the policy type |
2371 ## Function: sim_post_delete_instances ##
2373 Deletes all instances (and status), for one ric
2377 | `<response-code> <ric-id>` |
2379 | parameter | description |
2380 | --------- | ----------- |
2381 | `<response-code>` | Expected http response code |
2382 | `<ric-id>` | Id of the ric |
2384 ## Function: sim_post_delete_all ##
2386 Deletes all types, instances (and status), for one ric
2390 | `<response-code> <ric-id>` |
2392 | parameter | description |
2393 | --------- | ----------- |
2394 | `<response-code>` | Expected http response code |
2395 | `<ric-id>` | Id of the ric |
2397 ## Function: sim_post_forcedresponse ##
2399 Sets (or resets) response code for next (one) A1 message, for one ric.
2400 The intention is to simulate error response on the A1 interface.
2404 | `<response-code> <ric-id> [<forced_response_code>]`|
2406 | parameter | description |
2407 | --------- | ----------- |
2408 | `<response-code>` | Expected http response code |
2409 | `<ric-id>` | Id of the ric |
2410 | `<forced_response_code>` | Http response code to send |
2412 ## Function: sim_post_forcedelay ##
2414 Sets (or resets) A1 response delay, for one ric
2415 The intention is to delay responses on the A1 interface. Setting remains until removed.
2419 | `<response-code> <ric-id> [<delay-in-seconds>]`|
2421 | parameter | description |
2422 | --------- | ----------- |
2423 | `<response-code>` | Expected http response code |
2424 | `<ric-id>` | Id of the ric |
2425 | `<delay-in-seconds>` | Delay in seconds. If omitted, the delay is removed |
2429 Copyright (C) 2020 Nordix Foundation. All rights reserved.
2430 Licensed under the Apache License, Version 2.0 (the "License");
2431 you may not use this file except in compliance with the License.
2432 You may obtain a copy of the License at
2434 http://www.apache.org/licenses/LICENSE-2.0
2436 Unless required by applicable law or agreed to in writing, software
2437 distributed under the License is distributed on an "AS IS" BASIS,
2438 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2439 See the License for the specific language governing permissions and
2440 limitations under the License.