aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dcaegen2/prh-testcases/resources
diff options
context:
space:
mode:
authorgrabinsk <maciej.grabinski@nokia.com>2019-05-22 14:59:02 +0200
committergrabinsk <maciej.grabinski@nokia.com>2019-05-22 14:59:02 +0200
commitdb4c4a5f83b674d6c04f9e6f3355171b13d67fa4 (patch)
tree728a3c21caa50fae71635dce425d5b86f867d469 /tests/dcaegen2/prh-testcases/resources
parentb6f2ac350d36cf7cc22e0c6e02804d7aa82d77eb (diff)
Update PRH tests after SDK update to El Alto in PRH
Change-Id: I0ce656cc2b0e59254b788ac114f5617cacea1ffb Issue-ID: Issue-ID: DCAEGEN2-1501 Signed-off-by: grabinsk <maciej.grabinski@nokia.com>
Diffstat (limited to 'tests/dcaegen2/prh-testcases/resources')
-rw-r--r--tests/dcaegen2/prh-testcases/resources/PrhLibrary.py20
-rw-r--r--tests/dcaegen2/prh-testcases/resources/prh_library.robot2
2 files changed, 11 insertions, 11 deletions
diff --git a/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py b/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py
index f6439be3..88aeb45c 100644
--- a/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py
+++ b/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py
@@ -24,16 +24,16 @@ class PrhLibrary(object):
@staticmethod
def create_invalid_notification(json_file):
- json_to_python = json.loads(json_file)
- correlation_id = PrhLibrary.extract_correlation_id_value(json_to_python, "correlationId")
- ipv4 = PrhLibrary.extract_value_from_pnfRegistrationFields(json_to_python, "oamV4IpAddress", "oamV4IpAddress")
- ipv6 = PrhLibrary.extract_value_from_pnfRegistrationFields(json_to_python, "oamV6IpAddress", "oamV6IpAddress")
- serial_number = PrhLibrary.extract_value_from_pnfRegistrationFields(json_to_python, "serialNumber", "serialNumber")
- vendor_name = PrhLibrary.extract_value_from_pnfRegistrationFields(json_to_python, "vendorName", "vendorName")
- model_number = PrhLibrary.extract_value_from_pnfRegistrationFields(json_to_python, "modelNumber", "modelNumber")
- unit_type = PrhLibrary.extract_value_from_pnfRegistrationFields(json_to_python, "unitType", "unitType")
-
- additional_fields = PrhLibrary.extract_additional_fields(json_to_python)
+ event = json.loads(json_file)[0]
+ correlation_id = PrhLibrary.extract_correlation_id_value(event, "correlationId")
+ ipv4 = PrhLibrary.extract_value_from_pnfRegistrationFields(event, "oamV4IpAddress", "oamV4IpAddress")
+ ipv6 = PrhLibrary.extract_value_from_pnfRegistrationFields(event, "oamV6IpAddress", "oamV6IpAddress")
+ serial_number = PrhLibrary.extract_value_from_pnfRegistrationFields(event, "serialNumber", "serialNumber")
+ vendor_name = PrhLibrary.extract_value_from_pnfRegistrationFields(event, "vendorName", "vendorName")
+ model_number = PrhLibrary.extract_value_from_pnfRegistrationFields(event, "modelNumber", "modelNumber")
+ unit_type = PrhLibrary.extract_value_from_pnfRegistrationFields(event, "unitType", "unitType")
+
+ additional_fields = PrhLibrary.extract_additional_fields(event)
str_json = '{' + correlation_id + ipv4 + ipv6 + serial_number + vendor_name + model_number + unit_type + '"nfNamingCode":""' + "," + '"softwareVersion":"",' + additional_fields
return json.dumps(str_json).replace("\\", "")[1:-1].replace("\":", "\": ").rstrip(',') + '\\n}'
diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library.robot b/tests/dcaegen2/prh-testcases/resources/prh_library.robot
index 663f2ea7..5680f2f4 100644
--- a/tests/dcaegen2/prh-testcases/resources/prh_library.robot
+++ b/tests/dcaegen2/prh-testcases/resources/prh_library.robot
@@ -33,7 +33,7 @@ Verify incorrect JSON event is logged
[Arguments] ${test_case_directory}
${invalid_ves_event}= Get Data From File ${test_case_directory}/invalid-ves-event.json
Set VES event in DMaaP ${invalid_ves_event}
- Wait Until Keyword Succeeds 10x 3000ms Check PRH log |Element is neither JSON Object or Array
+ Wait Until Keyword Succeeds 10x 3000ms Check PRH log |com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonArray
Verify missing AAI record is logged
[Timeout] 100s