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