Fixing database insert Issue
Change-Id: I68813e751d9f266dfd7544cb8eefcd730d1bb118
diff --git a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
index 6a819eb..ec12f35 100644
--- a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
+++ b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
@@ -76,16 +76,13 @@
main.maxNumBatch = 0
main.setupSkipped = False
- nic = main.params[ 'DATABASE' ][ 'nic' ]
- node = main.params[ 'DATABASE' ][ 'node' ]
- nic = main.params[ 'DATABASE' ][ 'nic' ]
+ main.nic = main.params[ 'DATABASE' ][ 'nic' ]
node = main.params[ 'DATABASE' ][ 'node' ]
stepResult = main.TRUE
main.log.info( "Cresting DB file" )
with open( main.dbFileName, "w+" ) as dbFile:
dbFile.write( "" )
-
stepResult = main.testSetUp.gitPulling()
except Exception as e:
main.testSetUp.envSetupException( e )
@@ -93,11 +90,6 @@
main.commit = main.commit.split( " " )[ 1 ]
- with open( main.dbFileName, "a" ) as dbFile:
- temp = "'" + main.commit + "',"
- temp += "'" + nic + "',"
- dbFile.write( temp )
- dbFile.close()
def CASE1( self ):
# main.scale[ 0 ] determines the current number of ONOS controller
main.testSetUp.getNumCtrls( True )
@@ -258,8 +250,10 @@
# write to DB file
main.log.info("Writing results to DS file")
with open(main.dbFileName, "a") as dbFile:
+ temp = "'" + main.commit + "',"
+ temp += "'" + main.nic + "',"
# Scale number
- temp = str(main.numCtrls)
+ temp += str( main.numCtrls )
temp += ",'" + "baremetal1" + "'"
# average latency
temp += "," + str( averageResult )