Update Cluster Driver
Change-Id: I8a3a57e19637ff210548e57d41178e6f194cf694
diff --git a/TestON/tests/HA/HAstopNodes/HAstopNodes.py b/TestON/tests/HA/HAstopNodes/HAstopNodes.py
index c17e11d..8e6bd6f 100644
--- a/TestON/tests/HA/HAstopNodes/HAstopNodes.py
+++ b/TestON/tests/HA/HAstopNodes/HAstopNodes.py
@@ -80,20 +80,19 @@
main.exit()
main.testSetUp.envSetupDescription()
try:
- from dependencies.Cluster import Cluster
from tests.HA.dependencies.HA import HA
main.HA = HA()
- main.Cluster = Cluster( main.ONOScell.nodes )
cellName = main.params[ 'ENV' ][ 'cellName' ]
main.apps = main.params[ 'ENV' ][ 'appString' ]
- stepResult = main.testSetUp.envSetup( main.Cluster, hasNode=True )
+ stepResult = main.testSetUp.envSetup()
except Exception as e:
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
main.HA.generateGraph( "HAstopNodes" )
main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, cellName=cellName, removeLog=True,
- extraApply=main.HA.customizeOnosGenPartitions,
+ extraApply=[ main.HA.startingMininet,
+ main.HA.customizeOnosGenPartitions ],
extraClean=main.HA.cleanUpGenPartition )
main.HA.initialSetUp()
@@ -132,7 +131,6 @@
"""
The Failure case.
"""
- assert main.numCtrls, "main.numCtrls not defined"
assert main, "main not defined"
assert utilities.assert_equals, "utilities.assert_equals not defined"
main.case( "Stop minority of ONOS nodes" )
@@ -142,11 +140,11 @@
main.log.debug( "Checking logs for errors on " + ctrl.name + ":" )
main.log.warn( ctrl.checkLogs( ctrl.ipAddress ) )
- n = len( main.Cluster.controllers ) # Number of nodes
+ n = len( main.Cluster.runningNodes ) # Number of nodes
p = ( ( n + 1 ) / 2 ) + 1 # Number of partitions
- main.kill = [ main.Cluster.controllers[ 0 ] ] # ONOS node to kill, listed by index in main.nodes
+ main.kill = [ main.Cluster.runningNodes[ 0 ] ] # ONOS node to kill, listed by index in main.nodes
if n > 3:
- main.kill.append( main.Cluster.controllers[ p - 1 ] )
+ main.kill.append( main.Cluster.runningNodes[ p - 1 ] )
# NOTE: This only works for cluster sizes of 3,5, or 7.
main.step( "Stopping nodes: " + str( main.kill ) )
@@ -194,7 +192,7 @@
except AttributeError:
main.kill = []
- main.HA.checkStateAfterONOS( main, afterWhich=0 )
+ main.HA.checkStateAfterEvent( main, afterWhich=0 )
main.step( "Leadership Election is still functional" )
# Test of LeadershipElection
leaderList = []
diff --git a/TestON/tests/HA/HAstopNodes/HAstopNodes.topo b/TestON/tests/HA/HAstopNodes/HAstopNodes.topo
index f3b9278..4bf4bd4 100644
--- a/TestON/tests/HA/HAstopNodes/HAstopNodes.topo
+++ b/TestON/tests/HA/HAstopNodes/HAstopNodes.topo
@@ -1,17 +1,6 @@
<TOPOLOGY>
<COMPONENT>
- <ONOSbench>
- <host>localhost</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS>
- <prompt></prompt>
- </COMPONENTS>
- </ONOSbench>
-
<ONOScell>
<host>localhost</host> # ONOS "bench" machine
<user>sdn</user>
@@ -20,6 +9,7 @@
<connect_order>1</connect_order>
<COMPONENTS>
<cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
+ <diff_clihost></diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
<karaf_username></karaf_username>
<karaf_password></karaf_password>
<web_user></web_user>
@@ -36,7 +26,7 @@
<user>sdn</user>
<password>rocks</password>
<type>MininetCliDriver</type>
- <connect_order>16</connect_order>
+ <connect_order>2</connect_order>
<COMPONENTS>
#Specify the Option for mininet
<arg1> --custom ~/mininet/custom/obelisk.py </arg1>
@@ -53,7 +43,7 @@
<user>sdn</user>
<password>rocks</password>
<type>RemoteMininetDriver</type>
- <connect_order>17</connect_order>
+ <connect_order>3</connect_order>
<COMPONENTS>
<prompt></prompt>
</COMPONENTS>