diff options
Diffstat (limited to 'tests/dcaegen2/prh-testcases/resources/simulator/AAI.py')
-rw-r--r-- | tests/dcaegen2/prh-testcases/resources/simulator/AAI.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py b/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py index 9b76adf8..f6d3b1f6 100644 --- a/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py +++ b/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py @@ -22,6 +22,7 @@ AAI_RESOURCE_NOT_FOUND = b'{}' pnf_entries = {} patched_pnf = AAI_RESOURCE_NOT_FOUND created_logical_link = AAI_RESOURCE_NOT_FOUND +service_instance = AAI_RESOURCE_NOT_FOUND class AAISetup(BaseHTTPRequestHandler): @@ -53,6 +54,13 @@ class AAISetup(BaseHTTPRequestHandler): httpServerLib.set_response_200_ok(self) logger.debug('AAISetup PUT /setup/add_pnf_entry [' + pnf_name + '] -> 200 OK') + elif re.search('/setup/add_service_instace', self.path): + service_instance_payload = httpServerLib.get_payload(self) + global service_instance + service_instance = json.loads(service_instance_payload) + httpServerLib.set_response_200_ok(self) + logger.debug('AAISetup PUT /setup/add_service_instace -> 200 OK') + elif re.search('/set_pnf', self.path): pnf_name = httpServerLib.get_payload(self).decode() pnf_entries[pnf_name] = AAI_RESOURCE_NOT_FOUND @@ -70,9 +78,11 @@ class AAISetup(BaseHTTPRequestHandler): global pnf_entries global patched_pnf global created_logical_link + global service_instance pnf_entries = {} patched_pnf = AAI_RESOURCE_NOT_FOUND created_logical_link = AAI_RESOURCE_NOT_FOUND + service_instance = AAI_RESOURCE_NOT_FOUND httpServerLib.set_response_200_ok(self) logger.debug('AAISetup POST /reset -> 200 OK') @@ -95,6 +105,9 @@ class AAIHandler(BaseHTTPRequestHandler): else: httpServerLib.set_response_404_not_found(self) logger.info('AAIHandler GET /aai/v12/network/pnfs/pnf/' + pnf_name + ' -> 404 Not found, actual entries: ' + str(pnf_entries.keys())) + elif re.search('aai/v12/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFW/service-instances/service-instance/bbs_service', self.path): + httpServerLib.set_response_200_ok(self, payload = service_instance) + logger.debug('AAIHandler GET aai/v12/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFW/service-instances/service-instance/bbs_service -> 200 OK') else: httpServerLib.set_response_404_not_found(self) logger.info('AAIHandler GET ' + self.path + ' -> 404 Not found') |