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