PRH test fixes - align simulated Dmaap response to the real one
(real Dmaap response consists of array of escaped event json strings)
Change-Id: I84f1c5ee576b833e40138ce8af8a8558f39e0609
Issue-ID: INT-1100
Signed-off-by: grabinsk <maciej.grabinski@nokia.com>
diff --git a/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/ves-event.json b/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/ves-event.json
index 10ce41c..3a768df 100644
--- a/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/ves-event.json
+++ b/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/ves-event.json
@@ -1,39 +1,37 @@
-[
- {
- "event": {
- "commonEventHeader": {
- "startEpochMicrosec": 1540212137393,
- "sourceId": "val13",
- "eventId": "registration_40212137",
- "nfcNamingCode": "oam",
- "internalHeaderFields": {
- "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC"
- },
- "eventType": "pnfRegistration",
- "priority": "Normal",
- "version": "4.0.1",
- "reportingEntityName": "NOK6061ZW8",
- "sequence": 0,
- "domain": "pnfRegistration",
- "lastEpochMicrosec": 1540212137393,
- "eventName": "pnfRegistration_Nokia_5gDu",
- "vesEventListenerVersion": "7.0.1",
- "sourceName": "NOK6061ZW8",
- "nfNamingCode": "gNB"
+{
+ "event": {
+ "commonEventHeader": {
+ "startEpochMicrosec": 1540212137393,
+ "sourceId": "val13",
+ "eventId": "registration_40212137",
+ "nfcNamingCode": "oam",
+ "internalHeaderFields": {
+ "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC"
},
- "pnfRegistrationFields": {
- "unitType": "val8",
- "serialNumber": "6061ZW9",
- "pnfRegistrationFieldsVersion": "2.0",
- "manufactureDate": "1540212137393",
- "modelNumber": "val6",
- "lastServiceDate": "1540212137393",
- "unitFamily": "BBU",
- "vendorName": "Nokia",
- "oamV4IpAddress": "val3",
- "oamV6IpAddress": "val4",
- "softwareVersion": "val7"
- }
+ "eventType": "pnfRegistration",
+ "priority": "Normal",
+ "version": "4.0.1",
+ "reportingEntityName": "NOK6061ZW8",
+ "sequence": 0,
+ "domain": "pnfRegistration",
+ "lastEpochMicrosec": 1540212137393,
+ "eventName": "pnfRegistration_Nokia_5gDu",
+ "vesEventListenerVersion": "7.0.1",
+ "sourceName": "NOK6061ZW8",
+ "nfNamingCode": "gNB"
+ },
+ "pnfRegistrationFields": {
+ "unitType": "val8",
+ "serialNumber": "6061ZW9",
+ "pnfRegistrationFieldsVersion": "2.0",
+ "manufactureDate": "1540212137393",
+ "modelNumber": "val6",
+ "lastServiceDate": "1540212137393",
+ "unitFamily": "BBU",
+ "vendorName": "Nokia",
+ "oamV4IpAddress": "val3",
+ "oamV6IpAddress": "val4",
+ "softwareVersion": "val7"
}
}
-]
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/tests/dcaegen2/prh-testcases/assets/aai-not-responding/ves-event.json b/tests/dcaegen2/prh-testcases/assets/aai-not-responding/ves-event.json
index 10ce41c..3a768df 100644
--- a/tests/dcaegen2/prh-testcases/assets/aai-not-responding/ves-event.json
+++ b/tests/dcaegen2/prh-testcases/assets/aai-not-responding/ves-event.json
@@ -1,39 +1,37 @@
-[
- {
- "event": {
- "commonEventHeader": {
- "startEpochMicrosec": 1540212137393,
- "sourceId": "val13",
- "eventId": "registration_40212137",
- "nfcNamingCode": "oam",
- "internalHeaderFields": {
- "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC"
- },
- "eventType": "pnfRegistration",
- "priority": "Normal",
- "version": "4.0.1",
- "reportingEntityName": "NOK6061ZW8",
- "sequence": 0,
- "domain": "pnfRegistration",
- "lastEpochMicrosec": 1540212137393,
- "eventName": "pnfRegistration_Nokia_5gDu",
- "vesEventListenerVersion": "7.0.1",
- "sourceName": "NOK6061ZW8",
- "nfNamingCode": "gNB"
+{
+ "event": {
+ "commonEventHeader": {
+ "startEpochMicrosec": 1540212137393,
+ "sourceId": "val13",
+ "eventId": "registration_40212137",
+ "nfcNamingCode": "oam",
+ "internalHeaderFields": {
+ "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC"
},
- "pnfRegistrationFields": {
- "unitType": "val8",
- "serialNumber": "6061ZW9",
- "pnfRegistrationFieldsVersion": "2.0",
- "manufactureDate": "1540212137393",
- "modelNumber": "val6",
- "lastServiceDate": "1540212137393",
- "unitFamily": "BBU",
- "vendorName": "Nokia",
- "oamV4IpAddress": "val3",
- "oamV6IpAddress": "val4",
- "softwareVersion": "val7"
- }
+ "eventType": "pnfRegistration",
+ "priority": "Normal",
+ "version": "4.0.1",
+ "reportingEntityName": "NOK6061ZW8",
+ "sequence": 0,
+ "domain": "pnfRegistration",
+ "lastEpochMicrosec": 1540212137393,
+ "eventName": "pnfRegistration_Nokia_5gDu",
+ "vesEventListenerVersion": "7.0.1",
+ "sourceName": "NOK6061ZW8",
+ "nfNamingCode": "gNB"
+ },
+ "pnfRegistrationFields": {
+ "unitType": "val8",
+ "serialNumber": "6061ZW9",
+ "pnfRegistrationFieldsVersion": "2.0",
+ "manufactureDate": "1540212137393",
+ "modelNumber": "val6",
+ "lastServiceDate": "1540212137393",
+ "unitFamily": "BBU",
+ "vendorName": "Nokia",
+ "oamV4IpAddress": "val3",
+ "oamV6IpAddress": "val4",
+ "softwareVersion": "val7"
}
}
-]
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/tests/dcaegen2/prh-testcases/assets/re-registration/expected-logical-link.json b/tests/dcaegen2/prh-testcases/assets/re-registration/expected-logical-link.json
index 95c5570..b75df88 100644
--- a/tests/dcaegen2/prh-testcases/assets/re-registration/expected-logical-link.json
+++ b/tests/dcaegen2/prh-testcases/assets/re-registration/expected-logical-link.json
@@ -1,11 +1,13 @@
{
"link-name": "bbs-link",
"link-type": "attachment-point",
- "relationship-list": [
- {
- "relationship": {
- "related-link": "/network/pnfs/pnf/NOK6061ZW9"
+ "relationship-list":
+ {
+ "relationship": [
+ {
+ "related-link": "/network/pnfs/pnf/NOK6061ZW9",
+ "relationship-data": []
}
- }
- ]
+ ]
+ }
}
diff --git a/tests/dcaegen2/prh-testcases/assets/re-registration/ves-event.json b/tests/dcaegen2/prh-testcases/assets/re-registration/ves-event.json
index 84e5223..5de986c 100644
--- a/tests/dcaegen2/prh-testcases/assets/re-registration/ves-event.json
+++ b/tests/dcaegen2/prh-testcases/assets/re-registration/ves-event.json
@@ -1,42 +1,40 @@
-[
- {
- "event": {
- "commonEventHeader": {
- "startEpochMicrosec": 1540212137393,
- "sourceId": "val13",
- "eventId": "registration_40212137",
- "nfcNamingCode": "oam",
- "internalHeaderFields": {
- "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC"
- },
- "eventType": "pnfRegistration",
- "priority": "Normal",
- "version": "4.0.1",
- "reportingEntityName": "NOK6061ZW9",
- "sequence": 0,
- "domain": "pnfRegistration",
- "lastEpochMicrosec": 1540212137393,
- "eventName": "pnfRegistration_Nokia_5gDu",
- "vesEventListenerVersion": "7.0.1",
- "sourceName": "NOK6061ZW9",
- "nfNamingCode": "gNB"
+{
+ "event": {
+ "commonEventHeader": {
+ "startEpochMicrosec": 1540212137393,
+ "sourceId": "val13",
+ "eventId": "registration_40212137",
+ "nfcNamingCode": "oam",
+ "internalHeaderFields": {
+ "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC"
},
- "pnfRegistrationFields": {
- "unitType": "val8",
- "serialNumber": "6061ZW9",
- "pnfRegistrationFieldsVersion": "2.0",
- "manufactureDate": "1540212137393",
- "modelNumber": "val6",
- "lastServiceDate": "1540212137393",
- "unitFamily": "BBU",
- "vendorName": "Nokia",
- "oamV4IpAddress": "val3",
- "oamV6IpAddress": "val4",
- "softwareVersion": "val7",
- "additionalFields": {
- "attachment-point": "bbs-link"
- }
+ "eventType": "pnfRegistration",
+ "priority": "Normal",
+ "version": "4.0.1",
+ "reportingEntityName": "NOK6061ZW9",
+ "sequence": 0,
+ "domain": "pnfRegistration",
+ "lastEpochMicrosec": 1540212137393,
+ "eventName": "pnfRegistration_Nokia_5gDu",
+ "vesEventListenerVersion": "7.0.1",
+ "sourceName": "NOK6061ZW9",
+ "nfNamingCode": "gNB"
+ },
+ "pnfRegistrationFields": {
+ "unitType": "val8",
+ "serialNumber": "6061ZW9",
+ "pnfRegistrationFieldsVersion": "2.0",
+ "manufactureDate": "1540212137393",
+ "modelNumber": "val6",
+ "lastServiceDate": "1540212137393",
+ "unitFamily": "BBU",
+ "vendorName": "Nokia",
+ "oamV4IpAddress": "val3",
+ "oamV6IpAddress": "val4",
+ "softwareVersion": "val7",
+ "additionalFields": {
+ "attachment-point": "bbs-link"
}
}
}
-]
+}
\ No newline at end of file
diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-missing-field/invalid-ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-missing-field/invalid-ves-event.json
index 2bdc057..dd135f4 100644
--- a/tests/dcaegen2/prh-testcases/assets/ves-event-missing-field/invalid-ves-event.json
+++ b/tests/dcaegen2/prh-testcases/assets/ves-event-missing-field/invalid-ves-event.json
@@ -1,18 +1,16 @@
-[
- {
- "event": {
- "commonEventHeader": {
- "sourceName": ""
- },
- "pnfRegistrationFields": {
- "oamV4IpAddress": "10.18.123.236",
- "oamV6IpAddress": "2001:0db8:85a3:0000:0000:8a2a:0370:7334",
- "serialNumber": "",
- "vendorName": "",
- "modelNumber": "",
- "unitType": "",
- "additionalFields": {}
- }
+{
+ "event": {
+ "commonEventHeader": {
+ "sourceName": ""
+ },
+ "pnfRegistrationFields": {
+ "oamV4IpAddress": "10.18.123.236",
+ "oamV6IpAddress": "2001:0db8:85a3:0000:0000:8a2a:0370:7334",
+ "serialNumber": "",
+ "vendorName": "",
+ "modelNumber": "",
+ "unitType": "",
+ "additionalFields": {}
}
}
-]
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/expected-logical-link.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/expected-logical-link.json
index 95c5570..9b4c7e2 100644
--- a/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/expected-logical-link.json
+++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/expected-logical-link.json
@@ -1,11 +1,13 @@
{
"link-name": "bbs-link",
"link-type": "attachment-point",
- "relationship-list": [
+ "relationship-list":
{
- "relationship": {
- "related-link": "/network/pnfs/pnf/NOK6061ZW9"
- }
+ "relationship": [
+ {
+ "related-link": "/network/pnfs/pnf/NOK6061ZW9",
+ "relationship-data": []
+ }
+ ]
}
- ]
}
diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/ves-event.json
index 84e5223..5de986c 100644
--- a/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/ves-event.json
+++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/ves-event.json
@@ -1,42 +1,40 @@
-[
- {
- "event": {
- "commonEventHeader": {
- "startEpochMicrosec": 1540212137393,
- "sourceId": "val13",
- "eventId": "registration_40212137",
- "nfcNamingCode": "oam",
- "internalHeaderFields": {
- "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC"
- },
- "eventType": "pnfRegistration",
- "priority": "Normal",
- "version": "4.0.1",
- "reportingEntityName": "NOK6061ZW9",
- "sequence": 0,
- "domain": "pnfRegistration",
- "lastEpochMicrosec": 1540212137393,
- "eventName": "pnfRegistration_Nokia_5gDu",
- "vesEventListenerVersion": "7.0.1",
- "sourceName": "NOK6061ZW9",
- "nfNamingCode": "gNB"
+{
+ "event": {
+ "commonEventHeader": {
+ "startEpochMicrosec": 1540212137393,
+ "sourceId": "val13",
+ "eventId": "registration_40212137",
+ "nfcNamingCode": "oam",
+ "internalHeaderFields": {
+ "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC"
},
- "pnfRegistrationFields": {
- "unitType": "val8",
- "serialNumber": "6061ZW9",
- "pnfRegistrationFieldsVersion": "2.0",
- "manufactureDate": "1540212137393",
- "modelNumber": "val6",
- "lastServiceDate": "1540212137393",
- "unitFamily": "BBU",
- "vendorName": "Nokia",
- "oamV4IpAddress": "val3",
- "oamV6IpAddress": "val4",
- "softwareVersion": "val7",
- "additionalFields": {
- "attachment-point": "bbs-link"
- }
+ "eventType": "pnfRegistration",
+ "priority": "Normal",
+ "version": "4.0.1",
+ "reportingEntityName": "NOK6061ZW9",
+ "sequence": 0,
+ "domain": "pnfRegistration",
+ "lastEpochMicrosec": 1540212137393,
+ "eventName": "pnfRegistration_Nokia_5gDu",
+ "vesEventListenerVersion": "7.0.1",
+ "sourceName": "NOK6061ZW9",
+ "nfNamingCode": "gNB"
+ },
+ "pnfRegistrationFields": {
+ "unitType": "val8",
+ "serialNumber": "6061ZW9",
+ "pnfRegistrationFieldsVersion": "2.0",
+ "manufactureDate": "1540212137393",
+ "modelNumber": "val6",
+ "lastServiceDate": "1540212137393",
+ "unitFamily": "BBU",
+ "vendorName": "Nokia",
+ "oamV4IpAddress": "val3",
+ "oamV6IpAddress": "val4",
+ "softwareVersion": "val7",
+ "additionalFields": {
+ "attachment-point": "bbs-link"
}
}
}
-]
+}
\ No newline at end of file
diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/ves-event.json
index b7e5af5..ba91f28 100644
--- a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/ves-event.json
+++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/ves-event.json
@@ -1,41 +1,39 @@
-[
- {
- "event": {
- "commonEventHeader": {
- "startEpochMicrosec": 1540212137393,
- "sourceId": "val13",
- "eventId": "registration_40212137",
- "nfcNamingCode": "oam",
- "internalHeaderFields": {
- "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC"
- },
- "eventType": "pnfRegistration",
- "priority": "Normal",
- "version": "4.0.1",
- "reportingEntityName": "NOK6061ZW8",
- "sequence": 0,
- "domain": "pnfRegistration",
- "lastEpochMicrosec": 1540212137393,
- "eventName": "pnfRegistration_Nokia_5gDu",
- "vesEventListenerVersion": "7.0.1",
- "sourceName": "NOK6061ZW8",
- "nfNamingCode": "gNB"
+{
+ "event": {
+ "commonEventHeader": {
+ "startEpochMicrosec": 1540212137393,
+ "sourceId": "val13",
+ "eventId": "registration_40212137",
+ "nfcNamingCode": "oam",
+ "internalHeaderFields": {
+ "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC"
},
- "pnfRegistrationFields": {
- "unitType": "val8",
- "serialNumber": "6061ZW9",
- "pnfRegistrationFieldsVersion": "2.0",
- "manufactureDate": "1540212137393",
- "modelNumber": "val6",
- "lastServiceDate": "1540212137393",
- "unitFamily": "BBU",
- "vendorName": "Nokia",
- "oamV4IpAddress": "val3",
- "oamV6IpAddress": "val4",
- "softwareVersion": "val7",
- "additionalFields": {
- }
+ "eventType": "pnfRegistration",
+ "priority": "Normal",
+ "version": "4.0.1",
+ "reportingEntityName": "NOK6061ZW8",
+ "sequence": 0,
+ "domain": "pnfRegistration",
+ "lastEpochMicrosec": 1540212137393,
+ "eventName": "pnfRegistration_Nokia_5gDu",
+ "vesEventListenerVersion": "7.0.1",
+ "sourceName": "NOK6061ZW8",
+ "nfNamingCode": "gNB"
+ },
+ "pnfRegistrationFields": {
+ "unitType": "val8",
+ "serialNumber": "6061ZW9",
+ "pnfRegistrationFieldsVersion": "2.0",
+ "manufactureDate": "1540212137393",
+ "modelNumber": "val6",
+ "lastServiceDate": "1540212137393",
+ "unitFamily": "BBU",
+ "vendorName": "Nokia",
+ "oamV4IpAddress": "val3",
+ "oamV6IpAddress": "val4",
+ "softwareVersion": "val7",
+ "additionalFields": {
}
}
}
-]
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/ves-event.json
index fda6ef1..b56341f 100644
--- a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/ves-event.json
+++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/ves-event.json
@@ -1,42 +1,40 @@
-[
- {
- "event": {
- "commonEventHeader": {
- "startEpochMicrosec": 1540212137393,
- "sourceId": "val13",
- "eventId": "registration_40212137",
- "nfcNamingCode": "oam",
- "internalHeaderFields": {
- "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC"
- },
- "eventType": "pnfRegistration",
- "priority": "Normal",
- "version": "4.0.1",
- "reportingEntityName": "NOK6061ZW8",
- "sequence": 0,
- "domain": "pnfRegistration",
- "lastEpochMicrosec": 1540212137393,
- "eventName": "pnfRegistration_Nokia_5gDu",
- "vesEventListenerVersion": "7.0.1",
- "sourceName": "NOK6061ZW8",
- "nfNamingCode": "gNB"
+{
+ "event": {
+ "commonEventHeader": {
+ "startEpochMicrosec": 1540212137393,
+ "sourceId": "val13",
+ "eventId": "registration_40212137",
+ "nfcNamingCode": "oam",
+ "internalHeaderFields": {
+ "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC"
},
- "pnfRegistrationFields": {
- "unitType": "val8",
- "serialNumber": "6061ZW9",
- "pnfRegistrationFieldsVersion": "2.0",
- "manufactureDate": "1540212137393",
- "modelNumber": "val6",
- "lastServiceDate": "1540212137393",
- "unitFamily": "BBU",
- "vendorName": "Nokia",
- "oamV4IpAddress": "val3",
- "oamV6IpAddress": "val4",
- "softwareVersion": "val7",
- "additionalFields": {
- "attachment-point": ""
- }
+ "eventType": "pnfRegistration",
+ "priority": "Normal",
+ "version": "4.0.1",
+ "reportingEntityName": "NOK6061ZW8",
+ "sequence": 0,
+ "domain": "pnfRegistration",
+ "lastEpochMicrosec": 1540212137393,
+ "eventName": "pnfRegistration_Nokia_5gDu",
+ "vesEventListenerVersion": "7.0.1",
+ "sourceName": "NOK6061ZW8",
+ "nfNamingCode": "gNB"
+ },
+ "pnfRegistrationFields": {
+ "unitType": "val8",
+ "serialNumber": "6061ZW9",
+ "pnfRegistrationFieldsVersion": "2.0",
+ "manufactureDate": "1540212137393",
+ "modelNumber": "val6",
+ "lastServiceDate": "1540212137393",
+ "unitFamily": "BBU",
+ "vendorName": "Nokia",
+ "oamV4IpAddress": "val3",
+ "oamV6IpAddress": "val4",
+ "softwareVersion": "val7",
+ "additionalFields": {
+ "attachment-point": ""
}
}
}
-]
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/ves-event.json
index 10ce41c..3a768df 100644
--- a/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/ves-event.json
+++ b/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/ves-event.json
@@ -1,39 +1,37 @@
-[
- {
- "event": {
- "commonEventHeader": {
- "startEpochMicrosec": 1540212137393,
- "sourceId": "val13",
- "eventId": "registration_40212137",
- "nfcNamingCode": "oam",
- "internalHeaderFields": {
- "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC"
- },
- "eventType": "pnfRegistration",
- "priority": "Normal",
- "version": "4.0.1",
- "reportingEntityName": "NOK6061ZW8",
- "sequence": 0,
- "domain": "pnfRegistration",
- "lastEpochMicrosec": 1540212137393,
- "eventName": "pnfRegistration_Nokia_5gDu",
- "vesEventListenerVersion": "7.0.1",
- "sourceName": "NOK6061ZW8",
- "nfNamingCode": "gNB"
+{
+ "event": {
+ "commonEventHeader": {
+ "startEpochMicrosec": 1540212137393,
+ "sourceId": "val13",
+ "eventId": "registration_40212137",
+ "nfcNamingCode": "oam",
+ "internalHeaderFields": {
+ "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC"
},
- "pnfRegistrationFields": {
- "unitType": "val8",
- "serialNumber": "6061ZW9",
- "pnfRegistrationFieldsVersion": "2.0",
- "manufactureDate": "1540212137393",
- "modelNumber": "val6",
- "lastServiceDate": "1540212137393",
- "unitFamily": "BBU",
- "vendorName": "Nokia",
- "oamV4IpAddress": "val3",
- "oamV6IpAddress": "val4",
- "softwareVersion": "val7"
- }
+ "eventType": "pnfRegistration",
+ "priority": "Normal",
+ "version": "4.0.1",
+ "reportingEntityName": "NOK6061ZW8",
+ "sequence": 0,
+ "domain": "pnfRegistration",
+ "lastEpochMicrosec": 1540212137393,
+ "eventName": "pnfRegistration_Nokia_5gDu",
+ "vesEventListenerVersion": "7.0.1",
+ "sourceName": "NOK6061ZW8",
+ "nfNamingCode": "gNB"
+ },
+ "pnfRegistrationFields": {
+ "unitType": "val8",
+ "serialNumber": "6061ZW9",
+ "pnfRegistrationFieldsVersion": "2.0",
+ "manufactureDate": "1540212137393",
+ "modelNumber": "val6",
+ "lastServiceDate": "1540212137393",
+ "unitFamily": "BBU",
+ "vendorName": "Nokia",
+ "oamV4IpAddress": "val3",
+ "oamV6IpAddress": "val4",
+ "softwareVersion": "val7"
}
}
-]
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py b/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py
index b994261..b3f5f8d 100644
--- a/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py
+++ b/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py
@@ -46,8 +46,7 @@
@staticmethod
def create_invalid_notification(json_file):
output = {}
- input = json.loads(json_file)[0]
-
+ input = json.loads(json_file)
output["correlationId"] = PrhLibrary.__extract_correlation_id_value(input)
output["oamV4IpAddress"] = PrhLibrary.__extract_value_from_pnfRegistrationFields(input, "oamV4IpAddress")
output["oamV6IpAddress"] = PrhLibrary.__extract_value_from_pnfRegistrationFields(input, "oamV6IpAddress")
diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library.robot b/tests/dcaegen2/prh-testcases/resources/prh_library.robot
index bd426db..7bf1264 100644
--- a/tests/dcaegen2/prh-testcases/resources/prh_library.robot
+++ b/tests/dcaegen2/prh-testcases/resources/prh_library.robot
@@ -25,6 +25,7 @@
[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}
+ Log Invalid ves event: ${invalid_ves_event}
${notification}= Create invalid notification ${invalid_ves_event}
${error_msg}= Set Variable Incorrect json, consumerDmaapModel can not be created:
Wait Until Keyword Succeeds 10x 3000ms Check PRH json log ${error_msg} ${notification}
@@ -34,7 +35,7 @@
[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}
- Check PRH log |com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonArray
+ Check PRH log |WARN |Incorrect json, consumerDmaapModel can not be created:
Verify missing AAI record is logged
[Timeout] 100s
diff --git a/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py b/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
index 43d0bca..5ec601f 100644
--- a/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
+++ b/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
@@ -2,6 +2,7 @@
import re
import sys
import time
+import json
from http.server import BaseHTTPRequestHandler
import httpServerLib
@@ -99,7 +100,7 @@
try:
if re.search('/events/unauthenticated.VES_PNFREG_OUTPUT/OpenDCAE-c12/c12', self.path):
global event_ves
- httpServerLib.set_response_200_ok(self, payload = event_ves)
+ httpServerLib.set_response_200_ok(self, payload=self.pack_event_json_as_quoted_string_into_array(event_ves))
logger.debug(
'DMaaPHandler GET /events/unauthenticated.VES_PNFREG_OUTPUT/OpenDcae-c12/c12 -> 200, content: '
+ event_ves.decode("utf-8"))
@@ -112,6 +113,16 @@
logger.error(e)
httpServerLib.set_response_500_server_error(self)
+ def pack_event_json_as_quoted_string_into_array(self, event):
+ if event == DMAAP_EMPTY:
+ return DMAAP_EMPTY
+ else:
+ decoded = event_ves.decode("utf-8")
+ packed = '[' + json.dumps(decoded) + ']'
+ logger.info("prepared response: " + packed)
+ return packed.encode()
+
+
def _main_(handler_class=DMaaPHandler, protocol="HTTP/1.0"):
handler_class.protocol_version = protocol
httpServerLib.start_https_endpoint(2223, DMaaPHandler, keyfile="certs/dmaap-mr.key", certfile="certs/dmaap-mr.crt", ca_certs="certs/root.crt")