aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dcaegen2/prh-testcases/resources
diff options
context:
space:
mode:
authorkurczews <krzysztof.kurczewski@nokia.com>2019-04-18 09:07:14 +0200
committerkurczews <krzysztof.kurczewski@nokia.com>2019-04-18 09:32:28 +0200
commitb66da2b3b8519866973badc4e19f1ae717e77d1f (patch)
tree200e1615cb9b2a7426b54708d1516a5b02d36fa2 /tests/dcaegen2/prh-testcases/resources
parenta6795420765b4455dbc761bfc4a70ecb457693ad (diff)
PRH BBS tests
Issue-ID: INT-989 Change-Id: I2963a7b0df2ee16a8cf5bc3144510950a1fd7ad2 Signed-off-by: kurczews <krzysztof.kurczewski@nokia.com>
Diffstat (limited to 'tests/dcaegen2/prh-testcases/resources')
-rw-r--r--tests/dcaegen2/prh-testcases/resources/prh_library.robot6
-rw-r--r--tests/dcaegen2/prh-testcases/resources/prh_library2.robot74
-rw-r--r--tests/dcaegen2/prh-testcases/resources/simulator/AAI.py8
-rw-r--r--tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py8
4 files changed, 84 insertions, 12 deletions
diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library.robot b/tests/dcaegen2/prh-testcases/resources/prh_library.robot
index 29203ecd..cfe1d993 100644
--- a/tests/dcaegen2/prh-testcases/resources/prh_library.robot
+++ b/tests/dcaegen2/prh-testcases/resources/prh_library.robot
@@ -43,8 +43,6 @@ Invalid event processing
${invalid_notification}= Create invalid notification ${data}
${notification}= Catenate SEPARATOR= \\n |Incorrect json, consumerDmaapModel can not be created: ${invalid_notification}
Wait Until Keyword Succeeds 100x 100ms Check PRH log ${notification}
- #Wait Until Keyword Succeeds 100x 100ms Check PRH log ${notification}
-
Check PRH log
[Arguments] ${searched_log}
@@ -53,7 +51,7 @@ Check PRH log
Check PNF_READY notification
[Arguments] ${expected_event_pnf_ready_in_dpaap}
- ${resp}= Get Request ${dmaap_setup_session} /events/pnfReady headers=${suite_headers}
+ ${resp}= Get Request ${dmaap_setup_session} /setup/get_pnf_ready headers=${suite_headers}
Should Be Equal ${resp.text} ${expected_event_pnf_ready_in_dpaap}
Set PNF name in AAI
@@ -76,7 +74,7 @@ Set PNF content in AAI
Set event in DMaaP
[Arguments] ${event_in_dmaap}
- ${resp}= Put Request ${dmaap_setup_session} /set_get_event headers=${suite_headers} data=${event_in_dmaap}
+ ${resp}= Put Request ${dmaap_setup_session} /setup/set_ves_event headers=${suite_headers} data=${event_in_dmaap}
Should Be Equal As Strings ${resp.status_code} 200
Reset AAI simulator
diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library2.robot b/tests/dcaegen2/prh-testcases/resources/prh_library2.robot
new file mode 100644
index 00000000..99939a06
--- /dev/null
+++ b/tests/dcaegen2/prh-testcases/resources/prh_library2.robot
@@ -0,0 +1,74 @@
+*** Settings ***
+Library RequestsLibrary
+Library Collections
+Resource ../../../common.robot
+
+*** Keywords ***
+VES event with additional fields
+ [Arguments] ${test_case_directory}
+ ${pnf_entry}= Get Data From File ${test_case_directory}/aai-entry.json
+ ${ves_event}= Get Data From File ${test_case_directory}/ves-event.json
+ ${expected_pnf_ready_event}= Get Data From File ${test_case_directory}/expected-pnf-ready-event.json
+ ${expected_logical_link}= Get Data From File ${test_case_directory}/expected-logical-link.json
+ Add PNF entry in AAI ${pnf_entry}
+ Set VES event in DMaaP ${ves_event}
+ Wait Until Keyword Succeeds 10x 3000ms Check CBS ready
+ Wait Until Keyword Succeeds 10x 3000ms Check recorded PNF_READY notification ${expected_pnf_ready_event}
+ Check recorded Logical Link ${expected_logical_link}
+
+Check CBS ready
+ ${resp}= Get Request ${consul_setup_session} /v1/catalog/service/cbs
+ Should Be Equal As Strings ${resp.status_code} 200
+ Log CBS ${resp.content}
+
+Check recorded PNF_READY notification
+ [Arguments] ${expected_event_pnf_ready_in_dpaap}
+ ${resp}= Get Request ${dmaap_setup_session} /setup/get_pnf_ready headers=${suite_headers}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Be Equal As JSON ${resp.content} ${expected_event_pnf_ready_in_dpaap}
+
+Check recorded Logical Link
+ [Arguments] ${expected_logical_link_in_aai}
+ ${resp}= Get Request ${aai_setup_session} /setup/get_created_logical_link headers=${suite_headers}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Be Equal As JSON ${resp.content} ${expected_logical_link_in_aai}
+
+Add PNF entry in AAI
+ [Arguments] ${pnf_entry}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ Log AAI url ${AAI_SIMULATOR_SETUP_URL}
+ ${resp}= Put Request ${aai_setup_session} /setup/add_pnf_entry headers=${suite_headers} data=${pnf_entry}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+Set VES event in DMaaP
+ [Arguments] ${ves_event}
+ ${resp}= Put Request ${dmaap_setup_session} /setup/set_ves_event headers=${suite_headers} data=${ves_event}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+Should Be Equal As JSON
+ [Arguments] ${given} ${expected}
+ Should Be True ${given}==${expected}
+
+Create sessions
+ Create Session dmaap_setup_session ${DMAAP_SIMULATOR_SETUP_URL}
+ Set Suite Variable ${dmaap_setup_session} dmaap_setup_session
+ Create Session aai_setup_session ${AAI_SIMULATOR_SETUP_URL}
+ Set Suite Variable ${aai_setup_session} aai_setup_session
+ Create Session consul_setup_session ${CONSUL_SETUP_URL}
+ Set Suite Variable ${consul_setup_session} consul_setup_session
+
+Reset Simulators
+ Reset AAI simulator
+ Reset DMaaP simulator
+
+Reset AAI simulator
+ ${resp}= Post Request ${aai_setup_session} /reset
+ Should Be Equal As Strings ${resp.status_code} 200
+
+Reset DMaaP simulator
+ ${resp}= Post Request ${dmaap_setup_session} /reset
+ Should Be Equal As Strings ${resp.status_code} 200
+
+Create headers
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ Set Suite Variable ${suite_headers} ${headers} \ No newline at end of file
diff --git a/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py b/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py
index 010c5231..55b2d1f6 100644
--- a/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py
+++ b/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py
@@ -27,12 +27,12 @@ class AAISetup(BaseHTTPRequestHandler):
def do_GET(self):
try:
- if re.search('/setup/patched_pnf', self.path):
+ if re.search('/setup/get_patched_pnf', self.path):
httpServerLib.set_response_200_ok(self, payload = patched_pnf)
- logger.debug('AAISetup GET /setup/patched_pnf -> 200 OK')
- elif re.search('/setup/created_logical_link', self.path):
+ logger.debug('AAISetup GET /setup/get_patched_pnf -> 200 OK')
+ elif re.search('/setup/get_created_logical_link', self.path):
httpServerLib.set_response_200_ok(self, payload = created_logical_link)
- logger.debug('AAISetup GET /setup/created_logical_link -> 200 OK')
+ logger.debug('AAISetup GET /setup/get_created_logical_link -> 200 OK')
else:
httpServerLib.set_response_404_not_found(self)
logger.info('AAISetup GET ' + self.path + ' -> 404 Not found')
diff --git a/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py b/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
index 2d4fbd65..b2716968 100644
--- a/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
+++ b/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
@@ -24,10 +24,10 @@ class DmaapSetup(BaseHTTPRequestHandler):
def do_GET(self):
try:
- if re.search('/setup/pnf_ready', self.path) or re.search('events/pnfReady', self.path):
+ if re.search('/setup/get_pnf_ready', self.path):
global captured_prh_event
httpServerLib.set_response_200_ok(self, payload = captured_prh_event)
- logger.debug('DmaapSetup GET /setup/pnf_ready -> 200 OK')
+ logger.debug('DmaapSetup GET /setup/get_pnf_ready -> 200 OK')
else:
httpServerLib.set_response_404_not_found(self)
logger.info('DmaapSetup GET ' + self.path + ' -> 404 Not found')
@@ -37,11 +37,11 @@ class DmaapSetup(BaseHTTPRequestHandler):
def do_PUT(self):
try:
- if re.search('/setup/ves_event', self.path) or re.search('/set_get_event', self.path):
+ if re.search('/setup/set_ves_event', self.path):
global ves_event
ves_event = httpServerLib.get_payload(self)
httpServerLib.set_response_200_ok(self)
- logger.debug('DmaapSetup PUT /setup/ves_event -> 200 OK')
+ logger.debug('DmaapSetup PUT /setup/set_ves_event -> 200 OK')
else:
httpServerLib.set_response_404_not_found(self)
logger.info('DmaapSetup PUT ' + self.path + ' -> 404 Not found')