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