diff options
author | Gary Wu <gary.i.wu@huawei.com> | 2018-09-27 10:29:30 -0700 |
---|---|---|
committer | Gary Wu <gary.i.wu@huawei.com> | 2018-09-27 12:50:28 -0700 |
commit | 2d3d8dcf6ef1bd2a161c69d561c629c5ec3f59c4 (patch) | |
tree | 652fd47a183c291e96c6721f550a5f63464f6e66 /test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py | |
parent | e161173e279a73134dda4c2f429605d6c9ee1fe7 (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/simulator/AAI.py')
-rw-r--r-- | test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py deleted file mode 100644 index c57903c30..000000000 --- a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py +++ /dev/null @@ -1,56 +0,0 @@ -from http.server import BaseHTTPRequestHandler -from http.server import HTTPServer -import re -import sys - -pnfs = 'Empty' - - -class AAIHandler(BaseHTTPRequestHandler): - - def do_PUT(self): - if re.search('/set_pnfs', self.path): - global pnfs - content_length = int(self.headers['Content-Length']) - pnfs = self.rfile.read(content_length) - _header_200_and_json(self) - - return - - def do_PATCH(self): - pnfs_name = '/aai/v12/network/pnfs/pnf/' + pnfs.decode() - if re.search('wrong_aai_record', self.path): - self.send_response(400) - self.end_headers() - elif re.search(pnfs_name, self.path): - self.send_response(200) - self.end_headers() - - return - - -def _header_200_and_json(self): - self.send_response(200) - self.send_header('Content-Type', 'application/json') - self.end_headers() - - -def _main_(handler_class=AAIHandler, server_class=HTTPServer, protocol="HTTP/1.0"): - - if sys.argv[1:]: - port = int(sys.argv[1]) - else: - port = 3333 - - server_address = ('', port) - - handler_class.protocol_version = protocol - httpd = server_class(server_address, handler_class) - - sa = httpd.socket.getsockname() - print("Serving HTTP on", sa[0], "port", sa[1], "...") - httpd.serve_forever() - - -if __name__ == '__main__': - _main_() |