2 Documentation Keywords related to checking and updating PRH app config based on CBS config
3 Library RequestsLibrary
4 Library OperatingSystem
9 ${CONFIGS_DIR} %{WORKSPACE}/tests/dcaegen2/prh-testcases/resources/prh_configs/
10 ${PRH_CONFIG_FILE} ${CONFIGS_DIR}/prh_config_volume/application_config.yaml
13 Put key-value to config
14 [Arguments] ${key} ${value}
15 ${prh_config}= Get PRH config
16 set to dictionary ${prh_config} ${key} ${value}
17 Set PRH config ${prh_config}
20 [Arguments] ${logMessage}=prh config
21 ${prh_config_file_content}= Get File ${PRH_CONFIG_FILE}
22 ${prh_config}= yaml.Safe Load ${prh_config_file_content}
23 log ${logMessage}: ${prh_config}
24 [Return] ${prh_config}
27 [Arguments] ${prh_config}
28 ${prh_config_output}= yaml.Safe Dump ${prh_config}
29 Create File ${PRH_CONFIG_FILE} ${prh_config_output}
31 Set PRH config from file
32 [Arguments] ${config_file_name}
33 Copy File ${config_file_name} ${PRH_CONFIG_FILE}
34 Force PRH config refresh
36 Set default PRH config
37 Set PRH config from file ${CONFIGS_DIR}/prh-config.yaml
39 Force PRH config refresh
40 ${refresh_response}= post request prh_session /actuator/refresh
41 should be equal as integers ${refresh_response.status_code} 200
43 Check key-value in PRH app environment
44 [Arguments] ${key} ${expected_value}
45 ${env_response}= get request prh_session /actuator/env/${key}
46 should be equal as integers ${env_response.status_code} 200
47 log ${env_response.content}
48 should be equal ${env_response.json()["property"]["value"]} ${expected_value}
50 Set scheduled config updates interval
51 [Arguments] ${cbs_updates_interval}
52 Put key-value to config cbs.updates-interval ${cbs_updates_interval}
53 Force PRH config refresh
55 Set logging level in config
56 [Arguments] ${logger} ${level}
57 Put key-value to config logging.level.${logger} ${level}
60 ${some_random_value} evaluate random.randint(sys.maxint/10, sys.maxint) modules=random,sys
61 [Return] ${some_random_value}