diff options
-rw-r--r-- | docker/requirements.pip | 8 | ||||
-rw-r--r-- | testcases/Controllers/ONOS/Teston/CI/onosfunctest.py | 35 | ||||
-rw-r--r-- | testcases/features/promise.py | 10 |
3 files changed, 41 insertions, 12 deletions
diff --git a/docker/requirements.pip b/docker/requirements.pip index e2b67d3bd..0ecb447ca 100644 --- a/docker/requirements.pip +++ b/docker/requirements.pip @@ -9,12 +9,8 @@ # pyyaml==3.10 gitpython==1.0.1 -python-neutronclient==2.6.0 -python-novaclient==2.28.1 -python-glanceclient==1.1.0 -python-cinderclient==1.4.0 +python-openstackclient==2.0.0 python-ceilometerclient==1.5.1 -python-keystoneclient==1.6.0 virtualenv==1.11.4 pexpect==4.0 requests==2.8.0 @@ -25,4 +21,4 @@ configObj==5.0.6 Flask==0.10.1 xmltodict==0.9.2 scp==0.10.2 -paramiko==1.16.0
\ No newline at end of file +paramiko==1.16.0 diff --git a/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py b/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py index 2d22baec9..0c68fd799 100644 --- a/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py +++ b/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py @@ -98,11 +98,11 @@ def GetResult(): # 'status': Result} cmd = "grep -rnh 'Execution Time' " + LOGPATH Resultbuffer = os.popen(cmd).read() - time1 = Resultbuffer[114:128] - time2 = Resultbuffer[28:42] + time1 = Resultbuffer[114:128] + time2 = Resultbuffer[28:42] cmd = "grep -rnh 'Success Percentage' " + LOGPATH + "/FUNCvirNetNB_*" Resultbuffer = os.popen(cmd).read() - if Resultbuffer.find('100%') >= 0: + if Resultbuffer.find('100%') >= 0: result1='Success' else: result1='Failed' @@ -112,10 +112,33 @@ def GetResult(): result2='Success' else: result2='Failed' - payload={'FUNCvirNet':{'duration': time1, - 'result': result1}, + status1 = [] + status2 = [] + cmd = "grep -rnh 'h3' " + LOGPATH + "/FUNCvirNetNB_*" + Resultbuffer = os.popen(cmd).read() + pattern = re.compile("<h3>([^-]+) - ([^-]+) - (\S*)</h3>") + #res = pattern.search(Resultbuffer).groups() + res = pattern.findall(Resultbuffer) + i = 0 + for index in range(len(res)): + status1.append({'Case name:':res[i][0] + res[i][1],'Case result':res[i][2]}) + i=i+1 + cmd = "grep -rnh 'h3' " + LOGPATH + "/FUNCvirNetNBL3*" + Resultbuffer = os.popen(cmd).read() + pattern = re.compile("<h3>([^-]+) - ([^-]+) - (\S*)</h3>") + #res = pattern.search(Resultbuffer).groups() + res = pattern.findall(Resultbuffer) + i = 0 + for index in range(len(res)): + status2.append({'Case name:':res[i][0] + res[i][1],'Case result':res[i][2]}) + i=i+1 + payload={'timestart': str(starttime), + 'FUNCvirNet':{'duration': time1, + 'result': result1, + 'status': status1}, 'FUNCvirNetL3':{'duration': time2, - 'result': result2}} + 'result': result2, + 'status': status2}} return payload def SetOnosIp(): diff --git a/testcases/features/promise.py b/testcases/features/promise.py index 0dc755b57..22d28fb99 100644 --- a/testcases/features/promise.py +++ b/testcases/features/promise.py @@ -20,6 +20,7 @@ import yaml import keystoneclient.v2_0.client as ksclient import glanceclient.client as glclient import novaclient.client as nvclient +from neutronclient.v2_0 import client as ntclient parser = argparse.ArgumentParser() @@ -172,6 +173,13 @@ def main(): exit(-1) logger.debug("Flavor '%s' with ID '%s' created successfully." % (FLAVOR_NAME, flavor_id)) + neutron = ntclient.Client(**nt_creds) + private_net=functest_utils.get_private_net(neutron) + if private_net == None: + logger.error("There is no private network in the deployment. Aborting...") + exit(-1) + logger.debug("Using private network '%s' (%s)." % (private_net['name'], + private_net['id'])) logger.info("Exporting environment variables...") os.environ["NODE_ENV"] = "functest" @@ -180,6 +188,8 @@ def main(): os.environ["OS_PASSWORD"] = USER_PWD os.environ["OS_TEST_IMAGE"] = image_id os.environ["OS_TEST_FLAVOR"] = flavor_id + os.environ["OS_TEST_NETWORK"] = private_net['id'] + os.chdir(PROMISE_REPO) results_file=open('promise-results.json','w+') |