2 This dir contains most scripts needed for the auto-test environment. There are scripts with functions to adapt to the apis of the components of the Non-RT RIC; Policy Agent, A1 Controller and Ric (A1) simulator.
3 Some of the scripts can also be used for other kinds of tests, for example basic tests.
5 ## Overview for common test scripts and files ##
8 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.
9 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'. There are preconfigured env files, pattern 'test_env*.sh', in ../common.
11 `testcase_common.sh` \
12 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.
13 The included functions are described in detail further below.
15 `testsuite_common.sh` \
16 Common functions for running two or more auto test scripts as a suite.
19 A common curl based function for the agent and ecs apis.
21 `agent_api_functions.sh` \
22 Contains functions for adapting towards the Policy Agent API, also via dmaap (using a message-router stub interface)
24 `ecs_api_functions.sh` \
25 Contains functions for adapting towards the ECS API
27 `controller_api_functions.sh` \
28 Contains functions for adaping towards the A1-controller API.
30 `ricsimulator_api_functions.sh` \
31 Contains functions for adapting towards the RIC (A1) simulator admin API.
33 `prodstub_api_functions.sh` \
34 Contains functions for adapting towards the Producer stub interface - simulates a producer.
37 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'.
39 `count_json_elements.py` \
40 A python script returning the number of items in a json array.
42 `create_policies_process.py` \
43 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.
45 `create_rics_json.py` \
46 A python script to create a json file from a formatted string of ric info. Helper for the test enviroment.
48 `delete_policies_process.py` \
49 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.
51 `extract_sdnc_reply.py` \
52 A python script to extract the information from an sdnc (A1 Controller) reply json. Helper for the test environment.
55 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)
59 # Description of functions in testcase_common.sh #
62 The script can be started with these arguments
66 | `local|remote|remote-remove [auto-clean] [--stop-at-error] [--ricsim-prefix <prefix> ] [ --env-file <environment-filename> ] [--use-local-image <app-nam> [<app-name>]*]` |
68 | parameter | description |
70 | `local` | only locally built images (in local docker respository) will be used for the Non-RT RIC components. CBS, Consul, DB will still use remote nexus images |
71 | `remote` | only remote images from nexus will be used. Images pulled if not present in local docker repository |
72 | `remote-remove` | same as remote but all images are removed first so that fresh images are pulled when running |
73 | `auto-clean` | all containers will be automatically stopped and removed when the test case is complete. Requires the function 'auto_clean_containers' to be included last in the applicable auto-test script |
74 | `--stop-at-error` | intended for debugging and make the script stop at first 'FAIL' and save all logs with a prefix 'STOP_AT_ERROR' |
75 | `--ricsim-prefix <prefix>` | use another prefix for the ric simulator container name than the standard '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). |
76 | `--env-file` | point to a file with environment variables (the previous default, test_env.sh, replaced with one env file for each branch in test/common) |
77 | `--use-local-image <app-nam> [<app-name>]*` | nnly applicable when running as 'remote' or 'remote-remove'. Mainly for debugging when a locally built image shall be used together with other remote images from nexus.Accepts a space separated list of PA, CP, RICSIM, SDNC for Policy Agent, Control Panel, A1-controller and the Ric simulator |
80 ## Function: print_result ##
81 Print a test report of an auto-test script.
86 ## Function: start_timer ##
87 Start a timer for time measurement. Only one timer can be running.
90 | None - but any args will be printed (It is good practice to use same args for this function as for the `print_timer`) |
92 ## Function: print_timer ##
93 Print the value of the timer (in seconds) previously started by 'start_timer'. (Note that timer is still running after this function). The result of the timer as well as the args to the function will also be printed in the test report.
96 | `<timer-message-to-print>` |
98 | parameter | description |
99 | --------- | ----------- |
100 | `<timer-message-to-print>` | Any text message to be printed along with the timer result.(It is good practice to use same args for this function as for the `start_timer`) |
102 ## Function: print_and_reset_timer ##
103 Print the value of the timer (in seconds) previously started by 'start_timer'. Also reset the timer to 0. The result of the timer as well as the args to the function will also be printed in the test report.
106 | `<timer-message-to-print>` |
108 | parameter | description |
109 | --------- | ----------- |
110 | `<timer-message-to-print>` | Any text message to be printed along with the timer result.(It is good practice to use same args for this function as for the `start_timer`) |
112 ## Function: deviation ##
113 Mark a test as a deviation from the requirements. The list of deviations will be printed in the test report.
116 | `<deviation-message-to-print>` |
118 | parameter | description |
119 | --------- | ----------- |
120 | `<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 |
122 ## Function: clean_containers ##
123 Stop and remove all containers. Containers not part of the test are not affected.
128 ## Function: auto_clean_containers ##
129 Stop and remove all containers. Containers not part of the test are not affected. 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.
134 ## Function: sleep_wait ##
135 Make the script sleep for a number of seconds.
138 | `<sleep-time-in-sec> [<any-text-in-quotes-to-be-printed>]` |
140 | parameter | description |
141 | --------- | ----------- |
142 | `<sleep-time-in-sec> ` | Number of seconds to sleep |
143 | `<any-text-in-quotes-to-be-printed>` | Optional. The text will be printed, if present |
145 ## Function: generate_uuid ##
146 Geneate a UUID prefix to use along with the policy instance number when creating/deleting policies. Sets the env var UUID.
147 UUID is then automatically added to the policy id in GET/PUT/DELETE.
152 ## Function: consul_config_app ##
153 Function to load a json config from a file into consul for the Policy Agent
157 | `<json-config-file>` |
159 | parameter | description |
160 | --------- | ----------- |
161 | `<json-config-file>` | The path to the json file to be loaded to Consul/CBS |
163 ## Function: prepare_consul_config ##
164 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')
167 | `<deviation-message-to-print>` |
169 | parameter | description |
170 | --------- | ----------- |
171 | `SDNC|NOSDNC` | Configure based on a1-controller (SNDC) or without a controller/adapter (NOSDNC) |
172 | `<output-file>` | The path to the json output file containing the prepared config. This file is used in 'consul_config_app' |
174 ## Function: start_consul_cbs ##
175 Start the Consul and CBS containers
180 ## Function: use_simulator_http ##
181 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.
186 ## Function: use_simulator_https ##
187 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.
192 ## Function: start_ric_simulators ##
193 Start a group of simulator where a group may contain 1 more simulators.
196 | `ricsim_g1|ricsim_g2|ricsim_g3 <count> <interface-id>` |
198 | parameter | description |
199 | --------- | ----------- |
200 | `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 |
201 |`<count>`| And integer, 1 or greater. Specifies the number of simulators to start|
202 |`<interface-id>`| Shall be the interface id of the simulator. See the repo 'a1-interface' for the available ids. |
204 ## Function: start_control_panel ##
205 Start the Control Panel container
210 ## Function: start_sdnc ##
211 Start the SDNC A1 Controller container and its database container
216 ## Function: use_sdnc_http ##
217 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.
222 ## Function: use_sdnc_http ##
223 Use https for all API calls towards the SDNC A1 Controller. Note that this function shall be called before preparing the config for Consul.
228 ## Function: start_mr ##
229 Start the Message Router stub interface container
234 ## Function: use_mr_http ##
235 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.
240 ## Function: use_mr_https ##
241 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.
246 ## Function: start_cr ##
247 Start the Callback Receiver container
252 ## Function: use_cr_http ##
253 Use http for getting event from CR. The admin API is not affected. This is the default.
258 ## Function: use_cr_https ##
259 Use https for getting event from CR. The admin API is not affected.
260 Note: Not yet used as callback event is not fully implemented/deciced.
265 ## Function: start_prod_stub ##
266 Start the Producer stubb container
271 ## Function: use_prod_stub_http ##
272 Use http for the API. The admin API is not affected. This is the default protocol.
277 ## Function: use_prod_stub_https ##
278 Use https for the API. The admin API is not affected.
283 ## Function: start_policy_agent ##
284 Start the Policy Agent container. If the test script is configured to use a stand alone Policy Agent (for example other container or stand alone app) the script will prompt for starting the stand alone Policy Agent.
289 ## Function: use_agent_stand_alone ##
290 Configure to run the Policy Agent as a stand alone container or app. See also 'start_policy_agent'
295 ## Function: use_agent_rest_http ##
296 Use http for all API calls to the Policy Agent. This is the default.
301 ## Function: use_agent_rest_https ##
302 Use https for all API calls to the Policy Agent.
307 ## Function: use_agent_dmaap_http ##
308 Send and recieve all API calls to the Policy Agent over Dmaap via the MR over http.
313 ## Function: use_agent_dmaap_https ##
314 Send and recieve all API calls to the Policy Agent over Dmaap via the MR over https.
319 ## Function: set_agent_debug ##
320 Configure the Policy Agent log on debug level. The Policy Agent must be running.
325 ## Function: set_agent_trace ##
326 Configure the Policy Agent log on trace level. The Policy Agent must be running.
331 ## Function: use_agent_retries ##
332 Configure the Policy Agent to make upto 5 retries if an API calls return any of the specified http return codes.
335 | `[<response-code>]*` |
337 | parameter | description |
338 | --------- | ----------- |
339 | `[<response-code>]*` | A space separated list of http response codes, may be empty to reset to 'no codes'. |
341 ## Function: start_ecs ##
342 Start the ECS container.
347 ## Function: use_ecs_rest_http ##
348 Use http for all API calls to the ECS. This is the default protocol.
353 ## Function: use_ecs_rest_https ##
354 Use https for all API calls to the ECS.
359 ## Function: use_ecs_dmaap_http ##
360 Send and recieve all API calls to the ECS over Dmaap via the MR using http.
365 ## Function: use_ecs_dmaap_https ##
366 Send and recieve all API calls to the ECS over Dmaap via the MR using https.
371 ## Function: set_ecs_debug ##
372 Configure the ECS log on debug level. The ECS must be running.
377 ## Function: set_ecs_trace ##
378 Configure the ECS log on trace level. The ECS must be running.
383 ## Function: check_policy_agent_logs ##
384 Check the Policy Agent log for any warnings and errors and print the count of each.
389 ## Function: check_ecs_logs ##
390 Check the ECS log for any warnings and errors and print the count of each.
395 ## Function: check_control_panel_logs ##
396 Check the Control Panel log for any warnings and errors and print the count of each.
401 ## Function: check_sdnc_logs ##
402 Check the SDNC log for any warnings and errors and print the count of each.
407 ## Function: store_logs ##
408 Take a snap-shot of all logs for all running containers and stores them in `./logs/<ATC-id>`. All logs will get the specified prefix in the file name. In general, one of the last steps in an auto-test script shall be to call this function. If logs shall be taken several times during a test script, different prefixes shall be used each time.
411 | `<logfile-prefix>` |
413 | parameter | description |
414 | --------- | ----------- |
415 | `<logfile-prefix>` | Log file prefix |
418 ## Function: cr_equal ##
419 Tests if a variable value in the Callback Receiver (CR) simulator is equal to a target value.
420 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
421 With the timeout, the test waits up to the timeout seconds before setting pass or fail depending on if the variable value becomes equal to the target value or not.
422 See the 'cr' dir for more details.
425 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
427 | parameter | description |
428 | --------- | ----------- |
429 | `<variable-name>` | Variable name in the CR |
430 | `<target-value>` | Target value for the variable |
431 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
433 ## Function: mr_equal ##
434 Tests if a variable value in the Message Router (MR) simulator is equal to a target value.
435 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
436 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.
437 See the 'mrstub' dir for more details.
440 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
442 | parameter | description |
443 | --------- | ----------- |
444 | `<variable-name>` | Variable name in the MR |
445 | `<target-value>` | Target value for the variable |
446 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
448 ## Function: mr_greater ##
449 Tests if a variable value in the Message Router (MR) simulator is greater than a target value.
450 Without the timeout, the test sets pass or fail immediately depending on if the variable is greater than the target or not.
451 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.
452 See the 'mrstub' dir for more details.
455 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
457 | parameter | description |
458 | --------- | ----------- |
459 | `<variable-name>` | Variable name in the MR |
460 | `<target-value>` | Target value for the variable |
461 | `<timeout-in-sec>` | Max time to wait for the variable to become grater than the target value |
463 ## Function: mr_read ##
464 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.
465 See the 'mrstub' dir for more details.
468 | `<variable-name>` |
470 | parameter | description |
471 | --------- | ----------- |
472 | `<variable-name>` | Variable name in the MR |
474 ## Function: mr_print ##
475 Prints the value of a variable in the Message Router (MR) simulator.
476 See the 'mrstub' dir for more details.
479 | `<variable-name>` |
481 | parameter | description |
482 | --------- | ----------- |
483 | `<variable-name>` | Variable name in the MR |
485 ## Function: indent1 ##
486 Indent every line of a command output with one space char.
491 ## Function: indent2 ##
492 Indent every line of a command output with two space chars.
497 # Description of functions in testsuite_common.sh #
499 ## Function: suite_setup ##
500 Sets up the test suite and prints out a heading.
506 Print out the overall result of the executed test cases.
511 # Description of functions in agent_api_function.sh #
513 ## Function: api_equal() ##
515 Tests if the array length of a json array in the Policy Agent simulator is equal to a target value.
516 Without the timeout, the test sets pass or fail immediately depending on if the array length is equal to the target or not.
517 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.
518 See the 'cr' dir for more details.
521 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
523 | parameter | description |
524 | --------- | ----------- |
525 | `<variable-name>` | Relative url. Example 'json:policy_types' - checks the json array length of the url /policy_types |
526 | `<target-value>` | Target value for the length |
527 | `<timeout-in-sec>` | Max time to wait for the length to reach the target value |
529 ## Function: api_get_policies() ##
530 Test of GET '/policies' and optional check of the array of returned policies.
531 To test the response code only, provide the response code parameter as well as the following three parameters.
532 To also test the response payload add the 'NOID' for an expected empty array or repeat the last five parameters for each expected policy.
535 | `<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>]*]` |
537 | parameter | description |
538 | --------- | ----------- |
539 | `<response-code>` | Expected http response code |
540 | `<ric-id>` | Id of the ric |
541 | `NORIC` | Indicator that no ric is provided |
542 | `<service-id>` | Id of the service |
543 | `NOSERVICE` | Indicator that no service id is provided |
544 | `<policy-type-id>` | Id of the policy type |
545 | `NOTYPE` | Indicator that no type id is provided |
546 | `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
547 | `<policy-id>` | Id of the policy |
548 | `EMPTY` | Indicate for the special empty policy type |
549 | `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
552 ## Function: api_get_policy() ##
553 Test of GET /policy and optional check of the returned json payload.
554 To test the the response code only, provide the expected response code and policy id.
555 To test the contents of the returned json payload, add a path to the template file used when creating the policy.
558 | `<response-code> <policy-id> [<template-file>]` |
560 | parameter | description |
561 | --------- | ----------- |
562 | `<response-code>` | Expected http response code |
563 | `<policy-id>` | Id of the policy |
564 | `<template-file>` | Path to the template file for the policy (same template used when creating the policy) |
566 ## Function: api_put_policy() ##
567 Test of PUT '/policy'.
568 To test the response code only, provide the response code parameter as well as the following three parameters.
569 To also test the response payload add the 'NOID' for an expected empty array or repeat the last five parameters for each expected policy.
572 | `<response-code> <service-name> <ric-id> <policytype-id> <policy-id> <transient> <template-file> [<count>]` |
574 | parameter | description |
575 | --------- | ----------- |
576 | `<response-code>` | Expected http response code |
577 | `<service-id>` | Id of the service |
578 | `<ric-id>` | Id of the ric |
579 | `<policy-type-id>` | Id of the policy type |
580 | `<policy-id>` | Id of the policy. This value shall be a numeric value if more than one policy shall be created |
581 | `transient>` | Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provided) |
582 | `<template-file>` | Path to the template file for the policy |
583 | `<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 |
585 ## Function: api_put_policy_batch() ##
586 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.
587 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.
588 For arg list and parameters, see 'api_put_policy'.
590 ## Function: api_put_policy_parallel() ##
591 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.
594 | `<response-code> <service-name> <ric-id-base> <number-of-rics> <policytype-id> <policy-start-id> <transient> <template-file> <count-per-ric> <number-of-threads>`
596 | `<response-code>` | Expected http response code |
597 | `<service-id>` | Id of the service |
598 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing |
599 | `<number-of-rics>` | The number of rics, assuming the first index is '1'. The index is added to the 'ric-id-base' id |
600 | `<policy-type-id>` | Id of the policy type |
601 | `<policy-start-id>` | Id of the policy. This value shall be a numeric value and will be the id of the first policy |
602 | `transient>` | Transient 'true' or 'false'. 'NOTRANSIENT' can be used to indicate using the default value (no transient value provide) |
603 | `<template-file>` | Path to the template file for the policy |
604 | `<count-per-ric>` | Number of policies per ric |
605 | `<number-of-threads>` | Number of threads (processes) to run in parallel |
607 ## Function: api_delete_policy() ##
608 This tests the DELETE /policy. Removes the indicated policy or a 'count' number of policies starting with 'policy-id' as the first id.
611 | `<response-code> <policy-id> [<count>]`
613 | parameter | description |
614 | --------- | ----------- |
615 | `<response-code>` | Expected http response code |
616 | `<policy-id>` | Id of the policy |
617 | `<count>` | An optional count of policies to delete. The 'policy-id' will be the first id to be deleted. |
619 ## Function: api_delete_policy_batch() ##
620 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.
621 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.
622 For arg list and parameters, see 'api_delete_policy'.
624 ## Function: api_delete_policy_parallel() ##
625 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.
628 | `<response-code> <ric-id-base> <number-of-rics> <policy-start-id> <count-per-ric> <number-of-threads>`
630 | `<response-code>` | Expected http response code |
631 | `<ric-id-base>` | The base id of the rics, ie ric id without the sequence number. The sequence number is added during processing |
632 | `<number-of-rics>` | The number of rics, assuming the first index is '1' |
633 | `<policy-start-id>` | Id of the policy. This value shall be a numeric value and will be the id of the first policy |
634 | `<count-per-ric>` | Number of policies per ric |
635 | `<number-of-threads>` | Number of threads (processes) to run in parallel |
638 ## Function: api_get_policy_ids() ##
640 Test of GET '/policy_ids'.
641 To test response code only, provide the response code parameter as well as the following three parameters.
642 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.
645 | `<response-code> <ric-id>|NORIC <service-id>|NOSERVICE <type-id>|NOTYPE ([<policy-instance-id]*|NOID)` |
647 | parameter | description |
648 | --------- | ----------- |
649 | `<response-code>` | Expected http response code |
650 | `<ric-id>` | Id of the ric |
651 | `NORIC` | Indicator that no ric is provided |
652 | `<service-id>` | Id of the service |
653 | `NOSERVICE` | Indicator that no service id is provided |
654 | `type-id>` | Id of the policy type |
655 | `NOTYPE` | Indicator that no type id is provided |
656 | `NOID` | Indicator that no policy id is provided - indicate empty list of policies|
657 | `<policy-instance-id>` | Id of the policy |
659 ## Function: api_get_policy_schema() ##
660 Test of GET /policy_schema and optional check of the returned json schema.
661 To test the response code only, provide the expected response code and policy type id.
662 To test the contents of the returned json schema, add a path to a schema file to compare with.
665 | `<response-code> <policy-type-id> [<schema-file>]` |
667 | parameter | description |
668 | --------- | ----------- |
669 | `<response-code>` | Expected http response code |
670 | `<policy-type-id>` | Id of the policy type |
671 | `<schema-file>` | Path to the schema file for the policy type |
673 ## Function: api_get_policy_schemas() ##
674 Test of GET /policy_schemas and optional check of the returned json schemas.
675 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
676 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)
679 | `<response-code> <ric-id>|NORIC [<schema-file>|NOFILE]*` |
681 | parameter | description |
682 | --------- | ----------- |
683 | `<response-code>` | Expected http response code |
684 | `<ric-id>` | Id of the ric |
685 | `NORIC` | No ric id given |
686 | `<schema-file>` | Path to the schema file for the policy type |
687 | `NOFILE` | Indicate the template for an empty type |
689 ## Function: api_get_policy_status() ##
690 Test of GET /policy_status.
693 | `<response-code> <policy-id> (STD <enforce-status> [<reason>])|(OSC <instance-status> <has-been-deleted>)` |
695 | parameter | description |
696 | --------- | ----------- |
697 | `<response-code>` | Expected http response code |
698 | `<policy-id>` | Id of the policy |
699 | `STD` | Indicator of status of Standarized A1 |
700 | `<enforce-status>` | Enforcement status |
701 | `<reason>` | Optional reason |
702 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
703 | `<instance-status>` | Instance status |
704 | `<has-been-deleted>` | Deleted status, true or false |
706 ## Function: api_get_policy_types() ##
707 Test of GET /policy_types and optional check of the returned ids.
708 To test the response code only, provide the expected response code and ric id (or NORIC if no ric is given).
709 To test the contents of the returned json payload, add the list of expected policy type id (or 'EMPTY' for the '{}' type)
713 | `<response-code> [<ric-id>|NORIC [<policy-type-id>|EMPTY [<policy-type-id>]*]]` |
715 | parameter | description |
716 | --------- | ----------- |
717 | `<response-code>` | Expected http response code |
718 | `<ric-id>` | Id of the ric |
719 | `NORIC` | No ric id given |
720 | `<policy-type-id>` | Id of the policy type |
721 | `EMPTY` | Indicate the empty type |
723 ## Function: api_get_status() ##
727 | `<response-code>` |
729 | parameter | description |
730 | --------- | ----------- |
731 | `<response-code>` | Expected http response code |
733 ## Function: api_get_ric() ##
735 To test the response code only, provide the expected response code and managed element id.
736 To test the returned ric id, provide the expected ric id.
739 | `<reponse-code> <managed-element-id> [<ric-id>]` |
741 | parameter | description |
742 | --------- | ----------- |
743 | `<response-code>` | Expected http response code |
744 | `<managed-element-id>` | Id of the managed element |
745 | `<ric-id>` | Id of the ric |
747 ## Function: api_get_rics() ##
748 Test of GET /rics and optional check of the returned json payload (ricinfo).
749 To test the response code only, provide the expected response code and policy type id (or NOTYPE if no type is given).
750 To test also the returned payload, add the formatted string of info in the returned payload.
751 Format of ricinfo: '<ric-id>:<list-of-mes>:<list-of-policy-type-ids>'
752 Example `<space-separate-string-of-ricinfo> = "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1,2,4 ricsim_g1_1:me2_........."`
755 | `<reponse-code> <policy-type-id>|NOTYPE [<space-separate-string-of-ricinfo>]` |
757 | parameter | description |
758 | --------- | ----------- |
759 | `<response-code>` | Expected http response code |
760 | `<policy-type-id>` | Policy type id of the ric |
761 | `NOTYPE>` | No type given |
762 | `<space-separate-string-of-ricinfo>` | A space separated string of ric info - needs to be quoted |
764 ## Function: api_put_service() ##
768 | `<response-code> <service-name> <keepalive-timeout> <callbackurl>` |
770 | parameter | description |
771 | --------- | ----------- |
772 | `<response-code>` | Expected http response code |
773 | `<service-name>` | Service name |
774 | `<keepalive-timeout>` | Timeout value |
775 | `<callbackurl>` | Callback url |
777 ## Function: api_get_services() ##
778 Test of GET /service and optional check of the returned json payload.
779 To test only the response code, omit all parameters except the expected response code.
780 To test the returned json, provide the parameters after the response code.
783 | `<response-code> [ (<query-service-name> <target-service-name> <keepalive-timeout> <callbackurl>) | (NOSERVICE <target-service-name> <keepalive-timeout> <callbackurl> [<target-service-name> <keepalive-timeout> <callbackurl>]* )]` |
785 | parameter | description |
786 | --------- | ----------- |
787 | `<response-code>` | Expected http response code |
788 | <query-service-name>` | Service name for the query |
789 | <target-service-name>` | Target service name|
790 | `<keepalive-timeout>` | Timeout value |
791 | `<callbackurl>` | Callback url |
792 | `NOSERVICE` | Indicator of no target service name |
794 ## Function: api_get_service_ids() ##
795 Test of GET /services
798 | `<response-code> [<service-name>]*` |
800 | parameter | description |
801 | --------- | ----------- |
802 | `<response-code>` | Expected http response code |
803 | `<service-name>` | Service name |
805 ## Function: api_delete_services() ##
806 Test of DELETE /services
809 | `<response-code> [<service-name>]*` |
811 | parameter | description |
812 | --------- | ----------- |
813 | `<response-code>` | Expected http response code |
814 | `<service-name>` | Service name |
816 ## Function: api_put_services_keepalive() ##
817 Test of PUT /services/keepalive
820 | <response-code> <service-name>` |
822 | parameter | description |
823 | --------- | ----------- |
824 | `<response-code>` | Expected http response code |
825 | `<service-name>` | Service name |
827 # Description of functions in ricsimulator_api_functions.sh #
828 The functions below only use the admin interface of the simulator, no usage of the A1 interface.
830 ## Function: sim_equal ##
831 Tests if a variable value in the RIC simulator is equal to a target value.
832 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
833 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.
834 See the 'a1-interface' repo for more details.
837 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
839 | parameter | description |
840 | --------- | ----------- |
841 | `<variable-name>` | Variable name in the ric simulator |
842 | `<target-value>` | Target value for the variable |
843 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
845 ## Function: sim_print ##
846 Prints the value of a variable in the RIC simulator.
847 See the 'a1-interface' repo for more details.
850 | `<variable-name>` |
852 | parameter | description |
853 | --------- | ----------- |
854 | `<variable-name>` | Variable name in the RIC simulator |
857 ## Function: sim_contains_str ##
858 Tests if a variable value in the RIC simulator contains a target string.
859 Without the timeout, the test sets pass or fail immediately depending on if the variable contains the target string or not.
860 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.
861 See the 'a1-interface' repo for more details.
864 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
866 | parameter | description |
867 | --------- | ----------- |
868 | `<variable-name>` | Variable name in the ric simulator |
869 | `<target-value>` | Target substring for the variable |
870 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
872 ## Function: sim_put_policy_type ##
873 Loads a policy type to the simulator
876 | `<response-code> <ric-id> <policy-type-id> <policy-type-file>` |
878 | parameter | description |
879 | --------- | ----------- |
880 | `<response-code>` | Expected http response code |
881 | `<ric-id>` | Id of the ric |
882 | `<policy-type-id>` | Id of the policy type |
883 | `<policy-type-file>` | Path to the schema file of the policy type |
885 ## Function: sim_delete_policy_type ##
886 Deletes a policy type from the simulator
889 | `<response-code> <ric-id> <policy_type_id>` |
891 | parameter | description |
892 | --------- | ----------- |
893 | `<response-code>` | Expected http response code |
894 | `<ric-id>` | Id of the ric |
895 | `<policy-type-id>` | Id of the policy type |
897 ## Function: sim_post_delete_instances ##
898 Deletes all instances (and status), for one ric
901 | `<response-code> <ric-id>` |
903 | parameter | description |
904 | --------- | ----------- |
905 | `<response-code>` | Expected http response code |
906 | `<ric-id>` | Id of the ric |
909 ## Function: sim_post_delete_all ##
910 Deletes all types, instances (and status), for one ric
913 | `<response-code> <ric-id>` |
915 | parameter | description |
916 | --------- | ----------- |
917 | `<response-code>` | Expected http response code |
918 | `<ric-id>` | Id of the ric |
920 ## Function: sim_post_forcedresponse ##
921 Sets (or resets) response code for next (one) A1 message, for one ric.
922 The intention is to simulate error response on the A1 interface.
925 | `<response-code> <ric-id> [<forced_response_code>]`|
927 | parameter | description |
928 | --------- | ----------- |
929 | `<response-code>` | Expected http response code |
930 | `<ric-id>` | Id of the ric |
931 | `<forced_response_code>` | Http response code to send |
933 ## Function: sim_post_forcedelay ##
934 Sets (or resets) A1 response delay, for one ric
935 The intention is to delay responses on the A1 interface. Setting remains until removed.
938 | `<response-code> <ric-id> [<delay-in-seconds>]`|
940 | parameter | description |
941 | --------- | ----------- |
942 | `<response-code>` | Expected http response code |
943 | `<ric-id>` | Id of the ric |
944 | `<delay-in-seconds>` | Delay in seconds. If omitted, the delay is removed |
947 # Description of functions in controller_api_functions.sh #
948 The file contains a selection of the possible API tests towards the a1-controller
950 ## Function: controller_api_get_A1_policy_ids ##
951 Test of GET policy ids towards OSC or STD type simulator.
952 To test response code only, provide the response code, 'OSC' + policy type or 'STD'
953 To test the response payload, include the ids of the expexted response.
956 | `<response-code> (OSC <ric-id> <policy-type-id> [ <policy-id> [<policy-id>]* ]) | ( STD <ric-id> [ <policy-id> [<policy-id>]* ]` |
958 | parameter | description |
959 | --------- | ----------- |
960 | `<response-code>` | Expected http response code |
961 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
962 | `<ric-id>` | Id of the ric |
963 | `policy-type-id>` | Id of the policy type |
964 | `<policy-id>` | Id of the policy |
965 | `STD` | Indicator of status of Standarized A1 |
968 ## Function: controller_api_get_A1_policy_type ##
969 Test of GET a policy type (OSC only)
972 | `<response-code> OSC <ric-id> <policy-type-id> [<policy-type-file>]` |
974 | parameter | description |
975 | --------- | ----------- |
976 | `<response-code>` | Expected http response code |
977 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
978 | `<ric-id>` | Id of the ric |
979 | `policy-type-id>` | Id of the policy type |
980 | `policy-type-file>` | Optional schema file to compare the returned type with |
982 ## Function: controller_api_delete_A1_policy ##
983 Deletes a policy instance
986 | `(STD <ric-id> <policy-id>) | (OSC <ric-id> <policy-type-id> <policy-id>)` |
988 | parameter | description |
989 | --------- | ----------- |
990 | `<response-code>` | Expected http response code |
991 | `STD` | Indicator of status of Standarized A1 |
992 | `<ric-id>` | Id of the ric |
993 | `<policy-id>` | Id of the policy |
994 | `policy-type-id>` | Id of the policy type |
995 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
996 | `policy-type-file>` | Optional schema file to compare the returned type with |
998 ## Function: controller_api_put_A1_policy ##
999 Creates a policy instance
1002 | `<response-code> (STD <ric-id> <policy-id> <template-file> ) | (OSC <ric-id> <policy-type-id> <policy-id> <template-file>)` |
1004 | parameter | description |
1005 | --------- | ----------- |
1006 | `<response-code>` | Expected http response code |
1007 | `STD` | Indicator of status of Standarized A1 |
1008 | `<ric-id>` | Id of the ric |
1009 | `<policy-id>` | Id of the policy |
1010 | `<template-file>` | Path to the template file of the policy|
1011 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
1012 | `<policy-type-id>` | Id of the policy type |
1014 ## Function: controller_api_get_A1_policy_status ##
1015 Checks the status of a policy
1018 | `<response-code> (STD <ric-id> <policy-id> <enforce-status> [<reason>]) | (OSC <ric-id> <policy-type-id> <policy-id> <instance-status> <has-been-deleted>)` |
1020 | parameter | description |
1021 | --------- | ----------- |
1022 | `<response-code>` | Expected http response code |
1023 | `STD` | Indicator of status of Standarized A1 |
1024 | `<ric-id>` | Id of the ric |
1025 | `<policy-id>` | Id of the policy |
1026 | `<enforce-status>` | Enforcement status |
1027 | `<reason>` | Optional reason |
1028 | `OSC` | Indicator of status of Non-Standarized OSC A1 |
1029 | `<policy-type-id>` | Id of the policy type |
1030 | `<instance-status>` | Instance status |
1031 | `<has-been-deleted>` | Deleted status, true or false |
1036 # Description of functions in ecs_api_function.sh #
1038 ## Function: ecs_api_a1_get_job_ids() ##
1039 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs' and optional check of the array of returned job ids.
1040 To test the response code only, provide the response code parameter as well as a type id and an owner id.
1041 To also test the response payload add the 'EMPTY' for an expected empty array or repeat the last parameter for each expected job id.
1044 | `<response-code> <type-id> <owner-id>|NOOWNER [ EMPTY | <job-id>+ ]` |
1046 | parameter | description |
1047 | --------- | ----------- |
1048 | `<response-code>` | Expected http response code |
1049 | `<type-id>` | Id of the EI type |
1050 | `<owner-id>` | Id of the job owner |
1051 | `NOOWNER` | No owner is given |
1052 | `<job-id>` | Id of the expected job |
1053 | `EMPTY` | The expected list of job id shall be empty |
1055 ## Function: ecs_api_a1_get_type() ##
1056 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}' and optional check of the returned schema.
1057 To test the response code only, provide the response code parameter as well as the type-id.
1058 To also test the response payload add a path to the expected schema file.
1061 | `<response-code> <type-id> [<schema-file>]` |
1063 | parameter | description |
1064 | --------- | ----------- |
1065 | `<response-code>` | Expected http response code |
1066 | `<type-id>` | Id of the EI type |
1067 | `<schema-file>` | Path to a schema file to compare with the returned schema |
1069 ## Function: ecs_api_a1_get_type_ids() ##
1070 Test of GET '/A1-EI​/v1​/eitypes' and optional check of returned list of type ids.
1071 To test the response code only, provide the response only.
1072 To also test the response payload add the list of expected type ids (or EMPTY if the list is expected to be empty).
1075 | `<response-code> [ (EMPTY | [<type-id>]+) ]` |
1077 | parameter | description |
1078 | --------- | ----------- |
1079 | `<response-code>` | Expected http response code |
1080 | `EMPTY` | The expected list of type ids shall be empty |
1081 | `<type-id>` | Id of the EI type |
1083 ## Function: ecs_api_a1_get_job_status() ##
1084 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}​/status' and optional check of the returned status.
1085 To test the response code only, provide the response code, type id and job id.
1086 To also test the response payload add the expected status.
1089 | `<response-code> <type-id> <job-id> [<status>]` |
1091 | parameter | description |
1092 | --------- | ----------- |
1093 | `<response-code>` | Expected http response code |
1094 | `<type-id>` | Id of the EI type |
1095 | `<job-id>` | Id of the job |
1096 | `<status>` | Expected status |
1098 ## Function: ecs_api_a1_get_job() ##
1099 Test of GET '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}' and optional check of the returned job.
1100 To test the response code only, provide the response code, type id and job id.
1101 To also test the response payload add the remaining parameters.
1104 | `<response-code> <type-id> <job-id> [<target-url> <owner-id> <template-job-file>]` |
1106 | parameter | description |
1107 | --------- | ----------- |
1108 | `<response-code>` | Expected http response code |
1109 | `<type-id>` | Id of the EI type |
1110 | `<job-id>` | Id of the job |
1111 | `<target-url>` | Expected target url for the job |
1112 | `<owner-id>` | Expected owner for the job |
1113 | `<template-job-file>` | Path to a job template for job parameters of the job |
1115 ## Function: ecs_api_a1_delete_job() ##
1116 Test of DELETE '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1117 To test, provide all the specified parameters.
1120 | `<response-code> <type-id> <job-id> |
1122 | parameter | description |
1123 | --------- | ----------- |
1124 | `<response-code>` | Expected http response code |
1125 | `<type-id>` | Id of the EI type |
1126 | `<job-id>` | Id of the job |
1128 ## Function: ecs_api_a1_put_job() ##
1129 Test of PUT '/A1-EI​/v1​/eitypes​/{eiTypeId}​/eijobs​/{eiJobId}'.
1130 To test, provide all the specified parameters.
1133 | `<response-code> <type-id> <job-id> <target-url> <owner-id> <template-job-file>` |
1135 | parameter | description |
1136 | --------- | ----------- |
1137 | `<response-code>` | Expected http response code |
1138 | `<type-id>` | Id of the EI type |
1139 | `<job-id>` | Id of the job |
1140 | `<target-url>` | Target url for the job |
1141 | `<owner-id>` | Owner of the job |
1142 | `<template-job-file>` | Path to a job template for job parameters of the job |
1144 ## Function: ecs_api_edp_get_type_ids() ##
1145 Test of GET '/ei-producer/v1/eitypes' and an optional check of the returned list of type ids.
1146 To test the response code only, provide the response code.
1147 To also test the response payload add list of expected type ids (or EMPTY if the list is expected to be empty).
1150 | `<response-code> [ EMPTY | <type-id>+]` |
1152 | parameter | description |
1153 | --------- | ----------- |
1154 | `<response-code>` | Expected http response code |
1155 | `<type-id>` | Id of the EI type |
1156 | `EMPTY` | The expected list of type ids shall be empty |
1158 ## Function: ecs_api_edp_get_producer_status() ##
1159 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/status' and optional check of the returned status.
1160 To test the response code only, provide the response code and producer id.
1161 To also test the response payload add the expected status.
1164 | `<response-code> <producer-id> [<status>]` |
1166 | parameter | description |
1167 | --------- | ----------- |
1168 | `<response-code>` | Expected http response code |
1169 | `<producer-id>` | Id of the producer |
1170 | `<status>` | The expected status string |
1172 ## Function: ecs_api_edp_get_producer_ids() ##
1173 Test of GET '/ei-producer/v1/eiproducers' and optional check of the returned producer ids.
1174 To test the response code only, provide the response.
1175 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).
1178 | `<response-code> [ EMPTY | <producer-id>+]` |
1180 | parameter | description |
1181 | --------- | ----------- |
1182 | `<response-code>` | Expected http response code |
1183 | `<producer-id>` | Id of the producer |
1184 | `EMPTY` | The expected list of type ids shall be empty |
1186 ## Function: ecs_api_edp_get_type() ##
1187 Test of GET '/ei-producer/v1/eitypes/{eiTypeId}' and optional check of the returned type.
1188 To test the response code only, provide the response and the type-id.
1189 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).
1192 | `<response-code> <type-id> [<job-schema-file> (EMPTY | [<producer-id>]+)]` |
1194 | parameter | description |
1195 | --------- | ----------- |
1196 | `<response-code>` | Expected http response code |
1197 | `<type-id>` | Id of the EI type |
1198 | `<job-schema-file>` | Path to a job schema file |
1199 | `<producer-id>` | Id of the producer |
1200 | `EMPTY` | The expected list of type ids shall be empty |
1202 ## Function: ecs_api_edp_get_producer() ##
1203 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}' and optional check of the returned producer.
1204 To test the response code only, provide the response and the producer-id.
1205 To also test the response payload add the remaining parameters defining thee producer.
1208 | `<response-code> <producer-id> [<create-callback> <delete-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+) ]` |
1210 | parameter | description |
1211 | --------- | ----------- |
1212 | `<response-code>` | Expected http response code |
1213 | `<producer-id>` | Id of the producer |
1214 | `<create-callback>` | Callback for create job |
1215 | `<delete-callback>` | Callback for delete job |
1216 | `<supervision-callback>` | Callback for producer supervision |
1217 | `<type-id>` | Id of the EI type |
1218 | `<schema-file>` | Path to a schema file |
1219 | `EMPTY` | The expected list of type schema pairs shall be empty |
1221 ## Function: ecs_api_edp_delete_producer() ##
1222 Test of DELETE '/ei-producer/v1/eiproducers/{eiProducerId}'.
1223 To test, provide all parameters.
1226 | `<response-code> <producer-id>` |
1228 | parameter | description |
1229 | --------- | ----------- |
1230 | `<response-code>` | Expected http response code |
1231 | `<producer-id>` | Id of the producer |
1233 ## Function: ecs_api_edp_put_producer() ##
1234 Test of PUT '/ei-producer/v1/eiproducers/{eiProducerId}'.
1235 To test, provide all parameters. The list of type/schema pair may be empty.
1238 | `<response-code> <producer-id> <create-callback> <delete-callback> <supervision-callback> (EMPTY | [<type-id> <schema-file>]+)` |
1240 | parameter | description |
1241 | --------- | ----------- |
1242 | `<response-code>` | Expected http response code |
1243 | `<producer-id>` | Id of the producer |
1244 | `<create-callback>` | Callback for create job |
1245 | `<delete-callback>` | Callback for delete job |
1246 | `<supervision-callback>` | Callback for producer supervision |
1247 | `<type-id>` | Id of the EI type |
1248 | `<schema-file>` | Path to a schema file |
1249 | `EMPTY` | The list of type/schema pairs is empty |
1251 ## Function: ecs_api_edp_get_producer_jobs() ##
1252 Test of GET '/ei-producer/v1/eiproducers/{eiProducerId}/eijobs' and optional check of the returned producer job.
1253 To test the response code only, provide the response and the producer-id.
1254 To also test the response payload add the remaining parameters.
1257 | `<response-code> <producer-id> (EMPTY | [<job-id> <type-id> <target-url> <template-job-file>]+)` |
1259 | parameter | description |
1260 | --------- | ----------- |
1261 | `<response-code>` | Expected http response code |
1262 | `<producer-id>` | Id of the producer |
1263 | `<job-id>` | Id of the job |
1264 | `<type-id>` | Id of the EI type |
1265 | `<target-url>` | Target url for data delivery |
1266 | `<template-job-file>` | Path to a job template file |
1267 | `EMPTY` | The list of job/type/target/job-file tuples is empty |
1269 ## Function: ecs_api_service_status() ##
1270 Test of GET '/status'.
1273 | `<response-code>` |
1275 | parameter | description |
1276 | --------- | ----------- |
1277 | `<response-code>` | Expected http response code |
1280 # Description of functions in prodstub_api_function.sh #
1282 ## Function: prodstub_arm_producer() ##
1283 Preconfigure the prodstub with a producer. The producer supervision response code is optional, if not given the response code will be set to 200.
1286 | `<response-code> <producer-id> [<forced_response_code>]` |
1288 | parameter | description |
1289 | --------- | ----------- |
1290 | `<response-code>` | Expected http response code |
1291 | `<producer-id>` | Id of the producer |
1292 | `<forced_response_code>` | Forced response code for the producer callback url |
1294 ## Function: prodstub_arm_job_create() ##
1295 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.
1298 | `<response-code> <job-id> [<forced_response_code>]` |
1300 | parameter | description |
1301 | --------- | ----------- |
1302 | `<response-code>` | Expected http response code |
1303 | `<job-id>` | Id of the job |
1304 | `<forced_response_code>` | Forced response code for the create callback url |
1306 ## Function: prodstub_arm_job_delete() ##
1307 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.
1310 | `<response-code> <job-id> [<forced_response_code>]` |
1312 | parameter | description |
1313 | --------- | ----------- |
1314 | `<response-code>` | Expected http response code |
1315 | `<job-id>` | Id of the job |
1316 | `<forced_response_code>` | Forced response code for the delete callback url |
1318 ## Function: prodstub_arm_type() ##
1319 Preconfigure the prodstub with a type for a producer. Can be called multiple times to add more types.
1322 | `<response-code> <producer-id> <type-id>` |
1324 | parameter | description |
1325 | --------- | ----------- |
1326 | `<response-code>` | Expected http response code |
1327 | `<producer-id>` | Id of the producer |
1328 | `<type-id>` | Id of the type |
1330 ## Function: prodstub_disarm_type() ##
1331 Remove a type for the producer in the rodstub. Can be called multiple times to remove more types.
1334 | `<response-code> <producer-id> <type-id>` |
1336 | parameter | description |
1337 | --------- | ----------- |
1338 | `<response-code>` | Expected http response code |
1339 | `<producer-id>` | Id of the producer |
1340 | `<type-id>` | Id of the type |
1342 ## Function: prodstub_check_jobdata() ##
1343 Check a job in the prodstub towards the list of provided parameters.
1346 | `<response-code> <producer-id> <job-id> <type-id> <target-url> <template-job-file>` |
1348 | parameter | description |
1349 | --------- | ----------- |
1350 | `<response-code>` | Expected http response code |
1351 | `<producer-id>` | Id of the producer |
1352 | `<job-id>` | Id of the job |
1353 | `<type-id>` | Id of the type |
1354 | `<target-url>` | Target url for data delivery |
1355 | `<template-job-file>` | Path to a job template file |
1357 ## Function: prodstub_equal ##
1358 Tests if a variable value in the prodstub is equal to a target value.
1359 Without the timeout, the test sets pass or fail immediately depending on if the variable is equal to the target or not.
1360 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.
1363 | `<variable-name> <target-value> [ <timeout-in-sec> ]` |
1365 | parameter | description |
1366 | --------- | ----------- |
1367 | `<variable-name>` | Variable name in the prostub |
1368 | `<target-value>` | Target value for the variable |
1369 | `<timeout-in-sec>` | Max time to wait for the variable to reach the target value |
1374 Copyright (C) 2020 Nordix Foundation. All rights reserved.
1375 Licensed under the Apache License, Version 2.0 (the "License");
1376 you may not use this file except in compliance with the License.
1377 You may obtain a copy of the License at
1379 http://www.apache.org/licenses/LICENSE-2.0
1381 Unless required by applicable law or agreed to in writing, software
1382 distributed under the License is distributed on an "AS IS" BASIS,
1383 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1384 See the License for the specific language governing permissions and
1385 limitations under the License.