aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/tests/dcaegen2/prh-testcases/resources/simulator
diff options
context:
space:
mode:
authorMariusz Wagner <mariusz.wagner@nokia.com>2018-07-05 11:32:51 +0200
committerMariusz Wagner <mariusz.wagner@nokia.com>2018-07-05 11:32:51 +0200
commit60be36dd12980b15db0edbb7d14c7a719596d367 (patch)
treed46b95ea0986ec9da890a02e8bae89ec8051a172 /test/csit/tests/dcaegen2/prh-testcases/resources/simulator
parentbc76450dfae26da5364b4ef79535314598e04a1c (diff)
Fix for jenkins job
Issue-ID: INT-510 Change-Id: I75cd49524b313d1db121b246b70f8b3ba2ba11d4 Signed-off-by: Mariusz Wagner <mariusz.wagner@nokia.com>
Diffstat (limited to 'test/csit/tests/dcaegen2/prh-testcases/resources/simulator')
-rw-r--r--test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py23
-rw-r--r--test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator2
-rw-r--r--test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py28
-rw-r--r--test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator2
4 files changed, 26 insertions, 29 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
index 2c0b42dcd..a0dd814b8 100644
--- a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py
+++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py
@@ -17,43 +17,42 @@ class AAIHandler(BaseHTTPServer.BaseHTTPRequestHandler):
self.end_headers()
return
-
+
def do_PATCH(self):
- pnfs_name = '/aai/v12/network/pnfs/pnf/' + pnfs
+ pnfs_name = '/aai/v12/network/pnfs/pnf/' + pnfs
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 do_GET(self):
self.send_response(200)
self.send_header('Content-Type', 'application/json')
self.end_headers()
self.wfile.write('GET')
self.wfile.close()
-
+
return
-def _main_ (HandlerClass = AAIHandler,
- ServerClass = BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"):
-
+def _main_ (HandlerClass = AAIHandler, ServerClass = BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"):
+
if sys.argv[1:]:
port = int(sys.argv[1])
else:
port = 3333
-
+
server_address = ('', port)
-
+
HandlerClass.protocol_version = protocol
httpd = ServerClass(server_address, HandlerClass)
-
+
sa = httpd.socket.getsockname()
print "Serving HTTP on", sa[0], "port", sa[1], "..."
httpd.serve_forever()
-
+
if __name__ == '__main__':
_main_()
diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator
index 2d96d8925..d647207fc 100644
--- a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator
+++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/AAI_simulator
@@ -4,7 +4,7 @@ ENV https_proxy "$https_proxy"
ADD AAI.py /
-RUN pip install robotframework
+RUN pip install robotframework
EXPOSE 3333
diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
index af716fd06..167867842 100644
--- a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
+++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
@@ -7,10 +7,11 @@ from robot.api import logger
posted_event_from_prh = 'Empty'
received_event_to_get_method = 'Empty'
-class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler):
+class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_PUT(self):
if re.search('/set_get_event', self.path):
global received_event_to_get_method
+ posted_event_from_prh = 'Empty'
content_length = int(self.headers['Content-Length'])
received_event_to_get_method = self.rfile.read(content_length)
self.send_response(200)
@@ -18,20 +19,20 @@ class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler):
self.end_headers()
return
-
+
def do_POST(self):
- if re.search('/events/pnfReady', self.path):
+ if re.search('/events/unauthenticated.PNF_READY', self.path):
global posted_event_from_prh
content_length = int(self.headers['Content-Length'])
posted_event_from_prh = self.rfile.read(content_length)
self.send_response(200)
self.send_header('Content-Type', 'application/json')
self.end_headers()
-
+
return
-
+
def do_GET(self):
- if re.search('/events/unauthenticated.SEC_OTHER_OUTPUT', self.path):
+ if re.search('/events/unauthenticated.SEC_OTHER_OUTPUT/OpenDcae-c12/c12', self.path):
self.send_response(200)
self.send_header('Content-Type', 'application/json')
self.end_headers()
@@ -42,8 +43,6 @@ class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler):
self.send_header('Content-Type', 'application/json')
self.end_headers()
self.wfile.write(posted_event_from_prh)
- global posted_event_from_prh
- posted_event_from_prh = 'Empty'
self.wfile.close()
else:
self.send_response(200)
@@ -54,22 +53,21 @@ class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler):
return
-def _main_ (HandlerClass = DMaaPHandler,
- ServerClass = BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"):
-
+def _main_ (HandlerClass = DMaaPHandler, ServerClass = BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"):
+
if sys.argv[1:]:
port = int(sys.argv[1])
else:
port = 2222
-
+
server_address = ('', port)
-
+
HandlerClass.protocol_version = protocol
httpd = ServerClass(server_address, HandlerClass)
-
+
sa = httpd.socket.getsockname()
print "Serving HTTP on", sa[0], "port", sa[1], "..."
httpd.serve_forever()
-
+
if __name__ == '__main__':
_main_()
diff --git a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator
index 4de65393d..37da1c7c1 100644
--- a/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator
+++ b/test/csit/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP_simulator
@@ -4,7 +4,7 @@ ENV https_proxy "$https_proxy"
ADD DMaaP.py /
-RUN pip install robotframework
+RUN pip install robotframework
EXPOSE 2222