diff options
Diffstat (limited to 'tests/dcaegen2/prh-testcases/resources')
-rw-r--r-- | tests/dcaegen2/prh-testcases/resources/PrhLibrary.py | 20 | ||||
-rw-r--r-- | tests/dcaegen2/prh-testcases/resources/prh_library.robot | 2 |
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 |