2 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)
3 Some of the scripts can also be used for other kinds of tests, for example basic tests.
5 ## Overview for common test scripts and files ##
7 `agent_api_functions.sh` \
8 Contains functions for adapting towards the Policy Management Service (PMS) API, also via dmaap (using a message-router stub interface)
11 A common curl based function for the agent and ecs apis. Also partly used for the Callback receiver and RAPP Catalogue apis.
14 Cleans all services, deployments, pods, replica set etc started by the test environment in kubernetes.
17 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'.
19 `consul_cbs_function.sh` \
20 Contains functions for managing Consul and CBS as well as create the configuration for the PMS.
22 `control_panel_api_function.sh` \
23 Contains functions for managing Control Panel.
25 `controller_api_functions.sh` \
26 Contains functions for adaping towards the A1-controller API.
28 `count_json_elements.py` \
29 A python script returning the number of items in a json array.
31 `cr_api_functions.sh` \
32 Contains functions for adapting towards the Callback receiver for checking received callback event.
34 `create_policies_process.py` \
35 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.
37 `create_rics_json.py` \
38 A python script to create a json file from a formatted string of ric info. Helper for the test enviroment.
40 `delete_policies_process.py` \
41 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.
44 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)
46 `ecs_api_functions.sh` \
47 Contains functions for adapting towards the ECS API
49 `extract_sdnc_reply.py` \
50 A python script to extract the information from an sdnc (A1 Controller) reply json. Helper for the test environment.
52 `gateway_api_functions.sh` \
53 Contains functions for managing the Non-RT RIC Gateway
55 `http_proxy_api_functions.sh` \
56 Contains functions for managing the Http Proxy
58 `kube_proxy_api_functions.sh` \
59 Contains functions for managing the Kube Proxy - to gain access to all services pod inside a kube cluster.
61 `mr_api_functions.sh` \
62 Contains functions for managing the MR Stub and the Dmaap Message Router
64 `prodstub_api_functions.sh` \
65 Contains functions for adapting towards the Producer stub interface - simulates a producer.
67 `rapp_catalogue_api_functions.sh` \
68 Contains functions for adapting towards the RAPP Catalogue.
70 `ricsimulator_api_functions.sh` \
71 Contains functions for adapting towards the RIC (A1) simulator admin API.
74 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.
75 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'.
77 `testcase_common.sh` \
78 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.
79 The included functions are described in detail further below.
81 `testsuite_common.sh` \
82 Common functions for running two or more auto test scripts as a suite.
84 # Description of functions in testcase_common.sh #
87 The script can be started with these arguments
91 | `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>+]` |
93 | parameter | description |
95 | `remote` | Use images from remote repositories. Can be overridden for individual images using the '--use_xxx' flags |
96 | `remote-remove` | Same as 'remote' but will also try to pull fresh images from remote repositories |
97 | `docker` | Use docker environment for test |
98 | `kuber` | Use kubernetes environment for test. Requires a kubernetes minikube installation |
99 | `--env-file` | The script will use the supplied file to read environment variables from |
100 | `release` | If this flag is given the script will use release version of the images |
101 | `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 |
102 | `--stop-at-error` | The script will stop when the first failed test or configuration |
103 | `--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). |
104 | `--use-local-image` | The script will use local images for the supplied apps, space separated list of app short names |
105 | `--use-snapshot-image` | The script will use images from the nexus snapshot repo for the supplied apps, space separated list of app short names |
106 | `--use-staging-image` | The script will use images from the nexus staging repo for the supplied apps, space separated list of app short names |
107 | `--use-release-image` | The script will use images from the nexus release repo for the supplied apps, space separated list of app short names |
108 | `help` | Print this info along with the test script description and the list of app short names supported |
110 ## Function: setup_testenvironment
111 Main function to setup the test environment before any tests are started.
112 Must be called right after sourcing all component scripts.
117 ## Function: indent1 ##
118 Indent every line of a command output with one space char.
123 ## Function: indent2 ##
124 Indent every line of a command output with two space chars.
129 ## Function: print_result ##
130 Print a test report of an auto-test script.
135 ## Function: start_timer ##
136 Start a timer for time measurement. Only one timer can be running.
139 | None - but any args will be printed (It is good practice to use same args for this function as for the `print_timer`) |
141 ## Function: print_timer ##
142 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.
145 | `<timer-message-to-print>` |
147 | parameter | description |
148 | --------- | ----------- |
149 | `<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`) |
151 ## Function: print_and_reset_timer ##
152 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.
155 | `<timer-message-to-print>` |
157 | parameter | description |
158 | --------- | ----------- |
159 | `<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`) |
161 ## Function: deviation ##
162 Mark a test as a deviation from the requirements. The list of deviations will be printed in the test report.
165 | `<deviation-message-to-print>` |
167 | parameter | description |
168 | --------- | ----------- |
169 | `<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 |
171 ## Function: clean_environment ##
172 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).
177 ## Function: auto_clean_containers ##
178 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.
183 ## Function: sleep_wait ##
184 Make the script sleep for a number of seconds.
187 | `<sleep-time-in-sec> [<any-text-in-quotes-to-be-printed>]` |
189 | parameter | description |
190 | --------- | ----------- |
191 | `<sleep-time-in-sec> ` | Number of seconds to sleep |
192 | `<any-text-in-quotes-to-be-printed>` | Optional. The text will be printed, if present |
194 ## Function: check_control_panel_logs ##
195 Check the Control Panel log for any warnings and errors and print the count of each.
200 ## Function: store_logs ##
201 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.
204 | `<logfile-prefix>` |
206 | parameter | description |
207 | --------- | ----------- |
208 | `<logfile-prefix>` | Log file prefix |
211 # Description of functions in testsuite_common.sh #
213 ## Function: suite_setup ##
214 Sets up the test suite and prints out a heading.
220 Print out the overall result of the executed test cases.
225 # Description of functions in agent_api_functions.sh #
228 Both PMS version 1 and 2 are supported. The version is controlled by the env variable `$PMS_VERSION` set in the test env file.
229 For api function in version 2, an url prefix is added if configured.
231 ## Function: use_agent_rest_http ##
232 Use http for all API calls to the Policy Agent. This is the default.
237 ## Function: use_agent_rest_https ##
238 Use https for all API calls to the Policy Agent.
243 ## Function: use_agent_dmaap_http ##
244 Send and recieve all API calls to the Policy Agent over Dmaap via the MR over http.
249 ## Function: use_agent_dmaap_https ##
250 Send and recieve all API calls to the Policy Agent over Dmaap via the MR over https.
255 ## Function: start_policy_agent ##
256 Start the Policy Agent container or corresponding kube resources depending on docker/kube mode.
258 | `<logfile-prefix>` |
259 | (docker) `PROXY|NOPROXY <config-file>` |
260 | (kube) `PROXY|NOPROXY <config-file> [ <data-file> ]` |
261 | parameter | description |
262 | --------- | ----------- |
263 | `PROXY` | Configure with http proxy, if proxy is started |
264 | `NOPROXY` | Configure without http proxy |
265 | <config-file>` | Path to application.yaml |
266 | <data-file>` | Optional path to application_configuration.json |
268 ## Function: agent_load_config ##
269 Load the config into a config map (kubernetes only).
272 | parameter | description |
273 | --------- | ----------- |
274 | <data-file>` | Path to application_configuration.json |
276 ## Function: set_agent_debug ##
277 Configure the Policy Agent log on debug level. The Policy Agent must be running.
282 ## Function: set_agent_trace ##
283 Configure the Policy Agent log on trace level. The Policy Agent must be running.
288 ## Function: use_agent_retries ##
289 Configure the Policy Agent to make upto 5 retries if an API calls return any of the specified http return codes.
292 | `[<response-code>]*` |
295 ## Function: check_policy_agent_logs ##
296 Check the Policy Agent log for any warnings and errors and print the count of each.
301 ## Function: api_equal() ##
303 Tests if the array length of a json array in the Policy Agent simulator is equal to a target value.
304 Without the timeout, the test sets pass or fail immediately depending on if the array length is equal to the target or not.
305 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.
306 See the 'cr' dir for more details.
310 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
312 | parameter | description |
313 | --------- | ----------- |
314 | `<variable-name>` | Relative url. Example 'json:policy_types' - checks the json array length of the url /policy_types |
315 | `<target-value>` | Target value for the length |
316 | `<timeout-in-sec>` | Max time to wait for the length to reach the target value |
318 ## Function: api_get_policies() ##
319 Test of GET '/policies' or V2 GET '/v2/policy-instances' and optional check of the array of returned policies.
320 To test the response code only, provide the response code parameter as well as the following three parameters.
321 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.
325 | `<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>]*]` |
329 | `<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>]*]` |
331 | parameter | description |
332 | --------- | ----------- |
333 | `<response-code>` | Expected http response code |
334 | `<ric-id>` | Id of the ric |
335 | `NORIC` | Indicator that no ric is provided |
336 | `<service-id>` | Id of the service |
337 | `NOSERVICE` | Indicator that no service id is provided |
338 | `<policy-type-id>` | Id of the policy type |
339 | `NOTYPE` | Indicator that no type id is provided |
340 | `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
341 | `<policy-id>` | Id of the policy |
342 | `EMPTY` | Indicate for the special empty policy type |
343 | `transient` | Transient, true or false |
344 | `notification-url` | Url for notifications |
345 | `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
348 ## Function: api_get_policy() ##
349 Test of GET '/policy' or V2 GET '/v2/policies/{policy_id}' and optional check of the returned json payload.
350 To test the the response code only, provide the expected response code and policy id.
351 To test the contents of the returned json payload, add a path to the template file used when creating the policy.
355 | `<response-code> <policy-id> [<template-file>]` |
359 | `<response-code> <policy-id> [ <template-file> <service-name> <ric-id> <policytype-id>|NOTYPE <transient> <notification-url>|NOURL ]` |
361 | parameter | description |
362 | --------- | ----------- |
363 | `<response-code>` | Expected http response code |
364 | `<policy-id>` | Id of the policy |
365 | `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
366 | `<service-id>` | Id of the service |
367 | `<ric-id>` | Id of the ric |
368 | `<policy-type-id>` | Id of the policy type |
369 | `NOTYPE` | Indicator that no type id is provided |
370 | `transient` | Transient, true or false |
371 | `notification-url` | Url for notifications |
373 ## Function: api_put_policy() ##
374 Test of PUT '/policy' or V2 PUT '/policies'.
375 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).
379 | `<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]` |
383 | `<response-code> <service-name> <ric-id> <policytype-id>|NOTYPE <policy-id> <transient>|NOTRANSIENT <notification-url>|NOURL <template-file> [<count>]` |
385 | parameter | description |
386 | --------- | ----------- |
387 | `<response-code>` | Expected http response code |
388 | `<service-id>` | Id of the service |
389 | `<ric-id>` | Id of the ric |
390 | `<policy-type-id>` | Id of the policy type |
391 | `<policy-id>` | Id of the policy. This value shall be a numeric value if more than one policy shall be created |
392 | `transient>` | Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provided) |
393 | `notification-url` | Url for notifications |
394 |`NOURL`| Indicator for no url |
395 | `<template-file>` | Path to the template file for the policy |
396 | `<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 |
398 ## Function: api_put_policy_batch() ##
399 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.
400 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.
401 For arg list and parameters, see 'api_put_policy'.
403 ## Function: api_put_policy_parallel() ##
404 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.
408 | `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <template-file> <count-per-ric> <number-of-threads>`
412 | `<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>`
414 | parameter | description |
415 | --------- | ----------- |
416 | `<response-code>` | Expected http response code |
417 | `<service-id>` | Id of the service |
418 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing |
419 | `<number-of-rics>` | The number of rics, assuming the first index is '1'. The index is added to the 'ric-id-base' id |
420 | `<policy-type-id>` | Id of the policy type |
421 | `<policy-start-id>` | Id of the policy. This value shall be a numeric value and will be the id of the first policy |
422 | `transient>` | Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provide) |
423 | `notification-url` | Url for notifications |
424 | `<template-file>` | Path to the template file for the policy |
425 | `<count-per-ric>` | Number of policies per ric |
426 | `<number-of-threads>` | Number of threads (processes) to run in parallel |
428 ## Function: api_delete_policy() ##
429 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.
433 | `<response-code> <policy-id> [<count>]`
435 | parameter | description |
436 | --------- | ----------- |
437 | `<response-code>` | Expected http response code |
438 | `<policy-id>` | Id of the policy |
439 | `<count>` | An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
441 ## Function: api_delete_policy_batch() ##
442 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.
443 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.
444 For arg list and parameters, see 'api_delete_policy'.
446 ## Function: api_delete_policy_parallel() ##
447 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.
451 | `<response-code> <ric-id-base> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>`
453 | parameter | description |
454 | --------- | ----------- |
455 | `<response-code>` | Expected http response code |
456 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing |
457 | `<number-of-rics>` | The number of rics, assuming the first index is '1' |
458 | `<policy-start-id>` | Id of the policy. This value shall be a numeric value and will be the id of the first policy |
459 | `<count-per-ric>` | Number of policies per ric |
460 | `<number-of-threads>` | Number of threads (processes) to run in parallel |
463 ## Function: api_get_policy_ids() ##
465 Test of GET '/policy_ids' or V2 GET '/v2/policies'.
466 To test response code only, provide the response code parameter as well as the following three parameters.
467 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.
471 | `<response-code> <ric-id>|NORIC <service-id>|NOSERVICE <type-id>|NOTYPE ([<policy-instance-id]*|NOID)` |
473 | parameter | description |
474 | --------- | ----------- |
475 | `<response-code>` | Expected http response code |
476 | `<ric-id>` | Id of the ric |
477 | `NORIC` | Indicator that no ric is provided |
478 | `<service-id>` | Id of the service |
479 | `NOSERVICE` | Indicator that no service id is provided |
480 | `type-id>` | Id of the policy type |
481 | `NOTYPE` | Indicator that no type id is provided |
482 | `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
483 | `<policy-instance-id>` | Id of the policy |
485 ## Function: api_get_policy_schema() ##
486 Test of V2 GET '/v2/policy-types/{policyTypeId}' and optional check of the returned json schema.
487 To test the response code only, provide the expected response code and policy type id.
488 To test the contents of the returned json schema, add a path to a schema file to compare with.
492 | `<response-code> <policy-type-id> [<schema-file>]` |
494 | parameter | description |
495 | --------- | ----------- |
496 | `<response-code>` | Expected http response code |
497 | `<policy-type-id>` | Id of the policy type |
498 | `<schema-file>` | Path to the schema file for the policy type |
500 ## Function: api_get_policy_schema() ##
501 Test of GET '/policy_schema' and optional check of the returned json schema.
502 To test the response code only, provide the expected response code and policy type id.
503 To test the contents of the returned json schema, add a path to a schema file to compare with.
507 | `<response-code> <policy-type-id> [<schema-file>]` |
509 | parameter | description |
510 | --------- | ----------- |
511 | `<response-code>` | Expected http response code |
512 | `<policy-type-id>` | Id of the policy type |
513 | `<schema-file>` | Path to the schema file for the policy type |
515 ## Function: api_get_policy_schemas() ##
516 Test of GET '/policy_schemas' and optional check of the returned json schemas.
517 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
518 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)
522 | `<response-code> <ric-id>|NORIC [<schema-file>|NOFILE]*` |
524 | parameter | description |
525 | --------- | ----------- |
526 | `<response-code>` | Expected http response code |
527 | `<ric-id>` | Id of the ric |
528 | `NORIC` | No ric id given |
529 | `<schema-file>` | Path to the schema file for the policy type |
530 | `NOFILE` | Indicate the template for an empty type |
532 ## Function: api_get_policy_status() ##
533 Test of GET '/policy_status' or V2 GET '/policies/{policy_id}/status'.
537 | `<response-code> <policy-id> (STD|STD2 <enforce-status>|EMPTY [<reason>|EMPTY])|(OSC <instance-status> <has-been-deleted>)` |
539 | parameter | description |
540 | --------- | ----------- |
541 | `<response-code>` | Expected http response code |
542 | `<policy-id>` | Id of the policy |
543 | `STD` | Indicator of status of Standarized A1 |
544 | `STD2` | Indicator of status of Standarized A1 version 2 |
545 | `<enforce-status>` | Enforcement status |
546 | `<reason>` | Optional reason |
547 | `EMPTY` | Indicator of empty string status or reason |
548 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
549 | `<instance-status>` | Instance status |
550 | `<has-been-deleted>` | Deleted status, true or false |
552 ## Function: api_get_policy_types() ##
553 Test of GET '/policy_types' or V2 GET '/v2/policy-types' and optional check of the returned ids.
554 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
555 To test the contents of the returned json payload, add the list of expected policy type id (or 'EMPTY' for the '{}' type)
559 | `<response-code> [<ric-id>|NORIC [<policy-type-id>|EMPTY [<policy-type-id>]*]]` |
561 | parameter | description |
562 | --------- | ----------- |
563 | `<response-code>` | Expected http response code |
564 | `<ric-id>` | Id of the ric |
565 | `NORIC` | No ric id given |
566 | `<policy-type-id>` | Id of the policy type |
567 | `EMPTY` | Indicate the empty type |
569 ## Function: api_get_status() ##
570 Test of GET /status or V2 GET /status
574 | `<response-code>` |
576 | parameter | description |
577 | --------- | ----------- |
578 | `<response-code>` | Expected http response code |
580 ## Function: api_get_ric() ##
581 Test of GET '/ric' or V2 GET '/v2/rics/ric'
582 To test the response code only, provide the expected response code and managed element id.
583 To test the returned ric id, provide the expected ric id.
587 | `<reponse-code> <managed-element-id> [<ric-id>]` |
591 | `<reponse-code> <management-element-id>|NOME <ric-id>|<NORIC> [<string-of-ricinfo>]` |
593 | parameter | description |
594 | --------- | ----------- |
595 | `<response-code>` | Expected http response code |
596 | `<managed-element-id>` | Id of the managed element |
597 | `NOME` | Indicator for no ME |
598 | `ric-id` | Id of the ric |
599 | `NORIC` | Indicator no RIC |
600 | `string-of-ricinfo` | String of ric info |
602 ## Function: api_get_rics() ##
603 Test of GET '/rics' or V2 GET '/v2/rics' and optional check of the returned json payload (ricinfo).
604 To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
605 To test also the returned payload, add the formatted string of info in the returned payload.
606 Format of ricinfo: '<ric-id>:<list-of-mes>:<list-of-policy-type-ids>'
607 Example `<space-separate-string-of-ricinfo> = "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2,4 ricsim_g1_1:me2_........."`
611 | `<reponse-code> <policy-type-id>|NOTYPE [<space-separate-string-of-ricinfo>]` |
613 | parameter | description |
614 | --------- | ----------- |
615 | `<response-code>` | Expected http response code |
616 | `<policy-type-id>` | Policy type id of the ric |
617 | `NOTYPE>` | No type given |
618 | `<space-separate-string-of-ricinfo>` | A space separated string of ric info - needs to be quoted |
620 ## Function: api_put_service() ##
621 Test of PUT '/service' or V2 PUT '/service'.
624 | `<response-code> <service-name> <keepalive-timeout> <callbackurl>` |
626 | parameter | description |
627 | --------- | ----------- |
628 | `<response-code>` | Expected http response code |
629 | `<service-name>` | Service name |
630 | `<keepalive-timeout>` | Timeout value |
631 | `<callbackurl>` | Callback url |
633 ## Function: api_get_services() ##
634 Test of GET '/service' or V2 GET '/v2/services' and optional check of the returned json payload.
635 To test only the response code, omit all parameters except the expected response code.
636 To test the returned json, provide the parameters after the response code.
640 | `<response-code> [ (<query-service-name> <target-service-name> <keepalive-timeout> <callbackurl>) | (NOSERVICE <target-service-name> <keepalive-timeout> <callbackurl> [<target-service-name> <keepalive-timeout> <callbackurl>]* )]` |
642 | parameter | description |
643 | --------- | ----------- |
644 | `<response-code>` | Expected http response code |
645 | <query-service-name>` | Service name for the query |
646 | <target-service-name>` | Target service name|
647 | `<keepalive-timeout>` | Timeout value |
648 | `<callbackurl>` | Callback url |
649 | `NOSERVICE` | Indicator of no target service name |
651 ## Function: api_get_service_ids() ##
652 Test of GET '/services' or V2 GET /'v2/services'. Only check of service ids.
656 | `<response-code> [<service-name>]*` |
658 | parameter | description |
659 | --------- | ----------- |
660 | `<response-code>` | Expected http response code |
661 | `<service-name>` | Service name |
663 ## Function: api_delete_services() ##
664 Test of DELETE '/services' or V2 DELETE '/v2/services/{serviceId}'
668 | `<response-code> [<service-name>]*` |
670 | parameter | description |
671 | --------- | ----------- |
672 | `<response-code>` | Expected http response code |
673 | `<service-name>` | Service name |
675 ## Function: api_put_services_keepalive() ##
676 Test of PUT '/services/keepalive' or V2 PUT '/v2/services/{service_id}/keepalive'
680 | <response-code> <service-name>` |
682 | parameter | description |
683 | --------- | ----------- |
684 | `<response-code>` | Expected http response code |
685 | `<service-name>` | Service name |
687 ## Function: api_put_configuration() ##
688 Test of PUT '/v2/configuration'
692 | <response-code> <config-file>` |
694 | parameter | description |
695 | --------- | ----------- |
696 | `<response-code>` | Expected http response code |
697 | `<config-file>` | Path json config file |
699 ## Function: api_get_configuration() ##
700 Test of GET '/v2/configuration'
704 | <response-code> [<config-file>]` |
706 | parameter | description |
707 | --------- | ----------- |
708 | `<response-code>` | Expected http response code |
709 | `<config-file>` | Path json config file to compare the retrieved config with |
710 | parameter | description |
711 | --------- | ----------- |
712 | `[<response-code>]*` | A space separated list of http response codes, may be empty to reset to 'no codes'. |
715 # Description of functions in consul_cbs_function.sh #
718 ## Function: consul_config_app ##
719 Function to load a json config from a file into consul for the Policy Agent
723 | `<json-config-file>` |
725 | parameter | description |
726 | --------- | ----------- |
727 | `<json-config-file>` | The path to the json file to be loaded to Consul/CBS |
729 ## Function: prepare_consul_config ##
730 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')
733 | `<deviation-message-to-print>` |
735 | parameter | description |
736 | --------- | ----------- |
737 | `SDNC|NOSDNC` | Configure based on a1-controller (SNDC) or without a controller/adapter (NOSDNC) |
738 | `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app' |
740 ## Function: start_consul_cbs ##
741 Start the Consul and CBS containers
746 # Description of functions in control_panel_api_function.sh #
748 ## Function: use_control_panel_http ##
749 Set http as the protocol to use for all communication to the Control Panel
754 ## Function: use_control_panel_https ##
755 Set https as the protocol to use for all communication to the Control Panel
760 ## Function: start_control_panel ##
761 Start the Control Panel container
766 # Description of functions in controller_api_functions.sh #
767 The file contains a selection of the possible API tests towards the a1-controller
769 ## Function: use_sdnc_http ##
770 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.
775 ## Function: use_sdnc_http ##
776 Use https for all API calls towards the SDNC A1 Controller. Note that this function shall be called before preparing the config for Consul.
781 ## Function: start_sdnc ##
782 Start the SDNC A1 Controller container and its database container
787 ## Function: check_sdnc_logs ##
788 Check the SDNC log for any warnings and errors and print the count of each.
793 ## Function: controller_api_get_A1_policy_ids ##
794 Test of GET policy ids towards OSC or STD type simulator.
795 To test response code only, provide the response code, 'OSC' + policy type or 'STD'
796 To test the response payload, include the ids of the expexted response.
800 | `<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) | ( STD <ric-id> [ <policy-id> [<policy-id>]* ]` |
802 | parameter | description |
803 | --------- | ----------- |
804 | `<response-code>` | Expected http response code |
805 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
806 | `<ric-id>` | Id of the ric |
807 | `policy-type-id>` | Id of the policy type |
808 | `<policy-id>` | Id of the policy |
809 | `STD` | Indicator of status of Standarized A1 |
812 ## Function: controller_api_get_A1_policy_type ##
813 Test of GET a policy type (OSC only)
817 | `<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]` |
819 | parameter | description |
820 | --------- | ----------- |
821 | `<response-code>` | Expected http response code |
822 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
823 | `<ric-id>` | Id of the ric |
824 | `policy-type-id>` | Id of the policy type |
825 | `policy-type-file>` | Optional schema file to compare the returned type with |
827 ## Function: controller_api_delete_A1_policy ##
828 Deletes a policy instance
832 | `(STD <ric-id> <policy-id>) | (OSC <ric-id> <policy-type-id> <policy-id>)` |
834 | parameter | description |
835 | --------- | ----------- |
836 | `<response-code>` | Expected http response code |
837 | `STD` | Indicator of status of Standarized A1 |
838 | `<ric-id>` | Id of the ric |
839 | `<policy-id>` | Id of the policy |
840 | `policy-type-id>` | Id of the policy type |
841 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
842 | `policy-type-file>` | Optional schema file to compare the returned type with |
844 ## Function: controller_api_put_A1_policy ##
845 Creates a policy instance
849 | `<response-code> (STD <ric-id> <policy-id> <template-file> ) | (OSC <ric-id> <policy-type-id> <policy-id> <template-file>)` |
851 | parameter | description |
852 | --------- | ----------- |
853 | `<response-code>` | Expected http response code |
854 | `STD` | Indicator of status of Standarized A1 |
855 | `<ric-id>` | Id of the ric |
856 | `<policy-id>` | Id of the policy |
857 | `<template-file>` | Path to the template file of the policy|
858 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
859 | `<policy-type-id>` | Id of the policy type |
861 ## Function: controller_api_get_A1_policy_status ##
862 Checks the status of a policy
866 | `<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) | (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)` |
868 | parameter | description |
869 | --------- | ----------- |
870 | `<response-code>` | Expected http response code |
871 | `STD` | Indicator of status of Standarized A1 |
872 | `<ric-id>` | Id of the ric |
873 | `<policy-id>` | Id of the policy |
874 | `<enforce-status>` | Enforcement status |
875 | `<reason>` | Optional reason |
876 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
877 | `<policy-type-id>` | Id of the policy type |
878 | `<instance-status>` | Instance status |
879 | `<has-been-deleted>` | Deleted status, true or false |
882 # Description of functions in cr_api_functions.sh #
884 ## Function: use_cr_http ##
885 Use http for getting event from CR. The admin API is not affected. This is the default.
890 ## Function: use_cr_https ##
891 Use https for getting event from CR. The admin API is not affected.
892 Note: Not yet used as callback event is not fully implemented/deciced.
897 ## Function: start_cr ##
898 Start the Callback Receiver container in docker or kube depending on start mode.
903 ## Function: cr_equal ##
904 Tests if a variable value in the Callback Receiver (CR) simulator is equal to a target value.
905 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
906 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.
907 See the 'cr' dir for more details.
910 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
912 | parameter | description |
913 | --------- | ----------- |
914 | `<variable-name>` | Variable name in the CR |
915 | `<target-value>` | Target value for the variable |
916 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
918 ## Function: cr_api_check_all_sync_events() ##
919 Check the contents of all ric events received for a callback id.
923 | `<response-code> <id> [ EMPTY | ( <ric-id> )+ ]` |
925 | parameter | description |
926 | --------- | ----------- |
927 | `<response-code>` | Expected http response code |
928 | `<id>` | Id of the callback destination |
929 | `EMPTY` | Indicator for an empty list |
930 | `<ric-id>` | Id of the ric |
932 # Description of functions in ecs_api_functions.sh #
934 ## Function: use_ecs_rest_http ##
935 Use http for all API calls to the ECS. This is the default protocol.
940 ## Function: use_ecs_rest_https ##
941 Use https for all API calls to the ECS.
946 ## Function: use_ecs_dmaap_http ##
947 Send and recieve all API calls to the ECS over Dmaap via the MR using http.
952 ## Function: use_ecs_dmaap_https ##
953 Send and recieve all API calls to the ECS over Dmaap via the MR using https.
958 ## Function: start_ecs ##
959 Start the ECS container in docker or kube depending on running mode.
964 ## Function: restart_ecs ##
965 Restart the ECS container.
970 ## Function: set_ecs_debug ##
971 Configure the ECS log on debug level. The ECS must be running.
976 ## Function: set_ecs_trace ##
977 Configure the ECS log on trace level. The ECS must be running.
982 ## Function: check_ecs_logs ##
983 Check the ECS log for any warnings and errors and print the count of each.
988 ## Function: ecs_equal ##
989 Tests if a variable value in the ECS is equal to a target value.
990 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
991 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.
992 See the 'a1-interface' repo for more details.
996 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
998 | parameter | description |
999 | --------- | ----------- |
1000 | `<variable-name>` | Variable name in ecs |
1001 | `<target-value>` | Target value for the variable |
1002 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1004 ## Function: ecs_api_a1_get_job_ids() ##
1005 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs' and optional check of the array of returned job ids.
1006 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1007 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1011 | `<response-code> <type-id> <owner-id>|NOOWNER [ EMPTY | <job-id>+ ]` |
1013 | parameter | description |
1014 | --------- | ----------- |
1015 | `<response-code>` | Expected http response code |
1016 | `<type-id>` | Id of the EI type |
1017 | `<owner-id>` | Id of the job owner |
1018 | `NOOWNER` | No owner is given |
1019 | `<job-id>` | Id of the expected job |
1020 | `EMPTY` | The expected list of job id shall be empty |
1022 ## Function: ecs_api_a1_get_type() ##
1023 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}' and optional check of the returned schema.
1024 To test the response code only, provide the response code parameter as well as the type-id.
1025 To also test the response payload add a path to the expected schema file.
1029 | `<response-code> <type-id> [<schema-file>]` |
1031 | parameter | description |
1032 | --------- | ----------- |
1033 | `<response-code>` | Expected http response code |
1034 | `<type-id>` | Id of the EI type |
1035 | `<schema-file>` | Path to a schema file to compare with the returned schema |
1037 ## Function: ecs_api_a1_get_type_ids() ##
1038 Test of GET '/A1-EI​/v1​/eitypes' and optional check of returned list of type ids.
1039 To test the response code only, provide the response only.
1040 To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
1044 | `<response-code> [ (EMPTY | [<type-id>]+) ]` |
1046 | parameter | description |
1047 | --------- | ----------- |
1048 | `<response-code>` | Expected http response code |
1049 | `EMPTY` | The expected list of type ids shall be empty |
1050 | `<type-id>` | Id of the EI type |
1052 ## Function: ecs_api_a1_get_job_status() ##
1053 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}​/status' and optional check of the returned status.
1054 To test the response code only, provide the response code, type id and job id.
1055 To also test the response payload add the expected status.
1059 | `<response-code> <type-id> <job-id> [<status>]` |
1061 | parameter | description |
1062 | --------- | ----------- |
1063 | `<response-code>` | Expected http response code |
1064 | `<type-id>` | Id of the EI type |
1065 | `<job-id>` | Id of the job |
1066 | `<status>` | Expected status |
1068 ## Function: ecs_api_a1_get_job() ##
1069 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}' and optional check of the returned job.
1070 To test the response code only, provide the response code, type id and job id.
1071 To also test the response payload add the remaining parameters.
1075 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1077 | parameter | description |
1078 | --------- | ----------- |
1079 | `<response-code>` | Expected http response code |
1080 | `<type-id>` | Id of the EI type |
1081 | `<job-id>` | Id of the job |
1082 | `<target-url>` | Expected target url for the job |
1083 | `<owner-id>` | Expected owner for the job |
1084 | `<template-job-file>` | Path to a job template for job parameters of the job |
1086 ## Function: ecs_api_a1_delete_job() ##
1087 Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1088 To test, provide all the specified parameters.
1092 | `<response-code> <type-id> <job-id> |
1094 | parameter | description |
1095 | --------- | ----------- |
1096 | `<response-code>` | Expected http response code |
1097 | `<type-id>` | Id of the EI type |
1098 | `<job-id>` | Id of the job |
1100 ## Function: ecs_api_a1_put_job() ##
1101 Test of PUT '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1102 To test, provide all the specified parameters.
1106 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
1108 | parameter | description |
1109 | --------- | ----------- |
1110 | `<response-code>` | Expected http response code |
1111 | `<type-id>` | Id of the EI type |
1112 | `<job-id>` | Id of the job |
1113 | `<target-url>` | Target url for the job |
1114 | `<owner-id>` | Owner of the job |
1115 | `<template-job-file>` | Path to a job template for job parameters of the job |
1117 ## Function: ecs_api_edp_get_type_ids() ##
1118 Test of GET '/ei-producer/v1/eitypes' and an optional check of the returned list of type ids.
1119 To test the response code only, provide the response code.
1120 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1124 | `<response-code> [ EMPTY | <type-id>+]` |
1126 | parameter | description |
1127 | --------- | ----------- |
1128 | `<response-code>` | Expected http response code |
1129 | `<type-id>` | Id of the EI type |
1130 | `EMPTY` | The expected list of type ids shall be empty |
1132 ## Function: ecs_api_edp_get_producer_status() ##
1133 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/status' and optional check of the returned status.
1134 To test the response code only, provide the response code and producer id.
1135 To also test the response payload add the expected status.
1139 | `<response-code> <producer-id> [<status>]` |
1141 | parameter | description |
1142 | --------- | ----------- |
1143 | `<response-code>` | Expected http response code |
1144 | `<producer-id>` | Id of the producer |
1145 | `<status>` | The expected status string |
1147 ## Function: ecs_api_edp_get_producer_ids() ##
1148 Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
1149 To test the response code only, provide the response.
1150 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).
1154 | `<response-code> [ EMPTY | <producer-id>+]` |
1156 | parameter | description |
1157 | --------- | ----------- |
1158 | `<response-code>` | Expected http response code |
1159 | `<producer-id>` | Id of the producer |
1160 | `EMPTY` | The expected list of type ids shall be empty |
1162 ## Function: ecs_api_edp_get_type() ##
1163 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
1164 To test the response code only, provide the response and the type-id.
1165 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).
1169 | `<response-code> <type-id> [<job-schema-file> (EMPTY | [<producer-id>]+)]` |
1171 | parameter | description |
1172 | --------- | ----------- |
1173 | `<response-code>` | Expected http response code |
1174 | `<type-id>` | Id of the EI type |
1175 | `<job-schema-file>` | Path to a job schema file |
1176 | `<producer-id>` | Id of the producer |
1177 | `EMPTY` | The expected list of type ids shall be empty |
1179 ## Function: ecs_api_edp_get_producer() ##
1180 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
1181 To test the response code only, provide the response and the producer-id.
1182 To also test the response payload add the remaining parameters defining thee producer.
1186 | `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+) ]` |
1188 | parameter | description |
1189 | --------- | ----------- |
1190 | `<response-code>` | Expected http response code |
1191 | `<producer-id>` | Id of the producer |
1192 | `<create-callback>` | Callback for create job |
1193 | `<delete-callback>` | Callback for delete job |
1194 | `<supervision-callback>` | Callback for producer supervision |
1195 | `<type-id>` | Id of the EI type |
1196 | `<schema-file>` | Path to a schema file |
1197 | `EMPTY` | The expected list of type schema pairs shall be empty |
1199 ## Function: ecs_api_edp_delete_producer() ##
1200 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}'.
1201 To test, provide all parameters.
1205 | `<response-code> <producer-id>` |
1207 | parameter | description |
1208 | --------- | ----------- |
1209 | `<response-code>` | Expected http response code |
1210 | `<producer-id>` | Id of the producer |
1212 ## Function: ecs_api_edp_put_producer() ##
1213 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1214 To test, provide all parameters. The list of type/schema pair may be empty.
1218 | `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+)` |
1220 | parameter | description |
1221 | --------- | ----------- |
1222 | `<response-code>` | Expected http response code |
1223 | `<producer-id>` | Id of the producer |
1224 | `<job-callback>` | Callback for create/delete job |
1225 | `<supervision-callback>` | Callback for producer supervision |
1226 | `<type-id>` | Id of the EI type |
1227 | `<schema-file>` | Path to a schema file |
1228 | `EMPTY` | The list of type/schema pairs is empty |
1230 ## Function: ecs_api_edp_get_producer_jobs() ##
1231 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
1232 To test the response code only, provide the response and the producer-id.
1233 To also test the response payload add the remaining parameters.
1237 | `<response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1239 | parameter | description |
1240 | --------- | ----------- |
1241 | `<response-code>` | Expected http response code |
1242 | `<producer-id>` | Id of the producer |
1243 | `<job-id>` | Id of the job |
1244 | `<type-id>` | Id of the EI type |
1245 | `<target-url>` | Target url for data delivery |
1246 | `<job-owner>` | Id of the job owner |
1247 | `<template-job-file>` | Path to a job template file |
1248 | `EMPTY` | The list of job/type/target/job-file tuples is empty |
1250 ## Function: ecs_api_service_status() ##
1251 Test of GET '/status'.
1255 | `<response-code>` |
1257 | parameter | description |
1258 | --------- | ----------- |
1259 | `<response-code>` | Expected http response code |
1261 ## Function: ecs_api_admin_reset() ##
1262 Test of GET '/status'.
1266 | `<response-code> [ <type> ]` |
1268 | parameter | description |
1269 | --------- | ----------- |
1270 | `<response-code>` | Expected http response code |
1271 | `<type>` | Type id, if the interface supports type in url |
1273 # Description of functions in gateway_api_functions.sh #
1276 ## Function: use_gateway_http ##
1277 Use http for all calls to the gateway. This is set by default.
1282 ## Function: use_gateway_https ##
1283 Use https for all calls to the gateway.
1288 ## Function: set_gateway_debug ##
1289 Set debug level logging in the gateway
1294 ## Function: set_gateway_trace ##
1295 Set debug level logging in the trace
1300 ## Function: start_gateway ##
1301 Start the the gateway container in docker or kube depending on start mode
1306 ## Function: gateway_pms_get_status ##
1307 Sample test of pms api (status)
1310 | `<response-code> ` |
1312 | parameter | description |
1313 | --------- | ----------- |
1314 | `<response-code>` | Expected http response code |
1316 ## Function: gateway_ecs_get_types ##
1317 Sample test of ecs api (get ei type)
1318 Only response code tested - not payload
1321 | `<response-code> ` |
1323 | parameter | description |
1324 | --------- | ----------- |
1325 | `<response-code>` | Expected http response code |
1327 # Description of functions in http_proxy_api_functions.sh #
1329 ## Function: start_http_proxy ##
1330 Start the http proxy container in docker or kube depending on running mode.
1335 # Description of functions in kube_proxy_api_functions.sh #
1337 ## Function: start_kube_proxy ##
1338 Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
1339 No proxy is started if the function is called in docker mode.
1344 # Description of functions in mr_api_functions.sh #
1346 ## Function: use_mr_http ##
1347 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.
1352 ## Function: use_mr_https ##
1353 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.
1358 ## Function: start_mr ##
1359 Start the Message Router stub interface container in docker or kube depending on start mode
1365 ## Function: mr_equal ##
1366 Tests if a variable value in the Message Router (MR) simulator is equal to a target value.
1367 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1368 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.
1369 See the 'mrstub' dir for more details.
1372 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1374 | parameter | description |
1375 | --------- | ----------- |
1376 | `<variable-name>` | Variable name in the MR |
1377 | `<target-value>` | Target value for the variable |
1378 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1380 ## Function: mr_greater ##
1381 Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
1382 Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than the target or not.
1383 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.
1384 See the 'mrstub' dir for more details.
1387 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1389 | parameter | description |
1390 | --------- | ----------- |
1391 | `<variable-name>` | Variable name in the MR |
1392 | `<target-value>` | Target value for the variable |
1393 | `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value |
1395 ## Function: mr_read ##
1396 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.
1397 See the 'mrstub' dir for more details.
1400 | `<variable-name>` |
1402 | parameter | description |
1403 | --------- | ----------- |
1404 | `<variable-name>` | Variable name in the MR |
1406 ## Function: mr_print ##
1407 Prints the value of a variable in the Message Router (MR) simulator.
1408 See the 'mrstub' dir for more details.
1411 | `<variable-name>` |
1413 | parameter | description |
1414 | --------- | ----------- |
1415 | `<variable-name>` | Variable name in the MR |
1418 # Description of functions in prodstub_api_functions.sh #
1420 ## Function: use_prod_stub_http ##
1421 Use http for the API. The admin API is not affected. This is the default protocol.
1426 ## Function: use_prod_stub_https ##
1427 Use https for the API. The admin API is not affected.
1432 ## Function: start_prod_stub ##
1433 Start the Producer stub container in docker or kube depending on start mode
1438 ## Function: prodstub_arm_producer() ##
1439 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
1443 | `<response-code> <producer-id> [<forced_response_code>]` |
1445 | parameter | description |
1446 | --------- | ----------- |
1447 | `<response-code>` | Expected http response code |
1448 | `<producer-id>` | Id of the producer |
1449 | `<forced_response_code>` | Forced response code for the producer callback url |
1451 ## Function: prodstub_arm_job_create() ##
1452 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.
1456 | `<response-code> <job-id> [<forced_response_code>]` |
1458 | parameter | description |
1459 | --------- | ----------- |
1460 | `<response-code>` | Expected http response code |
1461 | `<job-id>` | Id of the job |
1462 | `<forced_response_code>` | Forced response code for the create callback url |
1464 ## Function: prodstub_arm_job_delete() ##
1465 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.
1469 | `<response-code> <job-id> [<forced_response_code>]` |
1471 | parameter | description |
1472 | --------- | ----------- |
1473 | `<response-code>` | Expected http response code |
1474 | `<job-id>` | Id of the job |
1475 | `<forced_response_code>` | Forced response code for the delete callback url |
1477 ## Function: prodstub_arm_type() ##
1478 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
1482 | `<response-code> <producer-id> <type-id>` |
1484 | parameter | description |
1485 | --------- | ----------- |
1486 | `<response-code>` | Expected http response code |
1487 | `<producer-id>` | Id of the producer |
1488 | `<type-id>` | Id of the type |
1490 ## Function: prodstub_disarm_type() ##
1491 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
1495 | `<response-code> <producer-id> <type-id>` |
1497 | parameter | description |
1498 | --------- | ----------- |
1499 | `<response-code>` | Expected http response code |
1500 | `<producer-id>` | Id of the producer |
1501 | `<type-id>` | Id of the type |
1503 ## Function: prodstub_check_jobdata() ##
1504 Check a job in the prodstub towards the list of provided parameters.
1508 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
1510 | parameter | description |
1511 | --------- | ----------- |
1512 | `<response-code>` | Expected http response code |
1513 | `<producer-id>` | Id of the producer |
1514 | `<job-id>` | Id of the job |
1515 | `<type-id>` | Id of the type |
1516 | `<target-url>` | Target url for data delivery |
1517 | `<job-owner>` | Id of the job owner |
1518 | `<template-job-file>` | Path to a job template file |
1520 ## Function: prodstub_delete_jobdata() ##
1521 Delete the job parameters, job data, for a job.
1525 | `<response-code> <producer-id> <job-id>` |
1527 | parameter | description |
1528 | --------- | ----------- |
1529 | `<response-code>` | Expected http response code |
1530 | `<producer-id>` | Id of the producer |
1531 | `<job-id>` | Id of the job |
1534 ## Function: prodstub_equal ##
1535 Tests if a variable value in the prodstub is equal to a target value.
1536 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1537 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.
1541 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1543 | parameter | description |
1544 | --------- | ----------- |
1545 | `<variable-name>` | Variable name in the prostub |
1546 | `<target-value>` | Target value for the variable |
1547 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1550 # Description of functions in rapp_catalogue_api_function.sh #
1552 ## Function: use_rapp_catalogue_http ##
1553 Use http for the API. This is the default protocol.
1558 ## Function: use_rapp_catalogue_https ##
1559 Use https for the API.
1564 ## Function: start_rapp_catalogue ##
1565 Start the rapp catalogue container in docker or kube depending on start mode
1570 ## Function: rc_equal ##
1571 Tests if a variable value in the RAPP Catalogue is equal to a target value.
1572 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1573 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.
1574 See the 'cr' dir for more details.
1577 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1579 | parameter | description |
1580 | --------- | ----------- |
1581 | `<variable-name>` | Variable name in the RC |
1582 | `<target-value>` | Target value for the variable |
1583 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1585 ## Function: rapp_cat_api_get_services() ##
1586 Check all registered services.
1590 | `<response-code> [(<service-id> <version> <display-name> <description>)+ | EMPTY ]` |
1592 | parameter | description |
1593 | --------- | ----------- |
1594 | `<response-code>` | Expected http response code |
1595 | `<service-id>` | Id of the service |
1596 | `<version>` | Version of the service |
1597 | `<display-name>` | Dislay name of the service |
1598 | `<description>` | Description of the service |
1599 | `EMPTY` | Indicator for an empty list |
1601 ## Function: rapp_cat_api_put_service() ##
1602 Register a services.
1606 | `<response-code> <service-id> <version> <display-name> <description>` |
1608 | parameter | description |
1609 | --------- | ----------- |
1610 | `<response-code>` | Expected http response code |
1611 | `<service-id>` | Id of the service |
1612 | `<version>` | Version of the service |
1613 | `<display-name>` | Dislay name of the service |
1614 | `<description>` | Description of the service |
1616 ## Function: rapp_cat_api_get_service() ##
1617 Check a registered service.
1621 | `<response-code> <service-id> <version> <display-name> <description>` |
1623 | parameter | description |
1624 | --------- | ----------- |
1625 | `<response-code>` | Expected http response code |
1626 | `<service-id>` | Id of the service |
1627 | `<version>` | Version of the service |
1628 | `<display-name>` | Dislay name of the service |
1629 | `<description>` | Description of the service |
1631 ## Function: rapp_cat_api_delete_service() ##
1632 Check a registered service.
1636 | `<response-code> <service-id>` |
1638 | parameter | description |
1639 | --------- | ----------- |
1640 | `<response-code>` | Expected http response code |
1641 | `<service-id>` | Id of the service |
1644 # Description of functions in ricsimulator_api_functions.sh #
1645 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
1648 ## Function: use_simulator_http ##
1649 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.
1654 ## Function: use_simulator_https ##
1655 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.
1660 ## Function: start_ric_simulators ##
1661 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
1664 | `ricsim_g1|ricsim_g2|ricsim_g3 <count> <interface-id>` |
1666 | parameter | description |
1667 | --------- | ----------- |
1668 | `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 |
1669 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
1670 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
1672 ## Function: get_kube_sim_host ##
1673 Translate ric name to kube host name.
1678 | parameter | description |
1679 | --------- | ----------- |
1680 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
1682 ## Function: generate_policy_uuid ##
1683 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
1684 UUID is then automatically added to the policy id in GET/PUT/DELETE.
1689 ## Function: sim_equal ##
1690 Tests if a variable value in the RIC simulator is equal to a target value.
1691 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1692 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.
1693 See the 'a1-interface' repo for more details.
1697 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1699 | parameter | description |
1700 | --------- | ----------- |
1701 | `<variable-name>` | Variable name in the ric simulator |
1702 | `<target-value>` | Target value for the variable |
1703 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1705 ## Function: sim_print ##
1706 Prints the value of a variable in the RIC simulator.
1707 See the 'a1-interface' repo for more details.
1711 | `<variable-name>` |
1713 | parameter | description |
1714 | --------- | ----------- |
1715 | `<variable-name>` | Variable name in the RIC simulator |
1718 ## Function: sim_contains_str ##
1719 Tests if a variable value in the RIC simulator contains a target string.
1720 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
1721 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.
1722 See the 'a1-interface' repo for more details.
1726 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1728 | parameter | description |
1729 | --------- | ----------- |
1730 | `<variable-name>` | Variable name in the ric simulator |
1731 | `<target-value>` | Target substring for the variable |
1732 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1734 ## Function: sim_put_policy_type ##
1735 Loads a policy type to the simulator
1739 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
1741 | parameter | description |
1742 | --------- | ----------- |
1743 | `<response-code>` | Expected http response code |
1744 | `<ric-id>` | Id of the ric |
1745 | `<policy-type-id>` | Id of the policy type |
1746 | `<policy-type-file>` | Path to the schema file of the policy type |
1748 ## Function: sim_delete_policy_type ##
1749 Deletes a policy type from the simulator
1753 | `<response-code> <ric-id> <policy_type_id>` |
1755 | parameter | description |
1756 | --------- | ----------- |
1757 | `<response-code>` | Expected http response code |
1758 | `<ric-id>` | Id of the ric |
1759 | `<policy-type-id>` | Id of the policy type |
1761 ## Function: sim_post_delete_instances ##
1762 Deletes all instances (and status), for one ric
1766 | `<response-code> <ric-id>` |
1768 | parameter | description |
1769 | --------- | ----------- |
1770 | `<response-code>` | Expected http response code |
1771 | `<ric-id>` | Id of the ric |
1774 ## Function: sim_post_delete_all ##
1775 Deletes all types, instances (and status), for one ric
1779 | `<response-code> <ric-id>` |
1781 | parameter | description |
1782 | --------- | ----------- |
1783 | `<response-code>` | Expected http response code |
1784 | `<ric-id>` | Id of the ric |
1786 ## Function: sim_post_forcedresponse ##
1787 Sets (or resets) response code for next (one) A1 message, for one ric.
1788 The intention is to simulate error response on the A1 interface.
1792 | `<response-code> <ric-id> [<forced_response_code>]`|
1794 | parameter | description |
1795 | --------- | ----------- |
1796 | `<response-code>` | Expected http response code |
1797 | `<ric-id>` | Id of the ric |
1798 | `<forced_response_code>` | Http response code to send |
1800 ## Function: sim_post_forcedelay ##
1801 Sets (or resets) A1 response delay, for one ric
1802 The intention is to delay responses on the A1 interface. Setting remains until removed.
1806 | `<response-code> <ric-id> [<delay-in-seconds>]`|
1808 | parameter | description |
1809 | --------- | ----------- |
1810 | `<response-code>` | Expected http response code |
1811 | `<ric-id>` | Id of the ric |
1812 | `<delay-in-seconds>` | Delay in seconds. If omitted, the delay is removed |
1817 Copyright (C) 2020 Nordix Foundation. All rights reserved.
1818 Licensed under the Apache License, Version 2.0 (the "License");
1819 you may not use this file except in compliance with the License.
1820 You may obtain a copy of the License at
1822 http://www.apache.org/licenses/LICENSE-2.0
1824 Unless required by applicable law or agreed to in writing, software
1825 distributed under the License is distributed on an "AS IS" BASIS,
1826 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1827 See the License for the specific language governing permissions and
1828 limitations under the License.