diff options
Diffstat (limited to 'tests/dcaegen2/prh-testcases/resources/prh_config_library.robot')
-rw-r--r-- | tests/dcaegen2/prh-testcases/resources/prh_config_library.robot | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/dcaegen2/prh-testcases/resources/prh_config_library.robot b/tests/dcaegen2/prh-testcases/resources/prh_config_library.robot new file mode 100644 index 00000000..26a62704 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/resources/prh_config_library.robot @@ -0,0 +1,43 @@ +*** Settings *** +Documentation Keywords related to checking and updating PRH app config based on CBS config +Library RequestsLibrary +Library Collections + +*** 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 + +Get PRH config from consul + [Arguments] ${logMessage}=prh config in consul + ${phr_config_response}= get request consul_session /v1/kv/dcae-prh?raw + log ${logMessage}: ${phr_config_response.content} + [Return] ${phr_config_response.json()} + +Force PRH config refresh + ${refresh_response}= post request prh_session /actuator/refresh + should be equal as integers ${refresh_response.status_code} 200 + +Check key-value in PRH app environment + [Arguments] ${key} ${expected_value} + ${env_response}= get request prh_session /actuator/env/${key} + should be equal as integers ${env_response.status_code} 200 + log ${env_response.content} + should be equal ${env_response.json()["property"]["value"]} ${expected_value} + +Set scheduled CBS updates interval + [Arguments] ${cbs_updates_interval} + Put key-value to consul cbs.updates-interval ${cbs_updates_interval} + Force PRH config refresh + +Set logging level in CBS + [Arguments] ${logger} ${level} + Put key-value to consul logging.level.${logger} ${level} + +Generate random value + ${some_random_value} evaluate random.randint(sys.maxint/10, sys.maxint) modules=random,sys + [Return] ${some_random_value}
\ No newline at end of file |