Update docker version numbers in Manifest file 03/40803/1
authorMarco Platania <platania@research.att.com>
Tue, 3 Apr 2018 20:52:13 +0000 (16:52 -0400)
committerMarco Platania <platania@research.att.com>
Tue, 3 Apr 2018 20:52:59 +0000 (16:52 -0400)
Change-Id: I17d617d5dfa060441b4a143066b62537066c018e
Issue-ID: INT-444
Signed-off-by: Marco Platania <platania@research.att.com>
test/csit/tests/dcaegen2/testcases/resources/DMaaP.py
test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py
test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot
test/csit/tests/dcaegen2/testcases/resources/dcae_properties.robot
test/csit/tests/vfc/nfvo-wfengine/workflow.robot
version-manifest/src/main/resources/docker-manifest.csv

index 63e4e8c..db59557 100644 (file)
-'''\r
-Created on Aug 15, 2017\r
-\r
-@author: sw6830\r
-'''\r
-import os\r
-import posixpath\r
-import BaseHTTPServer\r
-import urllib\r
-import urlparse\r
-import cgi, sys, shutil, mimetypes\r
-from jsonschema import validate\r
-import jsonschema, json\r
-import DcaeVariables\r
-import SimpleHTTPServer\r
-from robot.api import logger\r
-\r
-\r
-try:\r
-    from cStringIO import StringIO\r
-except ImportError:\r
-    from StringIO import StringIO\r
-\r
-EvtSchema = None\r
-DMaaPHttpd = None\r
-\r
-\r
-def cleanUpEvent():\r
-    sz = DcaeVariables.VESEventQ.qsize()\r
-    for i in range(sz):\r
-        try:\r
-            self.evtQueue.get_nowait()\r
-        except:\r
-            pass\r
-\r
-def enqueEvent(evt):\r
-    if DcaeVariables.VESEventQ != None:\r
-        try:\r
-            DcaeVariables.VESEventQ.put(evt)\r
-            if DcaeVariables.IsRobotRun:\r
-                logger.console("DMaaP Event enqued - size=" + str(len(evt)))\r
-            else:\r
-                print ("DMaaP Event enqueued - size=" + str(len(evt)))\r
-            return True\r
-        except Exception as e:\r
-            print (str(e))\r
-            return False\r
-    return False\r
-            \r
-def dequeEvent(waitSec=25):\r
-    if DcaeVariables.IsRobotRun:\r
-        logger.console("Enter DequeEvent")\r
-    try:\r
-        evt = DcaeVariables.VESEventQ.get(True, waitSec)\r
-        if DcaeVariables.IsRobotRun:\r
-            logger.console("DMaaP Event dequeued - size=" + str(len(evt)))\r
-        else:\r
-            print("DMaaP Event dequeued - size=" + str(len(evt)))\r
-        return evt\r
-    except Exception as e:\r
-        if DcaeVariables.IsRobotRun:\r
-            logger.console(str(e))\r
-            logger.console("DMaaP Event dequeue timeout")\r
-        else:\r
-            print("DMaaP Event dequeue timeout")\r
-        return None\r
\r
-class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler):\r
-      \r
-    def do_PUT(self):\r
-        self.send_response(405)\r
-        return\r
-        \r
-    def do_POST(self):\r
-        \r
-        respCode = 0\r
-        # Parse the form data posted\r
-        '''\r
-        form = cgi.FieldStorage(\r
-            fp=self.rfile, \r
-            headers=self.headers,\r
-            environ={'REQUEST_METHOD':'POST',\r
-                     'CONTENT_TYPE':self.headers['Content-Type'],\r
-                     })\r
-        \r
-        \r
-        form = cgi.FieldStorage(\r
-        fp=self.rfile,\r
-        headers=self.headers,\r
-        environ={"REQUEST_METHOD": "POST"})\r
-\r
-        for item in form.list:\r
-            print "%s=%s" % (item.name, item.value)\r
-            \r
-        '''\r
-        \r
-        if 'POST' not in self.requestline:\r
-            respCode = 405\r
-            \r
-        '''\r
-        if respCode == 0:\r
-            if '/eventlistener/v5' not in self.requestline and '/eventlistener/v5/eventBatch' not in self.requestline and \\r
-                        '/eventlistener/v5/clientThrottlingState' not in self.requestline:\r
-                respCode = 404\r
-         \r
-        \r
-        if respCode == 0:\r
-            if 'Y29uc29sZTpaakprWWpsbE1qbGpNVEkyTTJJeg==' not in str(self.headers):\r
-                respCode = 401\r
-        '''  \r
-        \r
-        if respCode == 0:\r
-            content_len = int(self.headers.getheader('content-length', 0))\r
-            post_body = self.rfile.read(content_len)\r
-            \r
-            if DcaeVariables.IsRobotRun:\r
-                logger.console("\n" + "DMaaP Receive Event:\n" + post_body)\r
-            else:\r
-                print("\n" + "DMaaP Receive Event:")\r
-                print (post_body)\r
-            \r
-            indx = post_body.index("{")\r
-            if indx != 0:\r
-                post_body = post_body[indx:]\r
-            \r
-            if enqueEvent(post_body) == False:\r
-                print "enque event fails"\r
-                   \r
-            global EvtSchema\r
-            try:\r
-                if EvtSchema == None:\r
-                    with open(DcaeVariables.CommonEventSchemaV5) as file:\r
-                        EvtSchema = json.load(file)\r
-                decoded_body = json.loads(post_body)\r
-                jsonschema.validate(decoded_body, EvtSchema)\r
-            except:\r
-                respCode = 400\r
-        \r
-        # Begin the response\r
-        if DcaeVariables.IsRobotRun == False:\r
-            print ("Response Message:")\r
-        \r
-        '''\r
-        {\r
-          "200" : {\r
-            "description" : "Success",\r
-            "schema" : {\r
-              "$ref" : "#/definitions/DR_Pub"\r
-            }\r
-        }\r
-        \r
-        rspStr = "{'responses' : {'200' : {'description' : 'Success'}}}"\r
-        rspStr1 = "{'count': 1, 'serverTimeMs': 3}"\r
-\r
-        '''\r
-        \r
-        if respCode == 0:\r
-            if 'clientThrottlingState' in self.requestline:\r
-                self.send_response(204)\r
-            else:\r
-                self.send_response(200)\r
-                self.send_header('Content-Type', 'application/json')\r
-                self.end_headers()\r
-                #self.wfile.write("{'responses' : {'200' : {'description' : 'Success'}}}")\r
-                self.wfile.write("{'count': 1, 'serverTimeMs': 3}")\r
-                self.wfile.close()\r
-        else:\r
-            self.send_response(respCode)\r
-        \r
-        '''\r
-        self.end_headers()\r
-        self.wfile.write('Client: %s\n' % str(self.client_address))\r
-        self.wfile.write('User-agent: %s\n' % str(self.headers['user-agent']))\r
-        self.wfile.write('Path: %s\n' % self.path)\r
-        self.wfile.write('Form data:\n')\r
-        self.wfile.close()\r
-\r
-        # Echo back information about what was posted in the form\r
-        for field in form.keys():\r
-            field_item = form[field]\r
-            if field_item.filename:\r
-                # The field contains an uploaded file\r
-                file_data = field_item.file.read()\r
-                file_len = len(file_data)\r
-                del file_data\r
-                self.wfile.write('\tUploaded %s as "%s" (%d bytes)\n' % \\r
-                        (field, field_item.filename, file_len))\r
-            else:\r
-                # Regular form value\r
-                self.wfile.write('\t%s=%s\n' % (field, form[field].value))\r
-        '''\r
-        return\r
-    \r
-    \r
-    def do_GET(self):\r
-        """Serve a GET request."""\r
-        f = self.send_head()\r
-        if f:\r
-            try:\r
-                self.copyfile(f, self.wfile)\r
-            finally:\r
-                f.close()\r
-\r
-    def do_HEAD(self):\r
-        """Serve a HEAD request."""\r
-        f = self.send_head()\r
-        if f:\r
-            f.close()\r
-\r
-    def send_head(self):\r
-        """Common code for GET and HEAD commands.\r
-\r
-        This sends the response code and MIME headers.\r
-\r
-        Return value is either a file object (which has to be copied\r
-        to the outputfile by the caller unless the command was HEAD,\r
-        and must be closed by the caller under all circumstances), or\r
-        None, in which case the caller has nothing further to do.\r
-\r
-        """\r
-        path = self.translate_path(self.path)\r
-        f = None\r
-        if os.path.isdir(path):\r
-            parts = urlparse.urlsplit(self.path)\r
-            if not parts.path.endswith('/'):\r
-                # redirect browser - doing basically what apache does\r
-                self.send_response(301)\r
-                new_parts = (parts[0], parts[1], parts[2] + '/',\r
-                             parts[3], parts[4])\r
-                new_url = urlparse.urlunsplit(new_parts)\r
-                self.send_header("Location", new_url)\r
-                self.end_headers()\r
-                return None\r
-            for index in "index.html", "index.htm":\r
-                index = os.path.join(path, index)\r
-                if os.path.exists(index):\r
-                    path = index\r
-                    break\r
-            else:\r
-                return self.list_directory(path)\r
-        ctype = self.guess_type(path)\r
-        try:\r
-            # Always read in binary mode. Opening files in text mode may cause\r
-            # newline translations, making the actual size of the content\r
-            # transmitted *less* than the content-length!\r
-            f = open(path, 'rb')\r
-        except IOError:\r
-            self.send_error(404, "File not found")\r
-            return None\r
-        try:\r
-            self.send_response(200)\r
-            self.send_header("Content-type", ctype)\r
-            fs = os.fstat(f.fileno())\r
-            self.send_header("Content-Length", str(fs[6]))\r
-            self.send_header("Last-Modified", self.date_time_string(fs.st_mtime))\r
-            self.end_headers()\r
-            return f\r
-        except:\r
-            f.close()\r
-            raise\r
-\r
-    def list_directory(self, path):\r
-        """Helper to produce a directory listing (absent index.html).\r
-\r
-        Return value is either a file object, or None (indicating an\r
-        error).  In either case, the headers are sent, making the\r
-        interface the same as for send_head().\r
-\r
-        """\r
-        try:\r
-            list = os.listdir(path)\r
-        except os.error:\r
-            self.send_error(404, "No permission to list directory")\r
-            return None\r
-        list.sort(key=lambda a: a.lower())\r
-        f = StringIO()\r
-        displaypath = cgi.escape(urllib.unquote(self.path))\r
-        f.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">')\r
-        f.write("<html>\n<title>Directory listing for %s</title>\n" % displaypath)\r
-        f.write("<body>\n<h2>Directory listing for %s</h2>\n" % displaypath)\r
-        f.write("<hr>\n<ul>\n")\r
-        for name in list:\r
-            fullname = os.path.join(path, name)\r
-            displayname = linkname = name\r
-            # Append / for directories or @ for symbolic links\r
-            if os.path.isdir(fullname):\r
-                displayname = name + "/"\r
-                linkname = name + "/"\r
-            if os.path.islink(fullname):\r
-                displayname = name + "@"\r
-                # Note: a link to a directory displays with @ and links with /\r
-            f.write('<li><a href="%s">%s</a>\n'\r
-                    % (urllib.quote(linkname), cgi.escape(displayname)))\r
-        f.write("</ul>\n<hr>\n</body>\n</html>\n")\r
-        length = f.tell()\r
-        f.seek(0)\r
-        self.send_response(200)\r
-        encoding = sys.getfilesystemencoding()\r
-        self.send_header("Content-type", "text/html; charset=%s" % encoding)\r
-        self.send_header("Content-Length", str(length))\r
-        self.end_headers()\r
-        return f\r
-\r
-    def translate_path(self, path):\r
-        """Translate a /-separated PATH to the local filename syntax.\r
-\r
-        Components that mean special things to the local file system\r
-        (e.g. drive or directory names) are ignored.  (XXX They should\r
-        probably be diagnosed.)\r
-\r
-        """\r
-        # abandon query parameters\r
-        path = path.split('?',1)[0]\r
-        path = path.split('#',1)[0]\r
-        # Don't forget explicit trailing slash when normalizing. Issue17324\r
-        trailing_slash = path.rstrip().endswith('/')\r
-        path = posixpath.normpath(urllib.unquote(path))\r
-        words = path.split('/')\r
-        words = filter(None, words)\r
-        path = os.getcwd()\r
-        for word in words:\r
-            if os.path.dirname(word) or word in (os.curdir, os.pardir):\r
-                # Ignore components that are not a simple file/directory name\r
-                continue\r
-            path = os.path.join(path, word)\r
-        if trailing_slash:\r
-            path += '/'\r
-        return path\r
-\r
-    def copyfile(self, source, outputfile):\r
-        """Copy all data between two file objects.\r
-\r
-        The SOURCE argument is a file object open for reading\r
-        (or anything with a read() method) and the DESTINATION\r
-        argument is a file object open for writing (or\r
-        anything with a write() method).\r
-\r
-        The only reason for overriding this would be to change\r
-        the block size or perhaps to replace newlines by CRLF\r
-        -- note however that this the default server uses this\r
-        to copy binary data as well.\r
-\r
-        """\r
-        shutil.copyfileobj(source, outputfile)\r
-\r
-    def guess_type(self, path):\r
-        """Guess the type of a file.\r
-\r
-        Argument is a PATH (a filename).\r
-\r
-        Return value is a string of the form type/subtype,\r
-        usable for a MIME Content-type header.\r
-\r
-        The default implementation looks the file's extension\r
-        up in the table self.extensions_map, using application/octet-stream\r
-        as a default; however it would be permissible (if\r
-        slow) to look inside the data to make a better guess.\r
-\r
-        """\r
-\r
-        base, ext = posixpath.splitext(path)\r
-        if ext in self.extensions_map:\r
-            return self.extensions_map[ext]\r
-        ext = ext.lower()\r
-        if ext in self.extensions_map:\r
-            return self.extensions_map[ext]\r
-        else:\r
-            return self.extensions_map['']\r
-\r
-    if not mimetypes.inited:\r
-        mimetypes.init() # try to read system mime.types\r
-    extensions_map = mimetypes.types_map.copy()\r
-    extensions_map.update({\r
-        '': 'application/octet-stream', # Default\r
-        '.py': 'text/plain',\r
-        '.c': 'text/plain',\r
-        '.h': 'text/plain',\r
-        })\r
-\r
-def test(HandlerClass = DMaaPHandler,\r
-         ServerClass = BaseHTTPServer.HTTPServer, protocol="HTTP/1.0", port=3904):\r
-    print "Load event schema file: " + DcaeVariables.CommonEventSchemaV5\r
-    with open(DcaeVariables.CommonEventSchemaV5) as file:\r
-        global EvtSchema\r
-        EvtSchema = json.load(file)\r
-        \r
-    server_address = ('', port)\r
-\r
-    HandlerClass.protocol_version = protocol\r
-    httpd = ServerClass(server_address, HandlerClass)\r
-    \r
-    global DMaaPHttpd\r
-    DMaaPHttpd = httpd\r
-    DcaeVariables.HTTPD = httpd\r
-\r
-    sa = httpd.socket.getsockname()\r
-    print "Serving HTTP on", sa[0], "port", sa[1], "..."\r
-    #httpd.serve_forever()\r
-\r
-def _main_ (HandlerClass = DMaaPHandler,\r
-         ServerClass = BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"):\r
-    \r
-    if sys.argv[1:]:\r
-        port = int(sys.argv[1])\r
-    else:\r
-        port = 3904\r
-    \r
-    print "Load event schema file: " + DcaeVariables.CommonEventSchemaV5\r
-    with open(DcaeVariables.CommonEventSchemaV5) as file:\r
-        global EvtSchema\r
-        EvtSchema = json.load(file)\r
-        \r
-    server_address = ('', port)\r
-\r
-    HandlerClass.protocol_version = protocol\r
-    httpd = ServerClass(server_address, HandlerClass)\r
-\r
-    sa = httpd.socket.getsockname()\r
-    print "Serving HTTP on", sa[0], "port", sa[1], "..."\r
-    httpd.serve_forever()\r
-    \r
-if __name__ == '__main__':\r
+'''
+Created on Aug 15, 2017
+
+@author: sw6830
+'''
+import os
+import posixpath
+import BaseHTTPServer
+import urllib
+import urlparse
+import cgi, sys, shutil, mimetypes
+from jsonschema import validate
+import jsonschema, json
+import DcaeVariables
+import SimpleHTTPServer
+from robot.api import logger
+
+
+try:
+    from cStringIO import StringIO
+except ImportError:
+    from StringIO import StringIO
+
+EvtSchema = None
+DMaaPHttpd = None
+
+
+def cleanUpEvent():
+    sz = DcaeVariables.VESEventQ.qsize()
+    for i in range(sz):
+        try:
+            self.evtQueue.get_nowait()
+        except:
+            pass
+
+def enqueEvent(evt):
+    if DcaeVariables.VESEventQ != None:
+        try:
+            DcaeVariables.VESEventQ.put(evt)
+            if DcaeVariables.IsRobotRun:
+                logger.console("DMaaP Event enqued - size=" + str(len(evt)))
+            else:
+                print ("DMaaP Event enqueued - size=" + str(len(evt)))
+            return True
+        except Exception as e:
+            print (str(e))
+            return False
+    return False
+            
+def dequeEvent(waitSec=25):
+    if DcaeVariables.IsRobotRun:
+        logger.console("Enter DequeEvent")
+    try:
+        evt = DcaeVariables.VESEventQ.get(True, waitSec)
+        if DcaeVariables.IsRobotRun:
+            logger.console("DMaaP Event dequeued - size=" + str(len(evt)))
+        else:
+            print("DMaaP Event dequeued - size=" + str(len(evt)))
+        return evt
+    except Exception as e:
+        if DcaeVariables.IsRobotRun:
+            logger.console(str(e))
+            logger.console("DMaaP Event dequeue timeout")
+        else:
+            print("DMaaP Event dequeue timeout")
+        return None
+class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler):
+      
+    def do_PUT(self):
+        self.send_response(405)
+        return
+        
+    def do_POST(self):
+        
+        respCode = 0
+        # Parse the form data posted
+        '''
+        form = cgi.FieldStorage(
+            fp=self.rfile, 
+            headers=self.headers,
+            environ={'REQUEST_METHOD':'POST',
+                     'CONTENT_TYPE':self.headers['Content-Type'],
+                     })
+        
+        
+        form = cgi.FieldStorage(
+        fp=self.rfile,
+        headers=self.headers,
+        environ={"REQUEST_METHOD": "POST"})
+
+        for item in form.list:
+            print "%s=%s" % (item.name, item.value)
+            
+        '''
+        
+        if 'POST' not in self.requestline:
+            respCode = 405
+            
+        '''
+        if respCode == 0:
+            if '/eventlistener/v5' not in self.requestline and '/eventlistener/v5/eventBatch' not in self.requestline and \
+                        '/eventlistener/v5/clientThrottlingState' not in self.requestline:
+                respCode = 404
+         
+        
+        if respCode == 0:
+            if 'Y29uc29sZTpaakprWWpsbE1qbGpNVEkyTTJJeg==' not in str(self.headers):
+                respCode = 401
+        '''  
+        
+        if respCode == 0:
+            content_len = int(self.headers.getheader('content-length', 0))
+            post_body = self.rfile.read(content_len)
+            
+            if DcaeVariables.IsRobotRun:
+                logger.console("\n" + "DMaaP Receive Event:\n" + post_body)
+            else:
+                print("\n" + "DMaaP Receive Event:")
+                print (post_body)
+            
+            indx = post_body.index("{")
+            if indx != 0:
+                post_body = post_body[indx:]
+            
+            if enqueEvent(post_body) == False:
+                print "enque event fails"
+                   
+            global EvtSchema
+            try:
+                if EvtSchema == None:
+                    with open(DcaeVariables.CommonEventSchemaV5) as file:
+                        EvtSchema = json.load(file)
+                decoded_body = json.loads(post_body)
+                jsonschema.validate(decoded_body, EvtSchema)
+            except:
+                respCode = 400
+        
+        # Begin the response
+        if DcaeVariables.IsRobotRun == False:
+            print ("Response Message:")
+        
+        '''
+        {
+          "200" : {
+            "description" : "Success",
+            "schema" : {
+              "$ref" : "#/definitions/DR_Pub"
+            }
+        }
+        
+        rspStr = "{'responses' : {'200' : {'description' : 'Success'}}}"
+        rspStr1 = "{'count': 1, 'serverTimeMs': 3}"
+
+        '''
+        
+        if respCode == 0:
+            if 'clientThrottlingState' in self.requestline:
+                self.send_response(204)
+            else:
+                self.send_response(200)
+                self.send_header('Content-Type', 'application/json')
+                self.end_headers()
+                #self.wfile.write("{'responses' : {'200' : {'description' : 'Success'}}}")
+                self.wfile.write("{'count': 1, 'serverTimeMs': 3}")
+                self.wfile.close()
+        else:
+            self.send_response(respCode)
+        
+        '''
+        self.end_headers()
+        self.wfile.write('Client: %s\n' % str(self.client_address))
+        self.wfile.write('User-agent: %s\n' % str(self.headers['user-agent']))
+        self.wfile.write('Path: %s\n' % self.path)
+        self.wfile.write('Form data:\n')
+        self.wfile.close()
+
+        # Echo back information about what was posted in the form
+        for field in form.keys():
+            field_item = form[field]
+            if field_item.filename:
+                # The field contains an uploaded file
+                file_data = field_item.file.read()
+                file_len = len(file_data)
+                del file_data
+                self.wfile.write('\tUploaded %s as "%s" (%d bytes)\n' % \
+                        (field, field_item.filename, file_len))
+            else:
+                # Regular form value
+                self.wfile.write('\t%s=%s\n' % (field, form[field].value))
+        '''
+        return
+    
+    
+    def do_GET(self):
+        """Serve a GET request."""
+        f = self.send_head()
+        if f:
+            try:
+                self.copyfile(f, self.wfile)
+            finally:
+                f.close()
+
+    def do_HEAD(self):
+        """Serve a HEAD request."""
+        f = self.send_head()
+        if f:
+            f.close()
+
+    def send_head(self):
+        """Common code for GET and HEAD commands.
+
+        This sends the response code and MIME headers.
+
+        Return value is either a file object (which has to be copied
+        to the outputfile by the caller unless the command was HEAD,
+        and must be closed by the caller under all circumstances), or
+        None, in which case the caller has nothing further to do.
+
+        """
+        path = self.translate_path(self.path)
+        f = None
+        if os.path.isdir(path):
+            parts = urlparse.urlsplit(self.path)
+            if not parts.path.endswith('/'):
+                # redirect browser - doing basically what apache does
+                self.send_response(301)
+                new_parts = (parts[0], parts[1], parts[2] + '/',
+                             parts[3], parts[4])
+                new_url = urlparse.urlunsplit(new_parts)
+                self.send_header("Location", new_url)
+                self.end_headers()
+                return None
+            for index in "index.html", "index.htm":
+                index = os.path.join(path, index)
+                if os.path.exists(index):
+                    path = index
+                    break
+            else:
+                return self.list_directory(path)
+        ctype = self.guess_type(path)
+        try:
+            # Always read in binary mode. Opening files in text mode may cause
+            # newline translations, making the actual size of the content
+            # transmitted *less* than the content-length!
+            f = open(path, 'rb')
+        except IOError:
+            self.send_error(404, "File not found")
+            return None
+        try:
+            self.send_response(200)
+            self.send_header("Content-type", ctype)
+            fs = os.fstat(f.fileno())
+            self.send_header("Content-Length", str(fs[6]))
+            self.send_header("Last-Modified", self.date_time_string(fs.st_mtime))
+            self.end_headers()
+            return f
+        except:
+            f.close()
+            raise
+
+    def list_directory(self, path):
+        """Helper to produce a directory listing (absent index.html).
+
+        Return value is either a file object, or None (indicating an
+        error).  In either case, the headers are sent, making the
+        interface the same as for send_head().
+
+        """
+        try:
+            list = os.listdir(path)
+        except os.error:
+            self.send_error(404, "No permission to list directory")
+            return None
+        list.sort(key=lambda a: a.lower())
+        f = StringIO()
+        displaypath = cgi.escape(urllib.unquote(self.path))
+        f.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">')
+        f.write("<html>\n<title>Directory listing for %s</title>\n" % displaypath)
+        f.write("<body>\n<h2>Directory listing for %s</h2>\n" % displaypath)
+        f.write("<hr>\n<ul>\n")
+        for name in list:
+            fullname = os.path.join(path, name)
+            displayname = linkname = name
+            # Append / for directories or @ for symbolic links
+            if os.path.isdir(fullname):
+                displayname = name + "/"
+                linkname = name + "/"
+            if os.path.islink(fullname):
+                displayname = name + "@"
+                # Note: a link to a directory displays with @ and links with /
+            f.write('<li><a href="%s">%s</a>\n'
+                    % (urllib.quote(linkname), cgi.escape(displayname)))
+        f.write("</ul>\n<hr>\n</body>\n</html>\n")
+        length = f.tell()
+        f.seek(0)
+        self.send_response(200)
+        encoding = sys.getfilesystemencoding()
+        self.send_header("Content-type", "text/html; charset=%s" % encoding)
+        self.send_header("Content-Length", str(length))
+        self.end_headers()
+        return f
+
+    def translate_path(self, path):
+        """Translate a /-separated PATH to the local filename syntax.
+
+        Components that mean special things to the local file system
+        (e.g. drive or directory names) are ignored.  (XXX They should
+        probably be diagnosed.)
+
+        """
+        # abandon query parameters
+        path = path.split('?',1)[0]
+        path = path.split('#',1)[0]
+        # Don't forget explicit trailing slash when normalizing. Issue17324
+        trailing_slash = path.rstrip().endswith('/')
+        path = posixpath.normpath(urllib.unquote(path))
+        words = path.split('/')
+        words = filter(None, words)
+        path = os.getcwd()
+        for word in words:
+            if os.path.dirname(word) or word in (os.curdir, os.pardir):
+                # Ignore components that are not a simple file/directory name
+                continue
+            path = os.path.join(path, word)
+        if trailing_slash:
+            path += '/'
+        return path
+
+    def copyfile(self, source, outputfile):
+        """Copy all data between two file objects.
+
+        The SOURCE argument is a file object open for reading
+        (or anything with a read() method) and the DESTINATION
+        argument is a file object open for writing (or
+        anything with a write() method).
+
+        The only reason for overriding this would be to change
+        the block size or perhaps to replace newlines by CRLF
+        -- note however that this the default server uses this
+        to copy binary data as well.
+
+        """
+        shutil.copyfileobj(source, outputfile)
+
+    def guess_type(self, path):
+        """Guess the type of a file.
+
+        Argument is a PATH (a filename).
+
+        Return value is a string of the form type/subtype,
+        usable for a MIME Content-type header.
+
+        The default implementation looks the file's extension
+        up in the table self.extensions_map, using application/octet-stream
+        as a default; however it would be permissible (if
+        slow) to look inside the data to make a better guess.
+
+        """
+
+        base, ext = posixpath.splitext(path)
+        if ext in self.extensions_map:
+            return self.extensions_map[ext]
+        ext = ext.lower()
+        if ext in self.extensions_map:
+            return self.extensions_map[ext]
+        else:
+            return self.extensions_map['']
+
+    if not mimetypes.inited:
+        mimetypes.init() # try to read system mime.types
+    extensions_map = mimetypes.types_map.copy()
+    extensions_map.update({
+        '': 'application/octet-stream', # Default
+        '.py': 'text/plain',
+        '.c': 'text/plain',
+        '.h': 'text/plain',
+        })
+
+def test(HandlerClass = DMaaPHandler,
+         ServerClass = BaseHTTPServer.HTTPServer, protocol="HTTP/1.0", port=3904):
+    print "Load event schema file: " + DcaeVariables.CommonEventSchemaV5
+    with open(DcaeVariables.CommonEventSchemaV5) as file:
+        global EvtSchema
+        EvtSchema = json.load(file)
+        
+    server_address = ('', port)
+
+    HandlerClass.protocol_version = protocol
+    httpd = ServerClass(server_address, HandlerClass)
+    
+    global DMaaPHttpd
+    DMaaPHttpd = httpd
+    DcaeVariables.HTTPD = httpd
+
+    sa = httpd.socket.getsockname()
+    print "Serving HTTP on", sa[0], "port", sa[1], "..."
+    #httpd.serve_forever()
+
+def _main_ (HandlerClass = DMaaPHandler,
+         ServerClass = BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"):
+    
+    if sys.argv[1:]:
+        port = int(sys.argv[1])
+    else:
+        port = 3904
+    
+    print "Load event schema file: " + DcaeVariables.CommonEventSchemaV5
+    with open(DcaeVariables.CommonEventSchemaV5) as file:
+        global EvtSchema
+        EvtSchema = json.load(file)
+        
+    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_()
\ No newline at end of file
index 0242ad7..e581f1b 100644 (file)
-'''\r
-Created on Aug 18, 2017\r
-\r
-@author: sw6830\r
-'''\r
-from robot.api import logger\r
-from Queue import Queue\r
-import uuid, time, datetime,json, threading,os, platform, subprocess,paramiko\r
-import DcaeVariables\r
-import DMaaP\r
-\r
-class DcaeLibrary(object):\r
-    \r
-    def __init__(self):\r
-        pass \r
-    \r
-    def setup_dmaap_server(self, portNum=3904):\r
-        if DcaeVariables.HttpServerThread != None:\r
-            DMaaP.cleanUpEvent()\r
-            logger.console("Clean up event from event queue before test")\r
-            logger.info("DMaaP Server already started")\r
-            return "true"\r
-        \r
-        DcaeVariables.IsRobotRun = True\r
-        DMaaP.test(port=portNum)\r
-        try:\r
-            DcaeVariables.VESEventQ = Queue()\r
-            DcaeVariables.HttpServerThread = threading.Thread(name='DMAAP_HTTPServer', target=DMaaP.DMaaPHttpd.serve_forever)\r
-            DcaeVariables.HttpServerThread.start()\r
-            logger.console("DMaaP Mockup Sever started")\r
-            time.sleep(2)\r
-            return "true"\r
-        except Exception as e:\r
-            print (str(e))\r
-            return "false"\r
-            \r
-    def shutdown_dmaap(self):\r
-        if DcaeVariables.HTTPD != None:\r
-            DcaeVariables.HTTPD.shutdown()\r
-            logger.console("DMaaP Server shut down")\r
-            time.sleep(3)\r
-            return "true"\r
-        else:\r
-            return "false"\r
-            \r
-    def cleanup_ves_events(self):\r
-        if DcaeVariables.HttpServerThread != None:\r
-            DMaaP.cleanUpEvent()\r
-            logger.console("DMaaP event queue is cleaned up")\r
-            return "true"\r
-        logger.console("DMaaP server not started yet")\r
-        return "false"\r
-    \r
-    def enable_vesc_https_auth(self):\r
-        if 'Windows' in platform.system():\r
-            try:\r
-                client = paramiko.SSHClient()\r
-                client.load_system_host_keys()\r
-                #client.set_missing_host_key_policy(paramiko.WarningPolicy)\r
-                client.set_missing_host_key_policy(paramiko.AutoAddPolicy())\r
-                \r
-                client.connect(os.environ['CSIT_IP'], port=22, username=os.environ['CSIT_USER'], password=os.environ['CSIT_PD'])\r
-                stdin, stdout, stderr = client.exec_command('%{WORKSPACE}/test/csit/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh')\r
-                logger.console(stdout.read())    \r
-            finally:\r
-                client.close()\r
-            return\r
-        ws = os.environ['WORKSPACE']\r
-        script2run = ws + "/test/csit/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh"\r
-        logger.info("Running script: " + script2run)\r
-        logger.console("Running script: " + script2run)\r
-        subprocess.call(script2run)\r
-        time.sleep(5)\r
-        return  \r
-                   \r
-    def dmaap_message_receive(self, evtobj, action='contain'):\r
-        \r
-        evtStr = DMaaP.dequeEvent()\r
-        while evtStr != None:\r
-            logger.console("DMaaP receive VES Event:\n" + evtStr)\r
-            if action == 'contain':\r
-                if evtobj in evtStr:\r
-                    logger.info("DMaaP Receive Expected Publish Event:\n" + evtStr)\r
-                    return 'true'\r
-            if action == 'sizematch':\r
-                if len(evtobj) == len(evtStr):\r
-                    return 'true'\r
-            if action == 'dictmatch':\r
-                evtDict = json.loads(evtStr)\r
-                if cmp(evtobj, evtDict) == 0:\r
-                    return 'true'\r
-            evtStr = DMaaP.dequeEvent()\r
-        return 'false'\r
-    \r
-    def create_header_from_string(self, dictStr):\r
-        logger.info("Enter create_header_from_string: dictStr")\r
-        return dict(u.split("=") for u in dictStr.split(","))\r
-    \r
-    def is_json_empty(self, resp):\r
-        logger.info("Enter is_json_empty: resp.text: " + resp.text)\r
-        if resp.text == None or len(resp.text) < 2:\r
-            return 'True'\r
-        return 'False'\r
-    \r
-    def Generate_UUID(self):\r
-        """generate a uuid"""\r
-        return uuid.uuid4()\r
-    \r
-    def get_json_value_list(self, jsonstr, keyval):\r
-        logger.info("Enter Get_Json_Key_Value_List")\r
-        if jsonstr == None or len(jsonstr) < 2:\r
-            logger.info("No Json data found")\r
-            return []\r
-        try:\r
-            data = json.loads(jsonstr)   \r
-            nodelist = []\r
-            for item in data:\r
-                nodelist.append(item[keyval])\r
-            return nodelist\r
-        except Exception as e:\r
-            logger.info("Json data parsing fails")\r
-            print str(e)\r
-            return []\r
-        \r
-    def generate_MilliTimestamp_UUID(self):\r
-        """generate a millisecond timestamp uuid"""\r
-        then = datetime.datetime.now()\r
-        return int(time.mktime(then.timetuple())*1e3 + then.microsecond/1e3)\r
-    \r
-    def test (self):\r
-        import json\r
-        from pprint import pprint\r
-\r
-        with open('robot/assets/dcae/ves_volte_single_fault_event.json') as data_file:    \r
-            data = json.load(data_file)\r
-\r
-        data['event']['commonEventHeader']['version'] = '5.0'\r
-        pprint(data)\r
-\r
-\r
-\r
-if __name__ == '__main__':\r
-    '''\r
-    dictStr = "action=getTable,Accept=application/json,Content-Type=application/json,X-FromAppId=1234908903284"\r
-    cls = DcaeLibrary()\r
-    #dict = cls.create_header_from_string(dictStr)\r
-    #print str(dict)\r
-    jsonStr = "[{'Node': 'onapfcnsl00', 'CheckID': 'serfHealth', 'Name': 'Serf Health Status', 'ServiceName': '', 'Notes': '', 'ModifyIndex': 6, 'Status': 'passing', 'ServiceID': '', 'ServiceTags': [], 'Output': 'Agent alive and reachable', 'CreateIndex': 6}]"\r
-    lsObj = cls.get_json_value_list(jsonStr, 'Status')\r
-    print lsObj\r
-    '''\r
-    \r
-    lib = DcaeLibrary()\r
-    lib.enable_vesc_https_auth()\r
-    \r
-    ret = lib.setup_dmaap_server()\r
-    print ret\r
-    time.sleep(100000)\r
-    \r
+'''
+Created on Aug 18, 2017
+
+@author: sw6830
+'''
+from robot.api import logger
+from Queue import Queue
+import uuid, time, datetime,json, threading,os, platform, subprocess,paramiko
+import DcaeVariables
+import DMaaP
+
+class DcaeLibrary(object):
+    
+    def __init__(self):
+        pass 
+    
+    def setup_dmaap_server(self, portNum=3904):
+        if DcaeVariables.HttpServerThread != None:
+            DMaaP.cleanUpEvent()
+            logger.console("Clean up event from event queue before test")
+            logger.info("DMaaP Server already started")
+            return "true"
+        
+        DcaeVariables.IsRobotRun = True
+        DMaaP.test(port=portNum)
+        try:
+            DcaeVariables.VESEventQ = Queue()
+            DcaeVariables.HttpServerThread = threading.Thread(name='DMAAP_HTTPServer', target=DMaaP.DMaaPHttpd.serve_forever)
+            DcaeVariables.HttpServerThread.start()
+            logger.console("DMaaP Mockup Sever started")
+            time.sleep(2)
+            return "true"
+        except Exception as e:
+            print (str(e))
+            return "false"
+            
+    def shutdown_dmaap(self):
+        if DcaeVariables.HTTPD != None:
+            DcaeVariables.HTTPD.shutdown()
+            logger.console("DMaaP Server shut down")
+            time.sleep(3)
+            return "true"
+        else:
+            return "false"
+            
+    def cleanup_ves_events(self):
+        if DcaeVariables.HttpServerThread != None:
+            DMaaP.cleanUpEvent()
+            logger.console("DMaaP event queue is cleaned up")
+            return "true"
+        logger.console("DMaaP server not started yet")
+        return "false"
+    
+    def enable_vesc_https_auth(self):
+        if 'Windows' in platform.system():
+            try:
+                client = paramiko.SSHClient()
+                client.load_system_host_keys()
+                #client.set_missing_host_key_policy(paramiko.WarningPolicy)
+                client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
+                
+                client.connect(os.environ['CSIT_IP'], port=22, username=os.environ['CSIT_USER'], password=os.environ['CSIT_PD'])
+                stdin, stdout, stderr = client.exec_command('%{WORKSPACE}/test/csit/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh')
+                logger.console(stdout.read())    
+            finally:
+                client.close()
+            return
+        ws = os.environ['WORKSPACE']
+        script2run = ws + "/test/csit/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh"
+        logger.info("Running script: " + script2run)
+        logger.console("Running script: " + script2run)
+        subprocess.call(script2run)
+        time.sleep(5)
+        return  
+                   
+    def dmaap_message_receive(self, evtobj, action='contain'):
+        
+        evtStr = DMaaP.dequeEvent()
+        while evtStr != None:
+            logger.console("DMaaP receive VES Event:\n" + evtStr)
+            if action == 'contain':
+                if evtobj in evtStr:
+                    logger.info("DMaaP Receive Expected Publish Event:\n" + evtStr)
+                    return 'true'
+            if action == 'sizematch':
+                if len(evtobj) == len(evtStr):
+                    return 'true'
+            if action == 'dictmatch':
+                evtDict = json.loads(evtStr)
+                if cmp(evtobj, evtDict) == 0:
+                    return 'true'
+            evtStr = DMaaP.dequeEvent()
+        return 'false'
+    
+    def create_header_from_string(self, dictStr):
+        logger.info("Enter create_header_from_string: dictStr")
+        return dict(u.split("=") for u in dictStr.split(","))
+    
+    def is_json_empty(self, resp):
+        logger.info("Enter is_json_empty: resp.text: " + resp.text)
+        if resp.text == None or len(resp.text) < 2:
+            return 'True'
+        return 'False'
+    
+    def Generate_UUID(self):
+        """generate a uuid"""
+        return uuid.uuid4()
+    
+    def get_json_value_list(self, jsonstr, keyval):
+        logger.info("Enter Get_Json_Key_Value_List")
+        if jsonstr == None or len(jsonstr) < 2:
+            logger.info("No Json data found")
+            return []
+        try:
+            data = json.loads(jsonstr)   
+            nodelist = []
+            for item in data:
+                nodelist.append(item[keyval])
+            return nodelist
+        except Exception as e:
+            logger.info("Json data parsing fails")
+            print str(e)
+            return []
+        
+    def generate_MilliTimestamp_UUID(self):
+        """generate a millisecond timestamp uuid"""
+        then = datetime.datetime.now()
+        return int(time.mktime(then.timetuple())*1e3 + then.microsecond/1e3)
+    
+    def test (self):
+        import json
+        from pprint import pprint
+
+        with open('robot/assets/dcae/ves_volte_single_fault_event.json') as data_file:    
+            data = json.load(data_file)
+
+        data['event']['commonEventHeader']['version'] = '5.0'
+        pprint(data)
+
+
+
+if __name__ == '__main__':
+    '''
+    dictStr = "action=getTable,Accept=application/json,Content-Type=application/json,X-FromAppId=1234908903284"
+    cls = DcaeLibrary()
+    #dict = cls.create_header_from_string(dictStr)
+    #print str(dict)
+    jsonStr = "[{'Node': 'onapfcnsl00', 'CheckID': 'serfHealth', 'Name': 'Serf Health Status', 'ServiceName': '', 'Notes': '', 'ModifyIndex': 6, 'Status': 'passing', 'ServiceID': '', 'ServiceTags': [], 'Output': 'Agent alive and reachable', 'CreateIndex': 6}]"
+    lsObj = cls.get_json_value_list(jsonStr, 'Status')
+    print lsObj
+    '''
+    
+    lib = DcaeLibrary()
+    lib.enable_vesc_https_auth()
+    
+    ret = lib.setup_dmaap_server()
+    print ret
+    time.sleep(100000)
+    
index 59d44e1..98b3415 100644 (file)
- *** Settings ***\r
-Documentation     The main interface for interacting with DCAE. It handles low level stuff like managing the http request library and DCAE required fields\r
-Library              RequestsLibrary\r
-Library                  DcaeLibrary   \r
-Library           OperatingSystem\r
-Library           Collections\r
-Variables         ../resources/DcaeVariables.py\r
-Resource          ../resources/dcae_properties.robot\r
-*** Variables ***\r
-${DCAE_HEALTH_CHECK_BODY}    %{WORKSPACE}/test/csit/tests/dcae/testcases/assets/json_events/dcae_healthcheck.json\r
-*** Keywords ***\r
-Get DCAE Nodes\r
-    [Documentation]    Get DCAE Nodes from Consul Catalog\r
-    #Log    Creating session   ${GLOBAL_DCAE_CONSUL_URL}\r
-    ${session}=    Create Session      dcae    ${GLOBAL_DCAE_CONSUL_URL}\r
-    ${uuid}=    Generate UUID\r
-    ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json  X-Consul-Token=abcd1234  X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid}    X-FromAppId=${GLOBAL_APPLICATION_ID}\r
-    ${resp}=   Get Request     dcae    /v1/catalog/nodes        headers=${headers}\r
-    Log    Received response from dcae consul: ${resp.json()}\r
-    Should Be Equal As Strings         ${resp.status_code}     200\r
-    ${NodeList}=   Get Json Value List   ${resp.text}   Node\r
-    ${NodeListLength}=  Get Length  ${NodeList}  \r
-    ${len}=  Get Length   ${NodeList}   \r
-    Should Not Be Equal As Integers   ${len}   0\r
-    [return]    ${NodeList}\r
-DCAE Node Health Check\r
-    [Documentation]    Perform DCAE Node Health Check\r
-    [Arguments]    ${NodeName}\r
-    ${session}=    Create Session      dcae-${NodeName}        ${GLOBAL_DCAE_CONSUL_URL}\r
-    ${uuid}=    Generate UUID\r
-    ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json  X-Consul-Token=abcd1234  X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid}    X-FromAppId=${GLOBAL_APPLICATION_ID}\r
-    ${hcpath}=   Catenate  SEPARATOR=    /v1/health/node/    ${NodeName}\r
-    ${resp}=   Get Request     dcae-${NodeName}        ${hcpath}        headers=${headers}\r
-    Log    Received response from dcae consul: ${resp.json()}\r
-    Should Be Equal As Strings         ${resp.status_code}     200\r
-    ${StatusList}=  Get Json Value List   ${resp.text}    Status\r
-    ${len}=  Get Length  ${StatusList}\r
-    Should Not Be Equal As Integers   ${len}   0\r
-    DCAE Check Health Status    ${NodeName}   ${StatusList[0]}    Serf Health Status\r
-    #Run Keyword if  ${len} > 1  DCAE Check Health Status  ${NodeName}  ${StatusList[1]}  Serf Health Status\r
-DCAE Check Health Status\r
-    [Arguments]    ${NodeName}    ${ItemStatus}   ${CheckType}\r
-    Should Be Equal As Strings    ${ItemStatus}    passing   \r
-    Log   Node: ${NodeName} ${CheckType} check pass ok\r
-VES Collector Suite Setup DMaaP\r
-    [Documentation]   Start DMaaP Mockup Server\r
-    ${ret}=  Setup DMaaP Server\r
-    Should Be Equal As Strings     ${ret}    true\r
-VES Collector Suite Shutdown DMaaP\r
-    [Documentation]   Shutdown DMaaP Mockup Server\r
-    ${ret}=  Shutdown DMaap\r
-    Should Be Equal As Strings     ${ret}    true\r
-Check DCAE Results\r
-    [Documentation]    Parse DCAE JSON response and make sure all rows have healthTestStatus=GREEN\r
-    [Arguments]    ${json}\r
-    @{rows}=    Get From Dictionary    ${json['returns']}    rows\r
-    @{headers}=    Get From Dictionary    ${json['returns']}    columns\r
-    # Retrieve column names from headers\r
-    ${columns}=    Create List\r
-    :for    ${header}    in    @{headers}\r
-    \    ${colName}=    Get From Dictionary    ${header}    colName\r
-    \    Append To List    ${columns}    ${colName}\r
-    # Process each row making sure status=GREEN\r
-    :for    ${row}    in    @{rows}\r
-    \    ${cells}=    Get From Dictionary    ${row}    cells\r
-    \    ${dict}=    Make A Dictionary    ${cells}    ${columns}\r
-    \    Dictionary Should Contain Item    ${dict}    healthTestStatus    GREEN\r
-Make A Dictionary\r
-    [Documentation]    Given a list of column names and a list of dictionaries, map columname=value\r
-    [Arguments]     ${columns}    ${names}    ${valuename}=value\r
-    ${dict}=    Create Dictionary\r
-    ${collength}=    Get Length    ${columns}\r
-    ${namelength}=    Get Length    ${names}\r
-    :for    ${index}    in range    0   ${collength}\r
-    \    ${name}=    Evaluate     ${names}[${index}]\r
-    \    ${valued}=    Evaluate     ${columns}[${index}]\r
-    \    ${value}=    Get From Dictionary    ${valued}    ${valueName}\r
-    \    Set To Dictionary    ${dict}   ${name}    ${value}     \r
-    [Return]     ${dict}\r
-Get Event Data From File\r
-    [Arguments]    ${jsonfile}\r
-    ${data}=    OperatingSystem.Get File    ${jsonfile}\r
-    #Should Not Be_Equal    ${data}    None\r
-    [return]    ${data}\r
-Json String To Dictionary\r
-    [Arguments]  ${json_string}   \r
-    ${json_dict}=  evaluate    json.loads('''${json_string}''')    json\r
-    [return]   ${json_dict}\r
-Dictionary To Json String\r
-    [Arguments]  ${json_dict}\r
-    ${json_string}=    evaluate    json.dumps(${json_dict})    json\r
-    [return]    ${json_string}\r
-Get DCAE Service Component Status\r
-    [Documentation]   Get the status of a DCAE Service Component\r
-    [Arguments]    ${url}    ${urlpath}     ${usr}    ${passwd}    \r
-    ${auth}=  Create List  ${usr}  ${passwd}\r
-    ${session}=    Create Session      dcae-service-component  ${url}    auth=${auth}\r
-    ${resp}=   Get Request     dcae-service-component  ${urlpath}\r
-    [return]    ${resp}\r
-Publish Event To VES Collector No Auth\r
-    [Documentation]    Send an event to VES Collector\r
-    [Arguments]     ${url}  ${evtpath}   ${httpheaders}    ${evtdata}\r
-    Log    Creating session ${url}\r
-    ${session}=    Create Session      dcaegen2-d1     ${url}\r
-    ${resp}=   Post Request    dcaegen2-d1     ${evtpath}     data=${evtdata}   headers=${httpheaders}\r
-    #Log    Received response from dcae ${resp.json()}\r
-    [return]   ${resp}\r
-Publish Event To VES Collector\r
-    [Documentation]    Send an event to VES Collector\r
-    [Arguments]     ${url}  ${evtpath}   ${httpheaders}    ${evtdata}   ${user}  ${pd}\r
-    ${auth}=  Create List  ${user}   ${pd}\r
-    Log    Creating session ${url}\r
-    ${session}=    Create Session      dcaegen2-d1     ${url}    auth=${auth}   disable_warnings=1\r
-    ${resp}=   Post Request    dcaegen2-d1     ${evtpath}     data=${evtdata}   headers=${httpheaders}\r
-    #Log    Received response from dcae ${resp.json()}\r
-    [return]   ${resp}\r
-Publish Event To VES Collector With Put Method\r
-    [Documentation]    Send an event to VES Collector\r
-    [Arguments]     ${url}  ${evtpath}   ${httpheaders}    ${evtdata}   ${user}  ${pd}\r
-    ${auth}=  Create List  ${user}   ${pd}\r
-    Log    Creating session ${url}\r
-    ${session}=    Create Session      dcae-d1         ${url}    auth=${auth}\r
-    ${resp}=   Put Request     dcae-d1         ${evtpath}     data=${evtdata}   headers=${httpheaders}\r
-    #Log    Received response from dcae ${resp.json()}\r
-    [return]   ${resp}\r
-Publish Event To VES Collector With Put Method No Auth\r
-    [Documentation]    Send an event to VES Collector\r
-    [Arguments]     ${url}  ${evtpath}   ${httpheaders}    ${evtdata}\r
-    Log    Creating session ${url}\r
-    ${session}=    Create Session      dcae-d1         ${url}\r
-    ${resp}=   Put Request     dcae-d1         ${evtpath}     data=${evtdata}   headers=${httpheaders}\r
-    #Log    Received response from dcae ${resp.json()}\r
-    [return]   ${resp}\r
+ *** Settings ***
+Documentation     The main interface for interacting with DCAE. It handles low level stuff like managing the http request library and DCAE required fields
+Library              RequestsLibrary
+Library                  DcaeLibrary   
+Library           OperatingSystem
+Library           Collections
+Variables         ../resources/DcaeVariables.py
+Resource          ../resources/dcae_properties.robot
+*** Variables ***
+${DCAE_HEALTH_CHECK_BODY}    %{WORKSPACE}/test/csit/tests/dcae/testcases/assets/json_events/dcae_healthcheck.json
+*** Keywords ***
+Get DCAE Nodes
+    [Documentation]    Get DCAE Nodes from Consul Catalog
+    #Log    Creating session   ${GLOBAL_DCAE_CONSUL_URL}
+    ${session}=    Create Session      dcae    ${GLOBAL_DCAE_CONSUL_URL}
+    ${uuid}=    Generate UUID
+    ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json  X-Consul-Token=abcd1234  X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid}    X-FromAppId=${GLOBAL_APPLICATION_ID}
+    ${resp}=   Get Request     dcae    /v1/catalog/nodes        headers=${headers}
+    Log    Received response from dcae consul: ${resp.json()}
+    Should Be Equal As Strings         ${resp.status_code}     200
+    ${NodeList}=   Get Json Value List   ${resp.text}   Node
+    ${NodeListLength}=  Get Length  ${NodeList}  
+    ${len}=  Get Length   ${NodeList}   
+    Should Not Be Equal As Integers   ${len}   0
+    [return]    ${NodeList}
+DCAE Node Health Check
+    [Documentation]    Perform DCAE Node Health Check
+    [Arguments]    ${NodeName}
+    ${session}=    Create Session      dcae-${NodeName}        ${GLOBAL_DCAE_CONSUL_URL}
+    ${uuid}=    Generate UUID
+    ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json  X-Consul-Token=abcd1234  X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid}    X-FromAppId=${GLOBAL_APPLICATION_ID}
+    ${hcpath}=   Catenate  SEPARATOR=    /v1/health/node/    ${NodeName}
+    ${resp}=   Get Request     dcae-${NodeName}        ${hcpath}        headers=${headers}
+    Log    Received response from dcae consul: ${resp.json()}
+    Should Be Equal As Strings         ${resp.status_code}     200
+    ${StatusList}=  Get Json Value List   ${resp.text}    Status
+    ${len}=  Get Length  ${StatusList}
+    Should Not Be Equal As Integers   ${len}   0
+    DCAE Check Health Status    ${NodeName}   ${StatusList[0]}    Serf Health Status
+    #Run Keyword if  ${len} > 1  DCAE Check Health Status  ${NodeName}  ${StatusList[1]}  Serf Health Status
+DCAE Check Health Status
+    [Arguments]    ${NodeName}    ${ItemStatus}   ${CheckType}
+    Should Be Equal As Strings    ${ItemStatus}    passing   
+    Log   Node: ${NodeName} ${CheckType} check pass ok
+VES Collector Suite Setup DMaaP
+    [Documentation]   Start DMaaP Mockup Server
+    ${ret}=  Setup DMaaP Server
+    Should Be Equal As Strings     ${ret}    true
+VES Collector Suite Shutdown DMaaP
+    [Documentation]   Shutdown DMaaP Mockup Server
+    ${ret}=  Shutdown DMaap
+    Should Be Equal As Strings     ${ret}    true
+Check DCAE Results
+    [Documentation]    Parse DCAE JSON response and make sure all rows have healthTestStatus=GREEN
+    [Arguments]    ${json}
+    @{rows}=    Get From Dictionary    ${json['returns']}    rows
+    @{headers}=    Get From Dictionary    ${json['returns']}    columns
+    # Retrieve column names from headers
+    ${columns}=    Create List
+    :for    ${header}    in    @{headers}
+    \    ${colName}=    Get From Dictionary    ${header}    colName
+    \    Append To List    ${columns}    ${colName}
+    # Process each row making sure status=GREEN
+    :for    ${row}    in    @{rows}
+    \    ${cells}=    Get From Dictionary    ${row}    cells
+    \    ${dict}=    Make A Dictionary    ${cells}    ${columns}
+    \    Dictionary Should Contain Item    ${dict}    healthTestStatus    GREEN
+Make A Dictionary
+    [Documentation]    Given a list of column names and a list of dictionaries, map columname=value
+    [Arguments]     ${columns}    ${names}    ${valuename}=value
+    ${dict}=    Create Dictionary
+    ${collength}=    Get Length    ${columns}
+    ${namelength}=    Get Length    ${names}
+    :for    ${index}    in range    0   ${collength}
+    \    ${name}=    Evaluate     ${names}[${index}]
+    \    ${valued}=    Evaluate     ${columns}[${index}]
+    \    ${value}=    Get From Dictionary    ${valued}    ${valueName}
+    \    Set To Dictionary    ${dict}   ${name}    ${value}     
+    [Return]     ${dict}
+Get Event Data From File
+    [Arguments]    ${jsonfile}
+    ${data}=    OperatingSystem.Get File    ${jsonfile}
+    #Should Not Be_Equal    ${data}    None
+    [return]    ${data}
+Json String To Dictionary
+    [Arguments]  ${json_string}   
+    ${json_dict}=  evaluate    json.loads('''${json_string}''')    json
+    [return]   ${json_dict}
+Dictionary To Json String
+    [Arguments]  ${json_dict}
+    ${json_string}=    evaluate    json.dumps(${json_dict})    json
+    [return]    ${json_string}
+Get DCAE Service Component Status
+    [Documentation]   Get the status of a DCAE Service Component
+    [Arguments]    ${url}    ${urlpath}     ${usr}    ${passwd}    
+    ${auth}=  Create List  ${usr}  ${passwd}
+    ${session}=    Create Session      dcae-service-component  ${url}    auth=${auth}
+    ${resp}=   Get Request     dcae-service-component  ${urlpath}
+    [return]    ${resp}
+Publish Event To VES Collector No Auth
+    [Documentation]    Send an event to VES Collector
+    [Arguments]     ${url}  ${evtpath}   ${httpheaders}    ${evtdata}
+    Log    Creating session ${url}
+    ${session}=    Create Session      dcaegen2-d1     ${url}
+    ${resp}=   Post Request    dcaegen2-d1     ${evtpath}     data=${evtdata}   headers=${httpheaders}
+    #Log    Received response from dcae ${resp.json()}
+    [return]   ${resp}
+Publish Event To VES Collector
+    [Documentation]    Send an event to VES Collector
+    [Arguments]     ${url}  ${evtpath}   ${httpheaders}    ${evtdata}   ${user}  ${pd}
+    ${auth}=  Create List  ${user}   ${pd}
+    Log    Creating session ${url}
+    ${session}=    Create Session      dcaegen2-d1     ${url}    auth=${auth}   disable_warnings=1
+    ${resp}=   Post Request    dcaegen2-d1     ${evtpath}     data=${evtdata}   headers=${httpheaders}
+    #Log    Received response from dcae ${resp.json()}
+    [return]   ${resp}
+Publish Event To VES Collector With Put Method
+    [Documentation]    Send an event to VES Collector
+    [Arguments]     ${url}  ${evtpath}   ${httpheaders}    ${evtdata}   ${user}  ${pd}
+    ${auth}=  Create List  ${user}   ${pd}
+    Log    Creating session ${url}
+    ${session}=    Create Session      dcae-d1         ${url}    auth=${auth}
+    ${resp}=   Put Request     dcae-d1         ${evtpath}     data=${evtdata}   headers=${httpheaders}
+    #Log    Received response from dcae ${resp.json()}
+    [return]   ${resp}
+Publish Event To VES Collector With Put Method No Auth
+    [Documentation]    Send an event to VES Collector
+    [Arguments]     ${url}  ${evtpath}   ${httpheaders}    ${evtdata}
+    Log    Creating session ${url}
+    ${session}=    Create Session      dcae-d1         ${url}
+    ${resp}=   Put Request     dcae-d1         ${evtpath}     data=${evtdata}   headers=${httpheaders}
+    #Log    Received response from dcae ${resp.json()}
+    [return]   ${resp}
index be072d7..6924888 100644 (file)
@@ -1,15 +1,15 @@
-Documentation        store all properties that can change or are used in multiple places here\r
-...                    format is all caps with underscores between words and prepended with GLOBAL\r
-...                   make sure you prepend them with GLOBAL so that other files can easily see it is from this file.\r
-\r
-\r
-\r
-*** Variables ***\r
-${GLOBAL_APPLICATION_ID}           robot-dcaegen2\r
-${GLOBAL_DCAE_CONSUL_URL}          http://135.205.228.129:8500\r
-${GLOBAL_DCAE_CONSUL_URL1}         http://135.205.228.170:8500\r
-${GLOBAL_DCAE_VES_URL}             http://localhost:8443/eventlistener/v5\r
-${GLOBAL_DCAE_USERNAME}            console\r
-${GLOBAL_DCAE_PASSWORD}            ZjJkYjllMjljMTI2M2Iz\r
-${VESC_HTTPS_USER}                 sample1\r
-${VESC_HTTPS_PD}                   sample1\r
+Documentation        store all properties that can change or are used in multiple places here
+...                    format is all caps with underscores between words and prepended with GLOBAL
+...                   make sure you prepend them with GLOBAL so that other files can easily see it is from this file.
+
+
+
+*** Variables ***
+${GLOBAL_APPLICATION_ID}           robot-dcaegen2
+${GLOBAL_DCAE_CONSUL_URL}          http://135.205.228.129:8500
+${GLOBAL_DCAE_CONSUL_URL1}         http://135.205.228.170:8500
+${GLOBAL_DCAE_VES_URL}             http://localhost:8443/eventlistener/v5
+${GLOBAL_DCAE_USERNAME}            console
+${GLOBAL_DCAE_PASSWORD}            ZjJkYjllMjljMTI2M2Iz
+${VESC_HTTPS_USER}                 sample1
+${VESC_HTTPS_PD}                   sample1
index 07bfe69..c9dbe6c 100644 (file)
-*** Settings ***\r
-Resource          ../../common.robot\r
-Library           Collections\r
-Library           json\r
-Library           OperatingSystem\r
-Library           RequestsLibrary\r
-Library           HttpLibrary.HTTP\r
-\r
-*** Variables ***\r
-${MSB_IP}         127.0.0.1\r
-${MSB_PORT}       10550\r
-${ACTIVITI_IP}    127.0.0.1\r
-${ACTIVITI_PORT}    8804\r
-${MGRSERVICE_IP}    127.0.0.1\r
-${MGRSERVICE_PORT}    8805\r
-${processId}      demo\r
-${deployid}       0\r
-${bmpfilepath}    ${SCRIPTS}/nfvo-wfengine/demo.bpmn20.xml\r
-\r
-*** Test Cases ***\r
-Deploy BPMN File Test On Activiti\r
-    [Documentation]    Check if the test bpmn file can be deployed in activiti engine\r
-    ${auth}=    Create List    kermit    kermit\r
-    ${headers}=    Create Dictionary    Accept=application/json\r
-    Create Session    web_session    http://${ACTIVITI_IP}:${ACTIVITI_PORT}    headers=${headers}    auth=${auth}\r
-    ${files}=    evaluate    {"file":open('${bmpfilepath}','rb')}\r
-    ${resp}=    Post Request    web_session    /activiti-rest/service/repository/deployments    files=${files}\r
-    Should Be Equal    ${resp.status_code}    ${201}\r
-    Log    ${resp.json()}\r
-    ${deployedId}=    Set Variable    ${resp.json()["id"]}\r
-    Set Global Variable    ${deployedId}\r
-\r
-Exectue BPMN File Testt On Activiti\r
-    [Documentation]    Check if the test bpmn file can be exectued in activiti engine\r
-    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json    Authorization=Basic a2VybWl0Omtlcm1pdA==\r
-    Create Session    web_session    http://${ACTIVITI_IP}:${ACTIVITI_PORT}    headers=${headers}\r
-    ${body}    Create Dictionary    processDefinitionKey=${processId}\r
-    ${body}    dumps    ${body}\r
-    ${resp}=    Post Request    web_session    /activiti-rest/service/runtime/process-instances    ${body}\r
-    Should Be Equal    ${resp.status_code}    ${201}\r
-\r
-UnDeploy BPMN File Testt On Activiti\r
-    [Documentation]    Check if the test bpmn file can be undeployed in activiti engine\r
-    log    ${deployedId}\r
-    ${auth}=    Create List    kermit    kermit\r
-    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json\r
-    Create Session    web_session    http://${ACTIVITI_IP}:${ACTIVITI_PORT}    headers=${headers}    auth=${auth}\r
-    ${resp}=    Delete Request    web_session    /activiti-rest/service/repository/deployments/${deployedId}?cascade=true\r
-    Should Be Equal    ${resp.status_code}    ${204}\r
-\r
-Deploy BPMN File Test On MgrService\r
-    [Documentation]    Check if the test bpmn file can be deployed in Management Service\r
-    ${auth}=    Create List    kermit    kermit\r
-    ${headers}=    Create Dictionary    Accept=application/json\r
-    Create Session    web_session    http://${MGRSERVICE_IP}:${MGRSERVICE_PORT}    headers=${headers}    auth=${auth}\r
-    ${files}=    evaluate    {"file":open('${bmpfilepath}','rb')}\r
-    ${resp}=    Post Request    web_session    api/workflow/v1/package    files=${files}\r
-    Should Be Equal    ${resp.status_code}    ${200}\r
-    Log    ${resp.json()}\r
-    ${deployedId}=    Set Variable    ${resp.json()["deployedId"]}\r
-    Set Global Variable    ${deployedId}\r
-\r
-Exectue BPMN File Testt On MgrService\r
-    [Documentation]    Check if the test bpmn file can be exectued in Management Service\r
-    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json    Authorization=Basic a2VybWl0Omtlcm1pdA==\r
-    Create Session    web_session    http://${MGRSERVICE_IP}:${MGRSERVICE_PORT}    headers=${headers}\r
-    ${body}    Create Dictionary    processDefinitionKey=${processId}\r
-    ${body}    dumps    ${body}\r
-    ${resp}=    Post Request    web_session    api/workflow/v1/process/instance    ${body}\r
-    Should Be Equal    ${resp.status_code}    ${200}\r
-    Log    ${resp.json()}\r
-    Should Be Equal    ${resp.json()["processDefinitionKey"]}    ${processId}\r
-\r
-UnDeploy BPMN File Testt On MgrService\r
-    [Documentation]    Check if the test bpmn file can be undeployed in Management Service\r
-    log    ${deployedId}\r
-    ${auth}=    Create List    kermit    kermit\r
-    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json\r
-    Create Session    web_session    http://${MGRSERVICE_IP}:${MGRSERVICE_PORT}    headers=${headers}    auth=${auth}\r
-    ${resp}=    Delete Request    web_session    /api/workflow/v1/package/${deployedId}\r
-    Should Be Equal    ${resp.status_code}    ${200}\r
-\r
-Deploy BPMN File Test On MSB\r
-    [Documentation]    Check if the test bpmn file can be deployed in activiti engine\r
-    ${auth}=    Create List    kermit    kermit\r
-    ${headers}=    Create Dictionary    Accept=application/json\r
-    Create Session    web_session    http://${MSB_IP}:${MSB_PORT}    headers=${headers}    auth=${auth}\r
-    ${files}=    evaluate    {"file":open('${bmpfilepath}','rb')}\r
-    ${resp}=    Post Request    web_session    api/workflow/v1/package    files=${files}\r
-    Should Be Equal    ${resp.status_code}    ${200}\r
-    Log    ${resp.json()}\r
-    ${deployedId}=    Set Variable    ${resp.json()["deployedId"]}\r
-    Set Global Variable    ${deployedId}\r
-\r
-Exectue BPMN File Testt On MSB\r
-    [Documentation]    Check if the test bpmn file can be exectued in MSB\r
-    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json    Authorization=Basic a2VybWl0Omtlcm1pdA==\r
-    Create Session    web_session    http://${MSB_IP}:${MSB_PORT}    headers=${headers}\r
-    ${body}    Create Dictionary    processDefinitionKey=${processId}\r
-    ${body}    dumps    ${body}\r
-    ${resp}=    Post Request    web_session    api/workflow/v1/process/instance    ${body}\r
-    Should Be Equal    ${resp.status_code}    ${200}\r
-    Log    ${resp.json()}\r
-    Should Be Equal    ${resp.json()["processDefinitionKey"]}    ${processId}\r
-\r
-UnDeploy BPMN File Testt On MSB\r
-    [Documentation]    Check if the test bpmn file can be undeployed in MSB\r
-    log    ${deployedId}\r
-    ${auth}=    Create List    kermit    kermit\r
-    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json\r
-    Create Session    web_session    http://${MSB_IP}:${MSB_PORT}    headers=${headers}    auth=${auth}\r
-    ${resp}=    Delete Request    web_session    /api/workflow/v1/package/${deployedId}\r
-    Should Be Equal    ${resp.status_code}    ${200}\r
+*** Settings ***
+Resource          ../../common.robot
+Library           Collections
+Library           json
+Library           OperatingSystem
+Library           RequestsLibrary
+Library           HttpLibrary.HTTP
+
+*** Variables ***
+${MSB_IP}         127.0.0.1
+${MSB_PORT}       10550
+${ACTIVITI_IP}    127.0.0.1
+${ACTIVITI_PORT}    8804
+${MGRSERVICE_IP}    127.0.0.1
+${MGRSERVICE_PORT}    8805
+${processId}      demo
+${deployid}       0
+${bmpfilepath}    ${SCRIPTS}/nfvo-wfengine/demo.bpmn20.xml
+
+*** Test Cases ***
+Deploy BPMN File Test On Activiti
+    [Documentation]    Check if the test bpmn file can be deployed in activiti engine
+    ${auth}=    Create List    kermit    kermit
+    ${headers}=    Create Dictionary    Accept=application/json
+    Create Session    web_session    http://${ACTIVITI_IP}:${ACTIVITI_PORT}    headers=${headers}    auth=${auth}
+    ${files}=    evaluate    {"file":open('${bmpfilepath}','rb')}
+    ${resp}=    Post Request    web_session    /activiti-rest/service/repository/deployments    files=${files}
+    Should Be Equal    ${resp.status_code}    ${201}
+    Log    ${resp.json()}
+    ${deployedId}=    Set Variable    ${resp.json()["id"]}
+    Set Global Variable    ${deployedId}
+
+Exectue BPMN File Testt On Activiti
+    [Documentation]    Check if the test bpmn file can be exectued in activiti engine
+    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json    Authorization=Basic a2VybWl0Omtlcm1pdA==
+    Create Session    web_session    http://${ACTIVITI_IP}:${ACTIVITI_PORT}    headers=${headers}
+    ${body}    Create Dictionary    processDefinitionKey=${processId}
+    ${body}    dumps    ${body}
+    ${resp}=    Post Request    web_session    /activiti-rest/service/runtime/process-instances    ${body}
+    Should Be Equal    ${resp.status_code}    ${201}
+
+UnDeploy BPMN File Testt On Activiti
+    [Documentation]    Check if the test bpmn file can be undeployed in activiti engine
+    log    ${deployedId}
+    ${auth}=    Create List    kermit    kermit
+    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
+    Create Session    web_session    http://${ACTIVITI_IP}:${ACTIVITI_PORT}    headers=${headers}    auth=${auth}
+    ${resp}=    Delete Request    web_session    /activiti-rest/service/repository/deployments/${deployedId}?cascade=true
+    Should Be Equal    ${resp.status_code}    ${204}
+
+Deploy BPMN File Test On MgrService
+    [Documentation]    Check if the test bpmn file can be deployed in Management Service
+    ${auth}=    Create List    kermit    kermit
+    ${headers}=    Create Dictionary    Accept=application/json
+    Create Session    web_session    http://${MGRSERVICE_IP}:${MGRSERVICE_PORT}    headers=${headers}    auth=${auth}
+    ${files}=    evaluate    {"file":open('${bmpfilepath}','rb')}
+    ${resp}=    Post Request    web_session    api/workflow/v1/package    files=${files}
+    Should Be Equal    ${resp.status_code}    ${200}
+    Log    ${resp.json()}
+    ${deployedId}=    Set Variable    ${resp.json()["deployedId"]}
+    Set Global Variable    ${deployedId}
+
+Exectue BPMN File Testt On MgrService
+    [Documentation]    Check if the test bpmn file can be exectued in Management Service
+    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json    Authorization=Basic a2VybWl0Omtlcm1pdA==
+    Create Session    web_session    http://${MGRSERVICE_IP}:${MGRSERVICE_PORT}    headers=${headers}
+    ${body}    Create Dictionary    processDefinitionKey=${processId}
+    ${body}    dumps    ${body}
+    ${resp}=    Post Request    web_session    api/workflow/v1/process/instance    ${body}
+    Should Be Equal    ${resp.status_code}    ${200}
+    Log    ${resp.json()}
+    Should Be Equal    ${resp.json()["processDefinitionKey"]}    ${processId}
+
+UnDeploy BPMN File Testt On MgrService
+    [Documentation]    Check if the test bpmn file can be undeployed in Management Service
+    log    ${deployedId}
+    ${auth}=    Create List    kermit    kermit
+    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
+    Create Session    web_session    http://${MGRSERVICE_IP}:${MGRSERVICE_PORT}    headers=${headers}    auth=${auth}
+    ${resp}=    Delete Request    web_session    /api/workflow/v1/package/${deployedId}
+    Should Be Equal    ${resp.status_code}    ${200}
+
+Deploy BPMN File Test On MSB
+    [Documentation]    Check if the test bpmn file can be deployed in activiti engine
+    ${auth}=    Create List    kermit    kermit
+    ${headers}=    Create Dictionary    Accept=application/json
+    Create Session    web_session    http://${MSB_IP}:${MSB_PORT}    headers=${headers}    auth=${auth}
+    ${files}=    evaluate    {"file":open('${bmpfilepath}','rb')}
+    ${resp}=    Post Request    web_session    api/workflow/v1/package    files=${files}
+    Should Be Equal    ${resp.status_code}    ${200}
+    Log    ${resp.json()}
+    ${deployedId}=    Set Variable    ${resp.json()["deployedId"]}
+    Set Global Variable    ${deployedId}
+
+Exectue BPMN File Testt On MSB
+    [Documentation]    Check if the test bpmn file can be exectued in MSB
+    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json    Authorization=Basic a2VybWl0Omtlcm1pdA==
+    Create Session    web_session    http://${MSB_IP}:${MSB_PORT}    headers=${headers}
+    ${body}    Create Dictionary    processDefinitionKey=${processId}
+    ${body}    dumps    ${body}
+    ${resp}=    Post Request    web_session    api/workflow/v1/process/instance    ${body}
+    Should Be Equal    ${resp.status_code}    ${200}
+    Log    ${resp.json()}
+    Should Be Equal    ${resp.json()["processDefinitionKey"]}    ${processId}
+
+UnDeploy BPMN File Testt On MSB
+    [Documentation]    Check if the test bpmn file can be undeployed in MSB
+    log    ${deployedId}
+    ${auth}=    Create List    kermit    kermit
+    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
+    Create Session    web_session    http://${MSB_IP}:${MSB_PORT}    headers=${headers}    auth=${auth}
+    ${resp}=    Delete Request    web_session    /api/workflow/v1/package/${deployedId}
+    Should Be Equal    ${resp.status_code}    ${200}
index 803c99a..5090c08 100644 (file)
@@ -1,28 +1,33 @@
 image,tag
-onap/aai/esr-gui,v1.0.0
-onap/aai/esr-server,v1.0.0
+onap/aaf,latest
 onap/aai-resources,1.2-STAGING-latest
 onap/aai-traversal,1.2-STAGING-latest
-onap/admportal-sdnc-image,v1.2.1
-onap/ccsdk-dgbuilder-image,v0.1.0
-onap/ccsdk-odl-image,v0.1.0
-onap/ccsdk-odlsli-image,v0.1.0
+onap/aai/esr-gui,1.1.0-SNAPSHOT
+onap/aai/esr-server,1.1.0-SNAPSHOT
+onap/admportal-sdnc-image,1.3-STAGING-latest
+onap/appc-image,1.3.0-SNAPSHOT-latest
+onap/ccsdk-dgbuilder-image,0.2.1-SNAPSHOT
+onap/ccsdk-odl-image,0.2.1-SNAPSHOT
+onap/ccsdk-odlsli-image,0.2.1-SNAPSHOT
 onap/clamp,2.0-STAGING-latest
 onap/cli,v1.1.0
 onap/data-router,1.2-STAGING-latest
 onap/dmaap/dmaap-mr,1.0.1
 onap/holmes/engine-management,v1.0.0
 onap/holmes/rule-management,v1.0.0
-onap/modeling/javatoscachecker,v1.0.0
 onap/model-loader,1.2-STAGING-latest
-onap/msb/msb_apigateway,1.0.0
-onap/msb/msb_discovery,1.0.0
+onap/modeling/javatoscachecker,latest
+onap/msb/msb_apigateway,1.1.0-STAGING-latest
+onap/msb/msb_discovery,1.1.0-STAGING-latest
 onap/multicloud/framework,v1.0.0
-onap/multicloud/openstack-newton,v1.0.0
-onap/multicloud/openstack-ocata,v1.0.0
-onap/multicloud/openstack-windriver,v1.0.0
-onap/multicloud/vio,v1.0.0
-onap/multicloud/vio-vesagent,v1.0.0
+onap/multicloud/openstack-newton,1.0.0-SNAPSHOT
+onap/multicloud/openstack-ocata,1.0.0-SNAPSHOT
+onap/multicloud/openstack-windriver,1.0.0-SNAPSHOT
+onap/multicloud/vio,1.0.0-SNAPSHOT
+onap/multicloud/vio-vesagent,1.0.0
+onap/music,latest
+onap/nbi,latest
+onap/oof,latest
 onap/oom/kube2msb,1.0.0
 onap/org.onap.dcaegen2.collectors.ves.vescollector,v1.1.0
 onap/org.onap.dcaegen2.deployments.bootstrap,v1.1.1
@@ -32,44 +37,45 @@ onap/org.onap.dcaegen2.platform.deployment-handler,v1.1.0
 onap/org.onap.dcaegen2.platform.inventory-api,v1.2.0
 onap/org.onap.dcaegen2.platform.policy-handler,v1.1.0
 onap/org.onap.dcaegen2.platform.servicechange-handler,v1.0.0
-onap/policy/policy-db,v1.1.1
-onap/policy/policy-drools,v1.1.1
-onap/policy/policy-nexus,v1.1.1
-onap/policy/policy-pe,v1.1.1
-onap/portal-apps,v1.3.0
-onap/portal-db,v1.3.0
-onap/portal-wms,v1.3.0
-onap/sdc/sdc-workflow-designer,1.0.0-STAGING-latest
-onap/sdnc-dmaap-listener-image,v1.2.1
-onap/sdnc-image,v1.2.1
-onap/sdnc-ueb-listener-image,v1.2.1
+onap/policy-db,v1.1.1
+onap/policy-drools,v1.1.1
+onap/policy-nexus,v1.1.1
+onap/policy-pe,v1.1.1
+onap/portal-app,2.1-STAGING-latest
+onap/portal-db,2.1-STAGING-latest
+onap/portal-wms,2.1-STAGING-latest
+onap/sdc-backend,1.2-STAGING-latest
+onap/sdc-elasticsearch,1.2-STAGING-latest
+onap/sdc-frontend,1.2-STAGING-latest
+onap/sdc-kibana,1.2-STAGING-latest
+onap/sdc-sanity,1.2-STAGING-latest
+onap/sdc/sdc-workflow-designer,1.1.0-SNAPSHOT-STAGING-latest
+onap/sdnc-dmaap-listener-image,1.3-STAGING-latest
+onap/sdnc-image,1.3-STAGING-latest
+onap/sdnc-ueb-listener-image,1.3-STAGING-latest
 onap/search-data-service,1.2-STAGING-latest
 onap/sparky-be,1.2-STAGING-latest
-onap/usecase-ui/usecase-ui-server,v1.0.1
-onap/usecase-ui,v1.0.1
-onap/vfc/catalog,v1.0.2
-onap/vfc/emsdriver,v1.0.1
-onap/vfc/gvnfmdriver,v1.0.1
-onap/vfc/jujudriver,v1.0.0
-onap/vfc/nfvo/svnfm/huawei,v1.0.2
-onap/vfc/nfvo/svnfm/nokia,v1.0.2
+onap/usecase-ui,1.1.0-SNAPSHOT-STAGING-latest
+onap/usecase-ui/usecase-ui-server,1.1.0-SNAPSHOT-STAGING-latest
+onap/vfc/catalog,1.1.0-STAGING-latest
+onap/vfc/emsdriver,1.1.0-STAGING-latest
+onap/vfc/gvnfmdriver,1.1.0-STAGING-latest
+onap/vfc/jujudriver,1.1.0-STAGING-latest
+onap/vfc/multivimproxy,1.0.0-STAGING-latest
+onap/vfc/nfvo/svnfm/huawei,1.1.0-STAGING-latest
+onap/vfc/nfvo/svnfm/nokia,1.1.0-STAGING-latest
 onap/vfc/nfvo/svnfm/nokiav2,1.1.0-STAGING-latest
-onap/vfc/nslcm,v1.0.2
-onap/vfc/resmanagement,v1.0.0
-onap/vfc/vnflcm,v1.0.1
-onap/vfc/vnfmgr,v1.0.1
-onap/vfc/vnfres,v1.0.1
-onap/vfc/wfengine-activiti,v1.0.0
-onap/vfc/wfengine-mgrservice,v1.0.0
-onap/vfc/ztesdncdriver,v1.0.0
-onap/vfc/ztevnfmdriver,v1.0.2
+onap/vfc/nslcm,1.1.0-STAGING-latest
+onap/vfc/resmanagement,1.1.0-STAGING-latest
+onap/vfc/vnflcm,1.1.0-STAGING-latest
+onap/vfc/vnfmgr,1.1.0-STAGING-latest
+onap/vfc/vnfres,1.1.0-STAGING-latest
+onap/vfc/wfengine-activiti,latest
+onap/vfc/wfengine-mgrservice,latest
+onap/vfc/ztesdncdriver,1.1.0-STAGING-latest
+onap/vfc/ztevmanagerdriver,1.0.3-STAGING-latest
+onap/vfc/ztevnfmdriver,1.1.0-STAGING-latest
 onap/vid,1.2.1
 onap/vnfsdk/refrepo,1.0.0
 onap/vnfsdk/refrepo-postgres,1.0.0
-openecomp/appc-image,v1.2.0
-openecomp/mso,v1.1.1
-openecomp/sdc-backend,v1.1.0
-openecomp/sdc-elasticsearch,v1.1.0
-openecomp/sdc-frontend,v1.1.0
-openecomp/sdc-kibana,v1.1.0
-openecomp/sdc-sanity,v1.1.0
+openecomp/mso,1.2.1