[ONOS-6863] Flxible way to specify number of neighbors in intent/flow throughput test

Change-Id: I8b4482ca4cabc0acf47f428933f8a45002242cd4
diff --git a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.params b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.params
index 6914862..cf5e7e8 100644
--- a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.params
+++ b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.params
@@ -65,7 +65,7 @@
         <numKeys>40000</numKeys>
         <numKeysFlowObj>4000</numKeysFlowObj>
         <cyclePeriod>1000</cyclePeriod>
-        <neighbors>0,a</neighbors>           #a == all nodes (-1)
+        <neighbors>0,0,a,0,a,0,a</neighbors>           #a == all nodes (-1)
         <skipReleaseResourcesOnWithdrawal>true</skipReleaseResourcesOnWithdrawal>
         <flowObj>False</flowObj>
     </TEST>
diff --git a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
index 70fcfb0..a781698 100644
--- a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
+++ b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
@@ -74,6 +74,7 @@
             main.nullProviderCfg = main.params[ 'CFG' ][ 'nullProvider' ]
             main.linkCollectionIntentCfg = main.params[ 'CFG' ][ 'linkCollectionIntent' ]
             main.intentPerfInstallerCfg = main.params[ 'CFG' ][ 'intentPerfInstaller' ]
+            main.neighbor = ( main.params[ 'TEST' ][ 'neighbors' ] ).split( "," )
             main.timeout = int( main.params[ 'SLEEP' ][ 'timeout' ] )
             main.cyclePeriod = main.params[ 'TEST' ][ 'cyclePeriod' ]
             if main.flowObj == "True":
@@ -90,9 +91,6 @@
             main.log.info( "Create Database file " + main.dbFileName )
             resultsDB = open( main.dbFileName, "w+" )
             resultsDB.close()
-
-            # set neighbors
-            main.neighbors = "1"
         except Exception as e:
             main.testSetUp.envSetupException( e )
         main.testSetUp.evnSetupConclusion( stepResult )
@@ -104,7 +102,6 @@
         main.maxNumBatch = 0
         main.testSetUp.ONOSSetUp( main.MN1Ip, main.Cluster, True,
                                   cellName=main.cellName, killRemoveMax=False )
-
         # config apps
         main.Cluster.active( 0 ).CLI.setCfg( main.intentManagerCfg,
                                              "skipReleaseResourcesOnWithdrawal " + main.skipRelRsrc )
@@ -123,27 +120,17 @@
         # balanceMasters
         main.Cluster.active( 0 ).CLI.balanceMasters()
         time.sleep( main.startUpSleep )
-
     def CASE2( self, main ):
         import numpy
 
         main.log.info( "Cluster Count = " + str( main.Cluster.numCtrls ) )
-        # adjust neighbors
-        if main.Cluster.numCtrls == 1:
-            main.neighbors = "0"
-            main.log.info( "Neighbors: 0" )
-        elif main.neighbors != "0":
-            main.neighbors = "0"
-            main.log.info( "Neighbors: 0" )
-        elif main.neighbors == "0":
-            main.neighbors = str( main.Cluster.numCtrls - 1 )
-            main.log.info( "Neighbors: " + main.neighbors )
-
+        neighbors = '0' if main.neighbor.pop( 0 ) == '0' else str( main.Cluster.numCtrls - 1 )
+        main.log.info( "Neighbors: " + neighbors )
         main.log.info( "Config intent-perf app" )
         main.Cluster.active( 0 ).CLI.setCfg( main.intentPerfInstallerCfg,
                                              "numKeys " + main.numKeys )
         main.Cluster.active( 0 ).CLI.setCfg( main.intentPerfInstallerCfg,
-                                             "numNeighbors " + str( main.neighbors ) )
+                                             "numNeighbors " + neighbors )
         main.Cluster.active( 0 ).CLI.setCfg( main.intentPerfInstallerCfg,
                                              "cyclePeriod " + main.cyclePeriod )
 
@@ -172,7 +159,7 @@
                 resultString += "'1gig',"
                 resultString += str( main.Cluster.numCtrls ) + ","
                 resultString += "'baremetal" + str( nodes + 1 ) + "',"
-                resultString += main.neighbors + ","
+                resultString += neighbors + ","
                 resultString += result[ main.Cluster.active( nodes ).ipAddress ] + ","
                 resultString += str( 0 ) + "\n"  # no stddev
                 resultDB.write( resultString )