Merge pull request #115 from opennetworkinglab/devl/wiki

Cleanup debug code and fix typo
diff --git a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py
index d67f244..0f0fe55 100644
--- a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py
+++ b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py
@@ -39,9 +39,9 @@
         except KeyError:
             # Jenkins build number is also used in posting to DB
             # If this test is not triggered by jenkins, give 
-            # it the runNum variable instead, ensuring that 
+            # it 0 instead, ensuring that 
             # the DB post will recognize it as a non-jenkins run
-            jenkinsBuildNumber = str(runNum)
+            jenkinsBuildNumber = str(0)
             main.log.info( 'Job is not run by jenkins. '+
                     'Build number set to: ' + jenkinsBuildNumber)
 
@@ -347,7 +347,13 @@
             if len(tempText) > 1:
                 main.log.info('Object read in from feature reply capture: '+
                         str(tempText))
-                featureTimestamp = float(tempText[1]) * 1000.0
+                if tempText[1] != ' ' and float(tempText[1]) > 1400000000.0:
+                    temp = tempText[1]
+                elif tempText[2] != ' ' and float(tempText[2]) > 1400000000.0:
+                    temp = tempText[2]
+                else:
+                    temp = 0 
+                featureTimestamp = float(temp) * 1000.0
             else:
                 main.log.error('Tshark output file for feature reply' +
                         ' returned unexpected results')
@@ -494,22 +500,21 @@
             main.step('Remove switch from controller')
             main.Mininet1.deleteSwController('s3')
             firstDevice = deviceList[0] 
-            main.log.info( "Removing device " +str(firstDevice)+
-                    " from ONOS" )
             
-            time.sleep( 5 )
-           
             # We need to get metrics before removing
             # device from the store below.
             for node in range(0, clusterCount):
                 metricsSwDown = CLIs[node].topologyEventsMetrics
                 jsonStr = metricsSwDown()
                 removeJsonList.append( json.loads(jsonStr) ) 
-            
-            #if deviceId:
-            main.ONOS1cli.deviceRemove(firstDevice)
            
             main.ONOS1.tsharkStop()
+            
+            main.log.info( "Removing device " +str(firstDevice)+
+                    " from ONOS" )
+           
+            #if deviceId:
+            main.ONOS1cli.deviceRemove(firstDevice)
 
             main.log.info('Copying over tshark files')
             os.system('scp ' + ONOSUser + '@' + nodeIpList[0] +
@@ -530,21 +535,23 @@
                     # tshark output is lengthy)
                     if len(obj) > 2:
                         # If first index of object is like an epoch time
-                        if obj[0] > 1400000000:
-                            temp = obj[0] 
-                        elif obj[1] > 1400000000:
-                            temp = obj[1]
-                        elif obj[2] > 1400000000:
-                            temp = obj[2] 
-                        elif obj[3] > 1400000000:
+                        if obj[1] != ' ' and float(obj[1]) > 1400000000.0:
+                            temp = obj[1] 
+                        elif obj[2] != ' 'and float(obj[2]) > 1400000000.0:
+                            temp = obj[2]
+                        elif obj[3] != ' 'and float(obj[3]) > 1400000000.0:
                             temp = obj[3]
                         else:
                             temp = 0
                         if index == 1:
                             tFinAck = float(temp) * 1000.0
+                        elif index == 2:
+                            continue
                         elif index == 3:
                             tAck = float(temp) * 1000.0
-                        
+                        else:
+                            tFinAck = 0
+                            tAck = 0
                     else:
                         main.log.error('Tshark output file for OFP' +
                             ' returned unexpected results')