Use new assignSwController function and minor test tweeks
diff --git a/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.py b/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.py
index 08d81c2..7a21c01 100644
--- a/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.py
+++ b/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.py
@@ -265,19 +265,13 @@
"master of the device."
main.step( "Assign switches to controllers" )
- # TODO: rewrite this function to take lists of ips and ports?
- # or list of tuples?
+ ipList = []
+ for i in range( numControllers ):
+ ipList.append( nodes[ i ].ip_address )
+ swList = []
for i in range( 1, 29 ):
- main.Mininet1.assignSwController(
- sw=str( i ),
- count=numControllers,
- ip1=nodes[ 0 ].ip_address, port1=ONOS1Port,
- ip2=nodes[ 1 ].ip_address, port2=ONOS2Port,
- ip3=nodes[ 2 ].ip_address, port3=ONOS3Port,
- ip4=nodes[ 3 ].ip_address, port4=ONOS4Port,
- ip5=nodes[ 4 ].ip_address, port5=ONOS5Port,
- ip6=nodes[ 5 ].ip_address, port6=ONOS6Port,
- ip7=nodes[ 6 ].ip_address, port7=ONOS7Port )
+ swList.append( "s" + str( i ) )
+ main.Mininet1.assignSwController( sw=swList, ip=ipList )
mastershipCheck = main.TRUE
for i in range( 1, 29 ):
@@ -462,12 +456,13 @@
for i in range(2): # Retry if pingall fails first time
time1 = time.time()
pingResult = main.Mininet1.pingall()
- utilities.assert_equals(
- expect=main.TRUE,
- actual=pingResult,
- onpass="Reactive Pingall test passed",
- onfail="Reactive Pingall failed, " +
- "one or more ping pairs failed" )
+ if i == 0:
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=pingResult,
+ onpass="Reactive Pingall test passed",
+ onfail="Reactive Pingall failed, " +
+ "one or more ping pairs failed" )
time2 = time.time()
main.log.info( "Time for pingall: %2f seconds" %
( time2 - time1 ) )
@@ -2587,22 +2582,10 @@
main.Mininet1.addSwitch( switch, dpid=switchDPID )
for peer in links:
main.Mininet1.addLink( switch, peer )
- main.Mininet1.assignSwController( sw=switch.split( 's' )[ 1 ],
- count=numControllers,
- ip1=nodes[ 0 ].ip_address,
- port1=ONOS1Port,
- ip2=nodes[ 1 ].ip_address,
- port2=ONOS2Port,
- ip3=nodes[ 2 ].ip_address,
- port3=ONOS3Port,
- ip4=nodes[ 3 ].ip_address,
- port4=ONOS4Port,
- ip5=nodes[ 4 ].ip_address,
- port5=ONOS5Port,
- ip6=nodes[ 5 ].ip_address,
- port6=ONOS6Port,
- ip7=nodes[ 6 ].ip_address,
- port7=ONOS7Port )
+ ipList = []
+ for i in range( numControllers ):
+ ipList.append( nodes[ i ].ip_address )
+ main.Mininet1.assignSwController( sw=switch, ip=ipList )
main.log.info( "Waiting " + str( switchSleep ) +
" seconds for switch up to be discovered" )
time.sleep( switchSleep )