aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/dcaegen2/prh-testcases/prh_tests.robot7
-rw-r--r--tests/dcaegen2/prh-testcases/resources/docker-compose.yml1
-rw-r--r--tests/dcaegen2/prh-testcases/resources/prh_config_tests.robot19
3 files changed, 25 insertions, 2 deletions
diff --git a/tests/dcaegen2/prh-testcases/prh_tests.robot b/tests/dcaegen2/prh-testcases/prh_tests.robot
index 9334d634..43d31885 100644
--- a/tests/dcaegen2/prh-testcases/prh_tests.robot
+++ b/tests/dcaegen2/prh-testcases/prh_tests.robot
@@ -70,4 +70,9 @@ PRH logging level change
CBS configuration forced refresh
[Documentation] It should be possible to force refresh PRH configuration from CBS
[Tags] PRH coniguration
- Verify PRH configuration forced refresh \ No newline at end of file
+ Verify PRH configuration forced refresh
+
+CBS configuration scheduled refresh
+ [Documentation] PRH should pull for CBS configuration updates according to schedule
+ [Tags] PRH coniguration
+ Verify scheduled CBS config updates \ No newline at end of file
diff --git a/tests/dcaegen2/prh-testcases/resources/docker-compose.yml b/tests/dcaegen2/prh-testcases/resources/docker-compose.yml
index f8472a5d..2ca2c8d5 100644
--- a/tests/dcaegen2/prh-testcases/resources/docker-compose.yml
+++ b/tests/dcaegen2/prh-testcases/resources/docker-compose.yml
@@ -54,6 +54,7 @@ services:
image: consul:1.0.6
restart: on-failure
command: ["kv", "put", "-http-addr=http://consul:8500", "dcae-prh", '{
+ "cbs.updates-interval": 0,
"logging.level.org.onap.dcaegen2.services.prh": "debug",
"logging.level.org.onap.dcaegen2.services.sdk": "debug",
"dmaap.dmaapConsumerConfiguration.dmaapUserName":"admin",
diff --git a/tests/dcaegen2/prh-testcases/resources/prh_config_tests.robot b/tests/dcaegen2/prh-testcases/resources/prh_config_tests.robot
index 54c58f2b..9044185d 100644
--- a/tests/dcaegen2/prh-testcases/resources/prh_config_tests.robot
+++ b/tests/dcaegen2/prh-testcases/resources/prh_config_tests.robot
@@ -6,7 +6,7 @@ Library Collections
*** Keywords ***
Verify PRH configuration forced refresh
- ${some_random_value} evaluate random.randint(sys.maxint/10, sys.maxint) modules=random,sys
+ ${some_random_value}= Generate random value
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}
@@ -34,3 +34,20 @@ Check key-value in PRH app environment
should be equal as integers ${env_response.status_code} 200
log ${env_response.content}
should be equal ${env_response.json()["property"]["value"]} ${expected_value}
+
+Verify scheduled CBS config updates
+ Set scheduled CBS updates interval 1s
+ ${some_random_value}= Generate random value
+ Put key-value to consul spam_${some_random_value} ham_${some_random_value}
+ wait until keyword succeeds 20x 500ms
+ ... Check key-value in PRH app environment spam_${some_random_value} ham_${some_random_value}
+ [Teardown] Set scheduled CBS updates interval 0
+
+Set scheduled CBS updates interval
+ [Arguments] ${cbs_updates_interval}
+ Put key-value to consul cbs.updates-interval ${cbs_updates_interval}
+ Force PRH config refresh
+
+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