Updated tests for changed ECS NBI
[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' or '/data-producer/v1/info-types' depending on ecs version 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 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' or '/data-producer/v1/info-producers/{infoProducerId}/status' depending on ecs version 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_producer_ids_2() ##
1213 Test of GET '/ei-producer/v1/eiproducers' or '/data-producer/v1/info-producers' depending on ecs version and optional check of the returned producer ids.
1214 To test the response code only, provide the response.
1215 To also test the response payload add the type (if any) and a list of expected producer-ids (or EMPTY if the list of ids is expected to be empty).
1216
1217 | arg list |
1218 |--|
1219 | `<response-code> [ ( NOTYPE | <type-id> ) [ EMPTY | <producer-id>+]` |
1220
1221 | parameter | description |
1222 | --------- | ----------- |
1223 | `<response-code>` | Expected http response code |
1224 | `<type-id>` | Id of the type  |
1225 | `EMPTY` | No type given  |
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_type() ##
1230 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
1231 To test the response code only, provide the response and the type-id.
1232 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).
1233
1234 | arg list |
1235 |--|
1236 | `<response-code> <type-id> [<job-schema-file> (EMPTY | [<producer-id>]+)]` |
1237
1238 | parameter | description |
1239 | --------- | ----------- |
1240 | `<response-code>` | Expected http response code |
1241 | `<type-id>` | Id of the type  |
1242 | `<job-schema-file>` | Path to a job schema file  |
1243 | `<producer-id>` | Id of the producer  |
1244 | `EMPTY` | The expected list of type ids shall be empty  |
1245
1246 ## Function: ecs_api_edp_get_type_2() ##
1247 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ecs version and optional check of the returned type.
1248 To test the response code only, provide the response and the type-id.
1249 To also test the response payload add a path to a job schema file.
1250
1251 | arg list |
1252 |--|
1253 | `<response-code> <type-id> [<job-schema-file>]` |
1254
1255 | parameter | description |
1256 | --------- | ----------- |
1257 | `<response-code>` | Expected http response code |
1258 | `<type-id>` | Id of the type  |
1259 | `<job-schema-file>` | Path to a job schema file  |
1260 | `EMPTY` | The expected list of type ids shall be empty  |
1261
1262 ## Function: ecs_api_edp_put_type_2() ##
1263 Test of PUT '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ecs version and optional check of the returned type.
1264
1265 | arg list |
1266 |--|
1267 | `<response-code> <type-id> [<job-schema-file>]` |
1268
1269 | parameter | description |
1270 | --------- | ----------- |
1271 | `<response-code>` | Expected http response code |
1272 | `<type-id>` | Id of the type  |
1273 | `<job-schema-file>` | Path to a job schema file  |
1274 | `EMPTY` | The expected list of type ids shall be empty  |
1275
1276 ## Function: ecs_api_edp_delete_type_2() ##
1277 Test of DELETE '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ecs version and optional check of the returned type.
1278
1279 | arg list |
1280 |--|
1281 | `<response-code> <type-id>` |
1282
1283 | parameter | description |
1284 | --------- | ----------- |
1285 | `<response-code>` | Expected http response code |
1286 | `<type-id>` | Id of the type  |
1287
1288 ## Function: ecs_api_edp_get_producer() ##
1289 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
1290 To test the response code only, provide the response and the producer-id.
1291 To also test the response payload add the remaining parameters defining thee producer.
1292
1293 | arg list |
1294 |--|
1295 | `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+) ]` |
1296
1297 | parameter | description |
1298 | --------- | ----------- |
1299 | `<response-code>` | Expected http response code |
1300 | `<producer-id>` | Id of the producer  |
1301 | `<create-callback>` | Callback for create job  |
1302 | `<delete-callback>` | Callback for delete job  |
1303 | `<supervision-callback>` | Callback for producer supervision  |
1304 | `<type-id>` | Id of the type  |
1305 | `<schema-file>` | Path to a schema file  |
1306 | `EMPTY` | The expected list of type schema pairs shall be empty  |
1307
1308
1309 ## Function: ecs_api_edp_get_producer_2() ##
1310 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version and optional check of the returned producer.
1311 To test the response code only, provide the response and the producer-id.
1312 To also test the response payload add the remaining parameters defining thee producer.
1313
1314 | arg list |
1315 |--|
1316 | `<response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY | <type-id>+) ]` |
1317
1318 | parameter | description |
1319 | --------- | ----------- |
1320 | `<response-code>` | Expected http response code |
1321 | `<producer-id>` | Id of the producer  |
1322 | `<job-callback>` | Callback for the url  |
1323 | `<supervision-callback>` | Callback for producer supervision  |
1324 | `<type-id>` | Id of the type  |
1325 | `EMPTY` | The expected list of types shall be empty  |
1326
1327 ## Function: ecs_api_edp_delete_producer() ##
1328 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version.
1329 To test, provide all parameters.
1330
1331 | arg list |
1332 |--|
1333 | `<response-code> <producer-id>` |
1334
1335 | parameter | description |
1336 | --------- | ----------- |
1337 | `<response-code>` | Expected http response code |
1338 | `<producer-id>` | Id of the producer  |
1339
1340 ## Function: ecs_api_edp_put_producer() ##
1341 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1342 To test, provide all parameters. The list of type/schema pair may be empty.
1343
1344 | arg list |
1345 |--|
1346 | `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+)` |
1347
1348 | parameter | description |
1349 | --------- | ----------- |
1350 | `<response-code>` | Expected http response code |
1351 | `<producer-id>` | Id of the producer  |
1352 | `<job-callback>` | Callback for create/delete job  |
1353 | `<supervision-callback>` | Callback for producer supervision  |
1354 | `<type-id>` | Id of the type  |
1355 | `<schema-file>` | Path to a schema file  |
1356 | `EMPTY` | The list of type/schema pairs is empty  |
1357
1358 ## Function: ecs_api_edp_put_producer_2() ##
1359 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ecs version.
1360 To test, provide all parameters. The list of type/schema pair may be empty.
1361
1362 | arg list |
1363 |--|
1364 | `<response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE|[<type-id>+]` |
1365
1366 | parameter | description |
1367 | --------- | ----------- |
1368 | `<response-code>` | Expected http response code |
1369 | `<producer-id>` | Id of the producer  |
1370 | `<job-callback>` | Callback for create/delete job  |
1371 | `<supervision-callback>` | Callback for producer supervision  |
1372 | `<type-id>` | Id of the type  |
1373 | `NOTYPE` | The list of types is empty  |
1374
1375 ## Function: ecs_api_edp_get_producer_jobs() ##
1376 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
1377 To test the response code only, provide the response and the producer-id.
1378 To also test the response payload add the remaining parameters.
1379
1380 | arg list |
1381 |--|
1382 | `<response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1383
1384 | parameter | description |
1385 | --------- | ----------- |
1386 | `<response-code>` | Expected http response code |
1387 | `<producer-id>` | Id of the producer  |
1388 | `<job-id>` | Id of the job  |
1389 | `<type-id>` | Id of the EI type  |
1390 | `<target-url>` | Target url for data delivery  |
1391 | `<job-owner>` | Id of the job owner  |
1392 | `<template-job-file>` | Path to a job template file  |
1393 | `EMPTY` | The list of job/type/target/job-file tuples is empty  |
1394
1395 ## Function: ecs_api_edp_get_producer_jobs_2() ##
1396 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' or '/data-producer/v1/info-producers/{infoProducerId}/info-jobs' depending on ecs version and optional check of the returned producer job.
1397 To test the response code only, provide the response and the producer-id.
1398 To also test the response payload add the remaining parameters.
1399
1400 | arg list |
1401 |--|
1402 | `<response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1403
1404 | parameter | description |
1405 | --------- | ----------- |
1406 | `<response-code>` | Expected http response code |
1407 | `<producer-id>` | Id of the producer  |
1408 | `<job-id>` | Id of the job  |
1409 | `<type-id>` | Id of the type  |
1410 | `<target-url>` | Target url for data delivery  |
1411 | `<job-owner>` | Id of the job owner  |
1412 | `<template-job-file>` | Path to a job template file  |
1413 | `EMPTY` | The list of job/type/target/job-file tuples is empty  |
1414
1415 ## Function: ecs_api_service_status() ##
1416 Test of GET '/status'.
1417
1418 | arg list |
1419 |--|
1420 | `<response-code>` |
1421
1422 | parameter | description |
1423 | --------- | ----------- |
1424 | `<response-code>` | Expected http response code |
1425
1426 ## Function: ecs_api_idc_get_type_ids() ##
1427 Test of GET '/data-consumer/v1/info-types' and an optional check of the returned list of type ids.
1428 To test the response code only, provide the response code.
1429 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1430
1431 | arg list |
1432 |--|
1433 | `<response-code> [ EMPTY | <type-id>+]` |
1434
1435 | parameter | description |
1436 | --------- | ----------- |
1437 | `<response-code>` | Expected http response code |
1438 | `<type-id>` | Id of the Info type  |
1439 | `EMPTY` | The expected list of type ids shall be empty  |
1440
1441 ## Function: ecs_api_idc_get_job_ids() ##
1442 Test of GET '/data-consumer/v1/info-jobs' and optional check of the array of returned job ids.
1443 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1444 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1445
1446 | arg list |
1447 |--|
1448 | `<response-code> <type-id>  <owner-id>|NOOWNER [ EMPTY | <job-id>+ ]` |
1449
1450 | parameter | description |
1451 | --------- | ----------- |
1452 | `<response-code>` | Expected http response code |
1453 | `<type-id>` | Id of the Info type  |
1454 | `<owner-id>` | Id of the job owner  |
1455 | `NOOWNER` | No owner is given  |
1456 | `<job-id>` | Id of the expected job  |
1457 | `EMPTY` | The expected list of job id shall be empty  |
1458
1459 ## Function: ecs_api_idc_get_job() ##
1460 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}' and optional check of the returned job.
1461 To test the response code only, provide the response code, type id and job id.
1462 To also test the response payload add the remaining parameters.
1463
1464 | arg list |
1465 |--|
1466 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1467
1468 | parameter | description |
1469 | --------- | ----------- |
1470 | `<response-code>` | Expected http response code |
1471 | `<type-id>` | Id of the Info type  |
1472 | `<job-id>` | Id of the job  |
1473 | `<target-url>` | Expected target url for the job  |
1474 | `<owner-id>` | Expected owner for the job  |
1475 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1476
1477 ## Function: ecs_api_idc_put_job() ##
1478 Test of PUT '​/data-consumer/v1/info-jobs/{infoJobId}'.
1479 To test, provide all the specified parameters.
1480
1481 | arg list |
1482 |--|
1483 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file> [VALIDATE]` |
1484
1485 | parameter | description |
1486 | --------- | ----------- |
1487 | `<response-code>` | Expected http response code |
1488 | `<type-id>` | Id of the Info type  |
1489 | `<job-id>` | Id of the job  |
1490 | `<target-url>` | Target url for the job  |
1491 | `<owner-id>` | Owner of the job  |
1492 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1493 | `VALIIDATE` | Indicator to preform type validation at creation  |
1494
1495 ## Function: ecs_api_idc_delete_job() ##
1496 Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1497 To test, provide all the specified parameters.
1498
1499 | arg list |
1500 |--|
1501 | `<response-code> <type-id> <job-id> |
1502
1503 | parameter | description |
1504 | --------- | ----------- |
1505 | `<response-code>` | Expected http response code |
1506 | `<type-id>` | Id of the type  |
1507 | `<job-id>` | Id of the job  |
1508
1509 ## Function: ecs_api_idc_get_type() ##
1510 Test of GET '/data-consumer/v1/info-types/{infoTypeId} and optional check of the returned schema.
1511 To test the response code only, provide the response code parameter as well as the type-id.
1512 To also test the response payload add a path to the expected schema file.
1513
1514 | arg list |
1515 |--|
1516 | `<response-code> <type-id> [<schema-file>]` |
1517
1518 | parameter | description |
1519 | --------- | ----------- |
1520 | `<response-code>` | Expected http response code |
1521 | `<type-id>` | Id of the Info type  |
1522 | `<schema-file>` | Path to a schema file to compare with the returned schema  |
1523
1524 ## Function: ecs_api_idc_get_job_status() ##
1525 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' and optional check of the returned status.
1526 To test the response code only, provide the response code, type id and job id.
1527 To also test the response payload add the expected status.
1528
1529 | arg list |
1530 |--|
1531 | `<response-code> <type-id> <job-id> [<status>]` |
1532
1533 | parameter | description |
1534 | --------- | ----------- |
1535 | `<response-code>` | Expected http response code |
1536 | `<type-id>` | Id of the Info type  |
1537 | `<job-id>` | Id of the job  |
1538 | `<status>` | Expected status  |
1539
1540
1541 ## Function: ecs_api_admin_reset() ##
1542 Test of GET '/status'.
1543
1544 | arg list |
1545 |--|
1546 | `<response-code> [ <type> ]` |
1547
1548 | parameter | description |
1549 | --------- | ----------- |
1550 | `<response-code>` | Expected http response code |
1551 | `<type>` | Type id, if the interface supports type in url |
1552
1553 # Description of functions in gateway_api_functions.sh #
1554
1555
1556 ## Function: use_gateway_http ##
1557 Use http for all calls to the gateway. This is set by default.
1558 | arg list |
1559 |--|
1560 | None |
1561
1562 ## Function: use_gateway_https ##
1563 Use https for all calls to the gateway.
1564 | arg list |
1565 |--|
1566 | None |
1567
1568 ## Function: set_gateway_debug ##
1569 Set debug level logging in the gateway
1570 | arg list |
1571 |--|
1572 | None |
1573
1574 ## Function: set_gateway_trace ##
1575 Set debug level logging in the trace
1576 | arg list |
1577 |--|
1578 | None |
1579
1580 ## Function: start_gateway ##
1581 Start the the gateway container in docker or kube depending on start mode
1582 | arg list |
1583 |--|
1584 | None |
1585
1586 ## Function: gateway_pms_get_status ##
1587 Sample test of pms api (status)
1588 | arg list |
1589 |--|
1590 | `<response-code> ` |
1591
1592 | parameter | description |
1593 | --------- | ----------- |
1594 | `<response-code>` | Expected http response code |
1595
1596 ## Function: gateway_ecs_get_types ##
1597 Sample test of ecs api (get types)
1598 Only response code tested - not payload
1599 | arg list |
1600 |--|
1601 | `<response-code> ` |
1602
1603 | parameter | description |
1604 | --------- | ----------- |
1605 | `<response-code>` | Expected http response code |
1606
1607 # Description of functions in http_proxy_api_functions.sh #
1608
1609 ## Function: use_http_proxy_http ##
1610 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.
1611 | arg list |
1612 |--|
1613 | None |
1614
1615 ## Function: use_http_proxy_https ##
1616 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.
1617 | arg list |
1618 |--|
1619 | None |
1620
1621 ## Function: start_http_proxy ##
1622 Start the http proxy container in docker or kube depending on running mode.
1623 | arg list |
1624 |--|
1625 | None |
1626
1627 # Description of functions in kube_proxy_api_functions.sh #
1628
1629 ## Function: use_kube_proxy_http ##
1630 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.
1631 | arg list |
1632 |--|
1633 | None |
1634
1635 ## Function: use_kube_proxy_https ##
1636 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.
1637 | arg list |
1638 |--|
1639 | None |
1640
1641 ## Function: start_kube_proxy ##
1642 Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
1643 No proxy is started if the function is called in docker mode.
1644 | arg list |
1645 |--|
1646 | None |
1647
1648 # Description of functions in mr_api_functions.sh #
1649
1650 ## Function: use_mr_http ##
1651 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.
1652 | arg list |
1653 |--|
1654 | None |
1655
1656 ## Function: use_mr_https ##
1657 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.
1658 | arg list |
1659 |--|
1660 | None |
1661
1662 ## Function: start_mr ##
1663 Start the Message Router stub interface container in docker or kube depending on start mode
1664 | arg list |
1665 |--|
1666 | None |
1667
1668
1669 ## Function: mr_equal ##
1670 Tests if a variable value in the Message Router (MR) simulator is equal to a target value.
1671 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1672 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.
1673 See the 'mrstub' dir for more details.
1674 | arg list |
1675 |--|
1676 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1677
1678 | parameter | description |
1679 | --------- | ----------- |
1680 | `<variable-name>` | Variable name in the MR  |
1681 | `<target-value>` | Target value for the variable  |
1682 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1683
1684 ## Function: mr_greater ##
1685 Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
1686 Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than the target or not.
1687 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.
1688 See the 'mrstub' dir for more details.
1689 | arg list |
1690 |--|
1691 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1692
1693 | parameter | description |
1694 | --------- | ----------- |
1695 | `<variable-name>` | Variable name in the MR  |
1696 | `<target-value>` | Target value for the variable  |
1697 | `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value  |
1698
1699 ## Function: mr_read ##
1700 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.
1701 See the 'mrstub' dir for more details.
1702 | arg list |
1703 |--|
1704 | `<variable-name>` |
1705
1706 | parameter | description |
1707 | --------- | ----------- |
1708 | `<variable-name>` | Variable name in the MR  |
1709
1710 ## Function: mr_print ##
1711 Prints the value of a variable in the Message Router (MR) simulator.
1712 See the 'mrstub' dir for more details.
1713 | arg list |
1714 |--|
1715 | `<variable-name>` |
1716
1717 | parameter | description |
1718 | --------- | ----------- |
1719 | `<variable-name>` | Variable name in the MR  |
1720
1721
1722 # Description of functions in prodstub_api_functions.sh #
1723
1724 ## Function: use_prod_stub_http ##
1725 Use http for the API.  The admin API is not affected. This is the default protocol.
1726 | arg list |
1727 |--|
1728 | None |
1729
1730 ## Function: use_prod_stub_https ##
1731 Use https for the API. The admin API is not affected.
1732 | arg list |
1733 |--|
1734 | None |
1735
1736 ## Function: start_prod_stub ##
1737 Start the Producer stub container in docker or kube depending on start mode
1738 | arg list |
1739 |--|
1740 | None |
1741
1742 ## Function: prodstub_arm_producer() ##
1743 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
1744
1745 | arg list |
1746 |--|
1747 | `<response-code> <producer-id> [<forced_response_code>]` |
1748
1749 | parameter | description |
1750 | --------- | ----------- |
1751 | `<response-code>` | Expected http response code |
1752 | `<producer-id>` | Id of the producer  |
1753 | `<forced_response_code>` | Forced response code for the producer callback url |
1754
1755 ## Function: prodstub_arm_job_create() ##
1756 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.
1757
1758 | arg list |
1759 |--|
1760 | `<response-code> <job-id> [<forced_response_code>]` |
1761
1762 | parameter | description |
1763 | --------- | ----------- |
1764 | `<response-code>` | Expected http response code |
1765 | `<job-id>` | Id of the job  |
1766 | `<forced_response_code>` | Forced response code for the create callback url |
1767
1768 ## Function: prodstub_arm_job_delete() ##
1769 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.
1770
1771 | arg list |
1772 |--|
1773 | `<response-code> <job-id> [<forced_response_code>]` |
1774
1775 | parameter | description |
1776 | --------- | ----------- |
1777 | `<response-code>` | Expected http response code |
1778 | `<job-id>` | Id of the job  |
1779 | `<forced_response_code>` | Forced response code for the delete callback url |
1780
1781 ## Function: prodstub_arm_type() ##
1782 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
1783
1784 | arg list |
1785 |--|
1786 | `<response-code> <producer-id> <type-id>` |
1787
1788 | parameter | description |
1789 | --------- | ----------- |
1790 | `<response-code>` | Expected http response code |
1791 | `<producer-id>` | Id of the producer  |
1792 | `<type-id>` | Id of the type  |
1793
1794 ## Function: prodstub_disarm_type() ##
1795 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
1796
1797 | arg list |
1798 |--|
1799 | `<response-code> <producer-id> <type-id>` |
1800
1801 | parameter | description |
1802 | --------- | ----------- |
1803 | `<response-code>` | Expected http response code |
1804 | `<producer-id>` | Id of the producer  |
1805 | `<type-id>` | Id of the type  |
1806
1807 ## Function: prodstub_check_jobdata() ##
1808 Check a job in the prodstub towards the list of provided parameters.
1809
1810 | arg list |
1811 |--|
1812 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
1813
1814 | parameter | description |
1815 | --------- | ----------- |
1816 | `<response-code>` | Expected http response code |
1817 | `<producer-id>` | Id of the producer  |
1818 | `<job-id>` | Id of the job  |
1819 | `<type-id>` | Id of the type  |
1820 | `<target-url>` | Target url for data delivery  |
1821 | `<job-owner>` | Id of the job owner  |
1822 | `<template-job-file>` | Path to a job template file  |
1823
1824 ## Function: prodstub_check_jobdata_2() ##
1825 Check a job in the prodstub towards the list of provided parameters.
1826
1827 | arg list |
1828 |--|
1829 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
1830
1831 | parameter | description |
1832 | --------- | ----------- |
1833 | `<response-code>` | Expected http response code |
1834 | `<producer-id>` | Id of the producer  |
1835 | `<job-id>` | Id of the job  |
1836 | `<type-id>` | Id of the type  |
1837 | `<target-url>` | Target url for data delivery  |
1838 | `<job-owner>` | Id of the job owner  |
1839 | `<template-job-file>` | Path to a job template file  |
1840
1841 ## Function: prodstub_check_jobdata_3() ##
1842 Check a job in the prodstub towards the list of provided parameters.
1843
1844 | arg list |
1845 |--|
1846 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
1847
1848 | parameter | description |
1849 | --------- | ----------- |
1850 | `<response-code>` | Expected http response code |
1851 | `<producer-id>` | Id of the producer  |
1852 | `<job-id>` | Id of the job  |
1853 | `<type-id>` | Id of the type  |
1854 | `<target-url>` | Target url for data delivery  |
1855 | `<job-owner>` | Id of the job owner  |
1856 | `<template-job-file>` | Path to a job template file  |
1857
1858 ## Function: prodstub_delete_jobdata() ##
1859 Delete the job parameters, job data, for a job.
1860
1861 | arg list |
1862 |--|
1863 | `<response-code> <producer-id> <job-id>` |
1864
1865 | parameter | description |
1866 | --------- | ----------- |
1867 | `<response-code>` | Expected http response code |
1868 | `<producer-id>` | Id of the producer  |
1869 | `<job-id>` | Id of the job  |
1870
1871
1872 ## Function: prodstub_equal ##
1873 Tests if a variable value in the prodstub is equal to a target value.
1874 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1875 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.
1876
1877 | arg list |
1878 |--|
1879 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1880
1881 | parameter | description |
1882 | --------- | ----------- |
1883 | `<variable-name>` | Variable name in the prostub  |
1884 | `<target-value>` | Target value for the variable  |
1885 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1886
1887
1888 # Description of functions in rapp_catalogue_api_function.sh #
1889
1890 ## Function: use_rapp_catalogue_http ##
1891 Use http for the API. This is the default protocol.
1892 | arg list |
1893 |--|
1894 | None |
1895
1896 ## Function: use_rapp_catalogue_https ##
1897 Use https for the API.
1898 | arg list |
1899 |--|
1900 | None |
1901
1902 ## Function: start_rapp_catalogue ##
1903 Start the rapp catalogue container in docker or kube depending on start mode
1904 | arg list |
1905 |--|
1906 | None |
1907
1908 ## Function: rc_equal ##
1909 Tests if a variable value in the RAPP Catalogue is equal to a target value.
1910 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1911 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.
1912 See the 'cr' dir for more details.
1913 | arg list |
1914 |--|
1915 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1916
1917 | parameter | description |
1918 | --------- | ----------- |
1919 | `<variable-name>` | Variable name in the RC  |
1920 | `<target-value>` | Target value for the variable  |
1921 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1922
1923 ## Function: rapp_cat_api_get_services() ##
1924 Check all registered services.
1925
1926 | arg list |
1927 |--|
1928 | `<response-code> [(<service-id> <version> <display-name> <description>)+ | EMPTY ]` |
1929
1930 | parameter | description |
1931 | --------- | ----------- |
1932 | `<response-code>` | Expected http response code |
1933 | `<service-id>` | Id of the service  |
1934 | `<version>` | Version of the service  |
1935 | `<display-name>` | Dislay name of the service  |
1936 | `<description>` | Description of the service  |
1937 | `EMPTY` | Indicator for an empty list  |
1938
1939 ## Function: rapp_cat_api_put_service() ##
1940 Register a services.
1941
1942 | arg list |
1943 |--|
1944 | `<response-code> <service-id> <version> <display-name> <description>` |
1945
1946 | parameter | description |
1947 | --------- | ----------- |
1948 | `<response-code>` | Expected http response code |
1949 | `<service-id>` | Id of the service  |
1950 | `<version>` | Version of the service  |
1951 | `<display-name>` | Dislay name of the service  |
1952 | `<description>` | Description of the service  |
1953
1954 ## Function: rapp_cat_api_get_service() ##
1955 Check a registered service.
1956
1957 | arg list |
1958 |--|
1959 | `<response-code> <service-id> <version> <display-name> <description>` |
1960
1961 | parameter | description |
1962 | --------- | ----------- |
1963 | `<response-code>` | Expected http response code |
1964 | `<service-id>` | Id of the service  |
1965 | `<version>` | Version of the service  |
1966 | `<display-name>` | Dislay name of the service  |
1967 | `<description>` | Description of the service  |
1968
1969 ## Function: rapp_cat_api_delete_service() ##
1970 Check a registered service.
1971
1972 | arg list |
1973 |--|
1974 | `<response-code> <service-id>` |
1975
1976 | parameter | description |
1977 | --------- | ----------- |
1978 | `<response-code>` | Expected http response code |
1979 | `<service-id>` | Id of the service  |
1980
1981
1982 # Description of functions in ricsimulator_api_functions.sh #
1983 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
1984
1985
1986 ## Function: use_simulator_http ##
1987 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.
1988 | arg list |
1989 |--|
1990 | None |
1991
1992 ## Function: use_simulator_https ##
1993 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.
1994 | arg list |
1995 |--|
1996 | None |
1997
1998 ## Function: start_ric_simulators ##
1999 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
2000 | arg list |
2001 |--|
2002 | `ricsim_g1|ricsim_g2|ricsim_g3 <count> <interface-id>` |
2003
2004 | parameter | description |
2005 | --------- | ----------- |
2006 | `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  |
2007 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
2008 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
2009
2010 ## Function: get_kube_sim_host ##
2011 Translate ric name to kube host name.
2012 | arg list |
2013 |--|
2014 | `<ric-name>` |
2015
2016 | parameter | description |
2017 | --------- | ----------- |
2018 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
2019
2020 ## Function: generate_policy_uuid ##
2021 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
2022 UUID is then automatically added to the policy id in GET/PUT/DELETE.
2023 | arg list |
2024 |--|
2025 | None |
2026
2027 ## Function: sim_equal ##
2028 Tests if a variable value in the RIC simulator is equal to a target value.
2029 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2030 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.
2031 See the 'a1-interface' repo for more details.
2032
2033 | arg list |
2034 |--|
2035 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2036
2037 | parameter | description |
2038 | --------- | ----------- |
2039 | `<variable-name>` | Variable name in the ric simulator  |
2040 | `<target-value>` | Target value for the variable  |
2041 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
2042
2043 ## Function: sim_print ##
2044 Prints the value of a variable in the RIC simulator.
2045 See the 'a1-interface' repo for more details.
2046
2047 | arg list |
2048 |--|
2049 | `<variable-name>` |
2050
2051 | parameter | description |
2052 | --------- | ----------- |
2053 | `<variable-name>` | Variable name in the RIC simulator  |
2054
2055
2056 ## Function: sim_contains_str ##
2057 Tests if a variable value in the RIC simulator contains a target string.
2058 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
2059 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.
2060 See the 'a1-interface' repo for more details.
2061
2062 | arg list |
2063 |--|
2064 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2065
2066 | parameter | description |
2067 | --------- | ----------- |
2068 | `<variable-name>` | Variable name in the ric simulator  |
2069 | `<target-value>` | Target substring for the variable  |
2070 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
2071
2072 ## Function: sim_put_policy_type ##
2073 Loads a policy type to the simulator
2074
2075 | arg list |
2076 |--|
2077 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
2078
2079 | parameter | description |
2080 | --------- | ----------- |
2081 | `<response-code>` | Expected http response code |
2082 | `<ric-id>` |  Id of the ric |
2083 | `<policy-type-id>` |  Id of the policy type |
2084 | `<policy-type-file>` |  Path to the schema file of the policy type |
2085
2086 ## Function: sim_delete_policy_type ##
2087 Deletes a policy type from the simulator
2088
2089 | arg list |
2090 |--|
2091 | `<response-code> <ric-id> <policy_type_id>` |
2092
2093 | parameter | description |
2094 | --------- | ----------- |
2095 | `<response-code>` | Expected http response code |
2096 | `<ric-id>` |  Id of the ric |
2097 | `<policy-type-id>` |  Id of the policy type |
2098
2099 ## Function: sim_post_delete_instances ##
2100 Deletes all instances (and status), for one ric
2101
2102 | arg list |
2103 |--|
2104 | `<response-code> <ric-id>` |
2105
2106 | parameter | description |
2107 | --------- | ----------- |
2108 | `<response-code>` | Expected http response code |
2109 | `<ric-id>` |  Id of the ric |
2110
2111
2112 ## Function: sim_post_delete_all ##
2113 Deletes all types, instances (and status), for one ric
2114
2115 | arg list |
2116 |--|
2117 | `<response-code> <ric-id>` |
2118
2119 | parameter | description |
2120 | --------- | ----------- |
2121 | `<response-code>` | Expected http response code |
2122 | `<ric-id>` |  Id of the ric |
2123
2124 ## Function: sim_post_forcedresponse ##
2125 Sets (or resets) response code for next (one) A1 message, for one ric.
2126 The intention is to simulate error response on the A1 interface.
2127
2128 | arg list |
2129 |--|
2130 | `<response-code> <ric-id> [<forced_response_code>]`|
2131
2132 | parameter | description |
2133 | --------- | ----------- |
2134 | `<response-code>` | Expected http response code |
2135 | `<ric-id>` |  Id of the ric |
2136 | `<forced_response_code>` |  Http response code to send |
2137
2138 ## Function: sim_post_forcedelay ##
2139 Sets (or resets) A1 response delay, for one ric
2140 The intention is to delay responses on the A1 interface. Setting remains until removed.
2141
2142 | arg list |
2143 |--|
2144 | `<response-code> <ric-id> [<delay-in-seconds>]`|
2145
2146 | parameter | description |
2147 | --------- | ----------- |
2148 | `<response-code>` | Expected http response code |
2149 | `<ric-id>` |  Id of the ric |
2150 | `<delay-in-seconds>` |  Delay in seconds. If omitted, the delay is removed |
2151
2152
2153 ## License
2154
2155 Copyright (C) 2020 Nordix Foundation. All rights reserved.
2156 Licensed under the Apache License, Version 2.0 (the "License");
2157 you may not use this file except in compliance with the License.
2158 You may obtain a copy of the License at
2159
2160      http://www.apache.org/licenses/LICENSE-2.0
2161
2162 Unless required by applicable law or agreed to in writing, software
2163 distributed under the License is distributed on an "AS IS" BASIS,
2164 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2165 See the License for the specific language governing permissions and
2166 limitations under the License.