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