aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dcaegen2/prh-testcases/resources/prh_config_tests.robot
diff options
context:
space:
mode:
authorgrabinsk <maciej.grabinski@nokia.com>2019-06-19 12:36:42 +0200
committergrabinsk <maciej.grabinski@nokia.com>2019-06-19 12:36:42 +0200
commitc68c2eefd7980e797c6c4d913d1db4e0b685f48a (patch)
tree9571d4b3ce28dde24f305db7cd7a72588a1ed788 /tests/dcaegen2/prh-testcases/resources/prh_config_tests.robot
parent9c7d8f024060f441ba25c14a04fd841f2e9e16bf (diff)
Add test for forcing CBS configuration refresh in PRH
Change-Id: Ie1d8659d4aaa82338c6986f68e47443dc6679b0e Issue-ID: DCAEGEN2-1544 Signed-off-by: grabinsk <maciej.grabinski@nokia.com>
Diffstat (limited to 'tests/dcaegen2/prh-testcases/resources/prh_config_tests.robot')
-rw-r--r--tests/dcaegen2/prh-testcases/resources/prh_config_tests.robot36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/dcaegen2/prh-testcases/resources/prh_config_tests.robot b/tests/dcaegen2/prh-testcases/resources/prh_config_tests.robot
new file mode 100644
index 00000000..54c58f2b
--- /dev/null
+++ b/tests/dcaegen2/prh-testcases/resources/prh_config_tests.robot
@@ -0,0 +1,36 @@
+*** Settings ***
+Documentation Tests and keywords related to updating PRH app config based on CBS config
+Library RequestsLibrary
+Library Collections
+
+*** Keywords ***
+
+Verify PRH configuration forced refresh
+ ${some_random_value} evaluate random.randint(sys.maxint/10, sys.maxint) modules=random,sys
+ Put key-value to consul foo_${some_random_value} bar_${some_random_value}
+ Force PRH config refresh
+ Check key-value in PRH app environment foo_${some_random_value} bar_${some_random_value}
+
+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}