Fixing database insert Issue
Change-Id: I68813e751d9f266dfd7544cb8eefcd730d1bb118
diff --git a/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py b/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py
index 2547317..68a94e5 100644
--- a/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py
+++ b/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py
@@ -53,7 +53,6 @@
except Exception as e:
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
-
main.commit = ( main.commit.split( " " ) )[ 1 ]
# -- END OF INIT SECTION --#
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 )
diff --git a/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py b/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
index 98290df..e7690ba 100644
--- a/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
+++ b/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
@@ -84,7 +84,7 @@
main.setupSkipped = False
wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
- nic = main.params[ 'DATABASE' ][ 'nic' ]
+ main.nic = main.params[ 'DATABASE' ][ 'nic' ]
node = main.params[ 'DATABASE' ][ 'node' ]
stepResult = main.testSetUp.gitPulling()
main.log.info( "Cresting DB file" )
@@ -94,10 +94,6 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
main.commit = main.commit.split( " " )[ 1 ]
- with open( main.dbFileName, "a" ) as dbFile:
- temp = "'" + main.commit + "',"
- temp += "'" + nic + "',"
- dbFile.write( temp )
def CASE1( self ):
main.testSetUp.getNumCtrls( True )
main.testSetUp.envSetup( includeGitPull=False, makeMaxNodes=False )
@@ -437,7 +433,9 @@
main.log.info("Writing results to DS file")
with open(main.dbFileName, "a") as dbFile:
# Scale number
- temp = str(main.numCtrls)
+ temp = "'" + main.commit + "',"
+ temp += "'" + main.nic + "',"
+ temp += str(main.numCtrls)
temp += ",'" + "baremetal1" + "'"
# how many intents we installed before crash
temp += "," + str(verifyTotalIntents)