aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-09-27 10:29:30 -0700
committerGary Wu <gary.i.wu@huawei.com>2018-09-27 12:50:28 -0700
commit2d3d8dcf6ef1bd2a161c69d561c629c5ec3f59c4 (patch)
tree652fd47a183c291e96c6721f550a5f63464f6e66 /test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py
parente161173e279a73134dda4c2f429605d6c9ee1fe7 (diff)
Move CSIT to integration/csit repo
To facilite branching of CSIT tests, all CSIT test code and scripts are relocated to the integration/csit repo. Change-Id: I6777cd414e43dbf2bfa6215f7e50849e1a6a2e59 Issue-ID: INT-671 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py')
-rw-r--r--test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py b/test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py
deleted file mode 100644
index 6a95c71e5..000000000
--- a/test/csit/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py
+++ /dev/null
@@ -1,46 +0,0 @@
-import json
-
-import docker
-
-
-class PrhLibrary(object):
-
- def __init__(self):
- pass
-
- @staticmethod
- def check_for_log(search_for):
- client = docker.from_env()
- container = client.containers.get('prh')
- for line in container.logs(stream=True):
- if search_for in line.strip():
- return True
- else:
- return False
-
- @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 + '"}'
- 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
-
- @staticmethod
- def stop_aai():
- client = docker.from_env()
- container = client.containers.get('aai_simulator')
- container.stop()
-
- def create_invalid_notification(self, json_file):
- return self.create_pnf_ready_notification(json_file).replace("\":", "\": ")\
- .replace("ipaddress-v4-oam", "oamV4IpAddress").replace("ipaddress-v6-oam", "oamV6IpAddress")\
- .replace("}", "\\n}")