diff options
author | Mariusz Wagner <mariusz.wagner@nokia.com> | 2018-09-28 09:03:08 +0200 |
---|---|---|
committer | Mariusz Wagner <mariusz.wagner@nokia.com> | 2018-09-28 09:03:08 +0200 |
commit | 1fd732afea2c2048303413d4fa47407a71cf2139 (patch) | |
tree | 69b8b76e46182ef565b2b9ccd718fb25d03b0f3b /tests/dcaegen2/prh-testcases/resources | |
parent | bd341518ff41ddaa96afd22df6301075e7a8b4f5 (diff) |
Fixed job in Jenkins
- fixed job
- added new TC - event without IPv6 field
Issue-ID: INT-673
Change-Id: I4fe7c2259d61c19eea6ad7b018c953ceee1442dc
Signed-off-by: Mariusz Wagner <mariusz.wagner@nokia.com>
Diffstat (limited to 'tests/dcaegen2/prh-testcases/resources')
-rw-r--r-- | tests/dcaegen2/prh-testcases/resources/PrhLibrary.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py b/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py index 6a95c71e..656f6fc3 100644 --- a/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py +++ b/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py @@ -21,18 +21,18 @@ class PrhLibrary(object): @staticmethod def create_pnf_ready_notification(json_file): json_to_python = json.loads(json_file) - ipv4 = json_to_python["event"]["pnfRegistrationFields"]["oamV4IpAddress"] - ipv6 = json_to_python["event"]["pnfRegistrationFields"]["oamV6IpAddress"] - correlationId = json_to_python["event"]["commonEventHeader"]["sourceName"] - str_json = '{"correlationId":"' + correlationId + '","ipaddress-v4-oam":"' + ipv4 + '","ipaddress-v6-oam":"' + ipv6 + '"}' + ipv4 = json_to_python.get("event").get("pnfRegistrationFields").get("oamV4IpAddress") + ipv6 = json_to_python.get("event").get("pnfRegistrationFields").get("oamV6IpAddress") if "oamV6IpAddress" in json_to_python["event"]["pnfRegistrationFields"] else "" + correlation_id = json_to_python.get("event").get("commonEventHeader").get("sourceName") + str_json = '{"correlationId":"' + correlation_id + '","ipaddress-v4-oam":"' + ipv4 + '","ipaddress-v6-oam":"' + ipv6 + '"}' python_to_json = json.dumps(str_json) return python_to_json.replace("\\", "")[1:-1] @staticmethod def create_pnf_name(json_file): json_to_python = json.loads(json_file) - correlationId = json_to_python["event"]["commonEventHeader"]["sourceName"] - return correlationId + correlation_id = json_to_python.get("sourceName") + return correlation_id @staticmethod def stop_aai(): |