Writing to DB file with the correct fields

Change-Id: I626e9ab0cf18f815a9194a7067d54c2e2c0ddd65
diff --git a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params
index 97e2aab..2f7ce4b 100755
--- a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params
+++ b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.params
@@ -3,6 +3,7 @@
     # 0-init, 1-setup, 10-null provider setup,
     # 11-mininet setup, 20-pushing intents,
     # 21-rerouting intents
+    # 0,1,10,20,1,11,20,1,10,21,1,11,21,100
     <testcases>0,1,10,20,1,11,20,1,10,21,1,11,21,100</testcases>
 
     <SCALE>
@@ -40,10 +41,15 @@
         <timeout>120</timeout>
     </SLEEP>
 
+    <DATABASE>
+        <nic>1gig</nic>
+        <node>baremetal</node>
+    </DATABASE>
+
     <TEST>
         <batch_size>1000</batch_size>
         <min_intents>800000</min_intents>
-        <max_intents>10000000</max_intents>
+        <max_intents>1000000</max_intents>
         <check_interval>10000</check_interval>
     </TEST>
 
diff --git a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
index 867acc7..834e968 100644
--- a/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
+++ b/TestON/tests/SCPFmaxIntents/SCPFmaxIntents.py
@@ -154,10 +154,16 @@
         commit = main.ONOSbench.getVersion()
         commit = commit.split(" ")[1]
 
+        main.log.info("Creating DB file")
+        nic = main.params['DATABASE']['nic']
+        node = main.params['DATABASE']['node']
         try:
             dbFileName="/tmp/MaxIntentDB"
             dbfile = open(dbFileName, "w+")
             temp = "'" + commit + "',"
+            temp += "'" + nic + "',"
+            temp += str(main.numCtrls) + ","
+            temp += "'" + node + "1" + "',"
             dbfile.write(temp)
             dbfile.close()
         except IOError:
@@ -170,7 +176,6 @@
         - Install ONOS cluster
         - Connect to cli
         """
-
         main.step( "Uninstalling ONOS package" )
         onosUninstallResult = main.TRUE
         for i in range( main.maxNodes ):
@@ -406,10 +411,12 @@
         main.log.info("Installed intents: " + str(maxIntents) +
                       "\nAdded flows: " + str(maxFlows))
 
+        main.log.info("Writing results to DB file")
         try:
             dbFileName="/tmp/MaxIntentDB"
-            dbfile = open(dbFileName, "a+")
-            temp = "'" + str(maxIntents) + "',"
+            dbfile = open(dbFileName, "a")
+            temp = str(maxIntents) + ","
+            temp += str(maxFlows) + "\n"
             dbfile.write(temp)
             dbfile.close()
         except IOError:
@@ -541,15 +548,6 @@
         main.log.info("Installed intents: " + str(maxIntents) +
                       "\nAdded flows: " + str(maxFlows))
 
-        try:
-            dbFileName="/tmp/MaxIntentDB"
-            dbfile = open(dbFileName, "a+")
-            temp = "'" + str(maxIntents) + "',"
-            dbfile.write(temp)
-            dbfile.close()
-        except IOError:
-            main.log.warn("Error opening " + dbFileName + " to write results.")
-
         # Stopping mininet
         if main.switch == "of":
             main.log.info("Stopping mininet")