fix the bug of onos test report 87/8787/1
authorlanqinglong <lanqinglong@huawei.com>
Fri, 29 Jan 2016 12:05:46 +0000 (20:05 +0800)
committerMorgan Richomme <morgan.richomme@orange.com>
Sat, 30 Jan 2016 19:54:00 +0000 (19:54 +0000)
Change-Id: I34a068f991b89af6c65c895c7e9e604eac5dadf6
(cherry picked from commit 38cb5f334a2acc034b9757eba68561d134da79fa)

testcases/Controllers/ONOS/Teston/CI/onosfunctest.py

index eb2c793..2d22bae 100644 (file)
@@ -93,9 +93,29 @@ def GetResult():
     else:
         logger.debug("Testcases Success")
         Result = "Success"
-    payload={'timestart': str(starttime),
-              'duration': str(duration),
-                'status': Result}
+    #payload={'timestart': str(starttime),
+    #          'duration': str(duration),
+    #            'status': Result}
+    cmd = "grep -rnh 'Execution Time' " + LOGPATH
+    Resultbuffer = os.popen(cmd).read()
+    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: 
+        result1='Success'
+    else:
+        result1='Failed'
+    cmd = "grep -rnh 'Success Percentage' " + LOGPATH + "/FUNCvirNetNBL3*"
+    Resultbuffer = os.popen(cmd).read()
+    if Resultbuffer.find('100%') >= 0:
+        result2='Success'
+    else:
+        result2='Failed'
+    payload={'FUNCvirNet':{'duration': time1,
+                           'result': result1},
+             'FUNCvirNetL3':{'duration': time2,
+                           'result': result2}}
     return payload
 
 def SetOnosIp():