aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dcaegen2/prh-testcases/resources/prh_config_library.robot
diff options
context:
space:
mode:
authorgrabinsk <maciej.grabinski@nokia.com>2019-06-26 14:19:04 +0200
committergrabinsk <maciej.grabinski@nokia.com>2019-06-26 15:20:53 +0200
commitd28f36b347191243ee3c49d516809462823fc2df (patch)
tree8780e69470cad584370614c4a3a0e70ae5fd8713 /tests/dcaegen2/prh-testcases/resources/prh_config_library.robot
parentb86374753af6cbad8feb6c98723e4cb8aab50c9c (diff)
Extract PRH cbs configuration from docker-compose.yml to independent json file.
Provide keywords for updating PRH configuration based on provided json file Change-Id: I5dffca521695700d98ac0c43992c212ece5f5495 Issue-ID: INT-1076 Signed-off-by: grabinsk <maciej.grabinski@nokia.com>
Diffstat (limited to 'tests/dcaegen2/prh-testcases/resources/prh_config_library.robot')
-rw-r--r--tests/dcaegen2/prh-testcases/resources/prh_config_library.robot28
1 files changed, 23 insertions, 5 deletions
diff --git a/tests/dcaegen2/prh-testcases/resources/prh_config_library.robot b/tests/dcaegen2/prh-testcases/resources/prh_config_library.robot
index 26a62704..78b47824 100644
--- a/tests/dcaegen2/prh-testcases/resources/prh_config_library.robot
+++ b/tests/dcaegen2/prh-testcases/resources/prh_config_library.robot
@@ -1,16 +1,19 @@
*** Settings ***
Documentation Keywords related to checking and updating PRH app config based on CBS config
Library RequestsLibrary
+Library OperatingSystem
Library Collections
+*** Variables ***
+${CONFIGS_DIR} %{WORKSPACE}/tests/dcaegen2/prh-testcases/resources/prh_configs/
+
*** Keywords ***
Put key-value to consul
- [Arguments] ${key} ${value}
- ${prh_config}= Get PRH config from consul
- set to dictionary ${prh_config} ${key} ${value}
- put request consul_session /v1/kv/dcae-prh json=${prh_config}
- Get PRH config from consul prh config in consul after update
+ [Arguments] ${key} ${value}
+ ${prh_config}= Get PRH config from consul
+ set to dictionary ${prh_config} ${key} ${value}
+ Set PRH config in consul ${prh_config}
Get PRH config from consul
[Arguments] ${logMessage}=prh config in consul
@@ -18,6 +21,21 @@ Get PRH config from consul
log ${logMessage}: ${phr_config_response.content}
[Return] ${phr_config_response.json()}
+Set PRH config in consul
+ [Arguments] ${prh_config}
+ put request consul_session /v1/kv/dcae-prh json=${prh_config}
+ Get PRH config from consul prh config in consul after update
+
+Set PRH CBS config from file
+ [Arguments] ${config_file_name}
+ ${config_file_content}= get file ${config_file_name}
+ ${config_json}= to json ${config_file_content}
+ Set PRH config in consul ${config_json}
+ Force PRH config refresh
+
+Set default PRH CBS config
+ Set PRH CBS config from file ${CONFIGS_DIR}/prh-config.json
+
Force PRH config refresh
${refresh_response}= post request prh_session /actuator/refresh
should be equal as integers ${refresh_response.status_code} 200