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