Adaptations to execute in multi-node kube cluster
[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 image repo. Only required in when running in multi-node kube cluster, otherwise optional. All used images will be re-tagged and pushed to this repo
150
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: restart_ecs ##
1008 Restart the ECS container.
1009 | arg list |
1010 |--|
1011 | None |
1012
1013 ## Function: set_ecs_debug ##
1014 Configure the ECS log on debug level. The ECS must be running.
1015 | arg list |
1016 |--|
1017 | None |
1018
1019 ## Function: set_ecs_trace ##
1020 Configure the ECS log on trace level. The ECS must be running.
1021 | arg list |
1022 |--|
1023 | None |
1024
1025 ## Function: check_ecs_logs ##
1026 Check the ECS log for any warnings and errors and print the count of each.
1027 | arg list |
1028 |--|
1029 | None |
1030
1031 ## Function: ecs_equal ##
1032 Tests if a variable value in the ECS is equal to a target value.
1033 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1034 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.
1035 See the 'a1-interface' repo for more details.
1036
1037 | arg list |
1038 |--|
1039 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1040
1041 | parameter | description |
1042 | --------- | ----------- |
1043 | `<variable-name>` | Variable name in ecs  |
1044 | `<target-value>` | Target value for the variable  |
1045 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1046
1047 ## Function: ecs_api_a1_get_job_ids() ##
1048 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs' and optional check of the array of returned job ids.
1049 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1050 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1051
1052 | arg list |
1053 |--|
1054 | `<response-code> <type-id>  <owner-id>|NOOWNER [ EMPTY | <job-id>+ ]` |
1055
1056 | parameter | description |
1057 | --------- | ----------- |
1058 | `<response-code>` | Expected http response code |
1059 | `<type-id>` | Id of the EI type  |
1060 | `<owner-id>` | Id of the job owner  |
1061 | `NOOWNER` | No owner is given  |
1062 | `<job-id>` | Id of the expected job  |
1063 | `EMPTY` | The expected list of job id shall be empty  |
1064
1065 ## Function: ecs_api_a1_get_type() ##
1066 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}' and optional check of the returned schema.
1067 To test the response code only, provide the response code parameter as well as the type-id.
1068 To also test the response payload add a path to the expected schema file.
1069
1070 | arg list |
1071 |--|
1072 | `<response-code> <type-id> [<schema-file>]` |
1073
1074 | parameter | description |
1075 | --------- | ----------- |
1076 | `<response-code>` | Expected http response code |
1077 | `<type-id>` | Id of the EI type  |
1078 | `<schema-file>` | Path to a schema file to compare with the returned schema  |
1079
1080 ## Function: ecs_api_a1_get_type_ids() ##
1081 Test of GET '/A1-EI​/v1​/eitypes' and optional check of returned list of type ids.
1082 To test the response code only, provide the response only.
1083 To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
1084
1085 | arg list |
1086 |--|
1087 | `<response-code> [ (EMPTY | [<type-id>]+) ]` |
1088
1089 | parameter | description |
1090 | --------- | ----------- |
1091 | `<response-code>` | Expected http response code |
1092 | `EMPTY` | The expected list of type ids shall be empty  |
1093 | `<type-id>` | Id of the EI type  |
1094
1095 ## Function: ecs_api_a1_get_job_status() ##
1096 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}​/status' and optional check of the returned status.
1097 To test the response code only, provide the response code, type id and job id.
1098 To also test the response payload add the expected status.
1099
1100 | arg list |
1101 |--|
1102 | `<response-code> <type-id> <job-id> [<status>]` |
1103
1104 | parameter | description |
1105 | --------- | ----------- |
1106 | `<response-code>` | Expected http response code |
1107 | `<type-id>` | Id of the EI type  |
1108 | `<job-id>` | Id of the job  |
1109 | `<status>` | Expected status  |
1110
1111 ## Function: ecs_api_a1_get_job() ##
1112 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}' and optional check of the returned job.
1113 To test the response code only, provide the response code, type id and job id.
1114 To also test the response payload add the remaining parameters.
1115
1116 | arg list |
1117 |--|
1118 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1119
1120 | parameter | description |
1121 | --------- | ----------- |
1122 | `<response-code>` | Expected http response code |
1123 | `<type-id>` | Id of the EI type  |
1124 | `<job-id>` | Id of the job  |
1125 | `<target-url>` | Expected target url for the job  |
1126 | `<owner-id>` | Expected owner for the job  |
1127 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1128
1129 ## Function: ecs_api_a1_delete_job() ##
1130 Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1131 To test, provide all the specified parameters.
1132
1133 | arg list |
1134 |--|
1135 | `<response-code> <type-id> <job-id> |
1136
1137 | parameter | description |
1138 | --------- | ----------- |
1139 | `<response-code>` | Expected http response code |
1140 | `<type-id>` | Id of the EI type  |
1141 | `<job-id>` | Id of the job  |
1142
1143 ## Function: ecs_api_a1_put_job() ##
1144 Test of PUT '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1145 To test, provide all the specified parameters.
1146
1147 | arg list |
1148 |--|
1149 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
1150
1151 | parameter | description |
1152 | --------- | ----------- |
1153 | `<response-code>` | Expected http response code |
1154 | `<type-id>` | Id of the EI type  |
1155 | `<job-id>` | Id of the job  |
1156 | `<target-url>` | Target url for the job  |
1157 | `<owner-id>` | Owner of the job  |
1158 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1159
1160 ## Function: ecs_api_edp_get_type_ids() ##
1161 Test of GET '/ei-producer/v1/eitypes' and an optional check of the returned list of type ids.
1162 To test the response code only, provide the response code.
1163 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1164
1165 | arg list |
1166 |--|
1167 | `<response-code> [ EMPTY | <type-id>+]` |
1168
1169 | parameter | description |
1170 | --------- | ----------- |
1171 | `<response-code>` | Expected http response code |
1172 | `<type-id>` | Id of the EI type  |
1173 | `EMPTY` | The expected list of type ids shall be empty  |
1174
1175 ## Function: ecs_api_edp_get_producer_status() ##
1176 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/status' and optional check of the returned status.
1177 To test the response code only, provide the response code and producer id.
1178 To also test the response payload add the expected status.
1179
1180 | arg list |
1181 |--|
1182 | `<response-code> <producer-id> [<status>]` |
1183
1184 | parameter | description |
1185 | --------- | ----------- |
1186 | `<response-code>` | Expected http response code |
1187 | `<producer-id>` | Id of the producer  |
1188 | `<status>` | The expected status string  |
1189
1190 ## Function: ecs_api_edp_get_producer_ids() ##
1191 Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
1192 To test the response code only, provide the response.
1193 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).
1194
1195 | arg list |
1196 |--|
1197 | `<response-code> [ EMPTY | <producer-id>+]` |
1198
1199 | parameter | description |
1200 | --------- | ----------- |
1201 | `<response-code>` | Expected http response code |
1202 | `<producer-id>` | Id of the producer  |
1203 | `EMPTY` | The expected list of type ids shall be empty  |
1204
1205 ## Function: ecs_api_edp_get_type() ##
1206 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
1207 To test the response code only, provide the response and the type-id.
1208 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).
1209
1210 | arg list |
1211 |--|
1212 | `<response-code> <type-id> [<job-schema-file> (EMPTY | [<producer-id>]+)]` |
1213
1214 | parameter | description |
1215 | --------- | ----------- |
1216 | `<response-code>` | Expected http response code |
1217 | `<type-id>` | Id of the EI type  |
1218 | `<job-schema-file>` | Path to a job schema file  |
1219 | `<producer-id>` | Id of the producer  |
1220 | `EMPTY` | The expected list of type ids shall be empty  |
1221
1222 ## Function: ecs_api_edp_get_producer() ##
1223 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
1224 To test the response code only, provide the response and the producer-id.
1225 To also test the response payload add the remaining parameters defining thee producer.
1226
1227 | arg list |
1228 |--|
1229 | `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+) ]` |
1230
1231 | parameter | description |
1232 | --------- | ----------- |
1233 | `<response-code>` | Expected http response code |
1234 | `<producer-id>` | Id of the producer  |
1235 | `<create-callback>` | Callback for create job  |
1236 | `<delete-callback>` | Callback for delete job  |
1237 | `<supervision-callback>` | Callback for producer supervision  |
1238 | `<type-id>` | Id of the EI type  |
1239 | `<schema-file>` | Path to a schema file  |
1240 | `EMPTY` | The expected list of type schema pairs shall be empty  |
1241
1242 ## Function: ecs_api_edp_delete_producer() ##
1243 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}'.
1244 To test, provide all parameters.
1245
1246 | arg list |
1247 |--|
1248 | `<response-code> <producer-id>` |
1249
1250 | parameter | description |
1251 | --------- | ----------- |
1252 | `<response-code>` | Expected http response code |
1253 | `<producer-id>` | Id of the producer  |
1254
1255 ## Function: ecs_api_edp_put_producer() ##
1256 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1257 To test, provide all parameters. The list of type/schema pair may be empty.
1258
1259 | arg list |
1260 |--|
1261 | `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+)` |
1262
1263 | parameter | description |
1264 | --------- | ----------- |
1265 | `<response-code>` | Expected http response code |
1266 | `<producer-id>` | Id of the producer  |
1267 | `<job-callback>` | Callback for create/delete job  |
1268 | `<supervision-callback>` | Callback for producer supervision  |
1269 | `<type-id>` | Id of the EI type  |
1270 | `<schema-file>` | Path to a schema file  |
1271 | `EMPTY` | The list of type/schema pairs is empty  |
1272
1273 ## Function: ecs_api_edp_get_producer_jobs() ##
1274 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
1275 To test the response code only, provide the response and the producer-id.
1276 To also test the response payload add the remaining parameters.
1277
1278 | arg list |
1279 |--|
1280 | `<response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1281
1282 | parameter | description |
1283 | --------- | ----------- |
1284 | `<response-code>` | Expected http response code |
1285 | `<producer-id>` | Id of the producer  |
1286 | `<job-id>` | Id of the job  |
1287 | `<type-id>` | Id of the EI type  |
1288 | `<target-url>` | Target url for data delivery  |
1289 | `<job-owner>` | Id of the job owner  |
1290 | `<template-job-file>` | Path to a job template file  |
1291 | `EMPTY` | The list of job/type/target/job-file tuples is empty  |
1292
1293 ## Function: ecs_api_service_status() ##
1294 Test of GET '/status'.
1295
1296 | arg list |
1297 |--|
1298 | `<response-code>` |
1299
1300 | parameter | description |
1301 | --------- | ----------- |
1302 | `<response-code>` | Expected http response code |
1303
1304 ## Function: ecs_api_admin_reset() ##
1305 Test of GET '/status'.
1306
1307 | arg list |
1308 |--|
1309 | `<response-code> [ <type> ]` |
1310
1311 | parameter | description |
1312 | --------- | ----------- |
1313 | `<response-code>` | Expected http response code |
1314 | `<type>` | Type id, if the interface supports type in url |
1315
1316 # Description of functions in gateway_api_functions.sh #
1317
1318
1319 ## Function: use_gateway_http ##
1320 Use http for all calls to the gateway. This is set by default.
1321 | arg list |
1322 |--|
1323 | None |
1324
1325 ## Function: use_gateway_https ##
1326 Use https for all calls to the gateway.
1327 | arg list |
1328 |--|
1329 | None |
1330
1331 ## Function: set_gateway_debug ##
1332 Set debug level logging in the gateway
1333 | arg list |
1334 |--|
1335 | None |
1336
1337 ## Function: set_gateway_trace ##
1338 Set debug level logging in the trace
1339 | arg list |
1340 |--|
1341 | None |
1342
1343 ## Function: start_gateway ##
1344 Start the the gateway container in docker or kube depending on start mode
1345 | arg list |
1346 |--|
1347 | None |
1348
1349 ## Function: gateway_pms_get_status ##
1350 Sample test of pms api (status)
1351 | arg list |
1352 |--|
1353 | `<response-code> ` |
1354
1355 | parameter | description |
1356 | --------- | ----------- |
1357 | `<response-code>` | Expected http response code |
1358
1359 ## Function: gateway_ecs_get_types ##
1360 Sample test of ecs api (get ei type)
1361 Only response code tested - not payload
1362 | arg list |
1363 |--|
1364 | `<response-code> ` |
1365
1366 | parameter | description |
1367 | --------- | ----------- |
1368 | `<response-code>` | Expected http response code |
1369
1370 # Description of functions in http_proxy_api_functions.sh #
1371
1372 ## Function: start_http_proxy ##
1373 Start the http proxy container in docker or kube depending on running mode.
1374 | arg list |
1375 |--|
1376 | None |
1377
1378 # Description of functions in kube_proxy_api_functions.sh #
1379
1380 ## Function: start_kube_proxy ##
1381 Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
1382 No proxy is started if the function is called in docker mode.
1383 | arg list |
1384 |--|
1385 | None |
1386
1387 # Description of functions in mr_api_functions.sh #
1388
1389 ## Function: use_mr_http ##
1390 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.
1391 | arg list |
1392 |--|
1393 | None |
1394
1395 ## Function: use_mr_https ##
1396 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.
1397 | arg list |
1398 |--|
1399 | None |
1400
1401 ## Function: start_mr ##
1402 Start the Message Router stub interface container in docker or kube depending on start mode
1403 | arg list |
1404 |--|
1405 | None |
1406
1407
1408 ## Function: mr_equal ##
1409 Tests if a variable value in the Message Router (MR) simulator is equal to a target value.
1410 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1411 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.
1412 See the 'mrstub' dir for more details.
1413 | arg list |
1414 |--|
1415 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1416
1417 | parameter | description |
1418 | --------- | ----------- |
1419 | `<variable-name>` | Variable name in the MR  |
1420 | `<target-value>` | Target value for the variable  |
1421 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1422
1423 ## Function: mr_greater ##
1424 Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
1425 Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than the target or not.
1426 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.
1427 See the 'mrstub' dir for more details.
1428 | arg list |
1429 |--|
1430 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1431
1432 | parameter | description |
1433 | --------- | ----------- |
1434 | `<variable-name>` | Variable name in the MR  |
1435 | `<target-value>` | Target value for the variable  |
1436 | `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value  |
1437
1438 ## Function: mr_read ##
1439 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.
1440 See the 'mrstub' dir for more details.
1441 | arg list |
1442 |--|
1443 | `<variable-name>` |
1444
1445 | parameter | description |
1446 | --------- | ----------- |
1447 | `<variable-name>` | Variable name in the MR  |
1448
1449 ## Function: mr_print ##
1450 Prints the value of a variable in the Message Router (MR) simulator.
1451 See the 'mrstub' dir for more details.
1452 | arg list |
1453 |--|
1454 | `<variable-name>` |
1455
1456 | parameter | description |
1457 | --------- | ----------- |
1458 | `<variable-name>` | Variable name in the MR  |
1459
1460
1461 # Description of functions in prodstub_api_functions.sh #
1462
1463 ## Function: use_prod_stub_http ##
1464 Use http for the API.  The admin API is not affected. This is the default protocol.
1465 | arg list |
1466 |--|
1467 | None |
1468
1469 ## Function: use_prod_stub_https ##
1470 Use https for the API. The admin API is not affected.
1471 | arg list |
1472 |--|
1473 | None |
1474
1475 ## Function: start_prod_stub ##
1476 Start the Producer stub container in docker or kube depending on start mode
1477 | arg list |
1478 |--|
1479 | None |
1480
1481 ## Function: prodstub_arm_producer() ##
1482 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
1483
1484 | arg list |
1485 |--|
1486 | `<response-code> <producer-id> [<forced_response_code>]` |
1487
1488 | parameter | description |
1489 | --------- | ----------- |
1490 | `<response-code>` | Expected http response code |
1491 | `<producer-id>` | Id of the producer  |
1492 | `<forced_response_code>` | Forced response code for the producer callback url |
1493
1494 ## Function: prodstub_arm_job_create() ##
1495 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.
1496
1497 | arg list |
1498 |--|
1499 | `<response-code> <job-id> [<forced_response_code>]` |
1500
1501 | parameter | description |
1502 | --------- | ----------- |
1503 | `<response-code>` | Expected http response code |
1504 | `<job-id>` | Id of the job  |
1505 | `<forced_response_code>` | Forced response code for the create callback url |
1506
1507 ## Function: prodstub_arm_job_delete() ##
1508 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.
1509
1510 | arg list |
1511 |--|
1512 | `<response-code> <job-id> [<forced_response_code>]` |
1513
1514 | parameter | description |
1515 | --------- | ----------- |
1516 | `<response-code>` | Expected http response code |
1517 | `<job-id>` | Id of the job  |
1518 | `<forced_response_code>` | Forced response code for the delete callback url |
1519
1520 ## Function: prodstub_arm_type() ##
1521 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
1522
1523 | arg list |
1524 |--|
1525 | `<response-code> <producer-id> <type-id>` |
1526
1527 | parameter | description |
1528 | --------- | ----------- |
1529 | `<response-code>` | Expected http response code |
1530 | `<producer-id>` | Id of the producer  |
1531 | `<type-id>` | Id of the type  |
1532
1533 ## Function: prodstub_disarm_type() ##
1534 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
1535
1536 | arg list |
1537 |--|
1538 | `<response-code> <producer-id> <type-id>` |
1539
1540 | parameter | description |
1541 | --------- | ----------- |
1542 | `<response-code>` | Expected http response code |
1543 | `<producer-id>` | Id of the producer  |
1544 | `<type-id>` | Id of the type  |
1545
1546 ## Function: prodstub_check_jobdata() ##
1547 Check a job in the prodstub towards the list of provided parameters.
1548
1549 | arg list |
1550 |--|
1551 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
1552
1553 | parameter | description |
1554 | --------- | ----------- |
1555 | `<response-code>` | Expected http response code |
1556 | `<producer-id>` | Id of the producer  |
1557 | `<job-id>` | Id of the job  |
1558 | `<type-id>` | Id of the type  |
1559 | `<target-url>` | Target url for data delivery  |
1560 | `<job-owner>` | Id of the job owner  |
1561 | `<template-job-file>` | Path to a job template file  |
1562
1563 ## Function: prodstub_delete_jobdata() ##
1564 Delete the job parameters, job data, for a job.
1565
1566 | arg list |
1567 |--|
1568 | `<response-code> <producer-id> <job-id>` |
1569
1570 | parameter | description |
1571 | --------- | ----------- |
1572 | `<response-code>` | Expected http response code |
1573 | `<producer-id>` | Id of the producer  |
1574 | `<job-id>` | Id of the job  |
1575
1576
1577 ## Function: prodstub_equal ##
1578 Tests if a variable value in the prodstub is equal to a target value.
1579 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1580 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.
1581
1582 | arg list |
1583 |--|
1584 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1585
1586 | parameter | description |
1587 | --------- | ----------- |
1588 | `<variable-name>` | Variable name in the prostub  |
1589 | `<target-value>` | Target value for the variable  |
1590 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1591
1592
1593 # Description of functions in rapp_catalogue_api_function.sh #
1594
1595 ## Function: use_rapp_catalogue_http ##
1596 Use http for the API. This is the default protocol.
1597 | arg list |
1598 |--|
1599 | None |
1600
1601 ## Function: use_rapp_catalogue_https ##
1602 Use https for the API.
1603 | arg list |
1604 |--|
1605 | None |
1606
1607 ## Function: start_rapp_catalogue ##
1608 Start the rapp catalogue container in docker or kube depending on start mode
1609 | arg list |
1610 |--|
1611 | None |
1612
1613 ## Function: rc_equal ##
1614 Tests if a variable value in the RAPP Catalogue is equal to a target value.
1615 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1616 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.
1617 See the 'cr' dir for more details.
1618 | arg list |
1619 |--|
1620 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1621
1622 | parameter | description |
1623 | --------- | ----------- |
1624 | `<variable-name>` | Variable name in the RC  |
1625 | `<target-value>` | Target value for the variable  |
1626 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1627
1628 ## Function: rapp_cat_api_get_services() ##
1629 Check all registered services.
1630
1631 | arg list |
1632 |--|
1633 | `<response-code> [(<service-id> <version> <display-name> <description>)+ | EMPTY ]` |
1634
1635 | parameter | description |
1636 | --------- | ----------- |
1637 | `<response-code>` | Expected http response code |
1638 | `<service-id>` | Id of the service  |
1639 | `<version>` | Version of the service  |
1640 | `<display-name>` | Dislay name of the service  |
1641 | `<description>` | Description of the service  |
1642 | `EMPTY` | Indicator for an empty list  |
1643
1644 ## Function: rapp_cat_api_put_service() ##
1645 Register a services.
1646
1647 | arg list |
1648 |--|
1649 | `<response-code> <service-id> <version> <display-name> <description>` |
1650
1651 | parameter | description |
1652 | --------- | ----------- |
1653 | `<response-code>` | Expected http response code |
1654 | `<service-id>` | Id of the service  |
1655 | `<version>` | Version of the service  |
1656 | `<display-name>` | Dislay name of the service  |
1657 | `<description>` | Description of the service  |
1658
1659 ## Function: rapp_cat_api_get_service() ##
1660 Check a registered service.
1661
1662 | arg list |
1663 |--|
1664 | `<response-code> <service-id> <version> <display-name> <description>` |
1665
1666 | parameter | description |
1667 | --------- | ----------- |
1668 | `<response-code>` | Expected http response code |
1669 | `<service-id>` | Id of the service  |
1670 | `<version>` | Version of the service  |
1671 | `<display-name>` | Dislay name of the service  |
1672 | `<description>` | Description of the service  |
1673
1674 ## Function: rapp_cat_api_delete_service() ##
1675 Check a registered service.
1676
1677 | arg list |
1678 |--|
1679 | `<response-code> <service-id>` |
1680
1681 | parameter | description |
1682 | --------- | ----------- |
1683 | `<response-code>` | Expected http response code |
1684 | `<service-id>` | Id of the service  |
1685
1686
1687 # Description of functions in ricsimulator_api_functions.sh #
1688 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
1689
1690
1691 ## Function: use_simulator_http ##
1692 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.
1693 | arg list |
1694 |--|
1695 | None |
1696
1697 ## Function: use_simulator_https ##
1698 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.
1699 | arg list |
1700 |--|
1701 | None |
1702
1703 ## Function: start_ric_simulators ##
1704 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
1705 | arg list |
1706 |--|
1707 | `ricsim_g1|ricsim_g2|ricsim_g3 <count> <interface-id>` |
1708
1709 | parameter | description |
1710 | --------- | ----------- |
1711 | `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  |
1712 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
1713 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
1714
1715 ## Function: get_kube_sim_host ##
1716 Translate ric name to kube host name.
1717 | arg list |
1718 |--|
1719 | `<ric-name>` |
1720
1721 | parameter | description |
1722 | --------- | ----------- |
1723 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
1724
1725 ## Function: generate_policy_uuid ##
1726 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
1727 UUID is then automatically added to the policy id in GET/PUT/DELETE.
1728 | arg list |
1729 |--|
1730 | None |
1731
1732 ## Function: sim_equal ##
1733 Tests if a variable value in the RIC simulator is equal to a target value.
1734 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1735 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.
1736 See the 'a1-interface' repo for more details.
1737
1738 | arg list |
1739 |--|
1740 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1741
1742 | parameter | description |
1743 | --------- | ----------- |
1744 | `<variable-name>` | Variable name in the ric simulator  |
1745 | `<target-value>` | Target value for the variable  |
1746 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1747
1748 ## Function: sim_print ##
1749 Prints the value of a variable in the RIC simulator.
1750 See the 'a1-interface' repo for more details.
1751
1752 | arg list |
1753 |--|
1754 | `<variable-name>` |
1755
1756 | parameter | description |
1757 | --------- | ----------- |
1758 | `<variable-name>` | Variable name in the RIC simulator  |
1759
1760
1761 ## Function: sim_contains_str ##
1762 Tests if a variable value in the RIC simulator contains a target string.
1763 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
1764 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.
1765 See the 'a1-interface' repo for more details.
1766
1767 | arg list |
1768 |--|
1769 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1770
1771 | parameter | description |
1772 | --------- | ----------- |
1773 | `<variable-name>` | Variable name in the ric simulator  |
1774 | `<target-value>` | Target substring for the variable  |
1775 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1776
1777 ## Function: sim_put_policy_type ##
1778 Loads a policy type to the simulator
1779
1780 | arg list |
1781 |--|
1782 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
1783
1784 | parameter | description |
1785 | --------- | ----------- |
1786 | `<response-code>` | Expected http response code |
1787 | `<ric-id>` |  Id of the ric |
1788 | `<policy-type-id>` |  Id of the policy type |
1789 | `<policy-type-file>` |  Path to the schema file of the policy type |
1790
1791 ## Function: sim_delete_policy_type ##
1792 Deletes a policy type from the simulator
1793
1794 | arg list |
1795 |--|
1796 | `<response-code> <ric-id> <policy_type_id>` |
1797
1798 | parameter | description |
1799 | --------- | ----------- |
1800 | `<response-code>` | Expected http response code |
1801 | `<ric-id>` |  Id of the ric |
1802 | `<policy-type-id>` |  Id of the policy type |
1803
1804 ## Function: sim_post_delete_instances ##
1805 Deletes all instances (and status), for one ric
1806
1807 | arg list |
1808 |--|
1809 | `<response-code> <ric-id>` |
1810
1811 | parameter | description |
1812 | --------- | ----------- |
1813 | `<response-code>` | Expected http response code |
1814 | `<ric-id>` |  Id of the ric |
1815
1816
1817 ## Function: sim_post_delete_all ##
1818 Deletes all types, instances (and status), for one ric
1819
1820 | arg list |
1821 |--|
1822 | `<response-code> <ric-id>` |
1823
1824 | parameter | description |
1825 | --------- | ----------- |
1826 | `<response-code>` | Expected http response code |
1827 | `<ric-id>` |  Id of the ric |
1828
1829 ## Function: sim_post_forcedresponse ##
1830 Sets (or resets) response code for next (one) A1 message, for one ric.
1831 The intention is to simulate error response on the A1 interface.
1832
1833 | arg list |
1834 |--|
1835 | `<response-code> <ric-id> [<forced_response_code>]`|
1836
1837 | parameter | description |
1838 | --------- | ----------- |
1839 | `<response-code>` | Expected http response code |
1840 | `<ric-id>` |  Id of the ric |
1841 | `<forced_response_code>` |  Http response code to send |
1842
1843 ## Function: sim_post_forcedelay ##
1844 Sets (or resets) A1 response delay, for one ric
1845 The intention is to delay responses on the A1 interface. Setting remains until removed.
1846
1847 | arg list |
1848 |--|
1849 | `<response-code> <ric-id> [<delay-in-seconds>]`|
1850
1851 | parameter | description |
1852 | --------- | ----------- |
1853 | `<response-code>` | Expected http response code |
1854 | `<ric-id>` |  Id of the ric |
1855 | `<delay-in-seconds>` |  Delay in seconds. If omitted, the delay is removed |
1856
1857
1858 ## License
1859
1860 Copyright (C) 2020 Nordix Foundation. All rights reserved.
1861 Licensed under the Apache License, Version 2.0 (the "License");
1862 you may not use this file except in compliance with the License.
1863 You may obtain a copy of the License at
1864
1865      http://www.apache.org/licenses/LICENSE-2.0
1866
1867 Unless required by applicable law or agreed to in writing, software
1868 distributed under the License is distributed on an "AS IS" BASIS,
1869 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1870 See the License for the specific language governing permissions and
1871 limitations under the License.