aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py
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/PrhLibrary.py
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/PrhLibrary.py')
-rw-r--r--tests/dcaegen2/prh-testcases/resources/PrhLibrary.py20
1 files changed, 10 insertions, 10 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}'