c61debb728fcce991ba48ecdf33a61f0e511c36c
[nonrtric.git] / test / common / README.md
1 # Introduction #
2
3 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 Managerment Service, Information Coordinator Service , A1 simulator as well as other components and simulators. The test environment supports both test with docker and kubernetes.
4 Some of the scripts can also be used for other kinds of tests, for example basic tests.
5
6 ## Overview for common test scripts and files ##
7
8 `api_curl.sh` \
9 A common curl based function for the a1pms and ics apis. Also partly used for the Callback receiver and RAPP Catalogue apis.
10
11 `cbs_api_function.sh` \
12 All functions are implemented in `consul_api_function.sh`.
13
14 `chartmus_api_functions.sh` \
15 Contains functions for managing a Chartmuseum instance.
16
17 `clean-docker.sh` \
18 Cleans all containers started by the test environment in docker.
19
20 `clean-kube.sh` \
21 Cleans all services, deployments, pods, replica set etc started by the test environment in kubernetes.
22
23 `compare_json.py` \
24 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'.
25
26 `consul_api_function.sh` \
27 Contains functions for managing Consul and CBS.
28
29 `count_json_elements.py` \
30 A python script calculate the length of json array or size of a json dictionary'.
31
32 `count_json_elements.py` \
33 A python script returning the number of items in a json array.
34
35 `cp_api_function.sh` \
36 Contains functions for managing the Control Panel.
37
38 `cr_api_functions.sh` \
39 Contains functions for adapting towards the Callback receiver for checking received callback events.
40
41 `create_policies_process.py` \
42 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.
43
44 `create_rics_json.py` \
45 A python script to create a json file from a formatted string of ric info. Helper for the test enviroment.
46
47 `delete_policies_process.py` \
48 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.
49
50 `dmaapadp_api_function.sh`
51 Contains funnctions for managing the Dmaap Adapter.
52
53 `dmaapmed_api_function.sh`
54 Contains funnctions for managing the Dmaap Mediator Service.
55
56 `dmaapmr_api_function.sh`
57 All functions are implemented in `mr_api_functions.sh`.
58
59 `do_curl_function.sh`
60 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)
61
62 `extract_sdnc_reply.py` \
63 A python script to extract the information from an sdnc (A1 Controller) reply json. Helper for the test environment.
64
65 `genstat.sh` \
66 This script collects container statistics to a file. Works both in docker and kubernetes (only for docker runtime).
67
68 `helmmanager_api_functions.sh` \
69 Contains functions for managing and testing of the Helm Manager.
70
71 `http_proxy_api_functions.sh` \
72 Contains functions for managing the Http Proxy.
73
74 `ics_api_functions.sh` \
75 Contains functions for adapting towards the Information Coordinator Service API.
76
77 `kafkapc_api_functions.sh` \
78 Contains functions for managing the kafka producer/consumer. Kafka is started by the dmaap message router component.
79
80 `kube_proxy_api_functions.sh` \
81 Contains functions for managing the Kube Proxy - to gain access to all services pod inside a kube cluster or all containers in a private docker network.
82
83 `localhelm_api_functions.sh` \
84 Contains functions for helm access on localhost.
85
86 `mr_api_functions.sh` \
87 Contains functions for managing the MR Stub and the Dmaap Message Router
88
89 `ngw_api_functions.sh` \
90 Contains functions for managing the Non-RT RIC Gateway
91
92 `a1pms_api_functions.sh` \
93 Contains functions for adapting towards the Policy Management Service (A1PMS) API, also via dmaap (using a message-router stub interface)
94
95 `prodstub_api_functions.sh` \
96 Contains functions for adapting towards the Producer stub interface - simulates a producer.
97
98 `pvccleaner_api_functions.sh` \
99 Contains functions for managing the PVC Cleaner (used for reset mounted volumes in kubernetes).
100
101 `rc_api_functions.sh` \
102 Contains functions for adapting towards the RAPP Catalogue.
103
104 `ricsim_api_functions.sh` \
105 Contains functions for adapting towards the RIC (A1) simulator admin API.
106
107 `sdnc_api_functions.sh` \
108 Contains functions for adaping towards the SDNC (used as an A1 controller).
109
110 `test_env*.sh` \
111 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.
112 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'.
113
114 `testcase_common.sh` \
115 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.
116 The included functions are described in detail further below.
117
118 `testengine_config.sh` \
119 Configuration file to setup the applications (components and simulators) the test enviroment handles.
120
121 `testsuite_common.sh` \
122 Common functions for running two or more auto test scripts as a suite.
123
124 ## Integration of a new applicaton ##
125
126 Integration a new application to the test environment involves the following steps.
127
128 * Choose a short name for the application. Should be a uppcase name. For example, the NonRTRIC Gateway has NGW as short name.
129 This short name shall be added to the testengine_config.sh. See that file for detailed instructions.
130
131 * Create a file in this directory using the pattern `<application-name>_api_functions.sh`.
132 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.
133
134 | Function |
135 |--|
136 | __<app-short_name>_imagesetup |
137 | __<app-short_name>_imagepull |
138 | __<app-short_name>_imagebuild |
139 | __<app-short_name>_image_data |
140 | __<app-short_name>_kube_scale_zero |
141 | __<app-short_name>_kube_scale_zero_and_wait |
142 | __<app-short_name>_kube_delete_all |
143 | __<app-short_name>_store_docker_logs |
144 | __<app-short_name>_initial_setup |
145 | __<app-short_name>_statisics_setup |
146 | __<app-short_name>_test_requirements |
147
148 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.
149
150 * 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.
151
152 * 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.
153
154 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.
155
156 | Label for docker compose | Description |
157 |--|--|
158 | nrttest_app | shall contain the application short name |
159 | nrttest_dp  | shall be set by a variable containing the display name, a short textual description of the applicaion |
160
161 | Label for kubernetes resource | Description |
162 |--|--|
163 | autotest | shall contain the application short name |
164
165 * 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>`.
166 In addition, all other needed environment shall also be defined in these file.
167
168 # Description of functions in testcase_common.sh #
169
170 ## Script args ##
171
172 The script can be started with these arguments
173
174 | arg list |
175 |--|
176 | `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>+] [--use-external-image <app-nam>+] [--image-repo <repo-address>] [--repo-policy local\|remote] [--cluster-timeout <timeout-in-seconds>]  [--print-stats]` |
177
178 | parameter | description |
179 |-|-|
180 | `remote` | Use images from remote repositories. Can be overridden for individual images using the '--use_xxx' flags |
181 | `remote-remove` | Same as 'remote' but will also try to pull fresh images from remote repositories |
182 | `docker` | Use docker environment for test |
183 | `kuber` | Use kubernetes environment for test. Requires a kubernetes minikube installation |
184 | `--env-file` | The script will use the supplied file to read environment variables from |
185 | `release` | If this flag is given the script will use release version of the images |
186 | `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 |
187 | `--stop-at-error` | The script will stop when the first failed test or configuration |
188 | `--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). |
189 | `--use-local-image` | The script will use local images for the supplied apps, space separated list of app short names |
190 | `--use-snapshot-image` | The script will use images from the nexus snapshot repo for the supplied apps, space separated list of app short names |
191 | `--use-staging-image` | The script will use images from the nexus staging repo for the supplied apps, space separated list of app short names |
192 | `--use-release-image` | The script will use images from the nexus release repo for the supplied apps, space separated list of app short names |
193 | `--use-external-image` | The script will use images from an external repo for the supplied apps, space separated list of app short names |
194 | `--image-repo` |  Url to optional image repo. Only locally built images will be re-tagged and pushed to this repo |
195 | `-repo-policy` |  Policy controlling which images to re-tag and push to image repo in param --image-repo. Can be set to 'local' (push only locally built images) or 'remote' (push locally built images and images from nexus repo). Default is 'local' |
196 | `--cluster-timeout` |  Optional timeout for cluster where it takes time to obtain external ip/host-name. Timeout in seconds |
197 | `--print-stats` |  Prints the number of tests, failed tests, failed configuration and deviations after each individual test or config |
198 | `--override <file>` |  Override setting from the file supplied by --env-file |
199 | `--pre-clean` |  Clean kube resouces when running docker and vice versa |
200 | `--gen-stats`  | Collect container/pod runtime statistics |
201 | `--delete-namespaces`  | Delete kubernetes namespaces before starting tests - but only those created by the test scripts. Kube mode only. Ignored if running with prestarted apps. |
202 | `--delete-containers`  | Delete docker containers before starting tests - but only those created by the test scripts. Docker mode only. |
203 | `--endpoint-stats`  | Collect http endpoint statistics |
204 | `help` | Print this info along with the test script description and the list of app short names supported |
205
206 ## Function: setup_testenvironment ##
207
208 Main function to setup the test environment before any tests are started.
209 Must be called right after sourcing all component scripts.
210 | arg list |
211 |--|
212 | None |
213
214 ## Function: print_result ##
215
216 Print a test report of an auto-test script.
217 | arg list |
218 |--|
219 | None |
220
221 ## Function: start_timer ##
222
223 Start a timer for time measurement. Only one timer can be running.
224 | arg list |
225 |--|
226 | `<timer-message-to-print>` |
227 | None - but any args will be printed (It is good practice to use same args for this function as for the `print_timer`) |
228
229 ## Function: print_timer ##
230
231 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 arg to 'start_timer' will also be printed in the test report.
232 | arg list |
233 |--|
234 | None |
235
236 ## Function: deviation ##
237
238 Mark a test as a deviation from the requirements. The list of deviations will be printed in the test report.
239 | arg list |
240 |--|
241 | `<deviation-message-to-print>` |
242
243 | parameter | description |
244 | --------- | ----------- |
245 | `<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 |
246
247 ## Function: clean_environment ##
248
249 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).
250 | arg list |
251 |--|
252 | None |
253
254 ## Function: auto_clean_containers ##
255
256 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.
257 | arg list |
258 |--|
259 | None |
260
261 ## Function: sleep_wait ##
262
263 Make the script sleep for a number of seconds.
264 | arg list |
265 |--|
266 | `<sleep-time-in-sec> [<any-text-in-quotes-to-be-printed>]` |
267
268 | parameter | description |
269 | --------- | ----------- |
270 | `<sleep-time-in-sec>` | Number of seconds to sleep |
271 | `<any-text-in-quotes-to-be-printed>` | Optional. The text will be printed, if present |
272
273 ## Function: store_logs ##
274
275 Take a snap-shot of all logs for all running containers/pods 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.
276 | arg list |
277 |--|
278 | `<logfile-prefix>` |
279
280 | parameter | description |
281 | --------- | ----------- |
282 | `<logfile-prefix>` | Log file prefix  |
283
284 # Description of functions in testsuite_common.sh #
285
286 ## Function: suite_setup ##
287
288 Sets up the test suite and prints out a heading.
289 | arg list |
290 |--|
291 | None |
292
293 ## suite_complete ##
294
295 Print out the overall result of the executed test cases.
296 | arg list |
297 |--|
298 | None |
299
300 # Description of functions in chartmus_api_function.sh #
301
302 ## Function: start_chart_museum ##
303
304 Start the Chart Museum
305 | arg list |
306 |--|
307 | None |
308
309 ## Function: chartmus_upload_test_chart ##
310
311 Upload a package chart to chartmusem
312 | arg list |
313 |--|
314 | `<chart-name>` |
315
316 | parameter | description |
317 | --------- | ----------- |
318 | `<chart-name>` | Name of the chart to upload |
319
320 ## Function: chartmus_delete_test_chart ##
321
322 Delete a chart in chartmusem
323 | arg list |
324 |--|
325 | `<chart-name> [<version>]` |
326
327 | parameter | description |
328 | --------- | ----------- |
329 | `<chart-name>` | Name of the chart to delete |
330 | `<version>` | Chart version, default is 0.1.0 |
331
332
333 # Description of functions in consul_api_function.sh #
334
335 ## Function: consul_config_app ##
336
337 Function to load a json config from a file into consul for the A1PMS
338
339 | arg list |
340 |--|
341 | `<json-config-file>` |
342
343 | parameter | description |
344 | --------- | ----------- |
345 | `<json-config-file>` | The path to the json file to be loaded to Consul/CBS |
346
347 ## Function: start_consul_cbs ##
348
349 Start the Consul and CBS containers
350 | arg list |
351 |--|
352 | None |
353
354 # Description of functions in cp_api_function.sh #
355
356 ## Function: use_control_panel_http ##
357
358 Set http as the protocol to use for all communication to the Control Panel
359 | arg list |
360 |--|
361 | None |
362
363 ## Function: use_control_panel_https ##
364
365 Set https as the protocol to use for all communication to the Control Panel
366 | arg list |
367 |--|
368 | None |
369
370 ## Function: start_control_panel ##
371
372 Start the Control Panel container
373 | arg list |
374 |--|
375 | None |
376
377 # Description of functions in cr_api_functions.sh #
378
379 ## Function: use_cr_http ##
380
381 Use http for getting event from CR.  The admin API is not affected. This is the default.
382 | arg list |
383 |--|
384 | None |
385
386 ## Function: use_cr_https ##
387
388 Use https for getting event from CR. The admin API is not affected.
389 Note: Not yet used as callback event is not fully implemented/deciced.
390 | arg list |
391 |--|
392 | None |
393
394 ## Function: start_cr ##
395
396 Start the Callback Receiver container in docker or kube depending on start mode.
397 | arg list |
398 |--|
399 | None |
400
401 ## Function: cr_equal ##
402
403 Tests if a variable value in the Callback Receiver (CR) simulator is equal to a target value.
404 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
405 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.
406 See the 'cr' dir for more details.
407 | arg list |
408 |--|
409 | `<cr-path-id> <variable-name> <target-value> [ <timeout-in-sec> ]` |
410
411 | parameter | description |
412 | --------- | ----------- |
413 | `<cr-path-id>` |  Variable index to CR |
414 | `<variable-name>` | Variable name in the CR  |
415 | `<target-value>` | Target value for the variable  |
416 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
417
418 ## Function: cr_greater_or_equal ##
419 Tests if a variable value in the Callback Receiver (CR) simulator is equal to or greater than a target value.
420 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to or greater than the target or not.
421 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.
422 See the 'cr' dir for more details.
423 | arg list |
424 |--|
425 | `<cr-path-id>  <variable-name> <target-value> [ <timeout-in-sec> ]` |
426
427 | parameter | description |
428 | --------- | ----------- |
429 | `<cr-path-id>` |  Variable index to CR |
430 | `<variable-name>` | Variable name in the CR  |
431 | `<target-value>` | Target value for the variable  |
432 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
433
434 ## Function: cr_contains_str ##
435
436 Tests if a variable value in the CR contains a target string.
437 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
438 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.
439 See the 'a1-interface' repo for more details.
440
441 | arg list |
442 |--|
443 | `<cr-path-id>  <variable-name> <target-value> [ <timeout-in-sec> ]` |
444
445
446 | parameter | description |
447 | --------- | ----------- |
448 | `<cr-path-id>` |  Variable index to CR |
449 | `<variable-name>` | Variable name in the CR  |
450 | `<target-value>` | Target substring for the variable  |
451 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
452
453 ## Function: cr_read ##
454
455 Reads the value of a variable in the CR simulator. The value is intended to be passed to a env variable in the test script.
456 See the 'mrstub' dir for more details.
457 | arg list |
458 |--|
459 | `<cr-path-id> <variable-name>` |
460
461 | parameter | description |
462 | --------- | ----------- |
463 | `<cr-path-id>` |  Variable index to CR |
464 | `<variable-name>` | Variable name in the CR  |
465
466 ## Function: cr_delay_callback ##
467
468 Function to configure write delay on callbacks. Delay given in seconds. Setting remains until removed.
469
470 | arg list |
471 |--|
472 | `<response-code> <cr-path-id> [<delay-in-seconds>]`|
473
474 | parameter | description |
475 | --------- | ----------- |
476 | `<response-code>` | Expected http response code |
477 | `<cr-path-id>` |  Variable index to CR |
478 | `<delay-in-seconds>` |  Delay in seconds. If omitted, the delay is removed |
479
480 ## Function: cr_api_check_all_sync_events ##
481
482 Check the contents of all ric events received for a callback id.
483
484 | arg list |
485 |--|
486 | `<response-code> <cr-path-id>  <id> [ EMPTY \| ( <ric-id> )+ ]` |
487
488 | parameter | description |
489 | --------- | ----------- |
490 | `<response-code>` | Expected http response code |
491 | `<cr-path-id>` | Variable index for CR  |
492 | `<id>` | Id of the callback destination  |
493 | `EMPTY` | Indicator for an empty list  |
494 | `<ric-id>` | Id of the ric  |
495
496 ## Function: cr_api_check_all_ics_events ##
497
498 Check the contents of all current status events for one id from ICS
499
500 | arg list |
501 |--|
502 | `<response-code> <cr-path-id> <id> [ EMPTY \| ( <status> )+ ]` |
503
504 | parameter | description |
505 | --------- | ----------- |
506 | `<response-code>` | Expected http response code |
507 | `<cr-path-id>` | Variable index for CR  |
508 | `<id>` | Id of the callback destination  |
509 | `EMPTY` | Indicator for an empty list  |
510 | `<status>` | Status string  |
511
512 ## Function: cr_api_check_all_ics_subscription_events ##
513
514 Check the contents of all current subscription events for one id from ICS
515
516 | arg list |
517 |--|
518 | `<response-code> <cr-path-id>  <id> [ EMPTY | ( <type-id> <schema> <registration-status> )+ ]` |
519
520 | parameter | description |
521 | --------- | ----------- |
522 | `<response-code>` | Expected http response code |
523 | `<cr-path-id>` | Variable index for CR  |
524 | `<id>` | Id of the callback destination  |
525 | `EMPTY` | Indicator for an empty list  |
526 | `<type-id>` | Id of the data type  |
527 | `<schema>` | Path to typeschema file  |
528 | `<registration-status>` | Status string  |
529
530 ## Function: cr_api_reset ##
531
532 Reset the callback receiver
533
534 | arg list |
535 |--|
536 | `<cr-path-id>` |
537
538 | parameter | description |
539 | --------- | ----------- |
540 | `<cr-path-id>` | Variable index for CR  |
541
542 ## Function: cr_api_check_all_genric_json_events ##
543
544 Check the contents of all json events for path
545
546 | arg list |
547 |--|
548 | `<response-code> <cr-path-id>  <topic-url> (EMPTY | <json-msg>+ )` |
549
550 | parameter | description |
551 | --------- | ----------- |
552 | `<response-code>` | Expected http response code |
553 | `<cr-path-id>` | Variable index for CR  |
554 | `<topic-url>` | Topic url  |
555 | `EMPTY` | Indicator for an empty list  |
556 | `json-msg` | Json msg string to compare with  |
557
558 ## Function: cr_api_check_single_genric_json_event ##
559
560 Check a single (oldest) json event (or none if empty) for path
561
562 | arg list |
563 |--|
564 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <json-msg> )` |
565
566 | parameter | description |
567 | --------- | ----------- |
568 | `<response-code>` | Expected http response code |
569 | `<cr-path-id>` | Variable index for CR  |
570 | `<topic-url>` | Topic url  |
571 | `EMPTY` | Indicator for no msg  |
572 | `json-msg` | Json msg string to compare with  |
573
574 ## Function: cr_api_check_single_genric_event_md5 ##
575
576 Check a single (oldest) json in md5 format (or none if empty) for path.
577 Note that if a json message is given, it shall be compact, no ws except inside string.
578 The MD5 will generate different hash if whitespace is present or not in otherwise equivalent json.
579
580 | arg list |
581 |--|
582 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <data-msg> )` |
583
584 | parameter | description |
585 | --------- | ----------- |
586 | `<response-code>` | Expected http response code |
587 | `<cr-path-id>` | Variable index for CR  |
588 | `<topic-url>` | Topic url  |
589 | `EMPTY` | Indicator for no msg  |
590 | `data-msg` | msg string to compare with  |
591
592 ## Function: cr_api_check_single_genric_event_md5_file ##
593
594 Check a single (oldest) event in md5 format (or none if empty) for path.
595 Note that if a file with json message is given, the json shall be compact, no ws except inside string and not newlines.
596 The MD5 will generate different hash if ws/newlines is present or not in otherwise equivalent json
597
598 | arg list |
599 |--|
600 | `<response-code> <cr-path-id> <topic-url> (EMPTY | <data-file> )` |
601
602 | parameter | description |
603 | --------- | ----------- |
604 | `<response-code>` | Expected http response code |
605 | `<cr-path-id>` | Variable index for CR  |
606 | `<topic-url>` | Topic url  |
607 | `EMPTY` | Indicator for no msg  |
608 | `data-file` | path to file to compare with  |
609
610 # Description of functions in dmaapadp_api_functions.sh #
611
612 ## Function: use_dmaapadp_http ##
613
614 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.
615
616 | arg list |
617 |--|
618 | None |
619
620 ## Function: use_dmaapadp_https ##
621
622 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.
623
624 | arg list |
625 |--|
626 | None |
627
628 ## Function: start_dmaapadp ##
629
630 Start the dmaap adator service container in docker or kube depending on running mode.
631
632 | arg list |
633 |--|
634 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
635
636 | parameter | description |
637 | --------- | ----------- |
638 | `PROXY` | Configure with http proxy, if proxy is started  |
639 | `NOPROXY` | Configure without http proxy  |
640 | `<config-file>`| Path to application.yaml  |
641 | `<data-file>` | Optional path to application_configuration.json  |
642
643 ## Function: set_dmaapadp_trace ##
644
645 Configure the dmaap adaptor service log on trace level. The app must be running.
646 | arg list |
647 |--|
648 | None |
649
650 # Description of functions in dmaapmed_api_functions.sh #
651
652 ## Function: use_dmaapmed_http ##
653
654 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.
655
656 | arg list |
657 |--|
658 | None |
659
660 ## Function: use_dmaapmed_https ##
661
662 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.
663
664 | arg list |
665 |--|
666 | None |
667
668 ## Function: start_dmaapmed ##
669
670 Start the dmaap mediator service container in docker or kube depending on running mode.
671
672 | arg list |
673 |--|
674 | None |
675
676 # Description of functions in httpproxy_api_functions.sh #
677
678 ## Function: use_http_proxy_http ##
679
680 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.
681 | arg list |
682 |--|
683 | None |
684
685 ## Function: use_http_proxy_https ##
686
687 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.
688 | arg list |
689 |--|
690 | None |
691
692 ## Function: start_http_proxy ##
693
694 Start the http proxy container in docker or kube depending on running mode.
695 | arg list |
696 |--|
697 | None |
698
699 # Description of functions in helmmanager_api_functions.sh #
700
701 ## Function: use_helm_manager_http ##
702
703 Use http for all API calls to the Helm Manager. This is the default protocol.
704 | arg list |
705 |--|
706 | None |
707
708 ## Function: use_helm_manager_https ##
709
710 Use https for all API calls to the Helm Manager.
711 | arg list |
712 |--|
713 | None |
714
715 ## Function: start_helm_manager ##
716
717 Start the Helm Manager container in docker or kube depending on running mode.
718 | arg list |
719 |--|
720 | None |
721
722 ## Function: helm_manager_api_get_charts ##
723
724 Get all charts and compare the expected contents.
725 | arg list |
726 |--|
727 | `<response-code> [ EMPTY | ( <chart> <version> <namespace> <release> <repo> )+ ]` |
728
729 | parameter | description |
730 | --------- | ----------- |
731 | `<response-code>` | Expected response code |
732 | `EMPTY` | Indicator for empty list  |
733 | `<chart>`| Name of the chart  |
734 | `<version>`| Version of the chart  |
735 | `<namespace>`| Namespace to of the chart  |
736 | `<release>`| Release name of the chart  |
737 | `<repo>`| Repository of the chart  |
738
739 ## Function: helm_manager_api_post_repo ##
740
741 Add repo to the helm manager.
742 | arg list |
743 |--|
744 | `<response-code> <repo-name> <repo-protocol> <repo-address> <repo-port>` |
745
746 | parameter | description |
747 | --------- | ----------- |
748 | `<response-code>` | Expected response code |
749 | `<repo-name>` | Name of the repo  |
750 | `<repo-protocol>`| Protocol http or https  |
751 | `<repo-address>`| Host name of the repo |
752 | `<repo-port>`| Host port of the repo  |
753
754 ## Function: helm_manager_api_post_onboard_chart ##
755
756 Onboard a chart to the helm manager.
757 | arg list |
758 |--|
759 | `<response-code> <repo> <chart> <version> <release> <namespace>` |
760
761 | parameter | description |
762 | --------- | ----------- |
763 | `<response-code>` | Expected response code |
764 | `<repo>`| Target repo of the chart  |
765 | `<chart>`| Name of the chart  |
766 | `<version>`| Version of the chart  |
767 | `<namespace>`| Namespace to of the chart  |
768 | `<release>`| Release name of the chart  |
769
770 ## Function: helm_manager_api_post_install_chart ##
771
772 Install an onboarded chart.
773 | arg list |
774 |--|
775 | `<response-code> <chart> <version>` |
776
777 | parameter | description |
778 | --------- | ----------- |
779 | `<response-code>` | Expected response code |
780 | `<chart>`| Name of the chart  |
781 | `<version>`| Version of the chart  |
782
783 ## Function: helm_manager_api_uninstall_chart ##
784
785 Uninstall a chart.
786 | arg list |
787 |--|
788 | `<response-code> <chart> <version>` |
789
790 | parameter | description |
791 | --------- | ----------- |
792 | `<response-code>` | Expected response code |
793 | `<chart>`| Name of the chart  |
794 | `<version>`| Version of the chart  |
795
796 ## Function: helm_manager_api_delete_chart ##
797
798 Delete a chart.
799 | arg list |
800 |--|
801 | `<response-code> <chart> <version>` |
802
803 | parameter | description |
804 | --------- | ----------- |
805 | `<response-code>` | Expected response code |
806 | `<chart>`| Name of the chart  |
807 | `<version>`| Version of the chart  |
808
809 ## Function: helm_manager_api_exec_add_repo ##
810
811 Add repo in helm manager by helm using exec.
812 | arg list |
813 |--|
814 | `<repo-name> <repo-url>` |
815
816 | parameter | description |
817 | --------- | ----------- |
818 | `<response-code>` | Expected response code |
819 | `<repo-name>`| Name of the repo  |
820 | `<repo-url>`| Full url to the repo. Url must be accessible by the container  |
821
822
823 # Description of functions in ics_api_functions.sh #
824
825 ## Function: use_ics_rest_http ##
826
827 Use http for all API calls to the ICS. This is the default protocol.
828 | arg list |
829 |--|
830 | None |
831
832 ## Function: use_ics_rest_https ##
833
834 Use https for all API calls to the ICS.
835 | arg list |
836 |--|
837 | None |
838
839 ## Function: use_ics_dmaap_http ##
840
841 Send and recieve all API calls to the ICS over Dmaap via the MR using http.
842 | arg list |
843 |--|
844 | None |
845
846 ## Function: use_ics_dmaap_https ##
847
848 Send and recieve all API calls to the ICS over Dmaap via the MR using https.
849 | arg list |
850 |--|
851 | None |
852
853 ## Function: start_ics ##
854
855 Start the ICS container in docker or kube depending on running mode.
856 | arg list |
857 |--|
858 | `PROXY|NOPROXY <config-file>` |
859
860 | parameter | description |
861 | --------- | ----------- |
862 | `PROXY` | Configure with http proxy, if proxy is started  |
863 | `NOPROXY` | Configure without http proxy  |
864 | `<config-file>`| Path to application.yaml  |
865
866 ## Function: stop_ics ##
867
868 Stop the ICS container.
869 | arg list |
870 |--|
871 | None |
872
873 ## Function: start_stopped_ics ##
874
875 Start a previously stopped ics.
876 | arg list |
877 |--|
878 | None |
879
880 ## Function: set_ics_debug ##
881
882 Configure the ICS log on debug level. The ICS must be running.
883 | arg list |
884 |--|
885 | None |
886
887 ## Function: set_ics_trace ##
888
889 Configure the ICS log on trace level. The ICS must be running.
890 | arg list |
891 |--|
892 | None |
893
894 ## Function: use_ics_retries ##
895
896 Perform curl retries when making direct call to ICS for the specified http response codes
897 Speace separated list of http response codes
898 | arg list |
899 |--|
900 | `[<response-code>]*` |
901
902 | parameter | description |
903 | --------- | ----------- |
904 | `<response-code>` | Http response code to make retry for  |
905
906 ## Function: check_ics_logs ##
907
908 Check the ICS log for any warnings and errors and print the count of each.
909 | arg list |
910 |--|
911 | None |
912
913 ## Function: ics_equal ##
914
915 Tests if a variable value in the ICS is equal to a target value.
916 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
917 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.
918 See the 'a1-interface' repo for more details.
919
920 | arg list |
921 |--|
922 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
923
924 | parameter | description |
925 | --------- | ----------- |
926 | `<variable-name>` | Variable name in ics  |
927 | `<target-value>` | Target value for the variable  |
928 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
929
930 ## Function: ics_api_a1_get_job_ids ##
931
932 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs' and optional check of the array of returned job ids.
933 To test the response code only, provide the response code parameter as well as a type id and an owner id.
934 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
935
936 | arg list |
937 |--|
938 | `<response-code> <type-id>  <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
939
940 | parameter | description |
941 | --------- | ----------- |
942 | `<response-code>` | Expected http response code |
943 | `<type-id>` | Id of the EI type  |
944 | `<owner-id>` | Id of the job owner  |
945 | `NOOWNER` | No owner is given  |
946 | `<job-id>` | Id of the expected job  |
947 | `EMPTY` | The expected list of job id shall be empty  |
948
949 ## Function: ics_api_a1_get_type ##
950
951 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}' and optional check of the returned schema.
952 To test the response code only, provide the response code parameter as well as the type-id.
953 To also test the response payload add a path to the expected schema file.
954
955 | arg list |
956 |--|
957 | `<response-code> <type-id> [<schema-file>]` |
958
959 | parameter | description |
960 | --------- | ----------- |
961 | `<response-code>` | Expected http response code |
962 | `<type-id>` | Id of the EI type  |
963 | `<schema-file>` | Path to a schema file to compare with the returned schema  |
964
965 ## Function: ics_api_a1_get_type_ids ##
966
967 Test of GET '/A1-EI/v1/eitypes' and optional check of returned list of type ids.
968 To test the response code only, provide the response only.
969 To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
970
971 | arg list |
972 |--|
973 | `<response-code> [ (EMPTY \| [<type-id>]+) ]` |
974
975 | parameter | description |
976 | --------- | ----------- |
977 | `<response-code>` | Expected http response code |
978 | `EMPTY` | The expected list of type ids shall be empty  |
979 | `<type-id>` | Id of the EI type  |
980
981 ## Function: ics_api_a1_get_job_status ##
982
983 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}/status' and optional check of the returned status.
984 To test the response code only, provide the response code, type id and job id.
985 To also test the response payload add the expected status.
986
987 | arg list |
988 |--|
989 | `<response-code> <type-id> <job-id> [<status>]` |
990
991 | parameter | description |
992 | --------- | ----------- |
993 | `<response-code>` | Expected http response code |
994 | `<type-id>` | Id of the EI type  |
995 | `<job-id>` | Id of the job  |
996 | `<status>` | Expected status  |
997
998 ## Function: ics_api_a1_get_job ##
999
1000 Test of GET '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}' and optional check of the returned job.
1001 To test the response code only, provide the response code, type id and job id.
1002 To also test the response payload add the remaining parameters.
1003
1004 | arg list |
1005 |--|
1006 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1007
1008 | parameter | description |
1009 | --------- | ----------- |
1010 | `<response-code>` | Expected http response code |
1011 | `<type-id>` | Id of the EI type  |
1012 | `<job-id>` | Id of the job  |
1013 | `<target-url>` | Expected target url for the job  |
1014 | `<owner-id>` | Expected owner for the job  |
1015 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1016
1017 ## Function: ics_api_a1_delete_job ##
1018
1019 Test of DELETE '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1020 To test, provide all the specified parameters.
1021
1022 | arg list |
1023 |--|
1024 | `<response-code> <type-id> <job-id>` |
1025
1026 | parameter | description |
1027 | --------- | ----------- |
1028 | `<response-code>` | Expected http response code |
1029 | `<type-id>` | Id of the EI type  |
1030 | `<job-id>` | Id of the job  |
1031
1032 ## Function: ics_api_a1_put_job ##
1033
1034 Test of PUT '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1035 To test, provide all the specified parameters.
1036
1037 | arg list |
1038 |--|
1039 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
1040
1041 | parameter | description |
1042 | --------- | ----------- |
1043 | `<response-code>` | Expected http response code |
1044 | `<type-id>` | Id of the EI type  |
1045 | `<job-id>` | Id of the job  |
1046 | `<target-url>` | Target url for the job  |
1047 | `<owner-id>` | Owner of the job  |
1048 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1049
1050 ## Function: ics_api_edp_get_type_ids ##
1051
1052 Test of GET '/ei-producer/v1/eitypes' or '/data-producer/v1/info-types' depending on ics version and an optional check of the returned list of type ids.
1053 To test the response code only, provide the response code.
1054 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1055
1056 | arg list |
1057 |--|
1058 | `<response-code> [ EMPTY \| <type-id>+]` |
1059
1060 | parameter | description |
1061 | --------- | ----------- |
1062 | `<response-code>` | Expected http response code |
1063 | `<type-id>` | Id of the type  |
1064 | `EMPTY` | The expected list of type ids shall be empty  |
1065
1066 ## Function: ics_api_edp_get_producer_status ##
1067
1068 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/status' or '/data-producer/v1/info-producers/{infoProducerId}/status' depending on ics version and optional check of the returned status.
1069 To test the response code only, provide the response code and producer id.
1070 To also test the response payload add the expected status.
1071
1072 | arg list |
1073 |--|
1074 | `<response-code> <producer-id> [<status>]` |
1075
1076 | parameter | description |
1077 | --------- | ----------- |
1078 | `<response-code>` | Expected http response code |
1079 | `<producer-id>` | Id of the producer  |
1080 | `<status>` | The expected status string  |
1081
1082 ## Function: ics_api_edp_get_producer_ids ##
1083
1084 Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
1085 To test the response code only, provide the response.
1086 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).
1087
1088 | arg list |
1089 |--|
1090 | `<response-code> [ EMPTY \| <producer-id>+]` |
1091
1092 | parameter | description |
1093 | --------- | ----------- |
1094 | `<response-code>` | Expected http response code |
1095 | `<producer-id>` | Id of the producer  |
1096 | `EMPTY` | The expected list of type ids shall be empty  |
1097
1098 ## Function: ics_api_edp_get_producer_ids_2 ##
1099
1100 Test of GET '/ei-producer/v1/eiproducers' or '/data-producer/v1/info-producers' depending on ics version and optional check of the returned producer ids.
1101 To test the response code only, provide the response.
1102 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).
1103
1104 | arg list |
1105 |--|
1106 | `<response-code> [ ( NOTYPE \| <type-id> ) [ EMPTY \| <producer-id>+]` |
1107
1108 | parameter | description |
1109 | --------- | ----------- |
1110 | `<response-code>` | Expected http response code |
1111 | `<type-id>` | Id of the type  |
1112 | `EMPTY` | No type given  |
1113 | `<producer-id>` | Id of the producer  |
1114 | `EMPTY` | The expected list of type ids shall be empty  |
1115
1116 ## Function: ics_api_edp_get_type ##
1117
1118 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
1119 To test the response code only, provide the response and the type-id.
1120 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).
1121
1122 | arg list |
1123 |--|
1124 | `<response-code> <type-id> [<job-schema-file> (EMPTY \| [<producer-id>]+)]` |
1125
1126 | parameter | description |
1127 | --------- | ----------- |
1128 | `<response-code>` | Expected http response code |
1129 | `<type-id>` | Id of the type  |
1130 | `<job-schema-file>` | Path to a job schema file  |
1131 | `<producer-id>` | Id of the producer  |
1132 | `EMPTY` | The expected list of type ids shall be empty  |
1133
1134 ## Function: ics_api_edp_get_type_2 ##
1135
1136 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ics version and optional check of the returned type.
1137 To test the response code only, provide the response and the type-id.
1138 To also test the response payload add a path to a job schema file.
1139
1140 | arg list |
1141 |--|
1142 | `<response-code> <type-id> [<job-schema-file>]` |
1143
1144 | parameter | description |
1145 | --------- | ----------- |
1146 | `<response-code>` | Expected http response code |
1147 | `<type-id>` | Id of the type  |
1148 | `<job-schema-file>` | Path to a job schema file  |
1149 | `EMPTY` | The expected list of type ids shall be empty  |
1150
1151 ## Function: ics_api_edp_put_type_2 ##
1152
1153 Test of PUT '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ics version and optional check of the returned type.
1154
1155 | arg list |
1156 |--|
1157 | `<response-code> <type-id> [<job-schema-file>]` |
1158
1159 | parameter | description |
1160 | --------- | ----------- |
1161 | `<response-code>` | Expected http response code |
1162 | `<type-id>` | Id of the type  |
1163 | `<job-schema-file>` | Path to a job schema file  |
1164 | `EMPTY` | The expected list of type ids shall be empty  |
1165
1166 ## Function: ics_api_edp_delete_type_2 ##
1167
1168 Test of DELETE '/ei-producer/v1/eitypes/{eiTypeId}' or '/data-producer/v1/info-types/{infoTypeId}' depending on ics version and optional check of the returned type.
1169
1170 | arg list |
1171 |--|
1172 | `<response-code> <type-id>` |
1173
1174 | parameter | description |
1175 | --------- | ----------- |
1176 | `<response-code>` | Expected http response code |
1177 | `<type-id>` | Id of the type  |
1178
1179 ## Function: ics_api_edp_get_producer ##
1180
1181 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
1182 To test the response code only, provide the response and the producer-id.
1183 To also test the response payload add the remaining parameters defining thee producer.
1184
1185 | arg list |
1186 |--|
1187 | `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY\| [<type-id> <schema-file>]+) ]` |
1188
1189 | parameter | description |
1190 | --------- | ----------- |
1191 | `<response-code>` | Expected http response code |
1192 | `<producer-id>` | Id of the producer  |
1193 | `<create-callback>` | Callback for create job  |
1194 | `<delete-callback>` | Callback for delete job  |
1195 | `<supervision-callback>` | Callback for producer supervision  |
1196 | `<type-id>` | Id of the type  |
1197 | `<schema-file>` | Path to a schema file  |
1198 | `EMPTY` | The expected list of type schema pairs shall be empty  |
1199
1200 ## Function: ics_api_edp_get_producer_2 ##
1201
1202 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version and optional check of the returned producer.
1203 To test the response code only, provide the response and the producer-id.
1204 To also test the response payload add the remaining parameters defining thee producer.
1205
1206 | arg list |
1207 |--|
1208 | `<response-code> <producer-id> [<job-callback> <supervision-callback> (EMPTY \| <type-id>+) ]` |
1209
1210 | parameter | description |
1211 | --------- | ----------- |
1212 | `<response-code>` | Expected http response code |
1213 | `<producer-id>` | Id of the producer  |
1214 | `<job-callback>` | Callback for the url  |
1215 | `<supervision-callback>` | Callback for producer supervision  |
1216 | `<type-id>` | Id of the type  |
1217 | `EMPTY` | The expected list of types shall be empty  |
1218
1219 ## Function: ics_api_edp_delete_producer ##
1220
1221 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version.
1222 To test, provide all parameters.
1223
1224 | arg list |
1225 |--|
1226 | `<response-code> <producer-id>` |
1227
1228 | parameter | description |
1229 | --------- | ----------- |
1230 | `<response-code>` | Expected http response code |
1231 | `<producer-id>` | Id of the producer  |
1232
1233 ## Function: ics_api_edp_put_producer ##
1234
1235 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1236 To test, provide all parameters. The list of type/schema pair may be empty.
1237
1238 | arg list |
1239 |--|
1240 | `<response-code> <producer-id> <job-callback> <supervision-callback> (EMPTY \| [<type-id> <schema-file>]+)` |
1241
1242 | parameter | description |
1243 | --------- | ----------- |
1244 | `<response-code>` | Expected http response code |
1245 | `<producer-id>` | Id of the producer  |
1246 | `<job-callback>` | Callback for create/delete job  |
1247 | `<supervision-callback>` | Callback for producer supervision  |
1248 | `<type-id>` | Id of the type  |
1249 | `<schema-file>` | Path to a schema file  |
1250 | `EMPTY` | The list of type/schema pairs is empty  |
1251
1252 ## Function: ics_api_edp_put_producer_2 ##
1253
1254 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}' or '/data-producer/v1/info-producers/{infoProducerId}' depending on ics version.
1255 To test, provide all parameters. The list of type/schema pair may be empty.
1256
1257 | arg list |
1258 |--|
1259 | `<response-code> <producer-id> <job-callback> <supervision-callback> NOTYPE\|[<type-id>+]` |
1260
1261 | parameter | description |
1262 | --------- | ----------- |
1263 | `<response-code>` | Expected http response code |
1264 | `<producer-id>` | Id of the producer  |
1265 | `<job-callback>` | Callback for create/delete job  |
1266 | `<supervision-callback>` | Callback for producer supervision  |
1267 | `<type-id>` | Id of the type  |
1268 | `NOTYPE` | The list of types is empty  |
1269
1270 ## Function: ics_api_edp_get_producer_jobs ##
1271
1272 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
1273 To test the response code only, provide the response and the producer-id.
1274 To also test the response payload add the remaining parameters.
1275
1276 | arg list |
1277 |--|
1278 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1279
1280 | parameter | description |
1281 | --------- | ----------- |
1282 | `<response-code>` | Expected http response code |
1283 | `<producer-id>` | Id of the producer  |
1284 | `<job-id>` | Id of the job  |
1285 | `<type-id>` | Id of the EI type  |
1286 | `<target-url>` | Target url for data delivery  |
1287 | `<job-owner>` | Id of the job owner  |
1288 | `<template-job-file>` | Path to a job template file  |
1289 | `EMPTY` | The list of job/type/target/job-file tuples is empty  |
1290
1291 ## Function: ics_api_edp_get_producer_jobs_2 ##
1292
1293 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' or '/data-producer/v1/info-producers/{infoProducerId}/info-jobs' depending on ics version and optional check of the returned producer job.
1294 To test the response code only, provide the response and the producer-id.
1295 To also test the response payload add the remaining parameters.
1296
1297 | arg list |
1298 |--|
1299 | `<response-code> <producer-id> (EMPTY \| [<job-id> <type-id> <target-url> <job-owner> <template-job-file>]+)` |
1300
1301 | parameter | description |
1302 | --------- | ----------- |
1303 | `<response-code>` | Expected http response code |
1304 | `<producer-id>` | Id of the producer  |
1305 | `<job-id>` | Id of the job  |
1306 | `<type-id>` | Id of the type  |
1307 | `<target-url>` | Target url for data delivery  |
1308 | `<job-owner>` | Id of the job owner  |
1309 | `<template-job-file>` | Path to a job template file  |
1310 | `EMPTY` | The list of job/type/target/job-file tuples is empty  |
1311
1312 ## Function: ics_api_service_status ##
1313
1314 Test of GET '/status'.
1315
1316 | arg list |
1317 |--|
1318 | `<response-code>` |
1319
1320 | parameter | description |
1321 | --------- | ----------- |
1322 | `<response-code>` | Expected http response code |
1323
1324 ## Function: ics_api_idc_get_type_ids ##
1325
1326 Test of GET '/data-consumer/v1/info-types' and an optional check of the returned list of type ids.
1327 To test the response code only, provide the response code.
1328 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1329
1330 | arg list |
1331 |--|
1332 | `<response-code> [ EMPTY \| <type-id>+]` |
1333
1334 | parameter | description |
1335 | --------- | ----------- |
1336 | `<response-code>` | Expected http response code |
1337 | `<type-id>` | Id of the Info type  |
1338 | `EMPTY` | The expected list of type ids shall be empty  |
1339
1340 ## Function: ics_api_idc_get_job_ids ##
1341
1342 Test of GET '/data-consumer/v1/info-jobs' and optional check of the array of returned job ids.
1343 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1344 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1345
1346 | arg list |
1347 |--|
1348 | `<response-code> <type-id>  <owner-id>\|NOOWNER [ EMPTY \| <job-id>+ ]` |
1349
1350 | parameter | description |
1351 | --------- | ----------- |
1352 | `<response-code>` | Expected http response code |
1353 | `<type-id>` | Id of the Info type  |
1354 | `<owner-id>` | Id of the job owner  |
1355 | `NOOWNER` | No owner is given  |
1356 | `<job-id>` | Id of the expected job  |
1357 | `EMPTY` | The expected list of job id shall be empty  |
1358
1359 ## Function: ics_api_idc_get_job ##
1360
1361 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}' and optional check of the returned job.
1362 To test the response code only, provide the response code, type id and job id.
1363 To also test the response payload add the remaining parameters.
1364
1365 | arg list |
1366 |--|
1367 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1368
1369 | parameter | description |
1370 | --------- | ----------- |
1371 | `<response-code>` | Expected http response code |
1372 | `<type-id>` | Id of the Info type  |
1373 | `<job-id>` | Id of the job  |
1374 | `<target-url>` | Expected target url for the job  |
1375 | `<owner-id>` | Expected owner for the job  |
1376 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1377
1378 ## Function: ics_api_idc_put_job ##
1379
1380 Test of PUT '/data-consumer/v1/info-jobs/{infoJobId}'.
1381 To test, provide all the specified parameters.
1382
1383 | arg list |
1384 |--|
1385 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file> [VALIDATE]` |
1386
1387 | parameter | description |
1388 | --------- | ----------- |
1389 | `<response-code>` | Expected http response code |
1390 | `<type-id>` | Id of the Info type  |
1391 | `<job-id>` | Id of the job  |
1392 | `<target-url>` | Target url for the job  |
1393 | `<owner-id>` | Owner of the job  |
1394 | `<template-job-file>` | Path to a job template for job parameters of the job  |
1395 | `VALIIDATE` | Indicator to preform type validation at creation  |
1396
1397 ## Function: ics_api_idc_delete_job ##
1398
1399 Test of DELETE '/A1-EI/v1/eitypes/{eiTypeId}/eijobs/{eiJobId}'.
1400 To test, provide all the specified parameters.
1401
1402 | arg list |
1403 |--|
1404 | `<response-code> <type-id> <job-id>` |
1405
1406 | parameter | description |
1407 | --------- | ----------- |
1408 | `<response-code>` | Expected http response code |
1409 | `<type-id>` | Id of the type  |
1410 | `<job-id>` | Id of the job  |
1411
1412 ## Function: ics_api_idc_get_type ##
1413
1414 Test of GET '/data-consumer/v1/info-types/{infoTypeId} and optional check of the returned schema.
1415 To test the response code only, provide the response code parameter as well as the type-id.
1416 To also test the response payload add a path to the expected schema file.
1417
1418 | arg list |
1419 |--|
1420 | `<response-code> <type-id> [<schema-file>]` |
1421
1422 | parameter | description |
1423 | --------- | ----------- |
1424 | `<response-code>` | Expected http response code |
1425 | `<type-id>` | Id of the Info type  |
1426 | `<schema-file>` | Path to a schema file to compare with the returned schema  |
1427
1428 ## Function: ics_api_idc_get_job_status ##
1429
1430 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' and optional check of the returned status and timeout.
1431 To test the response code only, provide the response code and job id.
1432 To also test the response payload add the expected status.
1433
1434 | arg list |
1435 |--|
1436 | `<response-code> <job-id> [<status> [ <timeout>]]` |
1437
1438 | parameter | description |
1439 | --------- | ----------- |
1440 | `<response-code>` | Expected http response code |
1441 | `<job-id>` | Id of the job  |
1442 | `<status>` | Expected status  |
1443 | `<timeout>` | Timeout |
1444
1445 ## Function: ics_api_idc_get_job_status2 ##
1446
1447 Test of GET '/data-consumer/v1/info-jobs/{infoJobId}/status' with returned producers and optional check of the returned status and timeout.
1448 To test the response code only, provide the response code and job id.
1449 To also test the response payload add the expected status.
1450
1451 | arg list |
1452 |--|
1453 | `<response-code> <job-id> [<status> EMPTYPROD|( <prod-count> <producer-id>+ ) [<timeout>]]` |
1454
1455 | parameter | description |
1456 | --------- | ----------- |
1457 | `<response-code>` | Expected http response code |
1458 | `<job-id>` | Id of the job  |
1459 | `<status>` | Expected status  |
1460 | `<EMPTYPROD>` | Indicated for empty list of producer  |
1461 | `<prod-count>` | Number of expected producer  |
1462 | `<producer-id>` |Id of the producer  |
1463 | `<timeout>` | Timeout |
1464
1465
1466 ## Function: ics_api_idc_get_subscription_ids ##
1467 Test of GET '/data-consumer/v1/info-type-subscription' with the returned list of subscription ids
1468
1469 | arg list |
1470 |--|
1471 | `<response-code>  <owner-id>|NOOWNER [ EMPTY | <subscription-id>+]` |
1472
1473 | parameter | description |
1474 | --------- | ----------- |
1475 | `<response-code>` | Expected http response code |
1476 | `<owner-id>` | Id of the owner  |
1477 | `<NOOWNER>` | Indicator for empty owner  |
1478 | `<EMPTY>` | Indicated for empty list of subscription ids  |
1479 | `<subscription-id>` |Id of the subscription  |
1480
1481 ## Function: ics_api_idc_get_subscription ##
1482 Test of GET '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
1483
1484 | arg list |
1485 |--|
1486 | `<response-code>  <subscription-id> [ <owner-id> <status-uri> ]` |
1487
1488 | parameter | description |
1489 | --------- | ----------- |
1490 | `<response-code>` | Expected http response code |
1491 | `<subscription-id>` |Id of the subscription  |
1492 | `<owner-id>` | Id of the owner  |
1493 | `<status-uri>` | Url for status notifications  |
1494
1495
1496 ## Function: ics_api_idc_put_subscription ##
1497 Test of PUT '/data-consumer/v1/info-type-subscription/{subscriptionId}' with the subscription information
1498
1499 | arg list |
1500 |--|
1501 | `<response-code>  <subscription-id> <owner-id> <status-uri>` |
1502
1503 | parameter | description |
1504 | --------- | ----------- |
1505 | `<response-code>` | Expected http response code |
1506 | `<subscription-id>` |Id of the subscription  |
1507 | `<owner-id>` | Id of the owner  |
1508 | `<status-uri>` | Url for status notifications  |
1509
1510 ## Function: ics_api_idc_delete_subscription ##
1511 Test of DELETE /data-consumer/v1/info-type-subscription/{subscriptionId}
1512
1513 | arg list |
1514 |--|
1515 | `<response-code>  <subscription-id>` |
1516
1517 | parameter | description |
1518 | --------- | ----------- |
1519 | `<response-code>` | Expected http response code |
1520 | `<subscription-id>` |Id of the subscription  |
1521
1522
1523 ## Function: ics_api_admin_reset ##
1524
1525 Test of GET '/status'.
1526
1527 | arg list |
1528 |--|
1529 | `<response-code> [ <type> ]` |
1530
1531 | parameter | description |
1532 | --------- | ----------- |
1533 | `<response-code>` | Expected http response code |
1534 | `<type>` | Type id, if the interface supports type in url |
1535
1536 ## Function: ics_kube_pvc_reset ##
1537
1538 Admin reset to remove all data in ics; jobs, producers etc
1539 NOTE - only works in kubernetes and the pod should not be running
1540
1541 | arg list |
1542 |--|
1543 | None |
1544
1545 # Description of functions in kafkapc_api_functions.sh #
1546
1547 ## Function: use_kafkapc_http ##
1548
1549 Use http for all calls to the KAFKAPC.
1550 | arg list |
1551 |--|
1552 | None |
1553
1554 ## Function: use_kafkapc_https ##
1555
1556 Use https for all calls to the KAFKAPC.
1557 | arg list |
1558 |--|
1559 | None |
1560
1561 ## Function: start_kafkapc ##
1562
1563 Start the KAFKAPC container in docker or kube depending on start mode
1564 | arg list |
1565 |--|
1566 | None |
1567
1568 ## Function: kafkapc_equal ##
1569
1570 Tests if a variable value in the KAFKAPC is equal to a target value.
1571 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1572 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.
1573 See the 'mrstub' dir for more details.
1574 | arg list |
1575 |--|
1576 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1577
1578 | parameter | description |
1579 | --------- | ----------- |
1580 | `<variable-name>` | Variable name in the KAFKAPC  |
1581 | `<target-value>` | Target value for the variable  |
1582 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1583
1584 ## Function: kafkapc_api_reset ##
1585
1586 Deep reset of KAFKAPC. Note that kafka itself is not affected, i.e. created topic still exist in kafka.
1587 | arg list |
1588 |--|
1589 | None |
1590
1591 ## Function: kafkapc_api_create_topic ##
1592
1593 Create a topic in kafka via kafkapc.
1594 | `<response-code> <topic-name>  <mime-type>` |
1595
1596 | parameter | description |
1597 | --------- | ----------- |
1598 | `<response-code>` | Http response code  |
1599 | `<topic-name>` | Name of the topic  |
1600 | `<mime-type>` | Mime type of the data to send to the topic. Data on the topic is expected to be of this type  |
1601
1602 ## Function: kafkapc_api_get_topic ##
1603
1604 Create a from kafkapc.
1605 | `<response-code> <topic-name>  <mime-type>` |
1606
1607 | parameter | description |
1608 | --------- | ----------- |
1609 | `<response-code>` | Http response code  |
1610 | `<topic-name>` | Name of the topic  |
1611 | `<mime-type>` | Mime type of the topic  |
1612
1613 ## Function: kafkapc_api_start_sending ##
1614
1615 Start sending msg from the msg queue to kafka for a topic.
1616 | `<response-code> <topic-name>` |
1617
1618 | parameter | description |
1619 | --------- | ----------- |
1620 | `<response-code>` | Http response code  |
1621 | `<topic-name>` | Name of the topic  |
1622
1623 ## Function: kafkapc_api_start_receiving ##
1624
1625 Start receiving msg from a kafka topic to the msg queue in kafkapc.
1626 | `<response-code> <topic-name>` |
1627
1628 | parameter | description |
1629 | --------- | ----------- |
1630 | `<response-code>` | Http response code  |
1631 | `<topic-name>` | Name of the topic  |
1632
1633 ## Function: kafkapc_api_stop_sending ##
1634
1635 Stop sending msg from the msg queue to kafka for a topic.
1636 | `<response-code> <topic-name>` |
1637
1638 | parameter | description |
1639 | --------- | ----------- |
1640 | `<response-code>` | Http response code  |
1641 | `<topic-name>` | Name of the topic  |
1642
1643 ## Function: kafkapc_api_stop_receiving ##
1644
1645 Stop receiving msg from a kafka topic to the msg queue in kafkapc.
1646 | `<response-code> <topic-name>` |
1647
1648 | parameter | description |
1649 | --------- | ----------- |
1650 | `<response-code>` | Http response code  |
1651 | `<topic-name>` | Name of the topic  |
1652
1653 ## Function: kafkapc_api_post_msg ##
1654
1655 Send a message on a topic.
1656 | arg list |
1657 |--|
1658 | `<response-code> <topic> <mime-type> <msg>` |
1659
1660 | parameter | description |
1661 | --------- | ----------- |
1662 | `<response-code>` | Http response code  |
1663 | `<topic>` | Topic name  |
1664 | `<mime-type>` | Mime type of the msg  |
1665 | `<msg>` | String msg to send  |
1666
1667 ## Function: kafkapc_api_get_msg ##
1668
1669 Get a message on a topic.
1670 | arg list |
1671 |--|
1672 | `<response-code> <topic>  ([ <mime-type>  <msg> ] | NOMSG )` |
1673
1674 | parameter | description |
1675 | --------- | ----------- |
1676 | `<response-code>` | Http response code  |
1677 | `<topic>` | Topic name  |
1678 | `<mime-type>` | Mime type of the msg  |
1679 | `<msg>` | String msg to receive  |
1680 | `NOMSG` | Indicated for no msg  |
1681
1682 ## Function: kafkapc_api_post_msg_from_file ##
1683
1684 Send a message in a file on a topic.
1685 | arg list |
1686 |--|
1687 | `<response-code> <topic> <mime-type> <file>` |
1688
1689 | parameter | description |
1690 | --------- | ----------- |
1691 | `<response-code>` | Http response code  |
1692 | `<topic>` | Topic name  |
1693 | `<mime-type>` | Mime type of the msg  |
1694 | `<file>` | Filepath to the string msg to send  |
1695
1696 ## Function: kafkapc_api_get_msg_from_file ##
1697
1698 Get a message on a topic.
1699 | arg list |
1700 |--|
1701 | `<response-code> <topic>  <mime-type>  <file> ` |
1702
1703 | parameter | description |
1704 | --------- | ----------- |
1705 | `<response-code>` | Http response code  |
1706 | `<topic>` | Topic name  |
1707 | `<mime-type>` | Mime type of the msg  |
1708 | `<file>` | Filepath to the string msg to receive  |
1709
1710 ## Function: kafkapc_api_generate_json_payload_file ##
1711
1712 Create json file with dummy data for payload.
1713 | arg list |
1714 |--|
1715 | `<size-in-kb> <filename>` |
1716
1717 | parameter | description |
1718 | --------- | ----------- |
1719 | `<size-in-kb>` | Generated size in kb  |
1720 | `<filename>` | Path to output file  |
1721
1722 ## Function: kafkapc_api_generate_text_payload_file ##
1723
1724 Create file with dummy text data for payload.
1725 | arg list |
1726 |--|
1727 | `<size-in-kb> <filename>` |
1728
1729 | parameter | description |
1730 | --------- | ----------- |
1731 | `<size-in-kb>` | Generated size in kb  |
1732 | `<filename>` | Path to output file  |
1733
1734 # Description of functions in kubeproxy_api_functions.sh #
1735
1736 ## Function: use_kube_proxy_http ##
1737
1738 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.
1739 | arg list |
1740 |--|
1741 | None |
1742
1743 ## Function: use_kube_proxy_https ##
1744
1745 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.
1746 | arg list |
1747 |--|
1748 | None |
1749
1750 ## Function: start_kube_proxy ##
1751
1752 Start the kube proxy container in kube. This proxy enabled the test env to access all services and pods in a kube cluster.
1753 No proxy is started if the function is called in docker mode.
1754 | arg list |
1755 |--|
1756 | None |
1757
1758 # Description of functions in localhelm_api_functions.sh #
1759
1760 ## Function: localhelm_create_test_chart ##
1761
1762 Create a dummy chart using helm
1763 | arg list |
1764 |--|
1765 | `chart-name` |
1766
1767 | parameter | description |
1768 | --------- | ----------- |
1769 | `chart-name` | Name of the chart |
1770
1771 ## Function: localhelm_package_test_chart ##
1772
1773 Package a dummy chart using helm
1774 | arg list |
1775 |--|
1776 | `chart-name` |
1777
1778 | parameter | description |
1779 | --------- | ----------- |
1780 | `chart-name` | Name of the chart |
1781
1782 ## Function: localhelm_installed_chart_release ##
1783
1784 Check if a chart is installed or not using helm
1785 | arg list |
1786 |--|
1787 | `INSTALLED|NOTINSTALLED <release-name> <name-space> |
1788
1789 | parameter | description |
1790 | --------- | ----------- |
1791 | `INSTALLED` | Expecting installed chart |
1792 | `NOTINSTALLED` | Expecting a not installed chart |
1793 | `release-name` | Name of the release |
1794 | `name-space` | Expected namespace |
1795
1796 # Description of functions in mr_api_functions.sh #
1797
1798 ## Function: use_mr_http ##
1799
1800 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.
1801 | arg list |
1802 |--|
1803 | None |
1804
1805 ## Function: use_mr_https ##
1806
1807 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.
1808 | arg list |
1809 |--|
1810 | None |
1811
1812 ## Function: start_mr ##
1813
1814 Start the Message Router stub interface container in docker or kube depending on start mode
1815 | arg list |
1816 |--|
1817 | None |
1818
1819 ## Function: dmaap_api_print_topics ##
1820
1821 Prints the current list of topics in DMAAP MR
1822
1823 | arg list |
1824 |--|
1825 | None |
1826
1827 ## Function: mr_equal ##
1828
1829 Tests if a variable value in the Message Router (MR) simulator is equal to a target value.
1830 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1831 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.
1832 See the 'mrstub' dir for more details.
1833 | arg list |
1834 |--|
1835 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1836
1837 | parameter | description |
1838 | --------- | ----------- |
1839 | `<variable-name>` | Variable name in the MR  |
1840 | `<target-value>` | Target value for the variable  |
1841 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
1842
1843 ## Function: mr_greater ##
1844
1845 Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
1846 Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than the target or not.
1847 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.
1848 See the 'mrstub' dir for more details.
1849 | arg list |
1850 |--|
1851 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1852
1853 | parameter | description |
1854 | --------- | ----------- |
1855 | `<variable-name>` | Variable name in the MR  |
1856 | `<target-value>` | Target value for the variable  |
1857 | `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value  |
1858
1859 ## Function: mr_read ##
1860
1861 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.
1862 See the 'mrstub' dir for more details.
1863 | arg list |
1864 |--|
1865 | `<variable-name>` |
1866
1867 | parameter | description |
1868 | --------- | ----------- |
1869 | `<variable-name>` | Variable name in the MR  |
1870
1871 ## Function: mr_print ##
1872
1873 Prints the value of a variable in the Message Router (MR) simulator.
1874 See the 'mrstub' dir for more details.
1875 | arg list |
1876 |--|
1877 | `<variable-name>` |
1878
1879 | parameter | description |
1880 | --------- | ----------- |
1881 | `<variable-name>` | Variable name in the MR  |
1882
1883 ## Function: mr_api_send_json ##
1884
1885 Send json to topic in mr-stub.
1886 | arg list |
1887 |--|
1888 | `<topic-url> <json-msg>` |
1889
1890 | parameter | description |
1891 | --------- | ----------- |
1892 | `<topic-url>` | Topic url  |
1893 | `<json-msg>` | Json msg as string  |
1894
1895 ## Function: mr_api_send_text ##
1896
1897 Send text to topic in mr-stub.
1898 | arg list |
1899 |--|
1900 | `<topic-url> <text-msg>` |
1901
1902 | parameter | description |
1903 | --------- | ----------- |
1904 | `<topic-url>` | Topic url  |
1905 | `<text-msg>` | Text (string) msg  |
1906
1907
1908
1909 ## Function: mr_api_send_json_file ##
1910
1911 Send json to topic in mr-stub.
1912 | arg list |
1913 |--|
1914 | `<topic-url> <json-file>` |
1915
1916 | parameter | description |
1917 | --------- | ----------- |
1918 | `<topic-url>` | Topic url  |
1919 | `<json-file>` | Path to file with json msg as string  |
1920
1921 ## Function: mr_api_send_text_file ##
1922
1923 Send text to topic in mr-stub.
1924 | arg list |
1925 |--|
1926 | `<topic-url> <text-file>` |
1927
1928 | parameter | description |
1929 | --------- | ----------- |
1930 | `<topic-url>` | Topic url  |
1931 | `<text-file>` | Path to file with text msg as string  |
1932
1933 ## Function: mr_api_generate_json_payload_file ##
1934
1935 Create json file with dummy data for payload.
1936 | arg list |
1937 |--|
1938 | `<size-in-kb> <filename>` |
1939
1940 | parameter | description |
1941 | --------- | ----------- |
1942 | `<size-in-kb>` | Generated size in kb  |
1943 | `<filename>` | Path to output file  |
1944
1945 ## Function: mr_api_generate_text_payload_file ##
1946
1947 Create file with dummy text data for payload.
1948 | arg list |
1949 |--|
1950 | `<size-in-kb> <filename>` |
1951
1952 | parameter | description |
1953 | --------- | ----------- |
1954 | `<size-in-kb>` | Generated size in kb  |
1955 | `<filename>` | Path to output file  |
1956
1957 # Description of functions in ngw_api_functions.sh #
1958
1959 ## Function: use_gateway_http ##
1960
1961 Use http for all calls to the gateway. This is set by default.
1962 | arg list |
1963 |--|
1964 | None |
1965
1966 ## Function: use_gateway_https ##
1967
1968 Use https for all calls to the gateway.
1969 | arg list |
1970 |--|
1971 | None |
1972
1973 ## Function: set_gateway_debug ##
1974
1975 Set debug level logging in the gateway
1976 | arg list |
1977 |--|
1978 | None |
1979
1980 ## Function: set_gateway_trace ##
1981
1982 Set debug level logging in the trace
1983 | arg list |
1984 |--|
1985 | None |
1986
1987 ## Function: start_gateway ##
1988
1989 Start the the gateway container in docker or kube depending on start mode
1990 | arg list |
1991 |--|
1992 | None |
1993
1994 ## Function: gateway_a1pms_get_status ##
1995
1996 Sample test of a1pms api (status)
1997 Only response code tested - not payload
1998 | arg list |
1999 |--|
2000 | `<response-code>` |
2001
2002 | parameter | description |
2003 | --------- | ----------- |
2004 | `<response-code>` | Expected http response code |
2005
2006 ## Function: gateway_ics_get_types ##
2007
2008 Sample test of ics api (get types)
2009 Only response code tested - not payload
2010 | arg list |
2011 |--|
2012 | `<response-code>` |
2013
2014 | parameter | description |
2015 | --------- | ----------- |
2016 | `<response-code>` | Expected http response code |
2017
2018 # Description of functions in a1pms_api_functions.sh #
2019
2020 ## General ##
2021
2022 Both A1PMS version 1 and 2 are supported. The version is controlled by the env variable `$A1PMS_VERSION` set in the test env file.
2023 For api function in version 2, an url prefix is added if configured.
2024
2025 ## Function: use_a1pms_rest_http ##
2026
2027 Use http for all API calls to the A1PMS. This is the default.
2028 | arg list |
2029 |--|
2030 | None |
2031
2032 ## Function: use_a1pms_rest_https ##
2033
2034 Use https for all API calls to the A1PMS.
2035 | arg list |
2036 |--|
2037 | None |
2038
2039 ## Function: use_a1pms_dmaap_http ##
2040
2041 Send and recieve all API calls to the A1PMS over Dmaap via the MR over http.
2042 | arg list |
2043 |--|
2044 | None |
2045
2046 ## Function: use_a1pms_dmaap_https ##
2047
2048 Send and recieve all API callss to the A1PMS over Dmaap via the MR over https.
2049 | arg list |
2050 |--|
2051 | None |
2052
2053 ## Function: start_a1pms ##
2054
2055 Start the A1PMS container or corresponding kube resources depending on docker/kube mode.
2056 | arg list |
2057 |--|
2058 | `<logfile-prefix>` |
2059 | (docker) `PROXY\|NOPROXY <config-file>` |
2060 | (kube) `PROXY\|NOPROXY <config-file> [ <data-file> ]` |
2061
2062 | parameter | description |
2063 | --------- | ----------- |
2064 | `PROXY` | Configure with http proxy, if proxy is started  |
2065 | `NOPROXY` | Configure without http proxy  |
2066 | `<config-file>`| Path to application.yaml  |
2067 | `<data-file>` | Optional path to application_configuration.json  |
2068
2069 ## Function: stop_a1pms ##
2070
2071 Stop the a1pms container (docker) or scale it to zero (kubernetes).
2072 | arg list |
2073 |--|
2074 |  None |
2075
2076 ## Function: start_stopped_a1pms ##
2077
2078 Start a previousely stopped a1pms container (docker) or scale it to 1 (kubernetes).
2079 | arg list |
2080 |--|
2081 |  None |
2082
2083 ## Function: prepare_consul_config ##
2084
2085 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')
2086 | arg list |
2087 |--|
2088 | `SDNC|NOSDNC <output-file>` |
2089
2090 | parameter | description |
2091 | --------- | ----------- |
2092 | `SDNC` | Configure with controller |
2093 | `NOSDNC` | Configure without controller |
2094 | `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app'  |
2095
2096 ## Function: a1pms_load_config ##
2097
2098 Load the config into a config map (kubernetes only).
2099 | arg list |
2100 |--|
2101 |  `<data-file>` |
2102
2103 | parameter | description |
2104 | --------- | ----------- |
2105 |  `<data-file>` | Path to application_configuration.json  |
2106
2107 ## Function: set_a1pms_debug ##
2108
2109 Configure the A1PMS log on debug level. The A1PMS must be running.
2110 | arg list |
2111 |--|
2112 | None |
2113
2114 ## Function: set_a1pms_trace ##
2115
2116 Configure the A1PMS log on trace level. The A1PMS must be running.
2117 | arg list |
2118 |--|
2119 | None |
2120
2121 ## Function: use_a1pms_retries ##
2122
2123 Configure the A1PMS to make upto 5 retries if an API calls return any of the specified http return codes.
2124 | arg list |
2125 |--|
2126 | `[<response-code>]*` |
2127
2128 ## Function: check_a1pms_logs ##
2129
2130 Check the A1PMS log for any warnings and errors and print the count of each.
2131 | arg list |
2132 |--|
2133 | None |
2134
2135 ## Function: a1pms_equal ##
2136
2137 Tests if the array length of a json array in the A1PMS simulator is equal to a target value.
2138 Without the timeout, the test sets pass or fail immediately depending on if the array length is equal to the target or not.
2139 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.
2140 See the 'cr' dir for more details.
2141
2142 | arg list |
2143 |--|
2144 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2145
2146 | parameter | description |
2147 | --------- | ----------- |
2148 | `<variable-name>` | Relative url. Example 'json:policy_types' - checks the json array length of the url /policy_types  |
2149 | `<target-value>` | Target value for the length  |
2150 | `<timeout-in-sec>` | Max time to wait for the length to reach the target value  |
2151
2152 ## Function: a1pms_api_get_policies ##
2153
2154 Test of GET '/policies' or V2 GET '/v2/policy-instances' and optional check of the array of returned policies.
2155 To test the response code only, provide the response code parameter as well as the following three parameters.
2156 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.
2157
2158 | arg list |
2159 |--|
2160 | `<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>]*]` |
2161
2162 | arg list V2 |
2163 |--|
2164 | `<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>]*]` |
2165
2166 | parameter | description |
2167 | --------- | ----------- |
2168 | `<response-code>` | Expected http response code |
2169 | `<ric-id>` | Id of the ric  |
2170 | `NORIC` | Indicator that no ric is provided  |
2171 | `<service-id>` | Id of the service  |
2172 | `NOSERVICE` | Indicator that no service id is provided  |
2173 | `<policy-type-id>` |  Id of the policy type |
2174 | `NOTYPE` | Indicator that no type id is provided  |
2175 | `NOID` |  Indicator that no policy id is provided - indicate empty list of policies|
2176 | `<policy-id>` |  Id of the policy |
2177 | `EMPTY` |  Indicate for the special empty policy type |
2178 | `transient` |  Transient, true or false |
2179 | `notification-url` |  Url for notifications |
2180 | `<template-file>` |  Path to the template file for the policy (same template used when creating the policy) |
2181
2182 ## Function: a1pms_api_get_policy ##
2183
2184 Test of GET '/policy' or V2 GET '/v2/policies/{policy_id}' and optional check of the returned json payload.
2185 To test the the response code only, provide the expected response code and policy id.
2186 To test the contents of the returned json payload, add a path to the template file used when creating the policy.
2187
2188 | arg list |
2189 |--|
2190 | `<response-code>  <policy-id> [<template-file>]` |
2191
2192 | arg list V2|
2193 |--|
2194 | `<response-code> <policy-id> [ <template-file> <service-name> <ric-id> <policytype-id>\|NOTYPE <transient> <notification-url>\|NOURL ]` |
2195
2196 | parameter | description |
2197 | --------- | ----------- |
2198 | `<response-code>` | Expected http response code |
2199 | `<policy-id>` |  Id of the policy |
2200 | `<template-file>` |  Path to the template file for the policy (same template used when creating the policy) |
2201 | `<service-id>` | Id of the service  |
2202 | `<ric-id>` | Id of the ric  |
2203 | `<policy-type-id>` |  Id of the policy type |
2204 | `NOTYPE` | Indicator that no type id is provided  |
2205 | `transient` |  Transient, true or false |
2206 | `notification-url` |  Url for notifications |
2207
2208 ## Function: a1pms_api_put_policy ##
2209
2210 Test of PUT '/policy' or V2 PUT '/policies'.
2211 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).
2212
2213 | arg list |
2214 |--|
2215 | `<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]` |
2216
2217 | arg list V2 |
2218 |--|
2219 | `<response-code> <service-name> <ric-id> <policytype-id>\|NOTYPE <policy-id> <transient>\|NOTRANSIENT <notification-url>\|NOURL <template-file> [<count>]` |
2220
2221 | parameter | description |
2222 | --------- | ----------- |
2223 | `<response-code>` | Expected http response code |
2224 | `<service-id>` | Id of the service  |
2225 | `<ric-id>` | Id of the ric  |
2226 | `<policy-type-id>` |  Id of the policy type |
2227 | `<policy-id>` |  Id of the policy. This value shall be a numeric value if more than one policy shall be created |
2228 | `transient>` |  Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provided) |
2229 | `notification-url` |  Url for notifications |
2230 |`NOURL`| Indicator for no url |
2231 | `<template-file>` |  Path to the template file for the policy |
2232 | `<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 |
2233
2234 ## Function: a1pms_api_put_policy_batch ##
2235
2236 This tests the same as function 'a1pms_api_put_policy' except that all put requests are sent to dmaap in one go and then the responses are polled one by one.
2237 If the a1pms api is not configured to use dmaap (see 'use_a1pms_dmaap', 'use_a1pms_rest_http' and 'use_a1pms_rest_https'), an error message is printed.
2238 For arg list and parameters, see 'a1pms_api_put_policy'.
2239
2240 ## Function: a1pms_api_put_policy_parallel ##
2241
2242 This tests the same as function 'a1pms_api_put_policy' except that the policy create is spread out over a number of processes and it only uses the a1pms 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.
2243
2244 | arg list |
2245 |--|
2246 | `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <template-file> <count-per-ric> <number-of-threads>`
2247
2248 | arg list |
2249 |--|
2250 | `<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>`
2251
2252 | parameter | description |
2253 | --------- | ----------- |
2254 | `<response-code>` | Expected http response code |
2255 | `<service-id>` | Id of the service  |
2256 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing  |
2257 | `<number-of-rics>` | The number of rics, assuming the first index is '1'. The index is added to the 'ric-id-base' id  |
2258 | `<policy-type-id>` |  Id of the policy type |
2259 | `<policy-start-id>` |  Id of the policy. This value shall be a numeric value and will be the id of the first policy |
2260 | `transient>` |  Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provide) |
2261 | `notification-url` |  Url for notifications |
2262 | `<template-file>` |  Path to the template file for the policy |
2263 | `<count-per-ric>` |  Number of policies per ric |
2264 | `<number-of-threads>` |  Number of threads (processes) to run in parallel |
2265
2266 ## Function: a1pms_api_delete_policy ##
2267
2268 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.
2269
2270 | arg list |
2271 |--|
2272 | `<response-code> <policy-id> [<count>]`
2273
2274 | parameter | description |
2275 | --------- | ----------- |
2276 | `<response-code>` | Expected http response code |
2277 | `<policy-id>` |  Id of the policy |
2278 | `<count>` |  An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
2279
2280 ## Function: a1pms_api_delete_policy_batch ##
2281
2282 This tests the same as function 'a1pms_api_delete_policy' except that all delete requests are sent to dmaap in one go and then the responses are polled one by one.
2283 If the a1pms api is not configured to used dmaap (see 'use_a1pms_dmaap', 'use_a1pms_rest_http' and 'use_a1pms_rest_https'), an error message is printed.
2284 For arg list and parameters, see 'a1pms_api_delete_policy'.
2285
2286 ## Function: a1pms_api_delete_policy_parallel ##
2287
2288 This tests the same as function 'a1pms_api_delete_policy' except that the policy delete is spread out over a number of processes and it only uses the a1pms 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.
2289
2290 | arg list |
2291 |--|
2292 | `<response-code> <ric-id-base> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>`
2293
2294 | parameter | description |
2295 | --------- | ----------- |
2296 | `<response-code>` | Expected http response code |
2297 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing  |
2298 | `<number-of-rics>` | The number of rics, assuming the first index is '1'  |
2299 | `<policy-start-id>` |  Id of the policy. This value shall be a numeric value and will be the id of the first policy |
2300 | `<count-per-ric>` |  Number of policies per ric |
2301 | `<number-of-threads>` |  Number of threads (processes) to run in parallel |
2302
2303 ## Function: a1pms_api_get_policy_ids ##
2304
2305 Test of GET '/policy_ids' or V2 GET '/v2/policies'.
2306 To test response code only, provide the response code parameter as well as the following three parameters.
2307 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.
2308
2309 | arg list |
2310 |--|
2311 | `<response-code> <ric-id>\|NORIC <service-id>\|NOSERVICE <type-id>\|NOTYPE ([<policy-instance-id]*\|NOID)` |
2312
2313 | parameter | description |
2314 | --------- | ----------- |
2315 | `<response-code>` | Expected http response code |
2316 | `<ric-id>` | Id of the ric  |
2317 | `NORIC` | Indicator that no ric is provided  |
2318 | `<service-id>` | Id of the service  |
2319 | `NOSERVICE` | Indicator that no service id is provided  |
2320 | `type-id>` |  Id of the policy type |
2321 | `NOTYPE` | Indicator that no type id is provided  |
2322 | `NOID` |  Indicator that no policy id is provided - indicate empty list of policies|
2323 | `<policy-instance-id>` |  Id of the policy |
2324
2325 ## Function: a1pms_api_get_policy_schema ##
2326
2327 Test of V2 GET '/v2/policy-types/{policyTypeId}' and optional check of the returned json schema.
2328 To test the response code only, provide the expected response code and policy type id.
2329 To test the contents of the returned json schema, add a path to a schema file to compare with.
2330
2331 | arg list |
2332 |--|
2333 | `<response-code> <policy-type-id> [<schema-file>]` |
2334
2335 | parameter | description |
2336 | --------- | ----------- |
2337 | `<response-code>` | Expected http response code |
2338 | `<policy-type-id>` |  Id of the policy type |
2339 | `<schema-file>` |  Path to the schema file for the policy type |
2340
2341 ## Function: a1pms_api_get_policy_schema ##
2342
2343 Test of GET '/policy_schema' and optional check of the returned json schema.
2344 To test the response code only, provide the expected response code and policy type id.
2345 To test the contents of the returned json schema, add a path to a schema file to compare with.
2346
2347 | arg list |
2348 |--|
2349 | `<response-code> <policy-type-id> [<schema-file>]` |
2350
2351 | parameter | description |
2352 | --------- | ----------- |
2353 | `<response-code>` | Expected http response code |
2354 | `<policy-type-id>` |  Id of the policy type |
2355 | `<schema-file>` |  Path to the schema file for the policy type |
2356
2357 ## Function: a1pms_api_get_policy_schemas ##
2358
2359 Test of GET '/policy_schemas' and optional check of the returned json schemas.
2360 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
2361 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)
2362
2363 | arg list |
2364 |--|
2365 | `<response-code>  <ric-id>\|NORIC [<schema-file>\|NOFILE]*` |
2366
2367 | parameter | description |
2368 | --------- | ----------- |
2369 | `<response-code>` | Expected http response code |
2370 | `<ric-id>` |  Id of the ric |
2371 | `NORIC` |  No ric id given |
2372 | `<schema-file>` |  Path to the schema file for the policy type |
2373 | `NOFILE` |  Indicate the template for an empty type |
2374
2375 ## Function: a1pms_api_get_policy_status ##
2376
2377 Test of GET '/policy_status' or V2 GET '/policies/{policy_id}/status'.
2378
2379 | arg list |
2380 |--|
2381 | `<response-code> <policy-id> (STD\|STD2 <enforce-status>\|EMPTY [<reason>\|EMPTY])\|(OSC <instance-status> <has-been-deleted>)` |
2382
2383 | parameter | description |
2384 | --------- | ----------- |
2385 | `<response-code>` | Expected http response code |
2386 | `<policy-id>` |  Id of the policy |
2387 | `STD` |  Indicator of status of Standarized A1 |
2388 | `STD2` |  Indicator of status of Standarized A1 version 2 |
2389 | `<enforce-status>` |  Enforcement status |
2390 | `<reason>` |  Optional reason |
2391 | `EMPTY` |  Indicator of empty string status or reason |
2392 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
2393 | `<instance-status>` |  Instance status |
2394 | `<has-been-deleted>` |  Deleted status, true or false |
2395
2396 ## Function: a1pms_api_get_policy_types ##
2397
2398 Test of GET '/policy_types' or  V2 GET '/v2/policy-types' and optional check of the returned ids.
2399 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
2400 To test the contents of the returned json payload, add the list of expected policy type id (or 'EMPTY' for the '{}' type)
2401
2402 | arg list |
2403 |--|
2404 | `<response-code> [<ric-id>\|NORIC [<policy-type-id>\|EMPTY [<policy-type-id>]*]]` |
2405
2406 | parameter | description |
2407 | --------- | ----------- |
2408 | `<response-code>` | Expected http response code |
2409 | `<ric-id>` |  Id of the ric |
2410 | `NORIC` |  No ric id given |
2411 | `<policy-type-id>` |  Id of the policy type |
2412 | `EMPTY` |  Indicate the empty type |
2413
2414 ## Function: a1pms_api_get_status ##
2415
2416 Test of GET /status or V2 GET /status
2417
2418 | arg list |
2419 |--|
2420 | `<response-code>` |
2421
2422 | parameter | description |
2423 | --------- | ----------- |
2424 | `<response-code>` | Expected http response code |
2425
2426 ## Function: a1pms_api_get_ric ##
2427
2428 Test of GET '/ric' or V2 GET '/v2/rics/ric'
2429 To test the response code only, provide the expected response code and managed element id.
2430 To test the returned ric id, provide the expected ric id.
2431
2432 | arg list |
2433 |--|
2434 | `<reponse-code> <managed-element-id> [<ric-id>]` |
2435
2436 | arg list V2 |
2437 |--|
2438 | `<reponse-code> <management-element-id>\|NOME <ric-id>\|<NORIC> [<string-of-ricinfo>]` |
2439
2440 | parameter | description |
2441 | --------- | ----------- |
2442 | `<response-code>` | Expected http response code |
2443 | `<managed-element-id>` |  Id of the managed element |
2444 | `NOME` |  Indicator for no ME |
2445 | `ric-id` |  Id of the ric |
2446 | `NORIC` |  Indicator no RIC |
2447 | `string-of-ricinfo` |  String of ric info |
2448
2449 ## Function: a1pms_api_get_rics ##
2450
2451 Test of GET '/rics' or V2 GET '/v2/rics' and optional check of the returned json payload (ricinfo).
2452 To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
2453 To test also the returned payload, add the formatted string of info in the returned payload.
2454 Format of ricinfo: <br>`<ric-id>:<list-of-mes>:<list-of-policy-type-ids>`<br>
2455 Example <br>`<space-separate-string-of-ricinfo> = "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2,4 ricsim_g1_1:me2_........."`
2456
2457 | arg list |
2458 |--|
2459 | `<reponse-code> <policy-type-id>\|NOTYPE [<space-separate-string-of-ricinfo>]` |
2460
2461 | parameter | description |
2462 | --------- | ----------- |
2463 | `<response-code>` | Expected http response code |
2464 | `<policy-type-id>` |  Policy type id of the ric |
2465 | `NOTYPE>` |  No type given |
2466 | `<space-separate-string-of-ricinfo>` |  A space separated string of ric info - needs to be quoted |
2467
2468 ## Function: a1pms_api_put_service ##
2469
2470 Test of PUT '/service' or V2 PUT '/service'.
2471 | arg list |
2472 |--|
2473 | `<response-code>  <service-name> <keepalive-timeout> <callbackurl>` |
2474
2475 | parameter | description |
2476 | --------- | ----------- |
2477 | `<response-code>` | Expected http response code |
2478 | `<service-name>` |  Service name |
2479 | `<keepalive-timeout>` |  Timeout value |
2480 | `<callbackurl>` |  Callback url |
2481
2482 ## Function: a1pms_api_get_services ##
2483
2484 Test of GET '/service' or V2 GET '/v2/services' and optional check of the returned json payload.
2485 To test only the response code, omit all parameters except the expected response code.
2486 To test the returned json, provide the parameters after the response code.
2487
2488 | arg list |
2489 |--|
2490 | `<response-code> [ (<query-service-name> <target-service-name> <keepalive-timeout> <callbackurl>) \| (NOSERVICE <target-service-name> <keepalive-timeout> <callbackurl> [<target-service-name> <keepalive-timeout> <callbackurl>]* )]` |
2491
2492 | parameter | description |
2493 | --------- | ----------- |
2494 | `<response-code>` | Expected http response code |
2495 | `<query-service-name>` |  Service name for the query |
2496 | `<target-service-name>` |  Target service name|
2497 | `<keepalive-timeout>` |  Timeout value |
2498 | `<callbackurl>` |  Callback url |
2499 | `NOSERVICE` |  Indicator of no target service name |
2500
2501 ## Function: a1pms_api_get_service_ids ##
2502
2503 Test of GET '/services' or V2 GET /'v2/services'. Only check of service ids.
2504
2505 | arg list |
2506 |--|
2507 | `<response-code> [<service-name>]*` |
2508
2509 | parameter | description |
2510 | --------- | ----------- |
2511 | `<response-code>` | Expected http response code |
2512 | `<service-name>` |  Service name |
2513
2514 ## Function: a1pms_api_delete_services ##
2515
2516 Test of DELETE '/services' or V2 DELETE '/v2/services/{serviceId}'
2517
2518 | arg list |
2519 |--|
2520 | `<response-code> [<service-name>]*` |
2521
2522 | parameter | description |
2523 | --------- | ----------- |
2524 | `<response-code>` | Expected http response code |
2525 | `<service-name>` |  Service name |
2526
2527 ## Function: a1pms_api_put_services_keepalive ##
2528
2529 Test of PUT '/services/keepalive' or V2 PUT '/v2/services/{service_id}/keepalive'
2530
2531 | arg list |
2532 |--|
2533 | `<response-code> <service-name>` |
2534
2535 | parameter | description |
2536 | --------- | ----------- |
2537 | `<response-code>` | Expected http response code |
2538 | `<service-name>` |  Service name |
2539
2540 ## Function: a1pms_api_put_configuration ##
2541
2542 Test of PUT '/v2/configuration'
2543
2544 | arg list |
2545 |--|
2546 | `<response-code> <config-file>` |
2547
2548 | parameter | description |
2549 | --------- | ----------- |
2550 | `<response-code>` | Expected http response code |
2551 | `<config-file>` |  Path json config file |
2552
2553 ## Function: a1pms_api_get_configuration ##
2554
2555 Test of GET '/v2/configuration'
2556
2557 | arg list |
2558 |--|
2559 | `<response-code> [<config-file>]` |
2560
2561 | parameter | description |
2562 | --------- | ----------- |
2563 | `<response-code>` | Expected http response code |
2564 | `<config-file>` |  Path json config file to compare the retrieved config with |
2565
2566 ## Function: a1pms_kube_pvc_reset ##
2567 Admin reset to remove all policies and services
2568 All types and instances etc are removed - types and instances in a1 sims need to be removed separately
2569 NOTE - only works in kubernetes and the pod should not be running
2570
2571 | arg list |
2572 |--|
2573 | None |
2574
2575
2576 # Description of functions in prodstub_api_functions.sh #
2577
2578 ## Function: use_prod_stub_http ##
2579
2580 Use http for the API.  The admin API is not affected. This is the default protocol.
2581 | arg list |
2582 |--|
2583 | None |
2584
2585 ## Function: use_prod_stub_https ##
2586
2587 Use https for the API. The admin API is not affected.
2588 | arg list |
2589 |--|
2590 | None |
2591
2592 ## Function: start_prod_stub ##
2593
2594 Start the Producer stub container in docker or kube depending on start mode
2595 | arg list |
2596 |--|
2597 | None |
2598
2599 ## Function: prodstub_arm_producer ##
2600
2601 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
2602
2603 | arg list |
2604 |--|
2605 | `<response-code> <producer-id> [<forced_response_code>]` |
2606
2607 | parameter | description |
2608 | --------- | ----------- |
2609 | `<response-code>` | Expected http response code |
2610 | `<producer-id>` | Id of the producer  |
2611 | `<forced_response_code>` | Forced response code for the producer callback url |
2612
2613 ## Function: prodstub_arm_job_create ##
2614
2615 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.
2616
2617 | arg list |
2618 |--|
2619 | `<response-code> <job-id> [<forced_response_code>]` |
2620
2621 | parameter | description |
2622 | --------- | ----------- |
2623 | `<response-code>` | Expected http response code |
2624 | `<job-id>` | Id of the job  |
2625 | `<forced_response_code>` | Forced response code for the create callback url |
2626
2627 ## Function: prodstub_arm_job_delete ##
2628
2629 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.
2630
2631 | arg list |
2632 |--|
2633 | `<response-code> <job-id> [<forced_response_code>]` |
2634
2635 | parameter | description |
2636 | --------- | ----------- |
2637 | `<response-code>` | Expected http response code |
2638 | `<job-id>` | Id of the job  |
2639 | `<forced_response_code>` | Forced response code for the delete callback url |
2640
2641 ## Function: prodstub_arm_type ##
2642
2643 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
2644
2645 | arg list |
2646 |--|
2647 | `<response-code> <producer-id> <type-id>` |
2648
2649 | parameter | description |
2650 | --------- | ----------- |
2651 | `<response-code>` | Expected http response code |
2652 | `<producer-id>` | Id of the producer  |
2653 | `<type-id>` | Id of the type  |
2654
2655 ## Function: prodstub_disarm_type ##
2656
2657 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
2658
2659 | arg list |
2660 |--|
2661 | `<response-code> <producer-id> <type-id>` |
2662
2663 | parameter | description |
2664 | --------- | ----------- |
2665 | `<response-code>` | Expected http response code |
2666 | `<producer-id>` | Id of the producer  |
2667 | `<type-id>` | Id of the type  |
2668
2669 ## Function: prodstub_check_jobdata ##
2670
2671 Check a job in the prodstub towards the list of provided parameters.
2672
2673 | arg list |
2674 |--|
2675 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2676
2677 | parameter | description |
2678 | --------- | ----------- |
2679 | `<response-code>` | Expected http response code |
2680 | `<producer-id>` | Id of the producer  |
2681 | `<job-id>` | Id of the job  |
2682 | `<type-id>` | Id of the type  |
2683 | `<target-url>` | Target url for data delivery  |
2684 | `<job-owner>` | Id of the job owner  |
2685 | `<template-job-file>` | Path to a job template file  |
2686
2687 ## Function: prodstub_check_jobdata_2 ##
2688
2689 Check a job in the prodstub towards the list of provided parameters.
2690
2691 | arg list |
2692 |--|
2693 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2694
2695 | parameter | description |
2696 | --------- | ----------- |
2697 | `<response-code>` | Expected http response code |
2698 | `<producer-id>` | Id of the producer  |
2699 | `<job-id>` | Id of the job  |
2700 | `<type-id>` | Id of the type  |
2701 | `<target-url>` | Target url for data delivery  |
2702 | `<job-owner>` | Id of the job owner  |
2703 | `<template-job-file>` | Path to a job template file  |
2704
2705 ## Function: prodstub_check_jobdata_3 ##
2706
2707 Check a job in the prodstub towards the list of provided parameters.
2708
2709 | arg list |
2710 |--|
2711 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <job-owner> <template-job-file>` |
2712
2713 | parameter | description |
2714 | --------- | ----------- |
2715 | `<response-code>` | Expected http response code |
2716 | `<producer-id>` | Id of the producer  |
2717 | `<job-id>` | Id of the job  |
2718 | `<type-id>` | Id of the type  |
2719 | `<target-url>` | Target url for data delivery  |
2720 | `<job-owner>` | Id of the job owner  |
2721 | `<template-job-file>` | Path to a job template file  |
2722
2723 ## Function: prodstub_delete_jobdata ##
2724
2725 Delete the job parameters, job data, for a job.
2726
2727 | arg list |
2728 |--|
2729 | `<response-code> <producer-id> <job-id>` |
2730
2731 | parameter | description |
2732 | --------- | ----------- |
2733 | `<response-code>` | Expected http response code |
2734 | `<producer-id>` | Id of the producer  |
2735 | `<job-id>` | Id of the job  |
2736
2737 ## Function: prodstub_equal ##
2738
2739 Tests if a variable value in the prodstub is equal to a target value.
2740 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2741 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.
2742
2743 | arg list |
2744 |--|
2745 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2746
2747 | parameter | description |
2748 | --------- | ----------- |
2749 | `<variable-name>` | Variable name in the prostub  |
2750 | `<target-value>` | Target value for the variable  |
2751 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
2752
2753 # Description of functions in rc_api_function.sh #
2754
2755 ## Function: use_rapp_catalogue_http ##
2756
2757 Use http for the API. This is the default protocol.
2758 | arg list |
2759 |--|
2760 | None |
2761
2762 ## Function: use_rapp_catalogue_https ##
2763
2764 Use https for the API.
2765 | arg list |
2766 |--|
2767 | None |
2768
2769 ## Function: start_rapp_catalogue ##
2770
2771 Start the rapp catalogue container in docker or kube depending on start mode
2772 | arg list |
2773 |--|
2774 | None |
2775
2776 ## Function: rc_equal ##
2777
2778 Tests if a variable value in the RAPP Catalogue is equal to a target value.
2779 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2780 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.
2781 See the 'cr' dir for more details.
2782 | arg list |
2783 |--|
2784 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2785
2786 | parameter | description |
2787 | --------- | ----------- |
2788 | `<variable-name>` | Variable name in the RC  |
2789 | `<target-value>` | Target value for the variable  |
2790 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
2791
2792 ## Function: rapp_cat_api_get_services ##
2793
2794 Check all registered services.
2795
2796 | arg list |
2797 |--|
2798 | `<response-code> [(<service-id> <version> <display-name> <description>)+ \| EMPTY ]` |
2799
2800 | parameter | description |
2801 | --------- | ----------- |
2802 | `<response-code>` | Expected http response code |
2803 | `<service-id>` | Id of the service  |
2804 | `<version>` | Version of the service  |
2805 | `<display-name>` | Dislay name of the service  |
2806 | `<description>` | Description of the service  |
2807 | `EMPTY` | Indicator for an empty list  |
2808
2809 ## Function: rapp_cat_api_put_service ##
2810
2811 Register a services.
2812
2813 | arg list |
2814 |--|
2815 | `<response-code> <service-id> <version> <display-name> <description>` |
2816
2817 | parameter | description |
2818 | --------- | ----------- |
2819 | `<response-code>` | Expected http response code |
2820 | `<service-id>` | Id of the service  |
2821 | `<version>` | Version of the service  |
2822 | `<display-name>` | Dislay name of the service  |
2823 | `<description>` | Description of the service  |
2824
2825 ## Function: rapp_cat_api_get_service ##
2826
2827 Check a registered service.
2828
2829 | arg list |
2830 |--|
2831 | `<response-code> <service-id> <version> <display-name> <description>` |
2832
2833 | parameter | description |
2834 | --------- | ----------- |
2835 | `<response-code>` | Expected http response code |
2836 | `<service-id>` | Id of the service  |
2837 | `<version>` | Version of the service  |
2838 | `<display-name>` | Dislay name of the service  |
2839 | `<description>` | Description of the service  |
2840
2841 ## Function: rapp_cat_api_delete_service ##
2842
2843 Check a registered service.
2844
2845 | arg list |
2846 |--|
2847 | `<response-code> <service-id>` |
2848
2849 | parameter | description |
2850 | --------- | ----------- |
2851 | `<response-code>` | Expected http response code |
2852 | `<service-id>` | Id of the service  |
2853
2854 # Description of functions in ricsim_api_functions.sh #
2855
2856 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
2857
2858 ## Function: use_simulator_http ##
2859
2860 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.
2861 | arg list |
2862 |--|
2863 | None |
2864
2865 ## Function: use_simulator_https ##
2866
2867 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.
2868 | arg list |
2869 |--|
2870 | None |
2871
2872 ## Function: start_ric_simulators ##
2873
2874 Start a group of simulator where a group may contain 1 more simulators. Started in docker or kube depending on start mode
2875 | arg list |
2876 |--|
2877 | `ricsim_g1\|ricsim_g2\|ricsim_g3 <count> <interface-id>` |
2878
2879 | parameter | description |
2880 | --------- | ----------- |
2881 | `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  |
2882 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
2883 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
2884
2885 ## Function: get_kube_sim_host ##
2886
2887 Translate ric name to kube host name.
2888 | arg list |
2889 |--|
2890 | `<ric-name>` |
2891
2892 | parameter | description |
2893 | --------- | ----------- |
2894 | `<ric-name>` | The name of the ric to translate into a host name (ip) |
2895
2896 ## Function: generate_policy_uuid ##
2897
2898 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
2899 UUID is then automatically added to the policy id in GET/PUT/DELETE.
2900 | arg list |
2901 |--|
2902 | None |
2903
2904 ## Function: sim_equal ##
2905
2906 Tests if a variable value in the RIC simulator is equal to a target value.
2907 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
2908 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.
2909 See the 'a1-interface' repo for more details.
2910
2911 | arg list |
2912 |--|
2913 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2914
2915 | parameter | description |
2916 | --------- | ----------- |
2917 | `<variable-name>` | Variable name in the ric simulator  |
2918 | `<target-value>` | Target value for the variable  |
2919 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
2920
2921 ## Function: sim_print ##
2922
2923 Prints the value of a variable in the RIC simulator.
2924 See the 'a1-interface' repo for more details.
2925
2926 | arg list |
2927 |--|
2928 | `<variable-name>` |
2929
2930 | parameter | description |
2931 | --------- | ----------- |
2932 | `<variable-name>` | Variable name in the RIC simulator  |
2933
2934 ## Function: sim_contains_str ##
2935
2936 Tests if a variable value in the RIC simulator contains a target string.
2937 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
2938 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.
2939 See the 'a1-interface' repo for more details.
2940
2941 | arg list |
2942 |--|
2943 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
2944
2945 | parameter | description |
2946 | --------- | ----------- |
2947 | `<variable-name>` | Variable name in the ric simulator  |
2948 | `<target-value>` | Target substring for the variable  |
2949 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value  |
2950
2951 ## Function: sim_put_policy_type ##
2952
2953 Loads a policy type to the simulator
2954
2955 | arg list |
2956 |--|
2957 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
2958
2959 | parameter | description |
2960 | --------- | ----------- |
2961 | `<response-code>` | Expected http response code |
2962 | `<ric-id>` |  Id of the ric |
2963 | `<policy-type-id>` |  Id of the policy type |
2964 | `<policy-type-file>` |  Path to the schema file of the policy type |
2965
2966 ## Function: sim_delete_policy_type ##
2967
2968 Deletes a policy type from the simulator
2969
2970 | arg list |
2971 |--|
2972 | `<response-code> <ric-id> <policy_type_id>` |
2973
2974 | parameter | description |
2975 | --------- | ----------- |
2976 | `<response-code>` | Expected http response code |
2977 | `<ric-id>` |  Id of the ric |
2978 | `<policy-type-id>` |  Id of the policy type |
2979
2980 ## Function: sim_post_delete_instances ##
2981
2982 Deletes all instances (and status), for one ric
2983
2984 | arg list |
2985 |--|
2986 | `<response-code> <ric-id>` |
2987
2988 | parameter | description |
2989 | --------- | ----------- |
2990 | `<response-code>` | Expected http response code |
2991 | `<ric-id>` |  Id of the ric |
2992
2993 ## Function: sim_post_delete_all ##
2994
2995 Deletes all types, instances (and status), for one ric
2996
2997 | arg list |
2998 |--|
2999 | `<response-code> <ric-id>` |
3000
3001 | parameter | description |
3002 | --------- | ----------- |
3003 | `<response-code>` | Expected http response code |
3004 | `<ric-id>` |  Id of the ric |
3005
3006 ## Function: sim_post_forcedresponse ##
3007
3008 Sets (or resets) response code for next (one) A1 message, for one ric.
3009 The intention is to simulate error response on the A1 interface.
3010
3011 | arg list |
3012 |--|
3013 | `<response-code> <ric-id> [<forced_response_code>]`|
3014
3015 | parameter | description |
3016 | --------- | ----------- |
3017 | `<response-code>` | Expected http response code |
3018 | `<ric-id>` |  Id of the ric |
3019 | `<forced_response_code>` |  Http response code to send |
3020
3021 ## Function: sim_post_forcedelay ##
3022
3023 Sets (or resets) A1 response delay, for one ric
3024 The intention is to delay responses on the A1 interface. Setting remains until removed.
3025
3026 | arg list |
3027 |--|
3028 | `<response-code> <ric-id> [<delay-in-seconds>]`|
3029
3030 | parameter | description |
3031 | --------- | ----------- |
3032 | `<response-code>` | Expected http response code |
3033 | `<ric-id>` |  Id of the ric |
3034 | `<delay-in-seconds>` |  Delay in seconds. If omitted, the delay is removed |
3035
3036 # Description of functions in sdnc_api_functions.sh #
3037
3038 The file contains a selection of the possible API tests towards the SDNC (a1-controller)
3039
3040 ## Function: use_sdnc_http ##
3041
3042 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.
3043 | arg list |
3044 |--|
3045 | None |
3046
3047 ## Function: use_sdnc_https ##
3048
3049 Use https for all API calls towards the SDNC A1 Controller. Note that this function shall be called before preparing the config for Consul.
3050 | arg list |
3051 |--|
3052 | None |
3053
3054 ## Function: start_sdnc ##
3055
3056 Start the SDNC A1 Controller container and its database container
3057 | arg list |
3058 |--|
3059 | None |
3060
3061 ## Function: stop_sdnc ##
3062
3063 Stop the SDNC A1 Controller container and its database container
3064 | arg list |
3065 |--|
3066 | None |
3067
3068 ## Function: start_stopped_sdnc ##
3069
3070 Start a previously stopped SDNC
3071 | arg list |
3072 |--|
3073 | None |
3074
3075 ## Function: check_sdnc_logs ##
3076
3077 Check the SDNC log for any warnings and errors and print the count of each.
3078 | arg list |
3079 |--|
3080 | None |
3081
3082 ## Function: controller_api_get_A1_policy_ids ##
3083
3084 Test of GET policy ids towards OSC or STD type simulator.
3085 To test response code only, provide the response code, 'OSC' + policy type or 'STD'
3086 To test the response payload, include the ids of the expexted response.
3087
3088 | arg list |
3089 |--|
3090 | `<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) \| ( STD <ric-id> [ <policy-id> [<policy-id>]* ]` |
3091
3092 | parameter | description |
3093 | --------- | ----------- |
3094 | `<response-code>` | Expected http response code |
3095 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
3096 | `<ric-id>` | Id of the ric  |
3097 | `policy-type-id>` |  Id of the policy type |
3098 | `<policy-id>` |  Id of the policy |
3099 | `STD` |  Indicator of status of Standarized A1 |
3100
3101 ## Function: controller_api_get_A1_policy_type ##
3102
3103 Test of GET a policy type (OSC only)
3104
3105 | arg list |
3106 |--|
3107 | `<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]` |
3108
3109 | parameter | description |
3110 | --------- | ----------- |
3111 | `<response-code>` | Expected http response code |
3112 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
3113 | `<ric-id>` | Id of the ric  |
3114 | `policy-type-id>` |  Id of the policy type |
3115 | `policy-type-file>` |  Optional schema file to compare the returned type with |
3116
3117 ## Function: controller_api_delete_A1_policy ##
3118
3119 Deletes a policy instance
3120
3121 | arg list |
3122 |--|
3123 | `(STD <ric-id> <policy-id>) \| (OSC <ric-id> <policy-type-id> <policy-id>)` |
3124
3125 | parameter | description |
3126 | --------- | ----------- |
3127 | `<response-code>` | Expected http response code |
3128 | `STD` |  Indicator of status of Standarized A1 |
3129 | `<ric-id>` | Id of the ric  |
3130 | `<policy-id>` |  Id of the policy |
3131 | `policy-type-id>` |  Id of the policy type |
3132 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
3133 | `policy-type-file>` |  Optional schema file to compare the returned type with |
3134
3135 ## Function: controller_api_put_A1_policy ##
3136
3137 Creates a policy instance
3138
3139 | arg list |
3140 |--|
3141 | `<response-code> (STD <ric-id> <policy-id> <template-file> ) \| (OSC <ric-id> <policy-type-id> <policy-id> <template-file>)` |
3142
3143 | parameter | description |
3144 | --------- | ----------- |
3145 | `<response-code>` | Expected http response code |
3146 | `STD` |  Indicator of status of Standarized A1 |
3147 | `<ric-id>` | Id of the ric  |
3148 | `<policy-id>` |  Id of the policy |
3149 | `<template-file>` |  Path to the template file of the policy|
3150 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
3151 | `<policy-type-id>` |  Id of the policy type |
3152
3153 ## Function: controller_api_get_A1_policy_status ##
3154
3155 Checks the status of a policy
3156
3157  arg list |
3158 |--|
3159 | `<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) \| (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)` |
3160
3161 | parameter | description |
3162 | --------- | ----------- |
3163 | `<response-code>` | Expected http response code |
3164 | `STD` |  Indicator of status of Standarized A1 |
3165 | `<ric-id>` | Id of the ric  |
3166 | `<policy-id>` |  Id of the policy |
3167 | `<enforce-status>` |  Enforcement status |
3168 | `<reason>` |  Optional reason |
3169 | `OSC` |  Indicator of status of Non-Standarized OSC A1 |
3170 | `<policy-type-id>` |  Id of the policy type |
3171 | `<instance-status>` |  Instance status |
3172 | `<has-been-deleted>` |  Deleted status, true or false |
3173
3174
3175 ## License
3176
3177 Copyright (C) 2020 Nordix Foundation. All rights reserved.
3178 Licensed under the Apache License, Version 2.0 (the "License");
3179 you may not use this file except in compliance with the License.
3180 You may obtain a copy of the License at
3181
3182      http://www.apache.org/licenses/LICENSE-2.0
3183
3184 Unless required by applicable law or agreed to in writing, software
3185 distributed under the License is distributed on an "AS IS" BASIS,
3186 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3187 See the License for the specific language governing permissions and
3188 limitations under the License.