Support for test of PMS persistency
[nonrtric.git] / test / common / README.md
1 # Introduction #
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.
4
5 ## Overview for common test scripts and files ##
6
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)
9
10 `api_curl.sh` \
11 A common curl based function for the agent and ecs apis. Also partly used for the Callback receiver and RAPP Catalogue apis.
12
13 `clean-kube.sh` \
14 Cleans all services, deployments, pods, replica set etc started by the test environment in kubernetes.
15
16 `compare_json.py` \
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'.
18
19 `consul_cbs_function.sh` \
20 Contains functions for managing Consul and CBS as well as create the configuration for the PMS.
21
22 `control_panel_api_function.sh` \
23 Contains functions for managing Control Panel.
24
25 `controller_api_functions.sh` \
26 Contains functions for adaping towards the A1-controller API.
27
28 `count_json_elements.py` \
29 A python script returning the number of items in a json array.
30
31 `cr_api_functions.sh` \
32 Contains functions for adapting towards the Callback receiver for checking received callback event.
33
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.
36
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.
39
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.
42
43 `do_curl_function.sh`
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)
45
46 `ecs_api_functions.sh` \
47 Contains functions for adapting towards the ECS API
48
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.
51
52 `gateway_api_functions.sh` \
53 Contains functions for managing the Non-RT RIC Gateway
54
55 `http_proxy_api_functions.sh` \
56 Contains functions for managing the Http Proxy
57
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.
60
61 `mr_api_functions.sh` \
62 Contains functions for managing the MR Stub and the Dmaap Message Router
63
64 `prodstub_api_functions.sh` \
65 Contains functions for adapting towards the Producer stub interface - simulates a producer.
66
67 `rapp_catalogue_api_functions.sh` \
68 Contains functions for adapting towards the RAPP Catalogue.
69
70 `ricsimulator_api_functions.sh` \
71 Contains functions for adapting towards the RIC (A1) simulator admin API.
72
73 `test_env*.sh` \
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'.
76
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.
80
81 `testsuite_common.sh` \
82 Common functions for running two or more auto test scripts as a suite.
83
84 ## Integration of a new applicaton
85
86 Integration a new application to the test environment involves the following steps.
87
88 * Choose a short name for the application. Should be a uppcase name. For example, the NonRTRIC Gateway has NGW as short name.
89 This short name shall be added to the testengine_config.sh. See that file for detailed instructions.
90
91 * Create a file in this directory using the pattern `<application-name>_api_functions.sh`.
92 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.
93
94 | Function |
95 |--|
96 | __<app-short_name>_imagesetup |
97 | __<app-short_name>_imagepull |
98 | __<app-short_name>_imagebuild |
99 | __<app-short_name>_image_data |
100 | __<app-short_name>_kube_scale_zero |
101 | __<app-short_name>_kube_scale_zero_and_wait |
102 | __<app-short_name>_kube_delete_all |
103
104 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.
105
106 * 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.
107
108 * 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.
109
110 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.
111
112 | Label for docker compose | Description |
113 |--|--|
114 | nrttest_app | shall contain the application short name |
115 | nrttest_dp  | shall be set by a variable containing the display name, a short textual description of the applicaion |
116
117 | Label for kubernetes resource | Description |
118 |--|--|
119 | autotest | shall contain the application short name |
120
121 * 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>`.
122 In addition, all other needed environment shall also be defined in these file.
123
124
125 # Description of functions in testcase_common.sh #
126
127 ## Script args ##
128 The script can be started with these arguments
129
130 | arg list |
131 |--|
132 | `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]` |
133
134 | parameter | description |
135 |-|-|
136 | `remote` | Use images from remote repositories. Can be overridden for individual images using the '--use_xxx' flags |
137 | `remote-remove` | Same as 'remote' but will also try to pull fresh images from remote repositories |
138 | `docker` | Use docker environment for test |
139 | `kuber` | Use kubernetes environment for test. Requires a kubernetes minikube installation |
140 | `--env-file` | The script will use the supplied file to read environment variables from |
141 | `release` | If this flag is given the script will use release version of the images |
142 | `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 |
143 | `--stop-at-error` | The script will stop when the first failed test or configuration |
144 | `--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). |
145 | `--use-local-image` | The script will use local images for the supplied apps, space separated list of app short names |
146 | `--use-snapshot-image` | The script will use images from the nexus snapshot repo for the supplied apps, space separated list of app short names |
147 | `--use-staging-image` | The script will use images from the nexus staging repo for the supplied apps, space separated list of app short names |
148 | `--use-release-image` | The script will use images from the nexus release repo for the supplied apps, space separated list of app short names |
149 | `--image-repo` |  Url to optional image repo. Only locally built images will be re-tagged and pushed to this repo |
150 | `--cluster-timeout` |  Optional timeout for cluster where it takes time to obtain external ip/host-name. Timeout in seconds |
151 | `help` | Print this info along with the test script description and the list of app short names supported |
152
153 ## Function: setup_testenvironment
154 Main function to setup the test environment before any tests are started.
155 Must be called right after sourcing all component scripts.
156 | arg list |
157 |--|
158 | None |
159
160 ## Function: indent1 ##
161 Indent every line of a command output with one space char.
162 | arg list |
163 |--|
164 | None |
165
166 ## Function: indent2 ##
167 Indent every line of a command output with two space chars.
168 | arg list |
169 |--|
170 | None |
171
172 ## Function: print_result ##
173 Print a test report of an auto-test script.
174 | arg list |
175 |--|
176 | None |
177
178 ## Function: start_timer ##
179 Start a timer for time measurement. Only one timer can be running.
180 | arg list |
181 |--|
182 | None - but any args will be printed (It is good practice to use same args for this function as for the `print_timer`) |
183
184 ## Function: print_timer ##
185 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.
186 | arg list |
187 |--|
188 | `<timer-message-to-print>` |
189
190 | parameter | description |
191 | --------- | ----------- |
192 | `<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`) |
193
194 ## Function: print_and_reset_timer ##
195 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.
196 | arg list |
197 |--|
198 | `<timer-message-to-print>` |
199
200 | parameter | description |
201 | --------- | ----------- |
202 | `<timer-message-to-print>` | Any text message to be printed along with the timer result.(It is good practice to use same args for this function as for the `start_timer`) |
203
204 ## Function: deviation ##
205 Mark a test as a deviation from the requirements. The list of deviations will be printed in the test report.
206 | arg list |
207 |--|
208 | `<deviation-message-to-print>` |
209
210 | parameter | description |
211 | --------- | ----------- |
212 | `<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 |
213
214 ## Function: clean_environment ##
215 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).
216 | arg list |
217 |--|
218 | None |
219
220 ## Function: auto_clean_containers ##
221 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.
222 | arg list |
223 |--|
224 | None |
225
226 ## Function: sleep_wait ##
227 Make the script sleep for a number of seconds.
228 | arg list |
229 |--|
230 | `<sleep-time-in-sec> [<any-text-in-quotes-to-be-printed>]` |
231
232 | parameter | description |
233 | --------- | ----------- |
234 | `<sleep-time-in-sec> ` | Number of seconds to sleep |
235 | `<any-text-in-quotes-to-be-printed>` | Optional. The text will be printed, if present |
236
237 ## Function: check_control_panel_logs ##
238 Check the Control Panel log for any warnings and errors and print the count of each.
239 | arg list |
240 |--|
241 | None |
242
243 ## Function: store_logs ##
244 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.
245 | arg list |
246 |--|
247 | `<logfile-prefix>` |
248
249 | parameter | description |
250 | --------- | ----------- |
251 | `<logfile-prefix>` | Log file prefix  |
252
253
254 # Description of functions in testsuite_common.sh #
255
256 ## Function: suite_setup ##
257 Sets up the test suite and prints out a heading.
258 | arg list |
259 |--|
260 | None |
261
262 ## suite_complete ##
263 Print out the overall result of the executed test cases.
264 | arg list |
265 |--|
266 | None |
267
268 # Description of functions in agent_api_functions.sh #
269
270 ## General ##
271 Both PMS version 1 and 2 are supported. The version is controlled by the env variable `$PMS_VERSION` set in the test env file.
272 For api function in version 2, an url prefix is added if configured.
273
274 ## Function: use_agent_rest_http ##
275 Use http for all API calls to the Policy Agent. This is the default.
276 | arg list |
277 |--|
278 | None |
279
280 ## Function: use_agent_rest_https ##
281 Use https for all API calls to the Policy Agent.
282 | arg list |
283 |--|
284 | None |
285
286 ## Function: use_agent_dmaap_http ##
287 Send and recieve all API calls to the Policy Agent over Dmaap via the MR over http.
288 | arg list |
289 |--|
290 | None |
291
292 ## Function: use_agent_dmaap_https ##
293 Send and recieve all API calls to the Policy Agent over Dmaap via the MR over https.
294 | arg list |
295 |--|
296 | None |
297
298 ## Function: start_policy_agent ##
299 Start the Policy Agent container or corresponding kube resources depending on docker/kube mode.
300 | arg list |
301 | `<logfile-prefix>` |
302 | (docker) `PROXY|NOPROXY <config-file>` |
303 | (kube) `PROXY|NOPROXY <config-file> [ <data-file> ]` |
304 | parameter | description |
305 | --------- | ----------- |
306 | `PROXY` | Configure with http proxy, if proxy is started  |
307 | `NOPROXY` | Configure without http proxy  |
308 | <config-file>` | Path to application.yaml  |
309 |  <data-file>` | Optional path to application_configuration.json  |
310
311 ## Function: agent_load_config ##
312 Load the config into a config map (kubernetes only).
313 | arg list |
314 |  <data-file> ]` |
315 | parameter | description |
316 | --------- | ----------- |
317 |  <data-file>` | Path to application_configuration.json  |
318
319 ## Function: set_agent_debug ##
320 Configure the Policy Agent log on debug level. The Policy Agent must be running.
321 | arg list |
322 |--|
323 | None |
324
325 ## Function: set_agent_trace ##
326 Configure the Policy Agent log on trace level. The Policy Agent must be running.
327 | arg list |
328 |--|
329 | None |
330
331 ## Function: use_agent_retries ##
332 Configure the Policy Agent to make upto 5 retries if an API calls return any of the specified http return codes.
333 | arg list |
334 |--|
335 | `[<response-code>]*` |
336
337
338 ## Function: check_policy_agent_logs ##
339 Check the Policy Agent log for any warnings and errors and print the count of each.
340 | arg list |
341 |--|
342 | None |
343
344 ## Function: api_equal() ##
345
346 Tests if the array length of a json array in the Policy Agent simulator is equal to a target value.
347 Without the timeout, the test sets pass or fail immediately depending on if the array length is equal to the target or not.
348 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.
349 See the 'cr' dir for more details.
350
351 | arg list |
352 |--|
353 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
354
355 | parameter | description |
356 | --------- | ----------- |
357 | `<variable-name>` | Relative url. Example 'json:policy_types' - checks the json array length of the url /policy_types  |
358 | `<target-value>` | Target value for the length  |
359 | `<timeout-in-sec>` | Max time to wait for the length to reach the target value  |
360
361 ## Function: api_get_policies() ##
362 Test of GET '/policies' or V2 GET '/v2/policy-instances' and optional check of the array of returned policies.
363 To test the response code only, provide the response code parameter as well as the following three parameters.
364 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.
365
366 | arg list |
367 |--|
368 | `<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>]*]` |
369
370 | arg list V2 |
371 |--|
372 | `<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>]*]` |
373
374 | parameter | description |
375 | --------- | ----------- |
376 | `<response-code>` | Expected http response code |
377 | `<ric-id>` | Id of the ric  |
378 | `NORIC` | Indicator that no ric is provided  |
379 | `<service-id>` | Id of the service  |
380 | `NOSERVICE` | Indicator that no service id is provided  |
381 | `<policy-type-id>` |  Id of the policy type |
382 | `NOTYPE` | Indicator that no type id is provided  |
383 | `NOID` |  Indicator that no policy id is provided - indicate empty list of policies|
384 | `<policy-id>` |  Id of the policy |
385 | `EMPTY` |  Indicate for the special empty policy type |
386 | `transient` |  Transient, true or false |
387 | `notification-url` |  Url for notifications |
388 | `<template-file>` |  Path to the template file for the policy (same template used when creating the policy) |
389
390
391 ## Function: api_get_policy() ##
392 Test of GET '/policy' or V2 GET '/v2/policies/{policy_id}' and optional check of the returned json payload.
393 To test the the response code only, provide the expected response code and policy id.
394 To test the contents of the returned json payload, add a path to the template file used when creating the policy.
395
396 | arg list |
397 |--|
398 | `<response-code>  <policy-id> [<template-file>]` |
399
400 | arg list V2|
401 |--|
402 | `<response-code> <policy-id> [ <template-file> <service-name> <ric-id> <policytype-id>|NOTYPE <transient> <notification-url>|NOURL ]` |
403
404 | parameter | description |
405 | --------- | ----------- |
406 | `<response-code>` | Expected http response code |
407 | `<policy-id>` |  Id of the policy |
408 | `<template-file>` |  Path to the template file for the policy (same template used when creating the policy) |
409 | `<service-id>` | Id of the service  |
410 | `<ric-id>` | Id of the ric  |
411 | `<policy-type-id>` |  Id of the policy type |
412 | `NOTYPE` | Indicator that no type id is provided  |
413 | `transient` |  Transient, true or false |
414 | `notification-url` |  Url for notifications |
415
416 ## Function: api_put_policy() ##
417 Test of PUT '/policy' or V2 PUT '/policies'.
418 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).
419
420 | arg list |
421 |--|
422 | `<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]` |
423
424 | arg list V2 |
425 |--|
426 | `<response-code> <service-name> <ric-id> <policytype-id>|NOTYPE <policy-id> <transient>|NOTRANSIENT <notification-url>|NOURL <template-file> [<count>]` |
427
428 | parameter | description |
429 | --------- | ----------- |
430 | `<response-code>` | Expected http response code |
431 | `<service-id>` | Id of the service  |
432 | `<ric-id>` | Id of the ric  |
433 | `<policy-type-id>` |  Id of the policy type |
434 | `<policy-id>` |  Id of the policy. This value shall be a numeric value if more than one policy shall be created |
435 | `transient>` |  Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provided) |
436 | `notification-url` |  Url for notifications |
437 |`NOURL`| Indicator for no url |
438 | `<template-file>` |  Path to the template file for the policy |
439 | `<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 |
440
441 ## Function: api_put_policy_batch() ##
442 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.
443 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.
444 For arg list and parameters, see 'api_put_policy'.
445
446 ## Function: api_put_policy_parallel() ##
447 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.
448
449 | arg list |
450 |--|
451 | `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <template-file> <count-per-ric> <number-of-threads>`
452
453 | arg list |
454 |--|
455 | `<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>`
456
457 | parameter | description |
458 | --------- | ----------- |
459 | `<response-code>` | Expected http response code |
460 | `<service-id>` | Id of the service  |
461 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing  |
462 | `<number-of-rics>` | The number of rics, assuming the first index is '1'. The index is added to the 'ric-id-base' id  |
463 | `<policy-type-id>` |  Id of the policy type |
464 | `<policy-start-id>` |  Id of the policy. This value shall be a numeric value and will be the id of the first policy |
465 | `transient>` |  Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provide) |
466 | `notification-url` |  Url for notifications |
467 | `<template-file>` |  Path to the template file for the policy |
468 | `<count-per-ric>` |  Number of policies per ric |
469 | `<number-of-threads>` |  Number of threads (processes) to run in parallel |
470
471 ## Function: api_delete_policy() ##
472 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.
473
474 | arg list |
475 |--|
476 | `<response-code> <policy-id> [<count>]`
477
478 | parameter | description |
479 | --------- | ----------- |
480 | `<response-code>` | Expected http response code |
481 | `<policy-id>` |  Id of the policy |
482 | `<count>` |  An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
483
484 ## Function: api_delete_policy_batch() ##
485 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.
486 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.
487 For arg list and parameters, see 'api_delete_policy'.
488
489 ## Function: api_delete_policy_parallel() ##
490 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.
491
492 | arg list |
493 |--|
494 | `<response-code> <ric-id-base> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>`
495
496 | parameter | description |
497 | --------- | ----------- |
498 | `<response-code>` | Expected http response code |
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'  |
501 | `<policy-start-id>` |  Id of the policy. This value shall be a numeric value and will be the id of the first policy |
502 | `<count-per-ric>` |  Number of policies per ric |
503 | `<number-of-threads>` |  Number of threads (processes) to run in parallel |
504
505
506 ## Function: api_get_policy_ids() ##
507
508 Test of GET '/policy_ids' or V2 GET '/v2/policies'.
509 To test response code only, provide the response code parameter as well as the following three parameters.
510 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.
511
512 | arg list |
513 |--|
514 | `<response-code> <ric-id>|NORIC <service-id>|NOSERVICE <type-id>|NOTYPE ([<policy-instance-id]*|NOID)` |
515
516 | parameter | description |
517 | --------- | ----------- |
518 | `<response-code>` | Expected http response code |
519 | `<ric-id>` | Id of the ric  |
520 | `NORIC` | Indicator that no ric is provided  |
521 | `<service-id>` | Id of the service  |
522 | `NOSERVICE` | Indicator that no service id is provided  |
523 | `type-id>` |  Id of the policy type |
524 | `NOTYPE` | Indicator that no type id is provided  |
525 | `NOID` |  Indicator that no policy id is provided - indicate empty list of policies|
526 | `<policy-instance-id>` |  Id of the policy |
527
528 ## Function: api_get_policy_schema() ##
529 Test of V2 GET '/v2/policy-types/{policyTypeId}' and optional check of the returned json schema.
530 To test the response code only, provide the expected response code and policy type id.
531 To test the contents of the returned json schema, add a path to a schema file to compare with.
532
533 | arg list |
534 |--|
535 | `<response-code> <policy-type-id> [<schema-file>]` |
536
537 | parameter | description |
538 | --------- | ----------- |
539 | `<response-code>` | Expected http response code |
540 | `<policy-type-id>` |  Id of the policy type |
541 | `<schema-file>` |  Path to the schema file for the policy type |
542
543 ## Function: api_get_policy_schema() ##
544 Test of GET '/policy_schema' and optional check of the returned json schema.
545 To test the response code only, provide the expected response code and policy type id.
546 To test the contents of the returned json schema, add a path to a schema file to compare with.
547
548 | arg list |
549 |--|
550 | `<response-code> <policy-type-id> [<schema-file>]` |
551
552 | parameter | description |
553 | --------- | ----------- |
554 | `<response-code>` | Expected http response code |
555 | `<policy-type-id>` |  Id of the policy type |
556 | `<schema-file>` |  Path to the schema file for the policy type |
557
558 ## Function: api_get_policy_schemas() ##
559 Test of GET '/policy_schemas' and optional check of the returned json schemas.
560 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
561 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)
562
563 | arg list |
564 |--|
565 | `<response-code>  <ric-id>|NORIC [<schema-file>|NOFILE]*` |
566
567 | parameter | description |
568 | --------- | ----------- |
569 | `<response-code>` | Expected http response code |
570 | `<ric-id>` |  Id of the ric |
571 | `NORIC` |  No ric id given |
572 | `<schema-file>` |  Path to the schema file for the policy type |
573 | `NOFILE` |  Indicate the template for an empty type |
574
575 ## Function: api_get_policy_status() ##
576 Test of GET '/policy_status' or V2 GET '/policies/{policy_id}/status'.
577
578 | arg list |
579 |--|
580 | `<response-code> <policy-id> (STD|STD2 <enforce-status>|EMPTY [<reason>|EMPTY])|(OSC <instance-status> <has-been-deleted>)` |
581
582 | parameter | description |
583 | --------- | ----------- |
584 | `<response-code>` | Expected http response code |
585 | `<policy-id>` |  Id of the policy |
586 | `STD` |  Indicator of status of Standarized A1 |
587 | `STD2` |  Indicator of status of Standarized A1 version 2 |
588 | `<enforce-status>` |  Enforcement status |
589 | `<reason>` |  Optional reason |
590 | `EMPTY` |  Indicator of empty string status or reason |
591 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
592 | `<instance-status>` |  Instance status |
593 | `<has-been-deleted>` |  Deleted status, true or false |
594
595 ## Function: api_get_policy_types() ##
596 Test of GET '/policy_types' or  V2 GET '/v2/policy-types' and optional check of the returned ids.
597 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
598 To test the contents of the returned json payload, add the list of expected policy type id (or 'EMPTY' for the '{}' type)
599
600 | arg list |
601 |--|
602 | `<response-code> [<ric-id>|NORIC [<policy-type-id>|EMPTY [<policy-type-id>]*]]` |
603
604 | parameter | description |
605 | --------- | ----------- |
606 | `<response-code>` | Expected http response code |
607 | `<ric-id>` |  Id of the ric |
608 | `NORIC` |  No ric id given |
609 | `<policy-type-id>` |  Id of the policy type |
610 | `EMPTY` |  Indicate the empty type |
611
612 ## Function: api_get_status() ##
613 Test of GET /status or V2 GET /status
614
615 | arg list |
616 |--|
617 | `<response-code>` |
618
619 | parameter | description |
620 | --------- | ----------- |
621 | `<response-code>` | Expected http response code |
622
623 ## Function: api_get_ric() ##
624 Test of GET '/ric' or V2 GET '/v2/rics/ric'
625 To test the response code only, provide the expected response code and managed element id.
626 To test the returned ric id, provide the expected ric id.
627
628 | arg list |
629 |--|
630 | `<reponse-code> <managed-element-id> [<ric-id>]` |
631
632 | arg list V2 |
633 |--|
634 | `<reponse-code> <management-element-id>|NOME <ric-id>|<NORIC> [<string-of-ricinfo>]` |
635
636 | parameter | description |
637 | --------- | ----------- |
638 | `<response-code>` | Expected http response code |
639 | `<managed-element-id>` |  Id of the managed element |
640 | `NOME` |  Indicator for no ME |
641 | `ric-id` |  Id of the ric |
642 | `NORIC` |  Indicator no RIC |
643 | `string-of-ricinfo` |  String of ric info |
644
645 ## Function: api_get_rics() ##
646 Test of GET '/rics' or V2 GET '/v2/rics' and optional check of the returned json payload (ricinfo).
647 To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
648 To test also the returned payload, add the formatted string of info in the returned payload.
649 Format of ricinfo: '<ric-id>:<list-of-mes>:<list-of-policy-type-ids>'
650 Example `<space-separate-string-of-ricinfo> = "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2,4 ricsim_g1_1:me2_........."`
651
652 | arg list |
653 |--|
654 | `<reponse-code> <policy-type-id>|NOTYPE [<space-separate-string-of-ricinfo>]` |
655
656 | parameter | description |
657 | --------- | ----------- |
658 | `<response-code>` | Expected http response code |
659 | `<policy-type-id>` |  Policy type id of the ric |
660 | `NOTYPE>` |  No type given |
661 | `<space-separate-string-of-ricinfo>` |  A space separated string of ric info - needs to be quoted |
662
663 ## Function: api_put_service() ##
664 Test of PUT '/service' or V2 PUT '/service'.
665 | arg list |
666 |--|
667 | `<response-code>  <service-name> <keepalive-timeout> <callbackurl>` |
668
669 | parameter | description |
670 | --------- | ----------- |
671 | `<response-code>` | Expected http response code |
672 | `<service-name>` |  Service name |
673 | `<keepalive-timeout>` |  Timeout value |
674 | `<callbackurl>` |  Callback url |
675
676 ## Function: api_get_services() ##
677 Test of GET '/service' or V2 GET '/v2/services' and optional check of the returned json payload.
678 To test only the response code, omit all parameters except the expected response code.
679 To test the returned json, provide the parameters after the response code.
680
681 | arg list |
682 |--|
683 | `<response-code> [ (<query-service-name> <target-service-name> <keepalive-timeout> <callbackurl>) | (NOSERVICE <target-service-name> <keepalive-timeout> <callbackurl> [<target-service-name> <keepalive-timeout> <callbackurl>]* )]` |
684
685 | parameter | description |
686 | --------- | ----------- |
687 | `<response-code>` | Expected http response code |
688 | <query-service-name>` |  Service name for the query |
689 | <target-service-name>` |  Target service name|
690 | `<keepalive-timeout>` |  Timeout value |
691 | `<callbackurl>` |  Callback url |
692 | `NOSERVICE` |  Indicator of no target service name |
693
694 ## Function: api_get_service_ids() ##
695 Test of GET '/services' or V2 GET /'v2/services'. Only check of service ids.
696
697 | arg list |
698 |--|
699 | `<response-code> [<service-name>]*` |
700
701 | parameter | description |
702 | --------- | ----------- |
703 | `<response-code>` | Expected http response code |
704 | `<service-name>` |  Service name |
705
706 ## Function: api_delete_services() ##
707 Test of DELETE '/services' or V2 DELETE '/v2/services/{serviceId}'
708
709 | arg list |
710 |--|
711 | `<response-code> [<service-name>]*` |
712
713 | parameter | description |
714 | --------- | ----------- |
715 | `<response-code>` | Expected http response code |
716 | `<service-name>` |  Service name |
717
718 ## Function: api_put_services_keepalive() ##
719 Test of PUT '/services/keepalive' or V2 PUT '/v2/services/{service_id}/keepalive'
720
721 | arg list |
722 |--|
723 | <response-code> <service-name>` |
724
725 | parameter | description |
726 | --------- | ----------- |
727 | `<response-code>` | Expected http response code |
728 | `<service-name>` |  Service name |
729
730 ## Function: api_put_configuration() ##
731 Test of PUT '/v2/configuration'
732
733 | arg list |
734 |--|
735 | <response-code> <config-file>` |
736
737 | parameter | description |
738 | --------- | ----------- |
739 | `<response-code>` | Expected http response code |
740 | `<config-file>` |  Path json config file |
741
742 ## Function: api_get_configuration() ##
743 Test of GET '/v2/configuration'
744
745 | arg list |
746 |--|
747 | <response-code> [<config-file>]` |
748
749 | parameter | description |
750 | --------- | ----------- |
751 | `<response-code>` | Expected http response code |
752 | `<config-file>` |  Path json config file to compare the retrieved config with |
753 | parameter | description |
754 | --------- | ----------- |
755 | `[<response-code>]*` | A space separated list of http response codes, may be empty to reset to 'no codes'.  |
756
757
758 # Description of functions in consul_cbs_function.sh #
759
760
761 ## Function: consul_config_app ##
762 Function to load a json config from a file into consul for the Policy Agent
763
764 | arg list |
765 |--|
766 | `<json-config-file>` |
767
768 | parameter | description |
769 | --------- | ----------- |
770 | `<json-config-file>` | The path to the json file to be loaded to Consul/CBS |
771
772 ## Function: prepare_consul_config ##
773 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')
774 | arg list |
775 |--|
776 | `<deviation-message-to-print>` |
777
778 | parameter | description |
779 | --------- | ----------- |
780 | `SDNC|NOSDNC` | Configure based on a1-controller (SNDC) or without a controller/adapter (NOSDNC) |
781 | `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app'  |
782
783 ## Function: start_consul_cbs ##
784 Start the Consul and CBS containers
785 | arg list |
786 |--|
787 | None |
788
789 # Description of functions in control_panel_api_function.sh #
790
791 ## Function: use_control_panel_http ##
792 Set http as the protocol to use for all communication to the Control Panel
793 | arg list |
794 |--|
795 | None |
796
797 ## Function: use_control_panel_https ##
798 Set https as the protocol to use for all communication to the Control Panel
799 | arg list |
800 |--|
801 | None |
802
803 ## Function: start_control_panel ##
804 Start the Control Panel container
805 | arg list |
806 |--|
807 | None |
808
809 # Description of functions in controller_api_functions.sh #
810 The file contains a selection of the possible API tests towards the a1-controller
811
812 ## Function: use_sdnc_http ##
813 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.
814 | arg list |
815 |--|
816 | None |
817
818 ## Function: use_sdnc_http ##
819 Use https for all API calls towards the SDNC A1 Controller. Note that this function shall be called before preparing the config for Consul.
820 | arg list |
821 |--|
822 | None |
823
824 ## Function: start_sdnc ##
825 Start the SDNC A1 Controller container and its database container
826 | arg list |
827 |--|
828 | None |
829
830 ## Function: check_sdnc_logs ##
831 Check the SDNC log for any warnings and errors and print the count of each.
832 | arg list |
833 |--|
834 | None |
835
836 ## Function: controller_api_get_A1_policy_ids ##
837 Test of GET policy ids towards OSC or STD type simulator.
838 To test response code only, provide the response code, 'OSC' + policy type or 'STD'
839 To test the response payload, include the ids of the expexted response.
840
841 | arg list |
842 |--|
843 | `<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) | ( STD <ric-id> [ <policy-id> [<policy-id>]* ]` |
844
845 | parameter | description |
846 | --------- | ----------- |
847 | `<response-code>` | Expected http response code |
848 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
849 | `<ric-id>` | Id of the ric  |
850 | `policy-type-id>` |  Id of the policy type |
851 | `<policy-id>` |  Id of the policy |
852 | `STD` |  Indicator of status of Standarized A1 |
853
854
855 ## Function: controller_api_get_A1_policy_type ##
856 Test of GET a policy type (OSC only)
857
858 | arg list |
859 |--|
860 | `<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]` |
861
862 | parameter | description |
863 | --------- | ----------- |
864 | `<response-code>` | Expected http response code |
865 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
866 | `<ric-id>` | Id of the ric  |
867 | `policy-type-id>` |  Id of the policy type |
868 | `policy-type-file>` |  Optional schema file to compare the returned type with |
869
870 ## Function: controller_api_delete_A1_policy ##
871 Deletes a policy instance
872
873 | arg list |
874 |--|
875 | `(STD <ric-id> <policy-id>) | (OSC <ric-id> <policy-type-id> <policy-id>)` |
876
877 | parameter | description |
878 | --------- | ----------- |
879 | `<response-code>` | Expected http response code |
880 | `STD` |  Indicator of status of Standarized A1 |
881 | `<ric-id>` | Id of the ric  |
882 | `<policy-id>` |  Id of the policy |
883 | `policy-type-id>` |  Id of the policy type |
884 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
885 | `policy-type-file>` |  Optional schema file to compare the returned type with |
886
887 ## Function: controller_api_put_A1_policy ##
888 Creates a policy instance
889
890 | arg list |
891 |--|
892 | `<response-code> (STD <ric-id> <policy-id> <template-file> ) | (OSC <ric-id> <policy-type-id> <policy-id> <template-file>)` |
893
894 | parameter | description |
895 | --------- | ----------- |
896 | `<response-code>` | Expected http response code |
897 | `STD` |  Indicator of status of Standarized A1 |
898 | `<ric-id>` | Id of the ric  |
899 | `<policy-id>` |  Id of the policy |
900 | `<template-file>` |  Path to the template file of the policy|
901 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
902 | `<policy-type-id>` |  Id of the policy type |
903
904 ## Function: controller_api_get_A1_policy_status ##
905 Checks the status of a policy
906
907  arg list |
908 |--|
909 | `<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) | (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)` |
910
911 | parameter | description |
912 | --------- | ----------- |
913 | `<response-code>` | Expected http response code |
914 | `STD` |  Indicator of status of Standarized A1 |
915 | `<ric-id>` | Id of the ric  |
916 | `<policy-id>` |  Id of the policy |
917 | `<enforce-status>` |  Enforcement status |
918 | `<reason>` |  Optional reason |
919 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
920 | `<policy-type-id>` |  Id of the policy type |
921 | `<instance-status>` |  Instance status |
922 | `<has-been-deleted>` |  Deleted status, true or false |
923
924
925 # Description of functions in cr_api_functions.sh #
926
927 ## Function: use_cr_http ##
928 Use http for getting event from CR.  The admin API is not affected. This is the default.
929 | arg list |
930 |--|
931 | None |
932
933 ## Function: use_cr_https ##
934 Use https for getting event from CR. The admin API is not affected.
935 Note: Not yet used as callback event is not fully implemented/deciced.
936 | arg list |
937 |--|
938 | None |
939
940 ## Function: start_cr ##
941 Start the Callback Receiver container in docker or kube depending on start mode.
942 | arg list |
943 |--|
944 | None |
945
946 ## Function: cr_equal ##
947 Tests if a variable value in the Callback Receiver (CR) simulator is equal to a target value.
948 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
949 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.
950 See the 'cr' dir for more details.
951 | arg list |
952 |--|
953 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
954
955 | parameter | description |
956 | --------- | ----------- |
957 | `<variable-name>` | Variable name in the CR  |
958 | `<target-value>` | Target value for the variable  |
959 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
960
961 ## Function: cr_api_check_all_sync_events() ##
962 Check the contents of all ric events received for a callback id.
963
964 | arg list |
965 |--|
966 | `<response-code> <id> [ EMPTY | ( <ric-id> )+ ]` |
967
968 | parameter | description |
969 | --------- | ----------- |
970 | `<response-code>` | Expected http response code |
971 | `<id>` | Id of the callback destination  |
972 | `EMPTY` | Indicator for an empty list  |
973 | `<ric-id>` | Id of the ric  |
974
975 # Description of functions in ecs_api_functions.sh #
976
977 ## Function: use_ecs_rest_http ##
978 Use http for all API calls to the ECS. This is the default protocol.
979 | arg list |
980 |--|
981 | None |
982
983 ## Function: use_ecs_rest_https ##
984 Use https for all API calls to the ECS.
985 | arg list |
986 |--|
987 | None |
988
989 ## Function: use_ecs_dmaap_http ##
990 Send and recieve all API calls to the ECS over Dmaap via the MR using http.
991 | arg list |
992 |--|
993 | None |
994
995 ## Function: use_ecs_dmaap_https ##
996 Send and recieve all API calls to the ECS over Dmaap via the MR using https.
997 | arg list |
998 |--|
999 | None |
1000
1001 ## Function: start_ecs ##
1002 Start the ECS container in docker or kube depending on running mode.
1003 | arg list |
1004 |--|
1005 | None |
1006
1007 ## Function: stop_ecs ##
1008 Stop the ECS container.
1009 | arg list |
1010 |--|
1011 | None |
1012
1013 ## Function: start_stopped_ecs ##
1014 Start a previously stopped ecs.
1015 | arg list |
1016 |--|
1017 | None |
1018
1019 ## Function: set_ecs_debug ##
1020 Configure the ECS log on debug level. The ECS must be running.
1021 | arg list |
1022 |--|
1023 | None |
1024
1025 ## Function: set_ecs_trace ##
1026 Configure the ECS log on trace level. The ECS must be running.
1027 | arg list |
1028 |--|
1029 | None |
1030
1031 ## Function: check_ecs_logs ##
1032 Check the ECS log for any warnings and errors and print the count of each.
1033 | arg list |
1034 |--|
1035 | None |
1036
1037 ## Function: ecs_equal ##
1038 Tests if a variable value in the ECS is equal to a target value.
1039 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1040 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.
1041 See the 'a1-interface' repo for more details.
1042
1043 | arg list |
1044 |--|
1045 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1046
1047 | parameter | description |
1048 | --------- | ----------- |
1049 | `<variable-name>` | Variable name in ecs  |
1050 | `<target-value>` | Target value for the variable  |
1051 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1052
1053 ## Function: ecs_api_a1_get_job_ids() ##
1054 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs' and optional check of the array of returned job ids.
1055 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1056 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1057
1058 | arg list |
1059 |--|
1060 | `<response-code> <type-id>  <owner-id>|NOOWNER [ EMPTY | <job-id>+ ]` |
1061
1062 | parameter | description |
1063 | --------- | ----------- |
1064 | `<response-code>` | Expected http response code |
1065 | `<type-id>` | Id of the EI type  |
1066 | `<owner-id>` | Id of the job owner  |
1067 | `NOOWNER` | No owner is given  |
1068 | `<job-id>` | Id of the expected job  |
1069 | `EMPTY` | The expected list of job id shall be empty  |
1070
1071 ## Function: ecs_api_a1_get_type() ##
1072 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}' and optional check of the returned schema.
1073 To test the response code only, provide the response code parameter as well as the type-id.
1074 To also test the response payload add a path to the expected schema file.
1075
1076 | arg list |
1077 |--|
1078 | `<response-code> <type-id> [<schema-file>]` |
1079
1080 | parameter | description |
1081 | --------- | ----------- |
1082 | `<response-code>` | Expected http response code |
1083 | `<type-id>` | Id of the EI type  |
1084 | `<schema-file>` | Path to a schema file to compare with the returned schema  |
1085
1086 ## Function: ecs_api_a1_get_type_ids() ##
1087 Test of GET '/A1-EI​/v1​/eitypes' and optional check of returned list of type ids.
1088 To test the response code only, provide the response only.
1089 To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
1090
1091 | arg list |
1092 |--|
1093 | `<response-code> [ (EMPTY | [<type-id>]+) ]` |
1094
1095 | parameter | description |
1096 | --------- | ----------- |
1097 | `<response-code>` | Expected http response code |
1098 | `EMPTY` | The expected list of type ids shall be empty  |
1099 | `<type-id>` | Id of the EI type  |
1100
1101 ## Function: ecs_api_a1_get_job_status() ##
1102 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}​/status' and optional check of the returned status.
1103 To test the response code only, provide the response code, type id and job id.
1104 To also test the response payload add the expected status.
1105
1106 | arg list |
1107 |--|
1108 | `<response-code> <type-id> <job-id> [<status>]` |
1109
1110 | parameter | description |
1111 | --------- | ----------- |
1112 | `<response-code>` | Expected http response code |
1113 | `<type-id>` | Id of the EI type  |
1114 | `<job-id>` | Id of the job  |
1115 | `<status>` | Expected status  |
1116
1117 ## Function: ecs_api_a1_get_job() ##
1118 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}' and optional check of the returned job.
1119 To test the response code only, provide the response code, type id and job id.
1120 To also test the response payload add the remaining parameters.
1121
1122 | arg list |
1123 |--|
1124 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1125
1126 | parameter | description |
1127 | --------- | ----------- |
1128 | `<response-code>` | Expected http response code |
1129 | `<type-id>` | Id of the EI type  |
1130 | `<job-id>` | Id of the job  |
1131 | `<target-url>` | Expected target url for the job  |
1132 | `<owner-id>` | Expected owner for the job  |
1133 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1134
1135 ## Function: ecs_api_a1_delete_job() ##
1136 Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1137 To test, provide all the specified parameters.
1138
1139 | arg list |
1140 |--|
1141 | `<response-code> <type-id> <job-id> |
1142
1143 | parameter | description |
1144 | --------- | ----------- |
1145 | `<response-code>` | Expected http response code |
1146 | `<type-id>` | Id of the EI type  |
1147 | `<job-id>` | Id of the job  |
1148
1149 ## Function: ecs_api_a1_put_job() ##
1150 Test of PUT '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1151 To test, provide all the specified parameters.
1152
1153 | arg list |
1154 |--|
1155 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
1156
1157 | parameter | description |
1158 | --------- | ----------- |
1159 | `<response-code>` | Expected http response code |
1160 | `<type-id>` | Id of the EI type  |
1161 | `<job-id>` | Id of the job  |
1162 | `<target-url>` | Target url for the job  |
1163 | `<owner-id>` | Owner of the job  |
1164 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1165
1166 ## Function: ecs_api_edp_get_type_ids() ##
1167 Test of GET '/ei-producer/v1/eitypes' and an optional check of the returned list of type ids.
1168 To test the response code only, provide the response code.
1169 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1170
1171 | arg list |
1172 |--|
1173 | `<response-code> [ EMPTY | <type-id>+]` |
1174
1175 | parameter | description |
1176 | --------- | ----------- |
1177 | `<response-code>` | Expected http response code |
1178 | `<type-id>` | Id of the EI type  |
1179 | `EMPTY` | The expected list of type ids shall be empty  |
1180
1181 ## Function: ecs_api_edp_get_producer_status() ##
1182 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/status' and optional check of the returned status.
1183 To test the response code only, provide the response code and producer id.
1184 To also test the response payload add the expected status.
1185
1186 | arg list |
1187 |--|
1188 | `<response-code> <producer-id> [<status>]` |
1189
1190 | parameter | description |
1191 | --------- | ----------- |
1192 | `<response-code>` | Expected http response code |
1193 | `<producer-id>` | Id of the producer  |
1194 | `<status>` | The expected status string  |
1195
1196 ## Function: ecs_api_edp_get_producer_ids() ##
1197 Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
1198 To test the response code only, provide the response.
1199 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).
1200
1201 | arg list |
1202 |--|
1203 | `<response-code> [ EMPTY | <producer-id>+]` |
1204
1205 | parameter | description |
1206 | --------- | ----------- |
1207 | `<response-code>` | Expected http response code |
1208 | `<producer-id>` | Id of the producer  |
1209 | `EMPTY` | The expected list of type ids shall be empty  |
1210
1211 ## Function: ecs_api_edp_get_type() ##
1212 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
1213 To test the response code only, provide the response and the type-id.
1214 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).
1215
1216 | arg list |
1217 |--|
1218 | `<response-code> <type-id> [<job-schema-file> (EMPTY | [<producer-id>]+)]` |
1219
1220 | parameter | description |
1221 | --------- | ----------- |
1222 | `<response-code>` | Expected http response code |
1223 | `<type-id>` | Id of the EI type  |
1224 | `<job-schema-file>` | Path to a job schema file  |
1225 | `<producer-id>` | Id of the producer  |
1226 | `EMPTY` | The expected list of type ids shall be empty  |
1227
1228 ## Function: ecs_api_edp_get_producer() ##
1229 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
1230 To test the response code only, provide the response and the producer-id.
1231 To also test the response payload add the remaining parameters defining thee producer.
1232
1233 | arg list |
1234 |--|
1235 | `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+) ]` |
1236
1237 | parameter | description |
1238 | --------- | ----------- |
1239 | `<response-code>` | Expected http response code |
1240 | `<producer-id>` | Id of the producer  |
1241 | `<create-callback>` | Callback for create job  |
1242 | `<delete-callback>` | Callback for delete job  |
1243 | `<supervision-callback>` | Callback for producer supervision  |
1244 | `<type-id>` | Id of the EI type  |
1245 | `<schema-file>` | Path to a schema file  |
1246 | `EMPTY` | The expected list of type schema pairs shall be empty  |
1247
1248 ## Function: ecs_api_edp_delete_producer() ##
1249 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}'.
1250 To test, provide all parameters.
1251
1252 | arg list |
1253 |--|
1254 | `<response-code> <producer-id>` |
1255
1256 | parameter | description |
1257 | --------- | ----------- |
1258 | `<response-code>` | Expected http response code |
1259 | `<producer-id>` | Id of the producer  |
1260
1261 ## Function: ecs_api_edp_put_producer() ##
1262 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1263 To test, provide all parameters. The list of type/schema pair may be empty.
1264
1265 | arg list |
1266 |--|
1267 | `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+)` |
1268
1269 | parameter | description |
1270 | --------- | ----------- |
1271 | `<response-code>` | Expected http response code |
1272 | `<producer-id>` | Id of the producer  |
1273 | `<job-callback>` | Callback for create/delete job  |
1274 | `<supervision-callback>` | Callback for producer supervision  |
1275 | `<type-id>` | Id of the EI type  |
1276 | `<schema-file>` | Path to a schema file  |
1277 | `EMPTY` | The list of type/schema pairs is empty  |
1278
1279 ## Function: ecs_api_edp_get_producer_jobs() ##
1280 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
1281 To test the response code only, provide the response and the producer-id.
1282 To also test the response payload add the remaining parameters.
1283
1284 | arg list |
1285 |--|
1286 | `<response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1287
1288 | parameter | description |
1289 | --------- | ----------- |
1290 | `<response-code>` | Expected http response code |
1291 | `<producer-id>` | Id of the producer  |
1292 | `<job-id>` | Id of the job  |
1293 | `<type-id>` | Id of the EI type  |
1294 | `<target-url>` | Target url for data delivery  |
1295 | `<job-owner>` | Id of the job owner  |
1296 | `<template-job-file>` | Path to a job template file  |
1297 | `EMPTY` | The list of job/type/target/job-file tuples is empty  |
1298
1299 ## Function: ecs_api_service_status() ##
1300 Test of GET '/status'.
1301
1302 | arg list |
1303 |--|
1304 | `<response-code>` |
1305
1306 | parameter | description |
1307 | --------- | ----------- |
1308 | `<response-code>` | Expected http response code |
1309
1310 ## Function: ecs_api_admin_reset() ##
1311 Test of GET '/status'.
1312
1313 | arg list |
1314 |--|
1315 | `<response-code> [ <type> ]` |
1316
1317 | parameter | description |
1318 | --------- | ----------- |
1319 | `<response-code>` | Expected http response code |
1320 | `<type>` | Type id, if the interface supports type in url |
1321
1322 # Description of functions in gateway_api_functions.sh #
1323
1324
1325 ## Function: use_gateway_http ##
1326 Use http for all calls to the gateway. This is set by default.
1327 | arg list |
1328 |--|
1329 | None |
1330
1331 ## Function: use_gateway_https ##
1332 Use https for all calls to the gateway.
1333 | arg list |
1334 |--|
1335 | None |
1336
1337 ## Function: set_gateway_debug ##
1338 Set debug level logging in the gateway
1339 | arg list |
1340 |--|
1341 | None |
1342
1343 ## Function: set_gateway_trace ##
1344 Set debug level logging in the trace
1345 | arg list |
1346 |--|
1347 | None |
1348
1349 ## Function: start_gateway ##
1350 Start the the gateway container in docker or kube depending on start mode
1351 | arg list |
1352 |--|
1353 | None |
1354
1355 ## Function: gateway_pms_get_status ##
1356 Sample test of pms api (status)
1357 | arg list |
1358 |--|
1359 | `<response-code> ` |
1360
1361 | parameter | description |
1362 | --------- | ----------- |
1363 | `<response-code>` | Expected http response code |
1364
1365 ## Function: gateway_ecs_get_types ##
1366 Sample test of ecs api (get ei type)
1367 Only response code tested - not payload
1368 | arg list |
1369 |--|
1370 | `<response-code> ` |
1371
1372 | parameter | description |
1373 | --------- | ----------- |
1374 | `<response-code>` | Expected http response code |
1375
1376 # Description of functions in http_proxy_api_functions.sh #
1377
1378 ## Function: start_http_proxy ##
1379 Start the http proxy container in docker or kube depending on running mode.
1380 | arg list |
1381 |--|
1382 | None |
1383
1384 # Description of functions in kube_proxy_api_functions.sh #
1385
1386 ## Function: start_kube_proxy ##
1387 Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
1388 No proxy is started if the function is called in docker mode.
1389 | arg list |
1390 |--|
1391 | None |
1392
1393 # Description of functions in mr_api_functions.sh #
1394
1395 ## Function: use_mr_http ##
1396 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.
1397 | arg list |
1398 |--|
1399 | None |
1400
1401 ## Function: use_mr_https ##
1402 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.
1403 | arg list |
1404 |--|
1405 | None |
1406
1407 ## Function: start_mr ##
1408 Start the Message Router stub interface container in docker or kube depending on start mode
1409 | arg list |
1410 |--|
1411 | None |
1412
1413
1414 ## Function: mr_equal ##
1415 Tests if a variable value in the Message Router (MR) simulator is equal to a target value.
1416 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1417 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.
1418 See the 'mrstub' dir for more details.
1419 | arg list |
1420 |--|
1421 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1422
1423 | parameter | description |
1424 | --------- | ----------- |
1425 | `<variable-name>` | Variable name in the MR  |
1426 | `<target-value>` | Target value for the variable  |
1427 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1428
1429 ## Function: mr_greater ##
1430 Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
1431 Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than the target or not.
1432 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.
1433 See the 'mrstub' dir for more details.
1434 | arg list |
1435 |--|
1436 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1437
1438 | parameter | description |
1439 | --------- | ----------- |
1440 | `<variable-name>` | Variable name in the MR  |
1441 | `<target-value>` | Target value for the variable  |
1442 | `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value  |
1443
1444 ## Function: mr_read ##
1445 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.
1446 See the 'mrstub' dir for more details.
1447 | arg list |
1448 |--|
1449 | `<variable-name>` |
1450
1451 | parameter | description |
1452 | --------- | ----------- |
1453 | `<variable-name>` | Variable name in the MR  |
1454
1455 ## Function: mr_print ##
1456 Prints the value of a variable in the Message Router (MR) simulator.
1457 See the 'mrstub' dir for more details.
1458 | arg list |
1459 |--|
1460 | `<variable-name>` |
1461
1462 | parameter | description |
1463 | --------- | ----------- |
1464 | `<variable-name>` | Variable name in the MR  |
1465
1466
1467 # Description of functions in prodstub_api_functions.sh #
1468
1469 ## Function: use_prod_stub_http ##
1470 Use http for the API.  The admin API is not affected. This is the default protocol.
1471 | arg list |
1472 |--|
1473 | None |
1474
1475 ## Function: use_prod_stub_https ##
1476 Use https for the API. The admin API is not affected.
1477 | arg list |
1478 |--|
1479 | None |
1480
1481 ## Function: start_prod_stub ##
1482 Start the Producer stub container in docker or kube depending on start mode
1483 | arg list |
1484 |--|
1485 | None |
1486
1487 ## Function: prodstub_arm_producer() ##
1488 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
1489
1490 | arg list |
1491 |--|
1492 | `<response-code> <producer-id> [<forced_response_code>]` |
1493
1494 | parameter | description |
1495 | --------- | ----------- |
1496 | `<response-code>` | Expected http response code |
1497 | `<producer-id>` | Id of the producer  |
1498 | `<forced_response_code>` | Forced response code for the producer callback url |
1499
1500 ## Function: prodstub_arm_job_create() ##
1501 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.
1502
1503 | arg list |
1504 |--|
1505 | `<response-code> <job-id> [<forced_response_code>]` |
1506
1507 | parameter | description |
1508 | --------- | ----------- |
1509 | `<response-code>` | Expected http response code |
1510 | `<job-id>` | Id of the job  |
1511 | `<forced_response_code>` | Forced response code for the create callback url |
1512
1513 ## Function: prodstub_arm_job_delete() ##
1514 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.
1515
1516 | arg list |
1517 |--|
1518 | `<response-code> <job-id> [<forced_response_code>]` |
1519
1520 | parameter | description |
1521 | --------- | ----------- |
1522 | `<response-code>` | Expected http response code |
1523 | `<job-id>` | Id of the job  |
1524 | `<forced_response_code>` | Forced response code for the delete callback url |
1525
1526 ## Function: prodstub_arm_type() ##
1527 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
1528
1529 | arg list |
1530 |--|
1531 | `<response-code> <producer-id> <type-id>` |
1532
1533 | parameter | description |
1534 | --------- | ----------- |
1535 | `<response-code>` | Expected http response code |
1536 | `<producer-id>` | Id of the producer  |
1537 | `<type-id>` | Id of the type  |
1538
1539 ## Function: prodstub_disarm_type() ##
1540 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
1541
1542 | arg list |
1543 |--|
1544 | `<response-code> <producer-id> <type-id>` |
1545
1546 | parameter | description |
1547 | --------- | ----------- |
1548 | `<response-code>` | Expected http response code |
1549 | `<producer-id>` | Id of the producer  |
1550 | `<type-id>` | Id of the type  |
1551
1552 ## Function: prodstub_check_jobdata() ##
1553 Check a job in the prodstub towards the list of provided parameters.
1554
1555 | arg list |
1556 |--|
1557 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
1558
1559 | parameter | description |
1560 | --------- | ----------- |
1561 | `<response-code>` | Expected http response code |
1562 | `<producer-id>` | Id of the producer  |
1563 | `<job-id>` | Id of the job  |
1564 | `<type-id>` | Id of the type  |
1565 | `<target-url>` | Target url for data delivery  |
1566 | `<job-owner>` | Id of the job owner  |
1567 | `<template-job-file>` | Path to a job template file  |
1568
1569 ## Function: prodstub_delete_jobdata() ##
1570 Delete the job parameters, job data, for a job.
1571
1572 | arg list |
1573 |--|
1574 | `<response-code> <producer-id> <job-id>` |
1575
1576 | parameter | description |
1577 | --------- | ----------- |
1578 | `<response-code>` | Expected http response code |
1579 | `<producer-id>` | Id of the producer  |
1580 | `<job-id>` | Id of the job  |
1581
1582
1583 ## Function: prodstub_equal ##
1584 Tests if a variable value in the prodstub is equal to a target value.
1585 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1586 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.
1587
1588 | arg list |
1589 |--|
1590 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1591
1592 | parameter | description |
1593 | --------- | ----------- |
1594 | `<variable-name>` | Variable name in the prostub  |
1595 | `<target-value>` | Target value for the variable  |
1596 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1597
1598
1599 # Description of functions in rapp_catalogue_api_function.sh #
1600
1601 ## Function: use_rapp_catalogue_http ##
1602 Use http for the API. This is the default protocol.
1603 | arg list |
1604 |--|
1605 | None |
1606
1607 ## Function: use_rapp_catalogue_https ##
1608 Use https for the API.
1609 | arg list |
1610 |--|
1611 | None |
1612
1613 ## Function: start_rapp_catalogue ##
1614 Start the rapp catalogue container in docker or kube depending on start mode
1615 | arg list |
1616 |--|
1617 | None |
1618
1619 ## Function: rc_equal ##
1620 Tests if a variable value in the RAPP Catalogue is equal to a target value.
1621 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1622 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.
1623 See the 'cr' dir for more details.
1624 | arg list |
1625 |--|
1626 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1627
1628 | parameter | description |
1629 | --------- | ----------- |
1630 | `<variable-name>` | Variable name in the RC  |
1631 | `<target-value>` | Target value for the variable  |
1632 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1633
1634 ## Function: rapp_cat_api_get_services() ##
1635 Check all registered services.
1636
1637 | arg list |
1638 |--|
1639 | `<response-code> [(<service-id> <version> <display-name> <description>)+ | EMPTY ]` |
1640
1641 | parameter | description |
1642 | --------- | ----------- |
1643 | `<response-code>` | Expected http response code |
1644 | `<service-id>` | Id of the service  |
1645 | `<version>` | Version of the service  |
1646 | `<display-name>` | Dislay name of the service  |
1647 | `<description>` | Description of the service  |
1648 | `EMPTY` | Indicator for an empty list  |
1649
1650 ## Function: rapp_cat_api_put_service() ##
1651 Register a services.
1652
1653 | arg list |
1654 |--|
1655 | `<response-code> <service-id> <version> <display-name> <description>` |
1656
1657 | parameter | description |
1658 | --------- | ----------- |
1659 | `<response-code>` | Expected http response code |
1660 | `<service-id>` | Id of the service  |
1661 | `<version>` | Version of the service  |
1662 | `<display-name>` | Dislay name of the service  |
1663 | `<description>` | Description of the service  |
1664
1665 ## Function: rapp_cat_api_get_service() ##
1666 Check a registered service.
1667
1668 | arg list |
1669 |--|
1670 | `<response-code> <service-id> <version> <display-name> <description>` |
1671
1672 | parameter | description |
1673 | --------- | ----------- |
1674 | `<response-code>` | Expected http response code |
1675 | `<service-id>` | Id of the service  |
1676 | `<version>` | Version of the service  |
1677 | `<display-name>` | Dislay name of the service  |
1678 | `<description>` | Description of the service  |
1679
1680 ## Function: rapp_cat_api_delete_service() ##
1681 Check a registered service.
1682
1683 | arg list |
1684 |--|
1685 | `<response-code> <service-id>` |
1686
1687 | parameter | description |
1688 | --------- | ----------- |
1689 | `<response-code>` | Expected http response code |
1690 | `<service-id>` | Id of the service  |
1691
1692
1693 # Description of functions in ricsimulator_api_functions.sh #
1694 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
1695
1696
1697 ## Function: use_simulator_http ##
1698 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.
1699 | arg list |
1700 |--|
1701 | None |
1702
1703 ## Function: use_simulator_https ##
1704 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.
1705 | arg list |
1706 |--|
1707 | None |
1708
1709 ## Function: start_ric_simulators ##
1710 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
1711 | arg list |
1712 |--|
1713 | `ricsim_g1|ricsim_g2|ricsim_g3 <count> <interface-id>` |
1714
1715 | parameter | description |
1716 | --------- | ----------- |
1717 | `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  |
1718 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
1719 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
1720
1721 ## Function: get_kube_sim_host ##
1722 Translate ric name to kube host name.
1723 | arg list |
1724 |--|
1725 | `<ric-name>` |
1726
1727 | parameter | description |
1728 | --------- | ----------- |
1729 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
1730
1731 ## Function: generate_policy_uuid ##
1732 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
1733 UUID is then automatically added to the policy id in GET/PUT/DELETE.
1734 | arg list |
1735 |--|
1736 | None |
1737
1738 ## Function: sim_equal ##
1739 Tests if a variable value in the RIC simulator is equal to a target value.
1740 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1741 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.
1742 See the 'a1-interface' repo for more details.
1743
1744 | arg list |
1745 |--|
1746 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1747
1748 | parameter | description |
1749 | --------- | ----------- |
1750 | `<variable-name>` | Variable name in the ric simulator  |
1751 | `<target-value>` | Target value for the variable  |
1752 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1753
1754 ## Function: sim_print ##
1755 Prints the value of a variable in the RIC simulator.
1756 See the 'a1-interface' repo for more details.
1757
1758 | arg list |
1759 |--|
1760 | `<variable-name>` |
1761
1762 | parameter | description |
1763 | --------- | ----------- |
1764 | `<variable-name>` | Variable name in the RIC simulator  |
1765
1766
1767 ## Function: sim_contains_str ##
1768 Tests if a variable value in the RIC simulator contains a target string.
1769 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
1770 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.
1771 See the 'a1-interface' repo for more details.
1772
1773 | arg list |
1774 |--|
1775 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1776
1777 | parameter | description |
1778 | --------- | ----------- |
1779 | `<variable-name>` | Variable name in the ric simulator  |
1780 | `<target-value>` | Target substring for the variable  |
1781 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1782
1783 ## Function: sim_put_policy_type ##
1784 Loads a policy type to the simulator
1785
1786 | arg list |
1787 |--|
1788 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
1789
1790 | parameter | description |
1791 | --------- | ----------- |
1792 | `<response-code>` | Expected http response code |
1793 | `<ric-id>` |  Id of the ric |
1794 | `<policy-type-id>` |  Id of the policy type |
1795 | `<policy-type-file>` |  Path to the schema file of the policy type |
1796
1797 ## Function: sim_delete_policy_type ##
1798 Deletes a policy type from the simulator
1799
1800 | arg list |
1801 |--|
1802 | `<response-code> <ric-id> <policy_type_id>` |
1803
1804 | parameter | description |
1805 | --------- | ----------- |
1806 | `<response-code>` | Expected http response code |
1807 | `<ric-id>` |  Id of the ric |
1808 | `<policy-type-id>` |  Id of the policy type |
1809
1810 ## Function: sim_post_delete_instances ##
1811 Deletes all instances (and status), for one ric
1812
1813 | arg list |
1814 |--|
1815 | `<response-code> <ric-id>` |
1816
1817 | parameter | description |
1818 | --------- | ----------- |
1819 | `<response-code>` | Expected http response code |
1820 | `<ric-id>` |  Id of the ric |
1821
1822
1823 ## Function: sim_post_delete_all ##
1824 Deletes all types, instances (and status), for one ric
1825
1826 | arg list |
1827 |--|
1828 | `<response-code> <ric-id>` |
1829
1830 | parameter | description |
1831 | --------- | ----------- |
1832 | `<response-code>` | Expected http response code |
1833 | `<ric-id>` |  Id of the ric |
1834
1835 ## Function: sim_post_forcedresponse ##
1836 Sets (or resets) response code for next (one) A1 message, for one ric.
1837 The intention is to simulate error response on the A1 interface.
1838
1839 | arg list |
1840 |--|
1841 | `<response-code> <ric-id> [<forced_response_code>]`|
1842
1843 | parameter | description |
1844 | --------- | ----------- |
1845 | `<response-code>` | Expected http response code |
1846 | `<ric-id>` |  Id of the ric |
1847 | `<forced_response_code>` |  Http response code to send |
1848
1849 ## Function: sim_post_forcedelay ##
1850 Sets (or resets) A1 response delay, for one ric
1851 The intention is to delay responses on the A1 interface. Setting remains until removed.
1852
1853 | arg list |
1854 |--|
1855 | `<response-code> <ric-id> [<delay-in-seconds>]`|
1856
1857 | parameter | description |
1858 | --------- | ----------- |
1859 | `<response-code>` | Expected http response code |
1860 | `<ric-id>` |  Id of the ric |
1861 | `<delay-in-seconds>` |  Delay in seconds. If omitted, the delay is removed |
1862
1863
1864 ## License
1865
1866 Copyright (C) 2020 Nordix Foundation. All rights reserved.
1867 Licensed under the Apache License, Version 2.0 (the "License");
1868 you may not use this file except in compliance with the License.
1869 You may obtain a copy of the License at
1870
1871      http://www.apache.org/licenses/LICENSE-2.0
1872
1873 Unless required by applicable law or agreed to in writing, software
1874 distributed under the License is distributed on an "AS IS" BASIS,
1875 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1876 See the License for the specific language governing permissions and
1877 limitations under the License.