summaryrefslogtreecommitdiffstats
path: root/test/csit/tests
diff options
context:
space:
mode:
Diffstat (limited to 'test/csit/tests')
-rw-r--r--test/csit/tests/aaf/aaf-sms-suite/__init__.robot2
-rw-r--r--test/csit/tests/aaf/aaf-sms-suite/aaf-sms-test.robot94
-rw-r--r--test/csit/tests/aaf/aaf-sms-suite/data/create_domain.json3
-rw-r--r--test/csit/tests/aaf/aaf-sms-suite/data/create_secret.json12
-rw-r--r--test/csit/tests/dcaegen2/testcases/resources/DMaaP.py844
-rw-r--r--test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py318
-rw-r--r--test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot266
-rw-r--r--test/csit/tests/dcaegen2/testcases/resources/dcae_properties.robot30
-rw-r--r--test/csit/tests/multicloud-vmware/hosts/sanity-host.robot24
-rw-r--r--test/csit/tests/multicloud-vmware/images/sanity-image.robot24
-rw-r--r--test/csit/tests/multicloud-vmware/networks/sanity-network.robot24
-rw-r--r--test/csit/tests/multicloud-vmware/provision/jsoninput/image_file.json7
-rw-r--r--test/csit/tests/multicloud-vmware/provision/sanity_test_image.robot34
-rw-r--r--test/csit/tests/multicloud-vmware/samples/sanity-sample.robot25
-rw-r--r--test/csit/tests/multicloud/provision/data/capacity.json6
-rw-r--r--test/csit/tests/multicloud/provision/sanity_test_multivim.robot11
-rw-r--r--test/csit/tests/music/music-distributed-kv-store-suite/__init__.robot2
-rw-r--r--test/csit/tests/music/music-distributed-kv-store-suite/data/register_domain.json3
-rw-r--r--test/csit/tests/music/music-distributed-kv-store-suite/music-distributed-kv-store-test.robot53
-rw-r--r--test/csit/tests/optf-has/has/data/healthcheck.json19
-rw-r--r--test/csit/tests/optf-has/has/data/onboard.json6
-rw-r--r--test/csit/tests/optf-has/has/data/plan_with_lati_and_longi.json41
-rw-r--r--test/csit/tests/optf-has/has/data/plan_with_short_distance_constraint.json64
-rw-r--r--test/csit/tests/optf-has/has/data/plan_with_wrong_distance_constraint.json63
-rw-r--r--test/csit/tests/optf-has/has/data/plan_with_wrong_version.json202
-rw-r--r--test/csit/tests/optf-has/has/data/plan_without_demand_section.json120
-rw-r--r--test/csit/tests/optf-has/has/optf_has_test.robot182
-rw-r--r--test/csit/tests/portal-sdk/testsuites/test1.robot204
-rw-r--r--test/csit/tests/portal/testsuites/test1.robot337
-rw-r--r--test/csit/tests/vfc/nfvo-multivimproxy/test.robot24
-rw-r--r--test/csit/tests/vfc/nfvo-wfengine/workflow.robot226
-rw-r--r--test/csit/tests/vnfsdk-pkgtools/tosca-metadata/csar/test_entry.mf4
32 files changed, 1925 insertions, 1349 deletions
diff --git a/test/csit/tests/aaf/aaf-sms-suite/__init__.robot b/test/csit/tests/aaf/aaf-sms-suite/__init__.robot
new file mode 100644
index 000000000..d1da7f385
--- /dev/null
+++ b/test/csit/tests/aaf/aaf-sms-suite/__init__.robot
@@ -0,0 +1,2 @@
+*** Settings ***
+Documentation Integration - Suite 1 \ No newline at end of file
diff --git a/test/csit/tests/aaf/aaf-sms-suite/aaf-sms-test.robot b/test/csit/tests/aaf/aaf-sms-suite/aaf-sms-test.robot
new file mode 100644
index 000000000..1302abc79
--- /dev/null
+++ b/test/csit/tests/aaf/aaf-sms-suite/aaf-sms-test.robot
@@ -0,0 +1,94 @@
+*** Settings ***
+Library OperatingSystem
+Library RequestsLibrary
+Library json
+
+*** Variables ***
+${MESSAGE} {"ping": "ok"}
+
+#global variables
+${generatedAID}
+
+*** Test Cases ***
+SMS Check SMS API Docker Container
+ [Documentation] Checks if SMS docker container is running
+ ${rc} ${output}= Run and Return RC and Output docker ps
+ Log To Console *********************
+ Log To Console retrurn_code = ${rc}
+ Log To Console output = ${output}
+ Should Be Equal As Integers ${rc} 0
+ Should Contain ${output} nexus3.onap.org:10001/onap/aaf/sms
+
+SMS GetStatus
+ [Documentation] Gets Backend Status
+ Create Session SMS ${SMS_HOSTNAME}:${SMS_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request SMS /v1/sms/status headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+
+SMS CreateDomain
+ [Documentation] Creates a Secret Domain to hold Secrets
+ Create Session SMS ${SMS_HOSTNAME}:${SMS_PORT}
+ ${data} Get Binary File ${CURDIR}${/}data${/}create_domain.json
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Post Request SMS /v1/sms/domain data=${data} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 201
+
+SMS CreateSecret
+ [Documentation] Create A Secret within the Domain
+ Create Session SMS ${SMS_HOSTNAME}:${SMS_PORT}
+ ${data} Get Binary File ${CURDIR}${/}data${/}create_secret.json
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Post Request SMS /v1/sms/domain/curltestdomain/secret data=${data} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 201
+
+SMS ListSecret
+ [Documentation] Lists all Secret Names within Domain
+ Create Session SMS ${SMS_HOSTNAME}:${SMS_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request SMS /v1/sms/domain/curltestdomain/secret headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+
+SMS GetSecret
+ [Documentation] Gets a single Secret with Values from Domain
+ Create Session SMS ${SMS_HOSTNAME}:${SMS_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request SMS /v1/sms/domain/curltestdomain/secret/curltestsecret1 headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+
+SMS DeleteSecret
+ [Documentation] Deletes a Secret referenced by Name from Domain
+ Create Session SMS ${SMS_HOSTNAME}:${SMS_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Delete Request SMS /v1/sms/domain/curltestdomain/secret/curltestsecret1 headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 204
+
+SMS DeleteDomain
+ [Documentation] Deletes a Domain referenced by Name
+ Create Session SMS ${SMS_HOSTNAME}:${SMS_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Delete Request SMS /v1/sms/domain/curltestdomain headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 204
+
+*** Keywords ***
diff --git a/test/csit/tests/aaf/aaf-sms-suite/data/create_domain.json b/test/csit/tests/aaf/aaf-sms-suite/data/create_domain.json
new file mode 100644
index 000000000..176f44431
--- /dev/null
+++ b/test/csit/tests/aaf/aaf-sms-suite/data/create_domain.json
@@ -0,0 +1,3 @@
+{
+ "name": "curltestdomain"
+}
diff --git a/test/csit/tests/aaf/aaf-sms-suite/data/create_secret.json b/test/csit/tests/aaf/aaf-sms-suite/data/create_secret.json
new file mode 100644
index 000000000..d99f4e2e0
--- /dev/null
+++ b/test/csit/tests/aaf/aaf-sms-suite/data/create_secret.json
@@ -0,0 +1,12 @@
+{
+ "name": "curltestsecret1",
+ "values": {
+ "name":"rah",
+ "age":35,
+ "map":{
+ "mapkey1": "mapvalue1",
+ "mapkey2": "mapvalue2"
+ },
+ "array":["golang","c++","java","python"]
+ }
+}
diff --git a/test/csit/tests/dcaegen2/testcases/resources/DMaaP.py b/test/csit/tests/dcaegen2/testcases/resources/DMaaP.py
index 63e4e8c6b..db59557db 100644
--- a/test/csit/tests/dcaegen2/testcases/resources/DMaaP.py
+++ b/test/csit/tests/dcaegen2/testcases/resources/DMaaP.py
@@ -1,423 +1,423 @@
-'''
-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__':
+'''
+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
diff --git a/test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py b/test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py
index 0242ad7ab..e581f1b2c 100644
--- a/test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py
+++ b/test/csit/tests/dcaegen2/testcases/resources/DcaeLibrary.py
@@ -1,159 +1,159 @@
-'''
-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)
-
+'''
+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)
+
diff --git a/test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot b/test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot
index 59d44e158..98b341529 100644
--- a/test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot
+++ b/test/csit/tests/dcaegen2/testcases/resources/dcae_keywords.robot
@@ -1,133 +1,133 @@
- *** 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}
+ *** 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}
diff --git a/test/csit/tests/dcaegen2/testcases/resources/dcae_properties.robot b/test/csit/tests/dcaegen2/testcases/resources/dcae_properties.robot
index be072d73c..692488814 100644
--- a/test/csit/tests/dcaegen2/testcases/resources/dcae_properties.robot
+++ b/test/csit/tests/dcaegen2/testcases/resources/dcae_properties.robot
@@ -1,15 +1,15 @@
-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
+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
diff --git a/test/csit/tests/multicloud-vmware/hosts/sanity-host.robot b/test/csit/tests/multicloud-vmware/hosts/sanity-host.robot
new file mode 100644
index 000000000..e74a79973
--- /dev/null
+++ b/test/csit/tests/multicloud-vmware/hosts/sanity-host.robot
@@ -0,0 +1,24 @@
+*** settings ***
+Resource ../../common.robot
+Library Collections
+Library RequestsLibrary
+Library OperatingSystem
+Library json
+Library HttpLibrary.HTTP
+
+
+*** Variables ***
+@{return_ok_list}= 200 201 202
+
+
+*** Test Cases ***
+
+TestGetHost
+ [Documentation] Sanity Test - Get Host
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Create Session web_session http://${VIO_IP}:9004 headers=${headers}
+ ${resp}= Get Request web_session api/multicloud-vio/v0/vmware_fake/1234/hosts/1
+ ${response_code}= Convert To String ${resp.status_code}
+ List Should Contain Value ${return_ok_list} ${response_code}
+ ${response_json} json.loads ${resp.content}
+ #Log To Console ${response_json}
diff --git a/test/csit/tests/multicloud-vmware/images/sanity-image.robot b/test/csit/tests/multicloud-vmware/images/sanity-image.robot
new file mode 100644
index 000000000..390433d5c
--- /dev/null
+++ b/test/csit/tests/multicloud-vmware/images/sanity-image.robot
@@ -0,0 +1,24 @@
+*** settings ***
+Resource ../../common.robot
+Library Collections
+Library RequestsLibrary
+Library OperatingSystem
+Library json
+Library HttpLibrary.HTTP
+
+
+*** Variables ***
+@{return_ok_list}= 200 201 202
+
+
+*** Test Cases ***
+
+TestGetHost
+ [Documentation] Sanity Test - Get Image
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Create Session web_session http://${VIO_IP}:9004 headers=${headers}
+ ${resp}= Get Request web_session api/multicloud-vio/v0/vmware_fake/1234/images/1
+ ${response_code}= Convert To String ${resp.status_code}
+ List Should Contain Value ${return_ok_list} ${response_code}
+ ${response_json} json.loads ${resp.content}
+ #Log To Console ${response_json}
diff --git a/test/csit/tests/multicloud-vmware/networks/sanity-network.robot b/test/csit/tests/multicloud-vmware/networks/sanity-network.robot
new file mode 100644
index 000000000..5433f18cb
--- /dev/null
+++ b/test/csit/tests/multicloud-vmware/networks/sanity-network.robot
@@ -0,0 +1,24 @@
+*** settings ***
+Resource ../../common.robot
+Library Collections
+Library RequestsLibrary
+Library OperatingSystem
+Library json
+Library HttpLibrary.HTTP
+
+
+*** Variables ***
+@{return_ok_list}= 200 201 202
+
+
+*** Test Cases ***
+
+TestGetHost
+ [Documentation] Sanity Test - Get Network
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Create Session web_session http://${VIO_IP}:9004 headers=${headers}
+ ${resp}= Get Request web_session api/multicloud-vio/v0/vmware_fake/1234/networks/1
+ ${response_code}= Convert To String ${resp.status_code}
+ List Should Contain Value ${return_ok_list} ${response_code}
+ ${response_json} json.loads ${resp.content}
+ #Log To Console ${response_json}
diff --git a/test/csit/tests/multicloud-vmware/provision/jsoninput/image_file.json b/test/csit/tests/multicloud-vmware/provision/jsoninput/image_file.json
new file mode 100644
index 000000000..1e3cac6f5
--- /dev/null
+++ b/test/csit/tests/multicloud-vmware/provision/jsoninput/image_file.json
@@ -0,0 +1,7 @@
+{
+ "name": "cirros-0.3.2-x86_64-disk",
+ "container_format": "bare",
+ "disk_format": "qcow2",
+ "visibility": "public",
+ "schema": "/v2/schemas/image"
+} \ No newline at end of file
diff --git a/test/csit/tests/multicloud-vmware/provision/sanity_test_image.robot b/test/csit/tests/multicloud-vmware/provision/sanity_test_image.robot
index 0a6f2f5e8..e8e36dc14 100644
--- a/test/csit/tests/multicloud-vmware/provision/sanity_test_image.robot
+++ b/test/csit/tests/multicloud-vmware/provision/sanity_test_image.robot
@@ -13,10 +13,13 @@ Library HttpLibrary.HTTP
${get_token_url} /api/multicloud-vio/v0/vmware_fake/identity/v3/auth/tokens
${get_image_url} /api/multicloud-vio/v0/vmware_fake/glance/v2/images
${get_image_schema_url} /api/multicloud-vio/v0/vmware_fake/glance/v2/schemas/image
+${image_service} /api/multicloud-vio/v0/vmware_fake/glance/v2/image/file
+
#json files
${auth_info_json} ${SCRIPTS}/../tests/multicloud-vmware/provision/jsoninput/auth_info.json
+${image_file} ${SCRIPTS}/../tests/multicloud-vmware/provision/jsoninput/image_file.json
#global vars
${TOKEN}
@@ -42,7 +45,7 @@ GetAuthToken
-TestCaseShoeImageSchema
+TestCaseShowImageSchema
[Documentation] Sanity test - Show Image Schema
${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN}
Create Session web_session http://${VIO_IP}:9004 headers=${headers}
@@ -76,3 +79,32 @@ TestCaseShowImage
List Should Contain Value ${return_ok_list} ${responese_code}
${response_json} json.loads ${resp.content}
Should Be Equal ${response_json['status']} active
+
+
+
+
+TestCaseUploadImage
+ [Documentation] Sanity test - Upload Image
+ ${json_value}= json_from_file ${image_file}
+ ${json_string}= string_from_json ${json_value}
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN}
+ Create Session web_session http://${VIO_IP}:9004 headers=${headers}
+ ${resp}= POST Request web_session ${image_service} ${json_string}
+ ${responese_code}= Convert To String ${resp.status_code}
+ List Should Contain Value ${return_ok_list} ${responese_code}
+ ${response_json} json.loads ${resp.content}
+ ${IMAGEID}= Convert To String ${response_json['id']}
+ Set Global Variable ${IMAGEID}
+
+
+
+
+TestCaseDownloadImage
+ [Documentation] Sanity test - Download Image
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json X-Auth-Token=${TOKEN}
+ Create Session web_session http://${VIO_IP}:9004 headers=${headers}
+ ${resp}= Get Request web_session ${image_service}/${IMAGEID}
+ ${responese_code}= Convert To String ${resp.status_code}
+ List Should Contain Value ${return_ok_list} ${responese_code}
+ ${response_json} json.loads ${resp.content}
+ Should Be Equal ${response_json['status']} active \ No newline at end of file
diff --git a/test/csit/tests/multicloud-vmware/samples/sanity-sample.robot b/test/csit/tests/multicloud-vmware/samples/sanity-sample.robot
new file mode 100644
index 000000000..fcb784b27
--- /dev/null
+++ b/test/csit/tests/multicloud-vmware/samples/sanity-sample.robot
@@ -0,0 +1,25 @@
+*** settings ***
+Library Collections
+Library RequestsLibrary
+Library OperatingSystem
+Library json
+
+*** Variables ***
+@{return_ok_list}= 200 201 202
+${querysample_vio_url} /samples
+
+*** Test Cases ***
+VioSwaggerTest
+ [Documentation] query swagger info rest test
+ ${headers} Create Dictionary Content-Type=application/json X-TRANSACTIONID=123456 Accept=application/json
+ Create Session web_session http://${VIO_IP}:9004 headers=${headers}
+ ${resp}= Get Request web_session ${querysample_vio_url}
+ ${responese_code}= Convert To String ${resp.status_code}
+ List Should Contain Value ${return_ok_list} ${responese_code}
+ # verify logging output
+ ${response_json} json.loads ${resp.content}
+ ${logs}= Convert To String ${response_json['logs']}
+ Log To Console ${logs}
+ Should Contain ${logs} 123456
+ Should Contain ${logs} multicloud-vio
+ Should Contain ${logs} vio.samples.views \ No newline at end of file
diff --git a/test/csit/tests/multicloud/provision/data/capacity.json b/test/csit/tests/multicloud/provision/data/capacity.json
new file mode 100644
index 000000000..9b1130d08
--- /dev/null
+++ b/test/csit/tests/multicloud/provision/data/capacity.json
@@ -0,0 +1,6 @@
+{
+ "vCPU": 1,
+ "Memory": 1,
+ "Storage": 1,
+ "VIMs": ["vmware_fake"]
+} \ No newline at end of file
diff --git a/test/csit/tests/multicloud/provision/sanity_test_multivim.robot b/test/csit/tests/multicloud/provision/sanity_test_multivim.robot
index 2c1ec3f9f..4848b7459 100644
--- a/test/csit/tests/multicloud/provision/sanity_test_multivim.robot
+++ b/test/csit/tests/multicloud/provision/sanity_test_multivim.robot
@@ -1,4 +1,5 @@
*** settings ***
+Resource ../../common.robot
Library Collections
Library RequestsLibrary
Library OperatingSystem
@@ -7,6 +8,7 @@ Library json
*** Variables ***
@{return_ok_list}= 200 201 202
${queryswagger_broker_url} /api/multicloud/v0/swagger.json
+${check_capacity_broker_url} /api/multicloud/v0/check_vim_capacity
*** Test Cases ***
@@ -20,3 +22,12 @@ BrokerSwaggerTest
${response_json} json.loads ${resp.content}
${swagger_version}= Convert To String ${response_json['swagger']}
Should Be Equal ${swagger_version} 2.0
+
+BrokerCapacityTest
+ [Documentation] Check VIMs capacity
+ ${data}= Get Binary File ${CURDIR}${/}data${/}capacity.json
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Create Session web_session http://${BROKER_IP}:9001 headers=${headers}
+ ${resp}= Post Request web_session ${check_capacity_broker_url} ${data}
+ ${responese_code}= Convert To String ${resp.status_code}
+ List Should Contain Value ${return_ok_list} ${responese_code}
diff --git a/test/csit/tests/music/music-distributed-kv-store-suite/__init__.robot b/test/csit/tests/music/music-distributed-kv-store-suite/__init__.robot
new file mode 100644
index 000000000..d1da7f385
--- /dev/null
+++ b/test/csit/tests/music/music-distributed-kv-store-suite/__init__.robot
@@ -0,0 +1,2 @@
+*** Settings ***
+Documentation Integration - Suite 1 \ No newline at end of file
diff --git a/test/csit/tests/music/music-distributed-kv-store-suite/data/register_domain.json b/test/csit/tests/music/music-distributed-kv-store-suite/data/register_domain.json
new file mode 100644
index 000000000..96811ee97
--- /dev/null
+++ b/test/csit/tests/music/music-distributed-kv-store-suite/data/register_domain.json
@@ -0,0 +1,3 @@
+{
+ "domain":"test_domain"
+} \ No newline at end of file
diff --git a/test/csit/tests/music/music-distributed-kv-store-suite/music-distributed-kv-store-test.robot b/test/csit/tests/music/music-distributed-kv-store-suite/music-distributed-kv-store-test.robot
new file mode 100644
index 000000000..de26e5f6e
--- /dev/null
+++ b/test/csit/tests/music/music-distributed-kv-store-suite/music-distributed-kv-store-test.robot
@@ -0,0 +1,53 @@
+*** Settings ***
+Library OperatingSystem
+Library RequestsLibrary
+Library json
+
+*** Variables ***
+${MESSAGE} {"ping": "ok"}
+
+#global variables
+${generatedAID}
+
+*** Test Cases ***
+DKV Check Distributed KV Store API Docker Container
+ [Documentation] Checks if DKV docker container is running
+ ${rc} ${output}= Run and Return RC and Output docker ps
+ Log To Console *********************
+ Log To Console retrurn_code = ${rc}
+ Log To Console output = ${output}
+ Should Be Equal As Integers ${rc} 0
+ Should Contain ${output} nexus3.onap.org:10001/onap/music/distributed-kv-store
+
+DKV LoadDefaultProperties
+ [Documentation] Loads default configuration files into Consul
+ Create Session dkv ${DKV_HOSTNAME}:${DKV_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request dkv /v1/config/load-default headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+
+DKV FetchDefaultProperties
+ [Documentation] Fetches all default keys from Consul
+ Create Session dkv ${DKV_HOSTNAME}:${DKV_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request dkv /v1/getconfigs headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+
+#DKV RegisterDomain
+# [Documentation] Send a POST request to create a domain
+# Create Session dkv ${DKV_HOSTNAME}:${DKV_PORT}
+# ${data}= Get Binary File ${CURDIR}${/}data${/}register_domain.json
+# &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+# ${resp}= Post Request dkv v1/register data=${data} headers=${headers}
+# Log To Console *********************
+# Log To Console response = ${resp}
+# Log To Console body = ${resp.text}
+# Should Be Equal As Integers ${resp.status_code} 200
+
+*** Keywords ***
diff --git a/test/csit/tests/optf-has/has/data/healthcheck.json b/test/csit/tests/optf-has/has/data/healthcheck.json
new file mode 100644
index 000000000..926bb2898
--- /dev/null
+++ b/test/csit/tests/optf-has/has/data/healthcheck.json
@@ -0,0 +1,19 @@
+{
+ "consistencyInfo": {
+ "type": "eventual"
+ },
+ "values": {
+ "created": 1479482603641,
+ "message": "",
+ "name": "foo",
+ "recommend_max": 1,
+ "solution": "{\"healthcheck\": \" healthcheck\"}",
+ "status": "solved",
+ "template": "{\"healthcheck\": \"healthcheck\"}",
+ "timeout": 3600,
+ "translation": "{\"healthcheck\": \" healthcheck\"}",
+ "updated": 1484324150629
+ }
+}
+
+
diff --git a/test/csit/tests/optf-has/has/data/onboard.json b/test/csit/tests/optf-has/has/data/onboard.json
new file mode 100644
index 000000000..a4939c459
--- /dev/null
+++ b/test/csit/tests/optf-has/has/data/onboard.json
@@ -0,0 +1,6 @@
+{
+ "appname": "conductor",
+ "userId": "conductor",
+ "isAAF": "false",
+ "password": "c0nduct0r"
+}
diff --git a/test/csit/tests/optf-has/has/data/plan_with_lati_and_longi.json b/test/csit/tests/optf-has/has/data/plan_with_lati_and_longi.json
new file mode 100644
index 000000000..5e35d6abf
--- /dev/null
+++ b/test/csit/tests/optf-has/has/data/plan_with_lati_and_longi.json
@@ -0,0 +1,41 @@
+{
+ "name":"onap template with lati and longi without constraints and without optimizations",
+ "template":{
+ "homing_template_version":"2017-10-10",
+ "parameters":{
+ "service_name":"Residential vCPE",
+ "service_id":"vcpe_service_id",
+ "customer_lat":45.395968,
+ "customer_long":-71.135344,
+ "physical_location":"DLLSTX233",
+ "REQUIRED_MEM":4,
+ "REQUIRED_DISK":100,
+ "pnf_id":"some_pnf_id"
+ },
+ "locations":{
+ "customer_loc":{
+ "latitude":{
+ "get_param":"customer_lat"
+ },
+ "longitude":{
+ "get_param":"customer_long"
+ }
+ }
+ },
+ "demands":{
+ "vG":[
+ {
+ "inventory_provider":"aai",
+ "inventory_type":"cloud"
+ }
+ ]
+ },
+ "constraints":{
+
+ },
+ "optimization":{
+
+ }
+ }
+}
+
diff --git a/test/csit/tests/optf-has/has/data/plan_with_short_distance_constraint.json b/test/csit/tests/optf-has/has/data/plan_with_short_distance_constraint.json
new file mode 100644
index 000000000..68a7e119b
--- /dev/null
+++ b/test/csit/tests/optf-has/has/data/plan_with_short_distance_constraint.json
@@ -0,0 +1,64 @@
+{
+ "name":"onap template with short distance constraint",
+ "template":{
+ "homing_template_version":"2017-10-10",
+ "parameters":{
+ "service_name":"Residential vCPE",
+ "service_id":"vcpe_service_id",
+ "customer_lat":25.395968,
+ "customer_long":-51.135344,
+ "physical_location":"DLLSTX233",
+ "REQUIRED_MEM":4,
+ "REQUIRED_DISK":100,
+ "pnf_id":"some_pnf_id"
+ },
+ "locations":{
+ "customer_loc":{
+ "latitude":{
+ "get_param":"customer_lat"
+ },
+ "longitude":{
+ "get_param":"customer_long"
+ }
+ }
+ },
+ "demands":{
+ "vG":[
+ {
+ "inventory_provider":"aai",
+ "inventory_type":"cloud"
+ }
+ ]
+ },
+ "constraints":{
+ "distance-vg":{
+ "type":"distance_to_location",
+ "demands":[
+ "vG"
+ ],
+ "properties":{
+ "distance":"< 1 km",
+ "location":"customer_loc"
+ }
+ }
+ },
+ "optimization":{
+ "minimize": {
+ "sum": [
+ {
+ "distance_between": [
+ "customer_loc",
+ "vG"
+ ]
+ },
+ {
+ "distance_between": [
+ "customer_loc",
+ "vG"
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
diff --git a/test/csit/tests/optf-has/has/data/plan_with_wrong_distance_constraint.json b/test/csit/tests/optf-has/has/data/plan_with_wrong_distance_constraint.json
new file mode 100644
index 000000000..9f25c2dff
--- /dev/null
+++ b/test/csit/tests/optf-has/has/data/plan_with_wrong_distance_constraint.json
@@ -0,0 +1,63 @@
+{
+ "name":"onap template with wrong distance constraint",
+ "template":{
+ "homing_template_version":"2017-10-10",
+ "parameters":{
+ "service_name":"Residential vCPE",
+ "service_id":"vcpe_service_id",
+ "customer_lat":45.395968,
+ "customer_long":-71.135344,
+ "physical_location":"DLLSTX233",
+ "REQUIRED_MEM":4,
+ "REQUIRED_DISK":100,
+ "pnf_id":"some_pnf_id"
+ },
+ "locations":{
+ "customer_loc":{
+ "latitude":{
+ "get_param":"customer_lat"
+ },
+ "longitude":{
+ "get_param":"customer_long"
+ }
+ }
+ },
+ "demands":{
+ "vG":[
+ {
+ "inventory_provider":"aai",
+ "inventory_type":"cloud"
+ }
+ ]
+ },
+ "constraints":{
+ "distance-vg":{
+ "demands":[
+ "vG"
+ ],
+ "properties":{
+ "distance":"< 1 km",
+ "location":"customer_loc"
+ }
+ }
+ },
+ "optimization":{
+ "minimize": {
+ "sum": [
+ {
+ "distance_between": [
+ "customer_loc",
+ "vG"
+ ]
+ },
+ {
+ "distance_between": [
+ "customer_loc",
+ "vG"
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
diff --git a/test/csit/tests/optf-has/has/data/plan_with_wrong_version.json b/test/csit/tests/optf-has/has/data/plan_with_wrong_version.json
index 9471fbf82..c0618bfbf 100644
--- a/test/csit/tests/optf-has/has/data/plan_with_wrong_version.json
+++ b/test/csit/tests/optf-has/has/data/plan_with_wrong_version.json
@@ -1,175 +1,41 @@
{
- "name": "onap optf has plan with wrong version",
- "template": {
- "conductor_template_version": "yyyy-mm-dd",
- "parameters": {
- "UCPEHOST": "chcil129snd",
- "CUSTOMER":"21014aa2-526b-11e6-beb8-9e71128cae77"
- },
- "locations": {
- "customer_loc": {
- "host_name": {
- "get_param": "UCPEHOST"
- }
- }
- },
- "demands": {
- "vHNPortalaaS_PRIMARY_1": [
- {
- "inventory_provider": "aai",
- "inventory_type": "service",
- "service_type": "HNPORTAL",
- "customer_id": {"get_param": "CUSTOMER"}
+ "name":"onap template with wrong version",
+ "template":{
+ "homing_template_version":"xxxx-yy-zz",
+ "parameters":{
+ "service_name":"Residential vCPE",
+ "service_id":"vcpe_service_id",
+ "customer_lat":45.395968,
+ "customer_long":-71.135344,
+ "physical_location":"DLLSTX233",
+ "REQUIRED_MEM":4,
+ "REQUIRED_DISK":100,
+ "pnf_id":"some_pnf_id"
},
- {
- "inventory_provider": "aai",
- "inventory_type": "cloud"
- }
- ],
- "vHNPortalaaS_SECONDARY_1": [
- {
- "inventory_provider": "aai",
- "inventory_type": "service",
- "service_type": "HNPORTAL",
- "customer_id": {"get_param": "CUSTOMER"}
+ "locations":{
+ "customer_loc":{
+ "latitude":{
+ "get_param":"customer_lat"
+ },
+ "longitude":{
+ "get_param":"customer_long"
+ }
+ }
},
- {
- "inventory_provider": "aai",
- "inventory_type": "cloud"
- }
- ],
- "vHNGWaaS_PRIMARY_1": [
- {
- "inventory_provider": "aai",
- "inventory_type": "service",
- "service_type": "HNGATEWAY",
- "customer_id": {"get_param": "CUSTOMER"}
+ "demands":{
+ "vG":[
+ {
+ "inventory_provider":"aai",
+ "inventory_type":"cloud"
+ }
+ ]
},
- {
- "inventory_provider": "aai",
- "inventory_type": "cloud"
- }
- ],
- "vHNGWaaS_SECONDARY_1": [
- {
- "inventory_provider": "aai",
- "inventory_type": "service",
- "service_type": "HNGATEWAY",
- "customer_id": {"get_param": "CUSTOMER"}
+ "constraints":{
+
},
- {
- "inventory_provider": "aai",
- "inventory_type": "cloud"
- }
- ],
- "vVIGaaS_PRIMARY_1": [
- {
- "inventory_provider": "aai",
- "inventory_type": "service",
- "service_type": "VVIG",
- "customer_id": {"get_param": "CUSTOMER"}
- }
- ],
- "vVIGaaS_SECONDARY_1": [
- {
- "inventory_provider": "aai",
- "inventory_type": "service",
- "service_type": "VVIG",
- "customer_id": {"get_param": "CUSTOMER"}
- }
- ],
- "vVIGaaS_PRIMARY_2": [
- {
- "inventory_provider": "aai",
- "inventory_type": "service",
- "service_type": "VVIG",
- "customer_id": {"get_param": "CUSTOMER"}
+ "optimization":{
+
}
- ],
- "vVIGaaS_SECONDARY_2": [
- {
- "inventory_provider": "aai",
- "inventory_type": "service",
- "service_type": "VVIG",
- "customer_id": {"get_param": "CUSTOMER"}
- }
- ]
- },
- "constraints": {
- "distance-vvig": {
- "type": "distance_to_location",
- "demands": [
- "vVIGaaS_SECONDARY_1",
- "vVIGaaS_PRIMARY_1"
- ],
- "properties": {
- "distance": "< 5000 km",
- "location": "customer_loc"
- }
- },
- "distance-vgw": {
- "type": "distance_to_location",
- "demands": [
- "vHNGWaaS_SECONDARY_1",
- "vHNGWaaS_PRIMARY_1"
- ],
- "properties": {
- "distance": "< 5000 km",
- "location": "customer_loc"
- }
- },
- "zone-vhngw": {
- "type": "zone",
- "demands": [
- "vHNGWaaS_SECONDARY_1",
- "vHNGWaaS_PRIMARY_1"
- ],
- "properties": {
- "qualifier": "different",
- "category": "complex"
- }
- },
- "zone-vhnportal": {
- "type": "zone",
- "demands": [
- "vHNPortalaaS_SECONDARY_1",
- "vHNPortalaaS_PRIMARY_1"
- ],
- "properties": {
- "qualifier": "different",
- "category": "complex"
- }
- }
- },
- "optimization": {
- "minimize": {
- "sum": [
- {
- "product": [
- 1,
- {
- "distance_between": [
- "customer_loc",
- "vVIGaaS_PRIMARY_1"
- ]
- }
- ]
- },
- {
- "product": [
- 1,
- {
- "distance_between": [
- "customer_loc",
- "vHNGWaaS_PRIMARY_1"
- ]
- }
- ]
- }
- ]
- }
- }
-},
- "timeout": 5,
- "limit": 3
+ }
}
+
diff --git a/test/csit/tests/optf-has/has/data/plan_without_demand_section.json b/test/csit/tests/optf-has/has/data/plan_without_demand_section.json
index 87a459d87..fe5d2fa65 100644
--- a/test/csit/tests/optf-has/has/data/plan_without_demand_section.json
+++ b/test/csit/tests/optf-has/has/data/plan_without_demand_section.json
@@ -1,93 +1,33 @@
{
- "name": "onap optf has plan with wrong version",
- "template": {
- "conductor_template_version": "2016-11-01",
- "parameters": {
- "UCPEHOST": "chcil129snd",
- "CUSTOMER":"21014aa2-526b-11e6-beb8-9e71128cae77"
- },
- "locations": {
- "customer_loc": {
- "host_name": {
- "get_param": "UCPEHOST"
- }
- }
- },
- "constraints": {
- "distance-vvig": {
- "type": "distance_to_location",
- "demands": [
- "vVIGaaS_SECONDARY_1",
- "vVIGaaS_PRIMARY_1"
- ],
- "properties": {
- "distance": "< 5000 km",
- "location": "customer_loc"
- }
- },
- "distance-vgw": {
- "type": "distance_to_location",
- "demands": [
- "vHNGWaaS_SECONDARY_1",
- "vHNGWaaS_PRIMARY_1"
- ],
- "properties": {
- "distance": "< 5000 km",
- "location": "customer_loc"
- }
- },
- "zone-vhngw": {
- "type": "zone",
- "demands": [
- "vHNGWaaS_SECONDARY_1",
- "vHNGWaaS_PRIMARY_1"
- ],
- "properties": {
- "qualifier": "different",
- "category": "complex"
- }
- },
- "zone-vhnportal": {
- "type": "zone",
- "demands": [
- "vHNPortalaaS_SECONDARY_1",
- "vHNPortalaaS_PRIMARY_1"
- ],
- "properties": {
- "qualifier": "different",
- "category": "complex"
- }
- }
- },
- "optimization": {
- "minimize": {
- "sum": [
- {
- "product": [
- 1,
- {
- "distance_between": [
- "customer_loc",
- "vVIGaaS_PRIMARY_1"
- ]
- }
- ]
- },
- {
- "product": [
- 1,
- {
- "distance_between": [
- "customer_loc",
- "vHNGWaaS_PRIMARY_1"
- ]
+ "name":"onap template without demand section",
+ "template":{
+ "homing_template_version":"2017-10-10",
+ "parameters":{
+ "service_name":"Residential vCPE",
+ "service_id":"vcpe_service_id",
+ "customer_lat":45.395968,
+ "customer_long":-71.135344,
+ "physical_location":"DLLSTX233",
+ "REQUIRED_MEM":4,
+ "REQUIRED_DISK":100,
+ "pnf_id":"some_pnf_id"
+ },
+ "locations":{
+ "customer_loc":{
+ "latitude":{
+ "get_param":"customer_lat"
+ },
+ "longitude":{
+ "get_param":"customer_long"
}
- ]
- }
- ]
- }
- }
-},
- "timeout": 5,
- "limit": 3
+ }
+ },
+ "constraints":{
+
+ },
+ "optimization":{
+
+ }
+ }
}
+
diff --git a/test/csit/tests/optf-has/has/optf_has_test.robot b/test/csit/tests/optf-has/has/optf_has_test.robot
index 4882c229f..62db10774 100644
--- a/test/csit/tests/optf-has/has/optf_has_test.robot
+++ b/test/csit/tests/optf-has/has/optf_has_test.robot
@@ -11,6 +11,8 @@ ${RESP_MESSAGE_WITHOUT_DEMANDS} Undefined Demand
#global variables
${generatedPlanId}
+${generatedAID}
+${resultStatus}
*** Test Cases ***
Check Cassandra Docker Container
@@ -114,6 +116,186 @@ Get Root Url
Log To Console body = ${resp.text}
Should Be Equal As Integers ${resp.status_code} 200
+Conductor AddHealthcheck Row Into Music
+ [Documentation] It sends a REST PUT request to Music to inject healthcheck plan
+ Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT}
+ ${data}= Get Binary File ${CURDIR}${/}data${/}healthcheck.json
+ &{headers}= Create Dictionary ns=conductor userId=conductor password=c0nduct0r Content-Type=application/json Accept=application/json
+ ${resp}= Put Request musicaas /MUSIC/rest/v2/keyspaces/conductor/tables/plans/rows?id=healthcheck data=${data} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ ${response_json} json.loads ${resp.content}
+ Should Be Equal As Integers ${resp.status_code} 200
+ Sleep 5s Wait Injection effectiveness
+
+Healthcheck
+ [Documentation] It sends a REST GET request to healthcheck url
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request optf-cond /v1/plans/healthcheck headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+
+SendPlanWithWrongVersion
+ [Documentation] It sends a POST request to conductor
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_wrong_version.json
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ ${response_json} json.loads ${resp.content}
+ ${generatedPlanId}= Convert To String ${response_json['id']}
+ Set Global Variable ${generatedPlanId}
+ Log To Console generatedPlanId = ${generatedPlanId}
+ Should Be Equal As Integers ${resp.status_code} 201
+ Sleep 10s Wait Plan Resolution
+
+GetPlanWithWrongVersion
+ [Documentation] It sends a REST GET request to capture error
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ ${response_json} json.loads ${resp.content}
+ ${resultStatus}= Convert To String ${response_json['plans'][0]['status']}
+ Set Global Variable ${resultStatus}
+ Log To Console resultStatus = ${resultStatus}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+ Should Be Equal error ${resultStatus}
+
+SendPlanWithoutDemandSection
+ [Documentation] It sends a POST request to conductor
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ ${data}= Get Binary File ${CURDIR}${/}data${/}plan_without_demand_section.json
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ ${response_json} json.loads ${resp.content}
+ ${generatedPlanId}= Convert To String ${response_json['id']}
+ Set Global Variable ${generatedPlanId}
+ Log To Console generatedPlanId = ${generatedPlanId}
+ Should Be Equal As Integers ${resp.status_code} 201
+ Sleep 10s Wait Plan Resolution
+
+GetPlanWithoutDemandSection
+ [Documentation] It sends a REST GET request to capture error
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ ${response_json} json.loads ${resp.content}
+ ${resultStatus}= Convert To String ${response_json['plans'][0]['status']}
+ Set Global Variable ${resultStatus}
+ Log To Console resultStatus = ${resultStatus}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+ Should Be Equal error ${resultStatus}
+
+SendPlanWithWrongConstraint
+ [Documentation] It sends a POST request to conductor
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_wrong_distance_constraint.json
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ ${response_json} json.loads ${resp.content}
+ ${generatedPlanId}= Convert To String ${response_json['id']}
+ Set Global Variable ${generatedPlanId}
+ Log To Console generatedPlanId = ${generatedPlanId}
+ Should Be Equal As Integers ${resp.status_code} 201
+ Sleep 10s Wait Plan Resolution
+
+GetPlanWithWrongConstraint
+ [Documentation] It sends a REST GET request to capture error
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ ${response_json} json.loads ${resp.content}
+ ${resultStatus}= Convert To String ${response_json['plans'][0]['status']}
+ Set Global Variable ${resultStatus}
+ Log To Console resultStatus = ${resultStatus}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+ Should Be Equal error ${resultStatus}
+
+
+SendPlanWithLatiAndLongi
+ [Documentation] It sends a POST request to conductor
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_lati_and_longi.json
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ ${response_json} json.loads ${resp.content}
+ ${generatedPlanId}= Convert To String ${response_json['id']}
+ Set Global Variable ${generatedPlanId}
+ Log To Console generatedPlanId = ${generatedPlanId}
+ Should Be Equal As Integers ${resp.status_code} 201
+ Sleep 60s Wait Plan Resolution
+
+GetPlanWithLatiAndLongi
+ [Documentation] It sends a REST GET request to capture recommendations
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ ${response_json} json.loads ${resp.content}
+ ${resultStatus}= Convert To String ${response_json['plans'][0]['status']}
+ Set Global Variable ${resultStatus}
+ Log To Console resultStatus = ${resultStatus}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+ Should Be Equal done ${resultStatus}
+
+SendPlanWithShortDistanceConstraint
+ [Documentation] It sends a POST request to conductor
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_short_distance_constraint.json
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ ${response_json} json.loads ${resp.content}
+ ${generatedPlanId}= Convert To String ${response_json['id']}
+ Set Global Variable ${generatedPlanId}
+ Log To Console generatedPlanId = ${generatedPlanId}
+ Should Be Equal As Integers ${resp.status_code} 201
+ Sleep 60s Wait Plan Resolution
+
+GetPlanWithShortDistanceConstraint
+ [Documentation] It sends a REST GET request to capture recommendations
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ ${response_json} json.loads ${resp.content}
+ ${resultStatus}= Convert To String ${response_json['plans'][0]['status']}
+ Set Global Variable ${resultStatus}
+ Log To Console resultStatus = ${resultStatus}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+ Should Be Equal not found ${resultStatus}
+
+
*** Keywords ***
diff --git a/test/csit/tests/portal-sdk/testsuites/test1.robot b/test/csit/tests/portal-sdk/testsuites/test1.robot
index 84579d017..00714024f 100644
--- a/test/csit/tests/portal-sdk/testsuites/test1.robot
+++ b/test/csit/tests/portal-sdk/testsuites/test1.robot
@@ -6,15 +6,15 @@ Library XvfbRobot
*** Variables ***
-${PORTAL_URL} http://portal.api.simpledemo.onap.org:8989
-${PORTAL_ENV} /ONAPPORTAL
+${PORTAL_URL} http://portal.api.simpledemo.onap.org:8990
+${PORTAL_ENV} /ONAPPORTALSDK
${PORTAL_LOGIN_URL} ${PORTAL_URL}${PORTAL_ENV}/login.htm
-${PORTAL_HOME_PAGE} ${PORTAL_URL}${PORTAL_ENV}/applicationsHome
+${PORTAL_HOME_PAGE} ${PORTAL_URL}${PORTAL_ENV}/welcome
${PORTAL_MICRO_ENDPOINT} ${PORTAL_URL}${PORTAL_ENV}/commonWidgets
${PORTAL_HOME_URL} ${PORTAL_URL}${PORTAL_ENV}/applicationsHome
${GLOBAL_APPLICATION_ID} robot-functional
${GLOBAL_PORTAL_ADMIN_USER} demo
-${GLOBAL_PORTAL_ADMIN_PWD} demo123456!
+${GLOBAL_PORTAL_ADMIN_PWD} demo
${GLOBAL_SELENIUM_BROWSER} chrome
${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} Create Dictionary
${GLOBAL_SELENIUM_DELAY} 0
@@ -36,115 +36,105 @@ Portal admin Login To Portal GUI
Set Selenium Speed ${GLOBAL_SELENIUM_DELAY}
Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
Log Logging in to ${PORTAL_URL}${PORTAL_ENV}
- # Handle Proxy Warning
+ # Handle Proxy Warning
Title Should Be Login
- Input Text xpath=//input[@ng-model='loginId'] ${GLOBAL_PORTAL_ADMIN_USER}
- Input Password xpath=//input[@ng-model='password'] ${GLOBAL_PORTAL_ADMIN_PWD}
- Click Link xpath=//a[@id='loginBtn']
- Wait Until Page Contains Element xpath=//img[@alt='Onap Logo'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
+ Input Text xpath=//input[@id='loginId'] ${GLOBAL_PORTAL_ADMIN_USER}
+ Input Password xpath=//input[@id='password'] ${GLOBAL_PORTAL_ADMIN_PWD}
+ Click Element //*[@id="loginBtn"]
+ Wait Until Page Contains Element xpath=//img[@src='app/fusionapp/icons/logo_onap_transbg.png'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
Log Logged in to ${PORTAL_URL}${PORTAL_ENV}
-
-Portal Admin Navigation Application Link Tab
- [Documentation] Logs into Portal GUI as Portal admin
- Click Element xpath=.//h3[contains(text(),'xDemo App')]/following::div[1]
- Go To ${PORTAL_HOME_PAGE}
- Dismiss Alert accept=false
- #Scroll Element Into View xpath=//span[@id='tab-Home']
- #Click Element xpath=//span[@id='tab-Home']
+SDKPortalAdmin Navigation Application Link Tab
+ [Documentation] Logs into Portal GUI as Portal admin
+ Comment Click Element xpath=.//h3[contains(text(),'xDemo App')]/following::div[1]
+ Comment Go To ${PORTAL_HOME_PAGE}
+ Comment Dismiss Alert accept=false
+ #Scroll Element Into View xpath=//span[@id='tab-Home']
+ #Click Element xpath=//span[@id='tab-Home']
#Click Element xpath=(//span[@id='tab-xDemo-App']/following::i[@class='ion-close-round'])[1]
- Click Element xpath=.//h3[contains(text(),'xDemo App')]/following::div[1]
-
-
-
-Validate SDK Sub Menu
- [Documentation] Logs into SDK GUI as Portal admin
- Page Should Contain Home
- Page Should Contain Sample Pages
- Page Should Contain Reports
- Page Should Contain Profile
- Page Should Contain Admin
-
-Click Sample Pages and validate sub Menu
- [Documentation] Click Sample Pages
- Select frame xpath=.//*[@id='tabframe-xDemo-App']
- Click Link xpath=//a[@id='parent-item-Sample-Pages']
- Element Text Should Be xpath=//a[@title='Collaboration'] Collaboration
- Element Text Should Be xpath=//a[@title='Notebook'] Notebook
- Click Link xpath=//a[contains(@title,'Collaboration')]
- Page Should Contain User List
- Select frame xpath=.//*[@id='tabframe-xDemo-App']
- Click Link xpath=//a[@id='parent-item-Sample-Pages']
- Click Link xpath=//a[contains(@title,'Notebook')]
- Element Text Should Be xpath=//h1[contains(.,'Notebook')] Notebook
-
-Click Reports and validate sub Menu
- [Documentation] Click Reports Tab
+ Comment Click Element xpath=.//h3[contains(text(),'xDemo App')]/following::div[1]
+
+Validate SDK Sub Menu
+ [Documentation] Logs into SDK GUI as Portal admin
+ Page Should Contain Home
+ Page Should Contain Sample Pages
+ Page Should Contain Reports
+ Page Should Contain Profile
+ Page Should Contain Admin
+
+#Click Sample Pages and validate sub Menu
+ #[Documentation] Click Sample Pages
+ #Comment Select frame xpath=.//*[@id='tabframe-xDemo-App']
+ #Click Link xpath=//a[@id='parent-item-Sample-Pages']
+ #Element Text Should Be xpath=//a[@title='Collaboration'] Collaboration
+ #Element Text Should Be xpath=//a[@title='Notebook'] Notebook
+ #Click Link xpath=//a[contains(@title,'Collaboration')]
+ #Page Should Contain User List
+ #Comment Select frame xpath=.//*[@id='tabframe-xDemo-App']
+ #Click Link xpath=//a[@id='parent-item-Sample-Pages']
+ #Click Link xpath=//a[contains(@title,'Notebook')]
+ #Element Text Should Be xpath=//h1[contains(.,'Notebook')] Notebook
+
+Click Reports and validate sub Menu
+ [Documentation] Click Reports Tab
#Select frame xpath=.//*[@id='tabframe-xDemo-App']
- Click Link xpath=//a[@id='parent-item-Reports']
- Element Text Should Be xpath=//a[@title='All Reports'] All Reports
- Element Text Should Be xpath=//a[@title='Create Reports'] Create Reports
- Click Link xpath=//a[contains(@title,'All Reports')]
- Page Should Contain Report search
- Select frame xpath=.//*[@id='tabframe-xDemo-App']
- Click Link xpath=//a[@id='parent-item-Reports']
- Click Link xpath=//a[contains(@title,'Create Reports')]
- Page Should Contain Report Wizard
-
-Click Profile and validate sub Menu
- [Documentation] Click Profile Tab
- Select frame xpath=.//*[@id='tabframe-xDemo-App']
- Click Link xpath=//a[@id='parent-item-Profile']
- Element Text Should Be xpath=//a[@title='Search'] Search
- Element Text Should Be xpath=//a[@title='Self'] Self
- Click Link xpath=//a[contains(@title,'Search')]
- Page Should Contain Profile Search
- Select frame xpath=.//*[@id='tabframe-xDemo-App']
- Click Link xpath=//a[@id='parent-item-Profile']
- Click Link xpath=//a[contains(@title,'Self')]
- Page Should Contain Self Profile Detail
-
-
-Click Admin and validate sub Menu
- [Documentation] Click Admin Tab
- Select frame xpath=.//*[@id='tabframe-xDemo-App']
- Click Link xpath=//a[@id='parent-item-Admin']
- Element Text Should Be xpath=//a[@title='Roles'] Roles
- Element Text Should Be xpath=//a[@title='Role Functions'] Role Functions
- Element Text Should Be xpath=//a[@title='Cache Admin'] Cache Admin
- Element Text Should Be xpath=//a[@title='Menus'] Menus
- Element Text Should Be xpath=//a[@title='Usage'] Usage
- Click Link xpath=//a[contains(@title,'Roles')]
- Page Should Contain Roles
- Select frame xpath=.//*[@id='tabframe-xDemo-App']
- Click Link xpath=//a[@id='parent-item-Admin']
- Click Link xpath=//a[contains(@title,'Role Function')]
- Page Should Contain Role Function
- Select frame xpath=.//*[@id='tabframe-xDemo-App']
- Click Link xpath=.//a[@id='parent-item-Admin']
- #Select frame xpath=.//*[@id='tabframe-xDemo-App']
- Click Link xpath=//a[@id='parent-item-Admin']
- Click Link xpath=//a[contains(@title,'Cache Admin')]
- Page Should Contain Cache Regions
- Select frame xpath=.//*[@id='tabframe-xDemo-App']
- Click Link xpath=.//a[@id='parent-item-Admin']
- Click Link xpath=//a[@id='parent-item-Admin']
- Click Link xpath=//a[contains(@title,'Menus')]
- Page Should Contain Admin Menu Items
- Select frame xpath=.//*[@id='tabframe-xDemo-App']
- Click Link xpath=//a[@id='parent-item-Admin']
- Click Link xpath=//a[@id='parent-item-Admin']
- Click Link xpath=//a[contains(@title,'Usage')]
- Page Should Contain Current Usage
-
-
-Teardown
- [Documentation] Close All Open browsers
- Close All Browsers
-
+ Click Link xpath=//a[@id='parent-item-Reports']
+ Element Text Should Be xpath=//a[@title='All Reports'] All Reports
+ Element Text Should Be xpath=//a[@title='Create Reports'] Create Reports
+ Click Link xpath=//a[contains(@title,'All Reports')]
+ Page Should Contain Report search
+ Comment Select frame xpath=.//*[@id='tabframe-xDemo-App']
+ Click Link xpath=//a[@id='parent-item-Reports']
+ Click Link xpath=//a[contains(@title,'Create Reports')]
+ Page Should Contain Report Wizard
+
+Click Profile and validate sub Menu
+ [Documentation] Click Profile Tab
+ Comment Select frame xpath=.//*[@id='tabframe-xDemo-App']
+ Click Link xpath=//a[@id='parent-item-Profile']
+ Element Text Should Be xpath=//a[@title='Search'] Search
+ Element Text Should Be xpath=//a[@title='Self'] Self
+ Click Link xpath=//a[contains(@title,'Search')]
+ Page Should Contain Profile Search
+ Comment Select frame xpath=.//*[@id='tabframe-xDemo-App']
+ Click Link xpath=//a[@id='parent-item-Profile']
+ Click Link xpath=//a[contains(@title,'Self')]
+ Page Should Contain Self Profile Detail
-
+Click Admin and validate sub Menu
+ [Documentation] Click Admin Tab
+ Comment Select frame xpath=.//*[@id='tabframe-xDemo-App']
+ Click Link xpath=//a[@id='parent-item-Admin']
+ Element Text Should Be xpath=//a[@title='Roles'] Roles
+ Element Text Should Be xpath=//a[@title='Role Functions'] Role Functions
+ Element Text Should Be xpath=//a[@title='Cache Admin'] Cache Admin
+ Element Text Should Be xpath=//a[@title='Menus'] Menus
+ Element Text Should Be xpath=//a[@title='Usage'] Usage
+ Click Link xpath=//a[contains(@title,'Roles')]
+ Page Should Contain Roles
+ Comment Select frame xpath=.//*[@id='tabframe-xDemo-App']
+ Click Link xpath=//a[@id='parent-item-Admin']
+ Click Link xpath=//a[contains(@title,'Role Function')]
+ Page Should Contain Role Function
+ Comment Select frame xpath=.//*[@id='tabframe-xDemo-App']
+ Click Link xpath=.//a[@id='parent-item-Admin']
+ #Select frame xpath=.//*[@id='tabframe-xDemo-App']
+ Click Link xpath=//a[@id='parent-item-Admin']
+ Click Link xpath=//a[contains(@title,'Cache Admin')]
+ Page Should Contain Cache Regions
+ Comment Select frame xpath=.//*[@id='tabframe-xDemo-App']
+ Click Link xpath=.//a[@id='parent-item-Admin']
+ Click Link xpath=//a[@id='parent-item-Admin']
+ Click Link xpath=//a[contains(@title,'Menus')]
+ Page Should Contain Admin Menu Items
+ Comment Select frame xpath=.//*[@id='tabframe-xDemo-App']
+ Click Link xpath=//a[@id='parent-item-Admin']
+ Click Link xpath=//a[@id='parent-item-Admin']
+ Click Link xpath=//a[contains(@title,'Usage')]
+ Page Should Contain Current Usage
-
+Teardown
+ [Documentation] Close All Open browsers
+ Close All Browsers
*** Keywords ***
diff --git a/test/csit/tests/portal/testsuites/test1.robot b/test/csit/tests/portal/testsuites/test1.robot
index bbbe5172f..90aa10788 100644
--- a/test/csit/tests/portal/testsuites/test1.robot
+++ b/test/csit/tests/portal/testsuites/test1.robot
@@ -62,6 +62,7 @@ ${jira} jira
${RESOURCE_PATH} ONAPPORTAL/auxapi/ticketevent
${portal_Template} ${CURDIR}/portal.template
+${Result} FALSE
*** Test Cases ***
@@ -72,133 +73,128 @@ Portal Health Check
Login into Portal URL
Portal admin Login To Portal GUI
-Portal R1 Release
- [Documentation] ONAP Portal R1 functionality test
- Notification on ONAP Portal
- Portal Application Account Management validation
+# Portal R1 Release
+ # [Documentation] ONAP Portal R1 functionality test
+ # Notification on ONAP Portal
+ # Portal Application Account Management validation
Portal R1 Release for AAF
[Documentation] ONAP Portal R1 functionality for AAF test
Portal AAF new fields
-Create Microse service onboarding
- Portal admin Microservice Onboarding
+#Create Microse service onboarding
+ #Portal admin Microservice Onboarding
+#Delete Microse service
+ #Portal admin Microservice Delete
-Create Widget for all users
- Portal Admin Create Widget for All users
-
-Delete Widget for all users
- Portal Admin Delete Widget for All users
-
-Create Widget for Application Roles
- Portal Admin Create Widget for Application Roles
-
-Delete Widget for Application Roles
- Portal Admin Delete Widget for Application Roles
+#Create Widget for all users
+ #Portal Admin Create Widget for All users
+
+# Delete Widget for all users
+ # Portal Admin Delete Widget for All users
+
+#Create Widget for Application Roles
+ #Portal Admin Create Widget for Application Roles
+
+#Delete Widget for Application Roles
+ #Portal Admin Delete Widget for Application Roles
-Validate Functional Top Menu Get Access
- Functional Top Menu Get Access
+#Validate Functional Top Menu Get Access
+ #Functional Top Menu Get Access
-Validate Functional Top Menu Contact Us
- Functional Top Menu Contact Us
+#Validate Functional Top Menu Contact Us
+ #Functional Top Menu Contact Us
-Edit Functional Menu
- Portal admin Edit Functional menu
+#Edit Functional Menu
+ #Portal admin Edit Functional menu
-Broadbond Notification functionality
- ${AdminBroadCastMsg}= Portal Admin Broadcast Notifications
- set global variable ${AdminBroadCastMsg}
+# Broadbond Notification functionality
+ # ${AdminBroadCastMsg}= Portal Admin Broadcast Notifications
+ # set global variable ${AdminBroadCastMsg}
-
-Category Notification functionality
- ${AdminCategoryMsg}= Portal Admin Category Notifications
- set global variable ${AdminCategoryMsg}
-
-Create a Test user for Application Admin -Test
- Portal admin Add Application admin User New user -Test
+# Category Notification functionality
+ # ${AdminCategoryMsg}= Portal Admin Category Notifications
+ # set global variable ${AdminCategoryMsg}
+
+#Create a Test user for Application Admin -Test
+ #Portal admin Add Application admin User New user -Test
-Create a Test User for Apllication Admin
- Portal admin Add Application admin User New user
+#Create a Test User for Apllication Admin
+ #Portal admin Add Application admin User New user
-Add Application Admin for Existing User Test user
- Portal admin Add Application Admin Exiting User -APPDEMO
+#Add Application Admin for Existing User Test user
+ #Portal admin Add Application Admin Exiting User -APPDEMO
-Create a Test user for Standared User
- Portal admin Add Standard User New user
+#Create a Test user for Standared User
+ #Portal admin Add Standard User New user
-Add Application Admin for Exisitng User
- Portal admin Add Application Admin Exiting User
+#Add Application Admin for Exisitng User
+ #Portal admin Add Application Admin Exiting User
-Delete Application Admin for Exisitng User
- Portal admin Delete Application Admin Existing User
+#Delete Application Admin for Exisitng User
+ #Portal admin Delete Application Admin Existing User
-Add Standard User Role for Existing user
- Portal admin Add Standard User Existing user
+# Add Standard User Role for Existing user
+ # Portal admin Add Standard User Existing user
-Edit Standard User Role for Existing user
- Portal admin Edit Standard User Existing user
+# Edit Standard User Role for Existing user
+ # Portal admin Edit Standard User Existing user
-Delete Standard User Role for Existing user
- Portal admin Delete Standard User Existing user
-
-
-
-
+#Delete Standard User Role for Existing user
+ #Portal admin Delete Standard User Existing user
+
Logout from Portal GUI as Portal Admin
Portal admin Logout from Portal GUI
-
-Login To Portal GUI as APP Admin
- Application admin Login To Portal GUI
-
-
+# Application Admin user Test cases
+
+#Login To Portal GUI as APP Admin
+ #Application admin Login To Portal GUI
+
##Navigate Functional Link as APP Admin
## Application Admin Navigation Functional Menu
-Add Standard User Role for Existing user as APP Admin
- Application admin Add Standard User Existing user
+# Add Standard User Role for Existing user as APP Admin
+ # Application admin Add Standard User Existing user
-Edit Standard User Role for Existing user as APP Admin
- Application admin Edit Standard User Existing user
+# Edit Standard User Role for Existing user as APP Admin
+ # Application admin Edit Standard User Existing user
-Delete Standard User Role for Existing user as APP Admin
- Application admin Delete Standard User Existing user
+# Delete Standard User Role for Existing user as APP Admin
+ # Application admin Delete Standard User Existing user
-#Navigate Application Link as APP Admin
-# Application Admin Navigation Application Link Tab
+# #Navigate Application Link as APP Admin
+# # Application Admin Navigation Application Link Tab
-Logout from Portal GUI as APP Admin
- Application admin Logout from Portal GUI
+#Logout from Portal GUI as APP Admin
+ #Application admin Logout from Portal GUI
+#Standard User Test cases
-Login To Portal GUI as Standared User
- Standared user Login To Portal GUI
+#Login To Portal GUI as Standared User
+ #Standared user Login To Portal GUI
#Navigate Application Link as Standared User
# Standared user Navigation Application Link Tab
##Navigate Functional Link as Standared User
## Standared user Navigation Functional Menu
+
-Broadcast Notifications Standared user
- Standared user Broadcast Notifications ${AdminBroadCastMsg}
+# Broadcast Notifications Standared user
+ # Standared user Broadcast Notifications ${AdminBroadCastMsg}
-Category Notifications Standared user
- Standared user Category Notifications ${AdminCategoryMsg}
+# Category Notifications Standared user
+ # Standared user Category Notifications ${AdminCategoryMsg}
Teardown
[Documentation] Close All Open browsers
Close All Browsers
-
-
-
-
-
*** Keywords ***
Setup Browser
@@ -296,6 +292,8 @@ Portal admin Add Application Admin Exiting User
Click Button xpath=//input[@value='Select application']
Scroll Element Into View xpath=(//input[@value='Select application']/following::*[contains(text(),'xDemo App' )])[1]
Click Element xpath=(//li[contains(.,'xDemo App' )])[2]
+# Scroll Element Into View xpath=(//input[@value='Select application']/following::*[contains(text(),'Default' )])[1]
+# Click Element xpath=(//li[contains(.,'Default' )])[2]
#Select From List xpath=(//input[@value='Select application']/following::*[contains(text(),'xDemo App')])[1] xDemo App
Click Button xpath=//button[@id='div-updateAdminAppsRoles']
Click Element xpath=//button[@id='admin-div-ok-button']
@@ -303,6 +301,7 @@ Portal admin Add Application Admin Exiting User
Get Selenium Implicit Wait
Click Link xpath=//a[@aria-label='Admins']
Click Element xpath=//input[@id='dropdown1']
+# Click Element xpath=//li[contains(.,'Default' )]
Click Element xpath=//li[contains(.,'xDemo App' )]
Input Text xpath=//input[@id='input-table-search'] ${Existing_User}
Table Column Should Contain xpath=//*[@table-data='admins.adminsTableData'] 1 ${Existing_User}
@@ -312,9 +311,16 @@ Portal admin Add Application Admin Exiting User
Portal admin Delete Application Admin Existing User
[Documentation] Naviage to Admins tab
+ Wait Until Element Is Visible xpath=//a[@title='Admins'] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
+ Click Link xpath=//a[@title='Admins']
+ Wait Until Element Is Visible xpath=//h1[contains(.,'Admins')] ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
+ Page Should Contain Admins
+ Click Button xpath=//button[@ng-click='toggleSidebar()']
+ Input Text xpath=//input[@id='input-table-search'] ${Existing_User}
Click Element xpath=(//span[contains(.,'portal')] )[1]
#Click Element xpath=(//span[contains(.,'demo')] )[1]
Click Element xpath=//*[@id='select-app-xDemo-App']/following::i[@id='i-delete-application']
+# Click Element xpath=//*[@id='select-app-Default']/following::i[@id='i-delete-application']
Click Element xpath=//button[@id='div-confirm-ok-button']
Click Button xpath=//button[@id='div-updateAdminAppsRoles']
Click Element xpath=//button[@id='admin-div-ok-button']
@@ -340,6 +346,21 @@ Portal admin Add Application admin User New user
Input Text xpath=//input[@ng-model='searchUsers.newUser.loginPwd'] ${App_Loginpwd}
Input Text xpath=//input[@ng-model='searchUsers.newUser.loginPwdCheck'] ${App_LoginPwdCheck}
Click Button xpath=//button[@ng-click='searchUsers.addNewUserFun()']
+
+ ${Result}= Get Matching XPath Count xpath=//*[contains(text(),'User with same loginId already exists')]
+
+ #log ${Result}
+ #${type_result}= Evaluate type(${Result})
+ #log ${type_result}
+
+ Run Keyword if '${Result}'== 0 AdminUser does not exist already
+ ... ELSE Goto Home Image
+ Set Selenium Implicit Wait 3000
+
+Goto Home Image
+ Click Image xpath=//img[@alt='Onap Logo']
+
+AdminUser does not exist already
Click Button xpath=//button[@id='next-button']
#Scroll Element Into View xpath=//div[@id='div-app-name-dropdown-xDemo-App']
Click Element xpath=//*[@id='div-app-name-dropdown-xDemo-App']
@@ -372,6 +393,18 @@ Portal admin Add Standard User New user
Input Text xpath=//input[@ng-model='searchUsers.newUser.loginPwd'] ${Sta_Loginpwd}
Input Text xpath=//input[@ng-model='searchUsers.newUser.loginPwdCheck'] ${Sta_LoginPwdCheck}
Click Button xpath=//button[@ng-click='searchUsers.addNewUserFun()']
+
+ ${Result}= Get Matching XPath Count xpath=//*[contains(text(),'User with same loginId already exists')]
+
+ #log ${Result}
+ #${type_result}= Evaluate type(${Result})
+ #log ${type_result}
+
+ Run Keyword if '${Result}'== 0 StaUser does not exist already
+ ... ELSE Goto Home Image
+ Set Selenium Implicit Wait 3000
+
+StaUser does not exist already
Click Button xpath=//button[@id='next-button']
#Scroll Element Into View xpath=//div[@id='div-app-name-dropdown-xDemo-App']
Click Element xpath=//*[@id='div-app-name-dropdown-xDemo-App']
@@ -455,13 +488,7 @@ Portal admin Add Application Admin Exiting User -APPDEMO
Table Column Should Contain xpath=//*[@table-data='admins.adminsTableData'] 1 ${App_First_Name}
Click Image xpath=//img[@alt='Onap Logo']
Set Selenium Implicit Wait 3000
-
-
-
-
-
-
-
+
Portal admin Add Standard User Existing user
[Documentation] Naviage to Users tab
Click Link xpath=//a[@title='Users']
@@ -472,10 +499,10 @@ Portal admin Add Standard User Existing user
Click Button xpath=//button[@id='button-search-users']
Click Element xpath=//span[@id='result-uuid-0']
Click Button xpath=//button[@id='next-button']
- Click Element xpath=//*[@id='div-app-name-dropdown-xDemo-App']
- Click Element xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
- #Click Element xpath=//div[@id='div-app-name-dropdown-xDemo-App']
- #Click Element xpath=//div[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
+# Click Element xpath=//*[@id='div-app-name-dropdown-Default']
+# Click Element xpath=//*[@id='div-app-name-Default']/following::input[@id='Standard-User-checkbox']
+ Click Element xpath=//div[@id='div-app-name-dropdown-xDemo-App']
+ Click Element xpath=//div[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
Set Selenium Implicit Wait 3000
Click Button xpath=//button[@id='new-user-save-button']
Set Selenium Implicit Wait 3000
@@ -487,19 +514,24 @@ Portal admin Add Standard User Existing user
Go To ${PORTAL_HOME_PAGE}
Click Link xpath=//a[@title='Users']
Click Element xpath=//input[@id='dropdown1']
- Click Element xpath=//li[contains(.,'xDemo App')]
- #Click Element xpath=//li[contains(.,'XDemo App')]
+# Click Element xpath=//li[contains(.,'Default')]
+ Click Element xpath=//li[contains(.,'XDemo App')]
Input Text xpath=//input[@id='input-table-search'] ${Existing_User}
- Element Text Should Be xpath=(.//*[@id='rowheader_t1_0'])[2] Standard User
-
-
-
+ Element Text Should Be xpath=(.//*[@id='rowheader_t1_0'])[2] Standard User
+ Set Selenium Implicit Wait 3000
+
Portal admin Edit Standard User Existing user
[Documentation] Naviage to Users tab
Click Element xpath=(.//*[@id='rowheader_t1_0'])[2]
+# Click Element xpath=//*[@id='div-app-name-dropdown-Default']
+# Click Element xpath=//*[@id='div-app-name-Default']/following::input[@id='Standard-User-checkbox']
+# Click Element xpath=//*[@id='div-app-name-Default']/following::input[@id='Portal-Notification-Admin-checkbox']
Click Element xpath=//*[@id='div-app-name-dropdown-xDemo-App']
Click Element xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
- Click Element xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='System-Administrator-checkbox']
+ Click Element xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Portal-Notification-Admin-checkbox']
+# Click Element xpath=//*[@id='div-app-name-dropdown-SDC']
+# Click Element xpath=//*[@id='div-app-name-SDC']/following::input[@id='Standard-User-checkbox']
+# Click Element xpath=//*[@id='div-app-name-SDC']/following::input[@id='Portal-Notification-Admin-checkbox']
Set Selenium Implicit Wait 3000
Click Button xpath=//button[@id='new-user-save-button']
Set Selenium Implicit Wait 3000
@@ -508,22 +540,24 @@ Portal admin Edit Standard User Existing user
#Click Element xpath=//li[contains(.,'xDemo App')]
Input Text xpath=//input[@id='input-table-search'] ${Existing_User}
Element Text Should Be xpath=(.//*[@id='rowheader_t1_0'])[2] System Administrator
-
+ Set Selenium Implicit Wait 3000
Portal admin Delete Standard User Existing user
[Documentation] Naviage to Users tab
Click Element xpath=(.//*[@id='rowheader_t1_0'])[2]
+# Scroll Element Into View xpath=//*[@id='div-app-name-Default']/following::*[@id='app-item-delete'][1]
+# Click Element xpath=//*[@id='div-app-name-Default']/following::*[@id='app-item-delete'][1]
Scroll Element Into View xpath=//*[@id='div-app-name-xDemo-App']/following::*[@id='app-item-delete'][1]
Click Element xpath=//*[@id='div-app-name-xDemo-App']/following::*[@id='app-item-delete'][1]
+# Scroll Element Into View xpath=//*[@id='div-app-name-SDC']/following::*[@id='app-item-delete'][1]
+# Click Element xpath=//*[@id='div-app-name-SDC']/following::*[@id='app-item-delete'][1]
Click Element xpath=//button[@id='div-confirm-ok-button']
Click Button xpath=//button[@id='new-user-save-button']
#Input Text xpath=//input[@id='input-table-search'] ${Existing_User}
- #Is Element Visible xpath=(//*[contains(.,'Portal')] )[2]
- Element Should Not Contain xpath=//*[@table-data='users.accountUsers'] portal
- #Element Should Not Contain xpath=//*[@table-data='users.accountUsers'] demo
-
-
-
+ #Is Element Visible xpath=(//*[contains(.,'Portal')] )[2]
+ Element Should Not Contain xpath=//*[@table-data='users.accountUsers'] Portal
+ #Element Should Not Contain xpath=//*[@table-data='users.accountUsers'] demo
+ Set Selenium Implicit Wait 3000
Functional Top Menu Get Access
[Documentation] Naviage to Support tab
@@ -531,7 +565,7 @@ Functional Top Menu Get Access
Mouse Over xpath=//*[contains(text(),'Get Access')]
Click Link xpath=//a[contains(.,'Get Access')]
Element Text Should Be xpath=//h1[contains(.,'Get Access')] Get Access
-
+ Set Selenium Implicit Wait 3000
Functional Top Menu Contact Us
[Documentation] Naviage to Support tab
@@ -540,7 +574,7 @@ Functional Top Menu Contact Us
Click Link xpath=//a[contains(.,'Contact Us')]
Element Text Should Be xpath=//h1[contains(.,'Contact Us')] Contact Us
Click Image xpath=//img[@alt='Onap Logo']
-
+ Set Selenium Implicit Wait 3000
Portal admin Edit Functional menu
[Documentation] Naviage to Edit Functional menu tab
@@ -583,7 +617,7 @@ Portal admin Edit Functional menu
Mouse Over xpath=//*[contains(text(),'Design')]
Set Selenium Implicit Wait 3000
Element Should Not Contain xpath=(.//*[contains(.,'Design')]/following::ul[1])[1] ONAP Test
-
+ Set Selenium Implicit Wait 3000
Portal admin Microservice Onboarding
@@ -605,11 +639,32 @@ Portal admin Microservice Onboarding
Click Button xpath=//button[@id='microservice-details-save-button']
Table Column Should Contain xpath=//*[@table-data='serviceList'] 1 Test Microservice
#Element Text Should Be xpath=//*[@table-data='serviceList'] Test Microservice
-
-
-
+ Set Selenium Implicit Wait 3000
+
+Portal admin Microservice Delete
+ [Documentation] Naviage to Edit Functional menu tab
+ Click Link xpath=//a[@title='Microservice Onboarding']
+ Click Button xpath=//button[@id='microservice-onboarding-button-add']
+ Input Text xpath=//input[@name='name'] TestMS
+ Input Text xpath=//*[@name='desc'] TestMS
+ Click Element xpath=//input[@id='microservice-details-input-app']
+ Scroll Element Into View xpath=//li[contains(.,'xDemo App')]
+ Click Element xpath=//li[contains(.,'xDemo App')]
+ Click Element xpath=//*[@name='desc']
+ Input Text xpath=//input[@name='url'] ${PORTAL_MICRO_ENDPOINT}
+ Click Element xpath=//input[@id='microservice-details-input-security-type']
+ Scroll Element Into View xpath=//li[contains(.,'Basic Authentication')]
+ Click Element xpath=//li[contains(.,'Basic Authentication')]
+ Input Text xpath=//input[@name='username'] ${GLOBAL_PORTAL_ADMIN_USER}
+ Input Text xpath=//input[@name='password'] ${GLOBAL_PORTAL_ADMIN_PWD}
+ Click Button xpath=//button[@id='microservice-details-save-button']
+ Table Column Should Contain xpath=//*[@table-data='serviceList'] 1 TestMS
+ Click Element xpath=(.//*[contains(text(),'TestMS')]/following::*[@ng-click='microserviceOnboarding.deleteService(rowData)'])[1]
+ Click Button xpath=//button[@id="div-confirm-ok-button"]
+ Set Selenium Implicit Wait 3000
+
Portal Admin Create Widget for All users
- [Documentation] Naviage to Create Widget menu tab
+ [Documentation] Navigate to Create Widget menu tab
${WidgetAttachment}= Catenate ${PORTAL_ASSETS_DIRECTORY}//news_widget.zip
Click Link xpath=//a[@title='Widget Onboarding']
Click Button xpath=//button[@ng-click='toggleSidebar()']
@@ -647,7 +702,6 @@ Portal Admin Delete Widget for All users
#Table Column Should Contain .//*[@table-data='portalAdmin.portalAdminsTableData'] 0 ONAP-xDemo
#Set Selenium Implicit Wait 3000
-
Portal Admin Create Widget for Application Roles
[Documentation] Naviage to Create Widget menu tab
${WidgetAttachment}= Catenate ${PORTAL_ASSETS_DIRECTORY}//news_widget.zip
@@ -677,10 +731,7 @@ Portal Admin Create Widget for Application Roles
Page Should Contain ONAP-xDemo
Set Selenium Implicit Wait 3000
GO TO ${PORTAL_HOME_PAGE}
-
-
-
-
+
Portal Admin Delete Widget for Application Roles
#Wait Until Page Contains ONAP-xDemo ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
#Page Should Contain ONAP-xDemo
@@ -698,7 +749,7 @@ Portal Admin Delete Widget for Application Roles
Element Should Not Contain xpath=//*[@table-data='portalAdmin.portalAdminsTableData'] ONAP-xDemo
#Is Element Visible xpath=//*[@table-data='portalAdmin.portalAdminsTableData']
#Table Column Should Contain .//*[@table-data='portalAdmin.portalAdminsTableData'] 0 ONAP-xDemo
- #Set Selenium Implicit Wait 3000
+ Set Selenium Implicit Wait 3000
@@ -720,15 +771,14 @@ Portal Admin Edit Widget
Click Element xpath=//div[@id='confirmation-button-next']
Element Should Not Contain xpath=//*[@table-data='ignoredTableData'] ONAP_VID
Click Link xpath=//a[@id='close-button']
-
-
-
+ Set Selenium Implicit Wait 3000
Portal Admin Broadcast Notifications
[Documentation] Portal Test Admin Broadcast Notifications
- ${CurrentDay}= Get Current Date result_format=%m/%d/%Y
- ${NextDay}= Get Current Date increment=24:00:00 result_format=%m/%d/%Y
- ${CurrentDate}= Get Current Date result_format=%m%d%y%H%M
+
+ ${CurrentDay}= Get Current Date increment=24:00:00 result_format=%m/%d/%Y
+ ${NextDay}= Get Current Date increment=48:00:00 result_format=%m/%d/%Y
+ ${CurrentDate}= Get Current Date increment=24:00:00 result_format=%m%d%y%H%M
${AdminBroadCastMsg}= catenate ONAP VID Broadcast Automation${CurrentDate}
Click Image xpath=//img[@alt='Onap Logo']
Set Selenium Implicit Wait 3000
@@ -744,15 +794,17 @@ Portal Admin Broadcast Notifications
click element xpath=//*[@id="megamenu-notification-button"]
click element xpath=//*[@id="notification-history-link"]
Wait until Element is visible xpath=//*[@id="notification-history-table"] timeout=10
- Table Column Should Contain xpath=//*[@id="notification-history-table"] 2 ${AdminBroadCastMsg}
+ Table Column Should Contain xpath=//*[@id="notification-history-table"] 2 ${AdminBroadCastMsg}
+ Set Selenium Implicit Wait 3000
log ${AdminBroadCastMsg}
[Return] ${AdminBroadCastMsg}
Portal Admin Category Notifications
[Documentation] Portal Admin Broadcast Notifications
- ${CurrentDay}= Get Current Date result_format=%m/%d/%Y
- ${NextDay}= Get Current Date increment=24:00:00 result_format=%m/%d/%Y
- ${CurrentDate}= Get Current Date result_format=%m%d%y%H%M
+ ${CurrentDay}= Get Current Date increment=24:00:00 result_format=%m/%d/%Y
+ ${NextDay}= Get Current Date increment=48:00:00 result_format=%m/%d/%Y
+# ${CurrentDay}= Get Current Date result_format=%m/%d/%Y
+ ${CurrentDate}= Get Current Date increment=24:00:00 result_format=%m%d%y%H%M
${AdminCategoryMsg}= catenate ONAP VID Category Automation${CurrentDate}
Click Link xpath=//a[@id='parent-item-Home']
Click Link xpath=//*[@id="parent-item-User-Notifications"]
@@ -772,9 +824,10 @@ Portal Admin Category Notifications
click element xpath=//*[@id="megamenu-notification-button"]
click element xpath=//*[@id="notification-history-link"]
Wait until Element is visible xpath=//*[@id="notification-history-table"] timeout=10
- Table Column Should Contain xpath=//*[@id="notification-history-table"] 2 ${AdminCategoryMsg}
+ Table Column Should Contain xpath=//*[@id="notification-history-table"] 2 ${AdminCategoryMsg}
+ Set Selenium Implicit Wait 3000
log ${AdminCategoryMsg}
- [Return] ${AdminCategoryMsg}
+ [Return] ${AdminCategoryMsg}
Portal admin Logout from Portal GUI
@@ -834,6 +887,7 @@ Application admin Add Standard User Existing user
Click Element xpath=//span[@id='result-uuid-0']
Click Button xpath=//button[@id='next-button']
Click Element xpath=//*[@id='div-app-name-dropdown-xDemo-App']
+ Set Selenium Implicit Wait 3000
Click Element xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
Set Selenium Implicit Wait 3000
Click Button xpath=//button[@id='new-user-save-button']
@@ -854,9 +908,12 @@ Application admin Add Standard User Existing user
Application admin Edit Standard User Existing user
[Documentation] Naviage to Users tab
Click Element xpath=(.//*[@id='rowheader_t1_0'])[2]
+# Click Element xpath=//*[@id='div-app-name-dropdown-Default']
+# Click Element xpath=//*[@id='div-app-name-Default']/following::input[@id='Standard-User-checkbox']
+# Click Element xpath=//*[@id='div-app-name-Default']/following::input[@id='Portal-Notification-Admin-checkbox']
Click Element xpath=//*[@id='div-app-name-dropdown-xDemo-App']
Click Element xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
- Click Element xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='System-Administrator-checkbox']
+ Click Element xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Portal-Notification-Admin-checkbox']
Set Selenium Implicit Wait 3000
Click Button xpath=//button[@id='new-user-save-button']
Set Selenium Implicit Wait 3000
@@ -870,15 +927,17 @@ Application admin Edit Standard User Existing user
Application admin Delete Standard User Existing user
[Documentation] Naviage to Users tab
Click Element xpath=(.//*[@id='rowheader_t1_0'])[2]
+# Scroll Element Into View xpath=//*[@id='div-app-name-Default']/following::*[@id='app-item-delete'][1]
+# Click Element xpath=//*[@id='div-app-name-Default']/following::*[@id='app-item-delete'][1]
Scroll Element Into View xpath=//*[@id='div-app-name-xDemo-App']/following::*[@id='app-item-delete'][1]
Click Element xpath=//*[@id='div-app-name-xDemo-App']/following::*[@id='app-item-delete'][1]
Click Element xpath=//button[@id='div-confirm-ok-button']
Click Button xpath=//button[@id='new-user-save-button']
- #Input Text xpath=//input[@id='input-table-search'] ${Existing_User}
- #Is Element Visible xpath=(//*[contains(.,'Portal')] )[2]
+# Input Text xpath=//input[@id='input-table-search'] ${Existing_User}
+# Is Element Visible xpath=(//*[contains(.,'Portal')] )[2]
Element Should Not Contain xpath=//*[@table-data='users.accountUsers'] Portal
#Click Image xpath=//img[@alt='Onap Logo']
- #Set Selenium Implicit Wait 3000
+ Set Selenium Implicit Wait 3000
@@ -918,16 +977,16 @@ Standared user Navigation Application Link Tab
Click Element xpath=.//h3[contains(text(),'xDemo App')]/following::div[1]
Page Should Contain ONAP Portal
Click Element xpath=(.//span[@id='tab-Home'])[1]
-
+ Set Selenium Implicit Wait 3000
Standared user Navigation Functional Menu
[Documentation] Logs into Portal GUI as application admin
Click Link xpath=//a[contains(.,'Manage')]
- Mouse Over xpath=//*[contains(text(),'Technology Insertion')]
- Click Link xpath= //*[contains(text(),'Infrastructure VNF Provisioning')]
- Page Should Contain Welcome to VID
- Click Element xpath=(.//span[@id='tab-Home'])[1]
-
+ Mouse Over xpath=//*[contains(text(),'Technology Insertion')]
+ Click Link xpath= //*[contains(text(),'Infrastructure VNF Provisioning')]
+ Page Should Contain Welcome to VID
+ Click Element xpath=(.//span[@id='tab-Home'])[1]
+ Set Selenium Implicit Wait 3000
Standared user Broadcast Notifications
diff --git a/test/csit/tests/vfc/nfvo-multivimproxy/test.robot b/test/csit/tests/vfc/nfvo-multivimproxy/test.robot
new file mode 100644
index 000000000..fab3694e4
--- /dev/null
+++ b/test/csit/tests/vfc/nfvo-multivimproxy/test.robot
@@ -0,0 +1,24 @@
+*** settings ***
+Resource ../../common.robot
+Library Collections
+Library RequestsLibrary
+Library simplejson
+Library OperatingSystem
+Library json
+Library HttpLibrary.HTTP
+
+*** Variables ***
+@{return_ok_list}= 200 201 202
+${queryswagger_url} /api/multivimproxy/v1/swagger.json
+
+*** Test Cases ***
+SwaggerFuncTest
+ [Documentation] query swagger info rest test
+ ${headers} Create Dictionary Content-Type=application/json Accept=application/json
+ Create Session web_session http://${RESMGR_IP}:8481 headers=${headers}
+ ${resp}= Get Request web_session ${queryswagger_url}
+ ${responese_code}= Convert To String ${resp.status_code}
+ List Should Contain Value ${return_ok_list} ${responese_code}
+ ${response_json} json.loads ${resp.content}
+ ${swagger_version}= Convert To String ${response_json['swagger']}
+ Should Be Equal ${swagger_version} 2.0 \ No newline at end of file
diff --git a/test/csit/tests/vfc/nfvo-wfengine/workflow.robot b/test/csit/tests/vfc/nfvo-wfengine/workflow.robot
index 07bfe6979..c9dbe6c46 100644
--- a/test/csit/tests/vfc/nfvo-wfengine/workflow.robot
+++ b/test/csit/tests/vfc/nfvo-wfengine/workflow.robot
@@ -1,113 +1,113 @@
-*** 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}
+*** 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}
diff --git a/test/csit/tests/vnfsdk-pkgtools/tosca-metadata/csar/test_entry.mf b/test/csit/tests/vnfsdk-pkgtools/tosca-metadata/csar/test_entry.mf
index 710d1a201..4441457e8 100644
--- a/test/csit/tests/vnfsdk-pkgtools/tosca-metadata/csar/test_entry.mf
+++ b/test/csit/tests/vnfsdk-pkgtools/tosca-metadata/csar/test_entry.mf
@@ -1,5 +1,5 @@
metadata:
vnf_product_name: test
vnf_provider_id: test
-vnf_pacakage_version: 1.0
-vnf_release_date_time: 2017.09.15T15:00+8:00
+vnf_package_version: 1.0
+vnf_release_data_time: 2017-09-15T15:00:03+08:00