Fix whitespace issues
Change-Id: I7c96843996f4847f9e15022f1dc6cd85e8a092f7
diff --git a/TestON/tests/CHOtest/CHOtest.py b/TestON/tests/CHOtest/CHOtest.py
index 994a710..140d089 100644
--- a/TestON/tests/CHOtest/CHOtest.py
+++ b/TestON/tests/CHOtest/CHOtest.py
@@ -116,7 +116,7 @@
onpass="Test step PASS",
onfail="Test step FAIL" )
statusResult = ( statusResult and onos_status )
-
+
main.step( "Start ONOS CLI on all nodes" )
cliResult = main.TRUE
main.log.step(" Start ONOS cli using thread ")
@@ -135,7 +135,7 @@
t.join()
startCliResult = startCliResult and t.result
time2 = time.time()
-
+
if not startCliResult:
main.log.info("ONOS CLI did not start up properly")
main.cleanup()
@@ -168,7 +168,7 @@
"________________________________________________________________________" )
main.case(
"Assign and Balance all Mininet switches across controllers" )
-
+
main.step( "Stop any previous Mininet network topology" )
cliResult = main.TRUE
if main.newTopo == main.params['TOPO3']['topo']:
@@ -177,7 +177,7 @@
main.step( "Start Mininet with Att topology" )
main.newTopo = main.params['TOPO1']['topo']
startStatus = main.Mininet1.startNet(topoFile = main.newTopo)
-
+
main.step( "Assign switches to controllers" )
for i in range( 1, ( main.numMNswitches + 1 ) ): # 1 to ( num of switches +1 )
main.Mininet1.assignSwController(
@@ -202,7 +202,7 @@
main.step( "Balance devices across controllers" )
balanceResult = main.ONOScli1.balanceMasters()
- # giving some breathing time for ONOS to complete re-balance
+ # giving some breathing time for ONOS to complete re-balance
time.sleep( 5 )
topology_output = main.ONOScli1.topology()
@@ -260,10 +260,10 @@
main.log.report( "Controller assignment successfull" )
else:
main.log.report( "Controller assignment failed" )
-
+
main.step( "Balance devices across controllers" )
balanceResult = main.ONOScli1.balanceMasters()
- # giving some breathing time for ONOS to complete re-balance
+ # giving some breathing time for ONOS to complete re-balance
time.sleep( 5 )
case21Result = switch_mastership
@@ -273,7 +273,7 @@
actual=case21Result,
onpass="Starting new Chordal topology test PASS",
onfail="Starting new Chordal topology test FAIL" )
-
+
def CASE22( self, main ):
"""
This test script Loads a new Topology (Spine) on CHO setup and balances all switches
@@ -287,7 +287,7 @@
main.numMNlinks = int ( main.params[ 'TOPO3' ][ 'numLinks' ] )
main.numMNhosts = int ( main.params[ 'TOPO3' ][ 'numHosts' ] )
main.pingTimeout = 600
-
+
main.log.report(
"Load Spine and Leaf topology and Balance all Mininet switches across controllers" )
main.log.report(
@@ -314,7 +314,7 @@
switch_mastership = switch_mastership and main.TRUE
else:
switch_mastership = main.FALSE
-
+
if switch_mastership == main.TRUE:
main.log.report( "Controller assignment successfull" )
else:
@@ -347,7 +347,7 @@
main.deviceLinks = []
main.deviceActiveLinksCount = []
main.devicePortsEnabledCount = []
-
+
main.log.report(
"Collect and Store topology details from ONOS before running any Tests" )
main.log.report(
@@ -410,7 +410,7 @@
main.step( "Collect and store each Device active links Count" )
time1 = time.time()
-
+
for i in xrange( 1,( main.numMNswitches + 1 ), int( main.numCtrls) ):
pool = []
for cli in main.CLIs:
@@ -434,13 +434,13 @@
main.log.info("Time for counting all enabled links of the switches: %2f seconds" %(time2-time1))
else:
- main.log.info("Devices (expected): %s, Links (expected): %s" %
+ main.log.info("Devices (expected): %s, Links (expected): %s" %
( str( main.numMNswitches ), str( main.numMNlinks ) ) )
main.log.info("Devices (actual): %s, Links (actual): %s" %
( numOnosDevices , numOnosLinks ) )
main.log.info("Topology does not match, exiting CHO test...")
topoResult = main.FALSE
- # It's better exit here from running the test
+ # It's better exit here from running the test
main.cleanup()
main.exit()
@@ -481,7 +481,7 @@
if appCheck != main.TRUE:
main.log.warn( main.CLIs[0].apps() )
main.log.warn( main.CLIs[0].appIDs() )
-
+
time.sleep( 10 )
main.step( "Verify Pingall" )
@@ -501,7 +501,7 @@
main.log.report( "Pingall Test in Reactive mode failed" )
main.step( "Disable Reactive forwarding" )
-
+
main.log.info( "Uninstall reactive forwarding app" )
appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
pool = []
@@ -561,7 +561,7 @@
if appCheck != main.TRUE:
main.log.warn( main.CLIs[0].apps() )
main.log.warn( main.CLIs[0].appIDs() )
-
+
time.sleep( 10 )
main.step( "Verify Pingall" )
@@ -581,7 +581,7 @@
main.log.report( "Pingall Test in Reactive mode failed" )
main.step( "Disable Reactive forwarding" )
-
+
main.log.info( "Uninstall reactive forwarding app" )
appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
pool = []
@@ -641,7 +641,7 @@
if appCheck != main.TRUE:
main.log.warn( main.CLIs[0].apps() )
main.log.warn( main.CLIs[0].appIDs() )
-
+
time.sleep( 10 )
main.step( "Verify Pingall" )
@@ -661,7 +661,7 @@
main.log.report( "Pingall Test in Reactive mode failed" )
main.step( "Disable Reactive forwarding" )
-
+
main.log.info( "Uninstall reactive forwarding app" )
appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
pool = []
@@ -694,7 +694,7 @@
Compare current ONOS topology with reference data
"""
import re
-
+
devicesDPIDTemp = []
hostMACsTemp = []
deviceLinksTemp = []
@@ -732,12 +732,12 @@
time2 = time.time()
main.log.info("Time for counting enabled ports of the switches: %2f seconds" %(time2-time1))
main.log.info (
- "Device Enabled ports EXPECTED: %s" %
- str( main.devicePortsEnabledCount ) )
+ "Device Enabled ports EXPECTED: %s" %
+ str( main.devicePortsEnabledCount ) )
main.log.info (
- "Device Enabled ports ACTUAL: %s" %
+ "Device Enabled ports ACTUAL: %s" %
str( devicePortsEnabledCountTemp ) )
-
+
if ( cmp( main.devicePortsEnabledCount,
devicePortsEnabledCountTemp ) == 0 ):
stepResult1 = main.TRUE
@@ -799,8 +799,8 @@
main.case( "Install 300 host intents" )
main.step( "Add host Intents" )
intentResult = main.TRUE
- hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
-
+ hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
+
intentIdList = []
time1 = time.time()
for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
@@ -865,15 +865,15 @@
main.log.report( "Add 600 host intents and verify pingall (Chordal Topo)" )
main.log.report( "_______________________________________" )
import itertools
-
+
main.case( "Install 600 host intents" )
main.step( "Add host Intents" )
intentResult = main.TRUE
- hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
-
+ hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
+
intentIdList = []
time1 = time.time()
-
+
for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
pool = []
for cli in main.CLIs:
@@ -913,7 +913,7 @@
onfail="PING ALL FAIL" )
case14Result = ( intentResult and pingResult )
-
+
utilities.assert_equals(
expect=main.TRUE,
actual=case14Result,
@@ -927,11 +927,11 @@
main.log.report( "Add 2278 host intents and verify pingall (Spine Topo)" )
main.log.report( "_______________________________________" )
import itertools
-
+
main.case( "Install 2278 host intents" )
main.step( "Add host Intents" )
intentResult = main.TRUE
- hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
+ hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
main.pingTimeout = 300
intentIdList = []
time1 = time.time()
@@ -974,7 +974,7 @@
onfail="PING ALL FAIL" )
case15Result = ( intentResult and pingResult )
-
+
utilities.assert_equals(
expect=main.TRUE,
actual=case15Result,
@@ -1282,9 +1282,9 @@
Randomly bring some links down and verify ping all ( Host Intents-Chordal Topo)
"""
import random
- import itertools
+ import itertools
link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
+
main.log.report( "Randomly bring some core links down and verify ping all (Host Intents-Chordal Topo)" )
main.log.report( "___________________________________________________________________________" )
main.case( "Host intents - Randomly bring some core links down and verify ping all" )
@@ -1296,7 +1296,7 @@
main.randomLinks = random.sample(switchesLinksComb, 5 )
print main.randomLinks
main.step( "Cut links on random devices" )
-
+
for switch in main.randomLinks:
main.Mininet1.link(
END1=switch[0],
@@ -1341,7 +1341,7 @@
"""
import random
link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
+
main.log.report(
"Bring the core links up that are down and verify ping all (Host Intents-Chordal Topo" )
main.log.report(
@@ -1349,7 +1349,7 @@
main.case(
"Host intents - Bring the core links up that are down and verify ping all" )
main.step( "Bring randomly cut links on devices up" )
-
+
for switch in main.randomLinks:
main.Mininet1.link(
END1=switch[0],
@@ -1394,9 +1394,9 @@
Randomly bring some links down and verify ping all ( Point Intents-Chordal Topo)
"""
import random
- import itertools
+ import itertools
link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
+
main.log.report( "Randomly bring some core links down and verify ping all ( Point Intents-Chordal Topo)" )
main.log.report( "___________________________________________________________________________" )
main.case( "Point intents - Randomly bring some core links down and verify ping all" )
@@ -1408,7 +1408,7 @@
main.randomLinks = random.sample(switchesLinksComb, 5 )
print main.randomLinks
main.step( "Cut links on random devices" )
-
+
for switch in main.randomLinks:
main.Mininet1.link(
END1=switch[0],
@@ -1453,7 +1453,7 @@
"""
import random
link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
+
main.log.report(
"Bring the core links up that are down and verify ping all ( Point Intents-Chordal Topo" )
main.log.report(
@@ -1461,7 +1461,7 @@
main.case(
"Point intents - Bring the core links up that are down and verify ping all" )
main.step( "Bring randomly cut links on devices up" )
-
+
for switch in main.randomLinks:
main.Mininet1.link(
END1=switch[0],
@@ -1518,10 +1518,10 @@
link2End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS10bot' ].split( ',' )
link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
main.pingTimeout = 400
-
+
main.log.report( "Bring some core links down and verify ping all (Host Intents-Spine Topo)" )
main.log.report( "___________________________________________________________________________" )
-
+
linkIndex = range(4)
linkIndexS9 = random.sample(linkIndex,1)[0]
linkIndex.remove(linkIndexS9)
@@ -1624,7 +1624,7 @@
utilities.assert_equals( expect=main.TRUE, actual=caseResult84,
onpass="Link Up Test PASS",
onfail="Link Up Test FAIL" )
-
+
def CASE90( self ):
"""
Install 600 point intents and verify ping all (Att Topology)
@@ -1636,8 +1636,8 @@
main.case( "Install 600 point intents" )
main.step( "Add point Intents" )
intentResult = main.TRUE
- deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
-
+ deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
+
intentIdList = []
time1 = time.time()
for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
@@ -1680,7 +1680,7 @@
onfail="PING ALL FAIL" )
case90Result = ( intentResult and pingResult )
-
+
utilities.assert_equals(
expect=main.TRUE,
actual=case90Result,
@@ -1698,8 +1698,8 @@
main.case( "Install 600 point intents" )
main.step( "Add point Intents" )
intentResult = main.TRUE
- deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
-
+ deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
+
intentIdList = []
time1 = time.time()
for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
@@ -1743,13 +1743,13 @@
onfail="PING ALL FAIL" )
case91Result = ( intentResult and pingResult )
-
+
utilities.assert_equals(
expect=main.TRUE,
actual=case91Result,
onpass="Install 600 point Intents and Ping All test PASS",
onfail="Install 600 point Intents and Ping All test FAIL" )
-
+
def CASE92( self ):
"""
Install 4556 point intents and verify ping all (Spine Topology)
@@ -1809,13 +1809,13 @@
onfail="PING ALL FAIL" )
case92Result = ( intentResult and pingResult )
-
+
utilities.assert_equals(
expect=main.TRUE,
actual=case92Result,
onpass="Install 4556 point Intents and Ping All test PASS",
onfail="Install 4556 point Intents and Ping All test FAIL" )
-
+
def CASE93( self ):
"""
Install multi-single point intents and verify Ping all works
@@ -1866,7 +1866,7 @@
checkIntentStateResult = main.ONOScli3.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
checkIntentStateResult = main.ONOScli4.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
checkIntentStateResult = main.ONOScli5.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
-
+
if checkIntentStateResult:
main.log.info( "All intents are installed correctly " )
@@ -1890,7 +1890,7 @@
actual=case93Result,
onpass="Install 25 multi to single point Intents and Ping All test PASS",
onfail="Install 25 multi to single point Intents and Ping All test FAIL" )
-
+
def CASE94( self ):
"""
Install multi-single point intents and verify Ping all works
@@ -1927,7 +1927,7 @@
thread.join()
intentIdList.append(thread.result)
time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+ main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
time.sleep(5)
main.step( "Verify Ping across all hosts" )
pingResult = main.FALSE
@@ -1946,7 +1946,7 @@
actual=case94Result,
onpass="Install 25 multi to single point Intents and Ping All test PASS",
onfail="Install 25 multi to single point Intents and Ping All test FAIL" )
-
+
#def CASE95 multi-single point intent for Spine
def CASE96( self ):
@@ -1984,7 +1984,7 @@
thread.join()
intentIdList.append(thread.result)
time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+ main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
time.sleep(5)
main.step( "Verify Ping across all hosts" )
pingResult = main.FALSE
@@ -2039,7 +2039,7 @@
thread.join()
intentIdList.append(thread.result)
time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+ main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
time.sleep(5)
main.step( "Verify Ping across all hosts" )
pingResult = main.FALSE
@@ -2101,7 +2101,7 @@
thread.join()
intentIdList.append(thread.result)
time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+ main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
time.sleep(5)
main.step( "Verify Ping across all hosts" )
pingResult = main.FALSE
@@ -2246,13 +2246,13 @@
pool.append(t)
t.start()
threadID = threadID + 1
-
+
results = []
for thread in pool:
thread.join()
results.append(thread.result)
time2 = time.time()
-
+
if( all(result == main.TRUE for result in results) == False):
main.log.info("Did not install onos-app-ifwd feature properly")
#main.cleanup()
@@ -2261,7 +2261,7 @@
main.log.info("Successful feature:install onos-app-ifwd")
installResult = main.TRUE
main.log.info("Time for feature:install onos-app-ifwd: %2f seconds" %(time2-time1))
-
+
main.step( "Verify Pingall" )
ping_result = main.FALSE
time1 = time.time()
@@ -2272,7 +2272,7 @@
"Time taken for Ping All: " +
str( timeDiff ) +
" seconds" )
-
+
if ping_result == main.TRUE:
main.log.report( "Pingall Test in Reactive mode successful" )
else:
@@ -2280,7 +2280,7 @@
main.step( "Disable Intent based Reactive forwarding" )
uninstallResult = main.FALSE
-
+
pool = []
time1 = time.time()
for cli,feature in main.CLIs:
@@ -2289,13 +2289,13 @@
pool.append(t)
t.start()
threadID = threadID + 1
-
+
results = []
for thread in pool:
thread.join()
results.append(thread.result)
time2 = time.time()
-
+
if( all(result == main.TRUE for result in results) == False):
main.log.info("Did not uninstall onos-app-ifwd feature properly")
uninstallResult = main.FALSE
diff --git a/TestON/tests/FUNCintent/Dependency/newFuncTopo.py b/TestON/tests/FUNCintent/Dependency/newFuncTopo.py
index 5552aa9..5edf7f7 100755
--- a/TestON/tests/FUNCintent/Dependency/newFuncTopo.py
+++ b/TestON/tests/FUNCintent/Dependency/newFuncTopo.py
@@ -16,121 +16,121 @@
class VLANHost( Host ):
def config( self, vlan=100, **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ifconfig %s inet 0' % intf )
- self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
- newName = '%s.%d' % ( intf, vlan )
- intf.name = newName
- self.nameToIntf[ newName ] = intf
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ifconfig %s inet 0' % intf )
+ self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ newName = '%s.%d' % ( intf, vlan )
+ intf.name = newName
+ self.nameToIntf[ newName ] = intf
+ return r
class IPv6Host( Host ):
def config( self, v6Addr='1000:1/64', **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ifconfig %s inet 0' % intf )
- self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ifconfig %s inet 0' % intf )
+ self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+ return r
class dualStackHost( Host ):
def config( self, v6Addr='2000:1/64', **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+ return r
class MyTopo( Topo ):
- def __init__( self ):
- # Initialize topology
- Topo.__init__( self )
- # Switch S5 Hosts
- host1=self.addHost( 'h1', ip='10.1.0.2/24' )
- host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
- host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
- #VLAN hosts
- host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
- host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host6=self.addHost( 'h6', ip='11.1.0.2/24' )
- host7=self.addHost( 'h7', ip='12.1.0.2/24' )
- #Multicast Sender
- host8=self.addHost( 'h8', ip='10.1.0.4/24' )
+ def __init__( self ):
+ # Initialize topology
+ Topo.__init__( self )
+ # Switch S5 Hosts
+ host1=self.addHost( 'h1', ip='10.1.0.2/24' )
+ host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
+ host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
+ #VLAN hosts
+ host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
+ host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host6=self.addHost( 'h6', ip='11.1.0.2/24' )
+ host7=self.addHost( 'h7', ip='12.1.0.2/24' )
+ #Multicast Sender
+ host8=self.addHost( 'h8', ip='10.1.0.4/24' )
- # Switch S6 Hosts
- host9=self.addHost( 'h9', ip='10.1.0.5/24' )
- host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
- host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
- #VLAN hosts
- host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
- host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host14=self.addHost( 'h14', ip='11.1.0.3/24' )
- host15=self.addHost( 'h15', ip='12.1.0.3/24' )
- #Multicast Receiver
- host16=self.addHost( 'h16', ip='10.1.0.7/24' )
+ # Switch S6 Hosts
+ host9=self.addHost( 'h9', ip='10.1.0.5/24' )
+ host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
+ host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
+ #VLAN hosts
+ host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
+ host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host14=self.addHost( 'h14', ip='11.1.0.3/24' )
+ host15=self.addHost( 'h15', ip='12.1.0.3/24' )
+ #Multicast Receiver
+ host16=self.addHost( 'h16', ip='10.1.0.7/24' )
- # Switch S7 Hosts
- host17=self.addHost( 'h17', ip='10.1.0.8/24' )
- host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
- host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
- #VLAN hosts
- host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
- host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host22=self.addHost( 'h22', ip='11.1.0.4/24' )
- host23=self.addHost( 'h23', ip='12.1.0.4/24' )
- #Multicast Receiver
- host24=self.addHost( 'h24', ip='10.1.0.10/24' )
+ # Switch S7 Hosts
+ host17=self.addHost( 'h17', ip='10.1.0.8/24' )
+ host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
+ host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
+ #VLAN hosts
+ host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
+ host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host22=self.addHost( 'h22', ip='11.1.0.4/24' )
+ host23=self.addHost( 'h23', ip='12.1.0.4/24' )
+ #Multicast Receiver
+ host24=self.addHost( 'h24', ip='10.1.0.10/24' )
- s1 = self.addSwitch( 's1' )
- s2 = self.addSwitch( 's2' )
- s3 = self.addSwitch( 's3' )
- s4 = self.addSwitch( 's4' )
- s5 = self.addSwitch( 's5' )
- s6 = self.addSwitch( 's6' )
- s7 = self.addSwitch( 's7' )
+ s1 = self.addSwitch( 's1' )
+ s2 = self.addSwitch( 's2' )
+ s3 = self.addSwitch( 's3' )
+ s4 = self.addSwitch( 's4' )
+ s5 = self.addSwitch( 's5' )
+ s6 = self.addSwitch( 's6' )
+ s7 = self.addSwitch( 's7' )
- self.addLink(s5,host1)
- self.addLink(s5,host2)
- self.addLink(s5,host3)
- self.addLink(s5,host4)
- self.addLink(s5,host5)
- self.addLink(s5,host6)
- self.addLink(s5,host7)
- self.addLink(s5,host8)
+ self.addLink(s5,host1)
+ self.addLink(s5,host2)
+ self.addLink(s5,host3)
+ self.addLink(s5,host4)
+ self.addLink(s5,host5)
+ self.addLink(s5,host6)
+ self.addLink(s5,host7)
+ self.addLink(s5,host8)
- self.addLink(s6,host9)
- self.addLink(s6,host10)
- self.addLink(s6,host11)
- self.addLink(s6,host12)
- self.addLink(s6,host13)
- self.addLink(s6,host14)
- self.addLink(s6,host15)
- self.addLink(s6,host16)
+ self.addLink(s6,host9)
+ self.addLink(s6,host10)
+ self.addLink(s6,host11)
+ self.addLink(s6,host12)
+ self.addLink(s6,host13)
+ self.addLink(s6,host14)
+ self.addLink(s6,host15)
+ self.addLink(s6,host16)
- self.addLink(s7,host17)
- self.addLink(s7,host18)
- self.addLink(s7,host19)
- self.addLink(s7,host20)
- self.addLink(s7,host21)
- self.addLink(s7,host22)
- self.addLink(s7,host23)
- self.addLink(s7,host24)
+ self.addLink(s7,host17)
+ self.addLink(s7,host18)
+ self.addLink(s7,host19)
+ self.addLink(s7,host20)
+ self.addLink(s7,host21)
+ self.addLink(s7,host22)
+ self.addLink(s7,host23)
+ self.addLink(s7,host24)
- self.addLink(s1,s2)
- self.addLink(s1,s3)
- self.addLink(s1,s4)
- self.addLink(s1,s5)
- self.addLink(s2,s3)
- self.addLink(s2,s5)
- self.addLink(s2,s6)
- self.addLink(s3,s4)
- self.addLink(s3,s6)
- self.addLink(s4,s7)
- topos = { 'mytopo': ( lambda: MyTopo() ) }
+ self.addLink(s1,s2)
+ self.addLink(s1,s3)
+ self.addLink(s1,s4)
+ self.addLink(s1,s5)
+ self.addLink(s2,s3)
+ self.addLink(s2,s5)
+ self.addLink(s2,s6)
+ self.addLink(s3,s4)
+ self.addLink(s3,s6)
+ self.addLink(s4,s7)
+ topos = { 'mytopo': ( lambda: MyTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
diff --git a/TestON/tests/HAclusterRestart/dependencies/obelisk.py b/TestON/tests/HAclusterRestart/dependencies/obelisk.py
index fb6ccdb..4378a9b 100755
--- a/TestON/tests/HAclusterRestart/dependencies/obelisk.py
+++ b/TestON/tests/HAclusterRestart/dependencies/obelisk.py
@@ -9,9 +9,9 @@
leftTopSwitch = self.addSwitch('s2',dpid='2000'.zfill(16))
rightTopSwitch = self.addSwitch('s5',dpid='5000'.zfill(16))
leftBotSwitch = self.addSwitch('s3',dpid='3000'.zfill(16))
- rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
+ rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
midBotSwitch = self.addSwitch('s28',dpid='2800'.zfill(16))
-
+
topHost = self.addHost( 'h1' )
leftTopHost = self.addHost('h2')
rightTopHost = self.addHost('h5')
diff --git a/TestON/tests/HAminorityRestart/dependencies/obelisk.py b/TestON/tests/HAminorityRestart/dependencies/obelisk.py
index fb6ccdb..4378a9b 100755
--- a/TestON/tests/HAminorityRestart/dependencies/obelisk.py
+++ b/TestON/tests/HAminorityRestart/dependencies/obelisk.py
@@ -9,9 +9,9 @@
leftTopSwitch = self.addSwitch('s2',dpid='2000'.zfill(16))
rightTopSwitch = self.addSwitch('s5',dpid='5000'.zfill(16))
leftBotSwitch = self.addSwitch('s3',dpid='3000'.zfill(16))
- rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
+ rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
midBotSwitch = self.addSwitch('s28',dpid='2800'.zfill(16))
-
+
topHost = self.addHost( 'h1' )
leftTopHost = self.addHost('h2')
rightTopHost = self.addHost('h5')
diff --git a/TestON/tests/HAsanity/dependencies/obelisk.py b/TestON/tests/HAsanity/dependencies/obelisk.py
index fb6ccdb..4378a9b 100755
--- a/TestON/tests/HAsanity/dependencies/obelisk.py
+++ b/TestON/tests/HAsanity/dependencies/obelisk.py
@@ -9,9 +9,9 @@
leftTopSwitch = self.addSwitch('s2',dpid='2000'.zfill(16))
rightTopSwitch = self.addSwitch('s5',dpid='5000'.zfill(16))
leftBotSwitch = self.addSwitch('s3',dpid='3000'.zfill(16))
- rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
+ rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
midBotSwitch = self.addSwitch('s28',dpid='2800'.zfill(16))
-
+
topHost = self.addHost( 'h1' )
leftTopHost = self.addHost('h2')
rightTopHost = self.addHost('h5')
diff --git a/TestON/tests/HAsingleInstanceRestart/dependencies/obelisk.py b/TestON/tests/HAsingleInstanceRestart/dependencies/obelisk.py
index fb6ccdb..4378a9b 100755
--- a/TestON/tests/HAsingleInstanceRestart/dependencies/obelisk.py
+++ b/TestON/tests/HAsingleInstanceRestart/dependencies/obelisk.py
@@ -9,9 +9,9 @@
leftTopSwitch = self.addSwitch('s2',dpid='2000'.zfill(16))
rightTopSwitch = self.addSwitch('s5',dpid='5000'.zfill(16))
leftBotSwitch = self.addSwitch('s3',dpid='3000'.zfill(16))
- rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
+ rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
midBotSwitch = self.addSwitch('s28',dpid='2800'.zfill(16))
-
+
topHost = self.addHost( 'h1' )
leftTopHost = self.addHost('h2')
rightTopHost = self.addHost('h5')
diff --git a/TestON/tests/SAMPscaleTopo/Dependency/newFuncTopo.py b/TestON/tests/SAMPscaleTopo/Dependency/newFuncTopo.py
index 5552aa9..5edf7f7 100755
--- a/TestON/tests/SAMPscaleTopo/Dependency/newFuncTopo.py
+++ b/TestON/tests/SAMPscaleTopo/Dependency/newFuncTopo.py
@@ -16,121 +16,121 @@
class VLANHost( Host ):
def config( self, vlan=100, **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ifconfig %s inet 0' % intf )
- self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
- newName = '%s.%d' % ( intf, vlan )
- intf.name = newName
- self.nameToIntf[ newName ] = intf
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ifconfig %s inet 0' % intf )
+ self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ newName = '%s.%d' % ( intf, vlan )
+ intf.name = newName
+ self.nameToIntf[ newName ] = intf
+ return r
class IPv6Host( Host ):
def config( self, v6Addr='1000:1/64', **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ifconfig %s inet 0' % intf )
- self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ifconfig %s inet 0' % intf )
+ self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+ return r
class dualStackHost( Host ):
def config( self, v6Addr='2000:1/64', **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+ return r
class MyTopo( Topo ):
- def __init__( self ):
- # Initialize topology
- Topo.__init__( self )
- # Switch S5 Hosts
- host1=self.addHost( 'h1', ip='10.1.0.2/24' )
- host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
- host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
- #VLAN hosts
- host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
- host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host6=self.addHost( 'h6', ip='11.1.0.2/24' )
- host7=self.addHost( 'h7', ip='12.1.0.2/24' )
- #Multicast Sender
- host8=self.addHost( 'h8', ip='10.1.0.4/24' )
+ def __init__( self ):
+ # Initialize topology
+ Topo.__init__( self )
+ # Switch S5 Hosts
+ host1=self.addHost( 'h1', ip='10.1.0.2/24' )
+ host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
+ host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
+ #VLAN hosts
+ host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
+ host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host6=self.addHost( 'h6', ip='11.1.0.2/24' )
+ host7=self.addHost( 'h7', ip='12.1.0.2/24' )
+ #Multicast Sender
+ host8=self.addHost( 'h8', ip='10.1.0.4/24' )
- # Switch S6 Hosts
- host9=self.addHost( 'h9', ip='10.1.0.5/24' )
- host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
- host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
- #VLAN hosts
- host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
- host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host14=self.addHost( 'h14', ip='11.1.0.3/24' )
- host15=self.addHost( 'h15', ip='12.1.0.3/24' )
- #Multicast Receiver
- host16=self.addHost( 'h16', ip='10.1.0.7/24' )
+ # Switch S6 Hosts
+ host9=self.addHost( 'h9', ip='10.1.0.5/24' )
+ host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
+ host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
+ #VLAN hosts
+ host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
+ host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host14=self.addHost( 'h14', ip='11.1.0.3/24' )
+ host15=self.addHost( 'h15', ip='12.1.0.3/24' )
+ #Multicast Receiver
+ host16=self.addHost( 'h16', ip='10.1.0.7/24' )
- # Switch S7 Hosts
- host17=self.addHost( 'h17', ip='10.1.0.8/24' )
- host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
- host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
- #VLAN hosts
- host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
- host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host22=self.addHost( 'h22', ip='11.1.0.4/24' )
- host23=self.addHost( 'h23', ip='12.1.0.4/24' )
- #Multicast Receiver
- host24=self.addHost( 'h24', ip='10.1.0.10/24' )
+ # Switch S7 Hosts
+ host17=self.addHost( 'h17', ip='10.1.0.8/24' )
+ host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
+ host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
+ #VLAN hosts
+ host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
+ host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host22=self.addHost( 'h22', ip='11.1.0.4/24' )
+ host23=self.addHost( 'h23', ip='12.1.0.4/24' )
+ #Multicast Receiver
+ host24=self.addHost( 'h24', ip='10.1.0.10/24' )
- s1 = self.addSwitch( 's1' )
- s2 = self.addSwitch( 's2' )
- s3 = self.addSwitch( 's3' )
- s4 = self.addSwitch( 's4' )
- s5 = self.addSwitch( 's5' )
- s6 = self.addSwitch( 's6' )
- s7 = self.addSwitch( 's7' )
+ s1 = self.addSwitch( 's1' )
+ s2 = self.addSwitch( 's2' )
+ s3 = self.addSwitch( 's3' )
+ s4 = self.addSwitch( 's4' )
+ s5 = self.addSwitch( 's5' )
+ s6 = self.addSwitch( 's6' )
+ s7 = self.addSwitch( 's7' )
- self.addLink(s5,host1)
- self.addLink(s5,host2)
- self.addLink(s5,host3)
- self.addLink(s5,host4)
- self.addLink(s5,host5)
- self.addLink(s5,host6)
- self.addLink(s5,host7)
- self.addLink(s5,host8)
+ self.addLink(s5,host1)
+ self.addLink(s5,host2)
+ self.addLink(s5,host3)
+ self.addLink(s5,host4)
+ self.addLink(s5,host5)
+ self.addLink(s5,host6)
+ self.addLink(s5,host7)
+ self.addLink(s5,host8)
- self.addLink(s6,host9)
- self.addLink(s6,host10)
- self.addLink(s6,host11)
- self.addLink(s6,host12)
- self.addLink(s6,host13)
- self.addLink(s6,host14)
- self.addLink(s6,host15)
- self.addLink(s6,host16)
+ self.addLink(s6,host9)
+ self.addLink(s6,host10)
+ self.addLink(s6,host11)
+ self.addLink(s6,host12)
+ self.addLink(s6,host13)
+ self.addLink(s6,host14)
+ self.addLink(s6,host15)
+ self.addLink(s6,host16)
- self.addLink(s7,host17)
- self.addLink(s7,host18)
- self.addLink(s7,host19)
- self.addLink(s7,host20)
- self.addLink(s7,host21)
- self.addLink(s7,host22)
- self.addLink(s7,host23)
- self.addLink(s7,host24)
+ self.addLink(s7,host17)
+ self.addLink(s7,host18)
+ self.addLink(s7,host19)
+ self.addLink(s7,host20)
+ self.addLink(s7,host21)
+ self.addLink(s7,host22)
+ self.addLink(s7,host23)
+ self.addLink(s7,host24)
- self.addLink(s1,s2)
- self.addLink(s1,s3)
- self.addLink(s1,s4)
- self.addLink(s1,s5)
- self.addLink(s2,s3)
- self.addLink(s2,s5)
- self.addLink(s2,s6)
- self.addLink(s3,s4)
- self.addLink(s3,s6)
- self.addLink(s4,s7)
- topos = { 'mytopo': ( lambda: MyTopo() ) }
+ self.addLink(s1,s2)
+ self.addLink(s1,s3)
+ self.addLink(s1,s4)
+ self.addLink(s1,s5)
+ self.addLink(s2,s3)
+ self.addLink(s2,s5)
+ self.addLink(s2,s6)
+ self.addLink(s3,s4)
+ self.addLink(s3,s6)
+ self.addLink(s4,s7)
+ topos = { 'mytopo': ( lambda: MyTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
diff --git a/TestON/tests/SAMPstartTemplate/Dependency/newFuncTopo.py b/TestON/tests/SAMPstartTemplate/Dependency/newFuncTopo.py
index 57ad42f..7fe68c1 100755
--- a/TestON/tests/SAMPstartTemplate/Dependency/newFuncTopo.py
+++ b/TestON/tests/SAMPstartTemplate/Dependency/newFuncTopo.py
@@ -16,125 +16,125 @@
class VLANHost( Host ):
def config( self, vlan=100, **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ifconfig %s inet 0' % intf )
- self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
- newName = '%s.%d' % ( intf, vlan )
- intf.name = newName
- self.nameToIntf[ newName ] = intf
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ifconfig %s inet 0' % intf )
+ self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ newName = '%s.%d' % ( intf, vlan )
+ intf.name = newName
+ self.nameToIntf[ newName ] = intf
+ return r
class IPv6Host( Host ):
def config( self, v6Addr='1000:1/64', **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ifconfig %s inet 0' % intf )
- self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ifconfig %s inet 0' % intf )
+ self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+ return r
class dualStackHost( Host ):
def config( self, v6Addr='2000:1/64', **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+ return r
class MyTopo( Topo ):
- def __init__( self ):
- # Initialize topology
- Topo.__init__( self )
-
- # Switch S5 Hosts
- host1=self.addHost( 'h1', ip='10.1.0.2/24' )
- host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
- host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
- #VLAN hosts
- host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
- host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host6=self.addHost( 'h6', ip='11.1.0.2/24' )
- host7=self.addHost( 'h7', ip='12.1.0.2/24' )
- #Multicast Sender
- host8=self.addHost( 'h8', ip='10.1.0.4/24' )
+ def __init__( self ):
+ # Initialize topology
+ Topo.__init__( self )
- # Switch S6 Hosts
- host9=self.addHost( 'h9', ip='10.1.0.5/24' )
- host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
- host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
- #VLAN hosts
- host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
- host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host14=self.addHost( 'h14', ip='11.1.0.3/24' )
- host15=self.addHost( 'h15', ip='12.1.0.3/24' )
- #Multicast Receiver
- host16=self.addHost( 'h16', ip='10.1.0.7/24' )
+ # Switch S5 Hosts
+ host1=self.addHost( 'h1', ip='10.1.0.2/24' )
+ host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
+ host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
+ #VLAN hosts
+ host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
+ host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host6=self.addHost( 'h6', ip='11.1.0.2/24' )
+ host7=self.addHost( 'h7', ip='12.1.0.2/24' )
+ #Multicast Sender
+ host8=self.addHost( 'h8', ip='10.1.0.4/24' )
- # Switch S7 Hosts
- host17=self.addHost( 'h17', ip='10.1.0.8/24' )
- host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
- host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
- #VLAN hosts
- host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
- host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host22=self.addHost( 'h22', ip='11.1.0.4/24' )
- host23=self.addHost( 'h23', ip='12.1.0.4/24' )
- #Multicast Receiver
- host24=self.addHost( 'h24', ip='10.1.0.10/24' )
+ # Switch S6 Hosts
+ host9=self.addHost( 'h9', ip='10.1.0.5/24' )
+ host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
+ host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
+ #VLAN hosts
+ host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
+ host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host14=self.addHost( 'h14', ip='11.1.0.3/24' )
+ host15=self.addHost( 'h15', ip='12.1.0.3/24' )
+ #Multicast Receiver
+ host16=self.addHost( 'h16', ip='10.1.0.7/24' )
- s1 = self.addSwitch( 's1' )
- s2 = self.addSwitch( 's2' )
- s3 = self.addSwitch( 's3' )
- s4 = self.addSwitch( 's4' )
- s5 = self.addSwitch( 's5' )
- s6 = self.addSwitch( 's6' )
- s7 = self.addSwitch( 's7' )
-
- self.addLink(s5,host1)
- self.addLink(s5,host2)
- self.addLink(s5,host3)
- self.addLink(s5,host4)
- self.addLink(s5,host5)
- self.addLink(s5,host6)
- self.addLink(s5,host7)
- self.addLink(s5,host8)
+ # Switch S7 Hosts
+ host17=self.addHost( 'h17', ip='10.1.0.8/24' )
+ host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
+ host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
+ #VLAN hosts
+ host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
+ host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host22=self.addHost( 'h22', ip='11.1.0.4/24' )
+ host23=self.addHost( 'h23', ip='12.1.0.4/24' )
+ #Multicast Receiver
+ host24=self.addHost( 'h24', ip='10.1.0.10/24' )
- self.addLink(s6,host9)
- self.addLink(s6,host10)
- self.addLink(s6,host11)
- self.addLink(s6,host12)
- self.addLink(s6,host13)
- self.addLink(s6,host14)
- self.addLink(s6,host15)
- self.addLink(s6,host16)
+ s1 = self.addSwitch( 's1' )
+ s2 = self.addSwitch( 's2' )
+ s3 = self.addSwitch( 's3' )
+ s4 = self.addSwitch( 's4' )
+ s5 = self.addSwitch( 's5' )
+ s6 = self.addSwitch( 's6' )
+ s7 = self.addSwitch( 's7' )
- self.addLink(s7,host17)
- self.addLink(s7,host18)
- self.addLink(s7,host19)
- self.addLink(s7,host20)
- self.addLink(s7,host21)
- self.addLink(s7,host22)
- self.addLink(s7,host23)
- self.addLink(s7,host24)
+ self.addLink(s5,host1)
+ self.addLink(s5,host2)
+ self.addLink(s5,host3)
+ self.addLink(s5,host4)
+ self.addLink(s5,host5)
+ self.addLink(s5,host6)
+ self.addLink(s5,host7)
+ self.addLink(s5,host8)
- self.addLink(s1,s2)
- self.addLink(s1,s3)
- self.addLink(s1,s4)
- self.addLink(s1,s5)
-
- self.addLink(s2,s3)
- self.addLink(s2,s5)
- self.addLink(s2,s6)
+ self.addLink(s6,host9)
+ self.addLink(s6,host10)
+ self.addLink(s6,host11)
+ self.addLink(s6,host12)
+ self.addLink(s6,host13)
+ self.addLink(s6,host14)
+ self.addLink(s6,host15)
+ self.addLink(s6,host16)
- self.addLink(s3,s4)
- self.addLink(s3,s6)
-
- self.addLink(s4,s7)
- topos = { 'mytopo': ( lambda: MyTopo() ) }
+ self.addLink(s7,host17)
+ self.addLink(s7,host18)
+ self.addLink(s7,host19)
+ self.addLink(s7,host20)
+ self.addLink(s7,host21)
+ self.addLink(s7,host22)
+ self.addLink(s7,host23)
+ self.addLink(s7,host24)
+
+ self.addLink(s1,s2)
+ self.addLink(s1,s3)
+ self.addLink(s1,s4)
+ self.addLink(s1,s5)
+
+ self.addLink(s2,s3)
+ self.addLink(s2,s5)
+ self.addLink(s2,s6)
+
+ self.addLink(s3,s4)
+ self.addLink(s3,s6)
+
+ self.addLink(s4,s7)
+ topos = { 'mytopo': ( lambda: MyTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
diff --git a/TestON/tests/SCPFcbench/SCPFcbench.py b/TestON/tests/SCPFcbench/SCPFcbench.py
index fd15862..647bf52 100644
--- a/TestON/tests/SCPFcbench/SCPFcbench.py
+++ b/TestON/tests/SCPFcbench/SCPFcbench.py
@@ -14,19 +14,19 @@
def __init__( self ):
self.default = ''
- def CASE1( self, main ):
-
- import time
- import os
- global init
+ def CASE1( self, main ):
+
+ import time
+ import os
+ global init
main.case("pre-condition for cbench test.")
- try:
- if type(init) is not bool:
- init = False
- except NameError:
- init = False
-
+ try:
+ if type(init) is not bool:
+ init = False
+ except NameError:
+ init = False
+
#Load values from params file
checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
gitPull = main.params[ 'GIT' ][ 'autopull' ]
@@ -36,25 +36,25 @@
MN1Ip = os.environ[ main.params[ 'MN' ][ 'ip1' ] ]
maxNodes = int(main.params[ 'availableNodes' ])
skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
init = True
global clusterCount #number of nodes running
global ONOSIp #list of ONOS IP addresses
- global scale
-
+ global scale
+
clusterCount = 0
ONOSIp = [ 0 ]
- scale = (main.params[ 'SCALE' ]).split(",")
+ scale = (main.params[ 'SCALE' ]).split(",")
clusterCount = int(scale[0])
- #Populate ONOSIp with ips from params
- for i in range(1, maxNodes + 1):
+ #Populate ONOSIp with ips from params
+ for i in range(1, maxNodes + 1):
ipString = os.environ[main.params['CTRL']['ip1']]
- ONOSIp.append(ipString)
-
+ ONOSIp.append(ipString)
+
#mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
if skipMvn != "yes":
mvnResult = main.ONOSbench.cleanInstall()
@@ -69,46 +69,46 @@
checkoutResult = main.TRUE
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
-
+
# -- END OF INIT SECTION --#
-
+
clusterCount = int(scale[0])
- scale.remove(scale[0])
-
- #kill off all onos processes
+ scale.remove(scale[0])
+
+ #kill off all onos processes
main.log.step("Safety check, killing all ONOS processes")
main.log.step("before initiating enviornment setup")
for node in range(1, maxNodes + 1):
main.ONOSbench.onosDie(ONOSIp[node])
-
+
#Uninstall everywhere
main.log.step( "Cleaning Enviornment..." )
for i in range(1, maxNodes + 1):
main.log.info(" Uninstalling ONOS " + str(i) )
main.ONOSbench.onosUninstall( ONOSIp[i] )
-
+
time.sleep(10)
main.ONOSbench.handle.sendline(" ")
main.ONOSbench.handle.expect(":~")
- print "pexpect: \n" + main.ONOSbench.handle.before
+ print "pexpect: \n" + main.ONOSbench.handle.before
print "Cellname is: "+ cellName + "ONOS IP is: " + str(ONOSIp)
main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,"drivers,openflow,fwd",[ONOSIp[1]])
-
+
main.step( "Set Cell" )
main.ONOSbench.setCell(cellName)
- #main.ONOSbench.handle.sendline(" ")
- #main.ONOSbench.handle.expect(":~")
- #print "pexpect: \n" + main.ONOSbench.handle.before
+ #main.ONOSbench.handle.sendline(" ")
+ #main.ONOSbench.handle.expect(":~")
+ #print "pexpect: \n" + main.ONOSbench.handle.before
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.onosPackage()
main.step( "verify cells" )
verifyCellResult = main.ONOSbench.verifyCell()
-
+
main.log.report( "Initializing " + str( clusterCount ) + " node cluster." )
for node in range(1, clusterCount + 1):
main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
@@ -124,53 +124,53 @@
main.log.report( "ONOS " + str(node) + " didn't start!" )
main.log.info("Startup sequence complete")
- for i in range(5):
+ for i in range(5):
main.ONOSbench.onosCfgSet(ONOSIp[1], "org.onosproject.fwd.ReactiveForwarding","packetOutOnly true")
time.sleep(5)
- main.ONOSbench.handle.sendline("onos $OC1 cfg get|grep packetOutOnly")
- main.ONOSbench.handle.expect(":~")
+ main.ONOSbench.handle.sendline("onos $OC1 cfg get|grep packetOutOnly")
+ main.ONOSbench.handle.expect(":~")
check = main.ONOSbench.handle.before
if "value=true" in check:
- main.log.info("cfg set successful")
+ main.log.info("cfg set successful")
stepResult = main.TRUE
- break
- if i == 4:
+ break
+ if i == 4:
main.log.info("Cfg set failed")
stepResult = main.FALSE
- else:
+ else:
time.sleep(5)
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully configure onos for cbench test ",
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully configure onos for cbench test ",
onfail="Failed to configure onos for cbench test" )
-
-
-
+
+
+
def CASE2( self, main ):
main.case("Running Cbench")
main.step("Issuing cbench commands and grab returned results")
validFlag = False
mode = main.params[ 'TEST' ][ 'mode' ]
if mode != "t":
- mode = " "
+ mode = " "
runCbench = ( "ssh " + CBENCHuser + "@" + ONOSIp[1] + " cbench -c localhost -p 6633 -m 1000 -l 25 -s 16 -M 100000 -w 15 -D 10000 -" + mode )
main.ONOSbench.handle.sendline(runCbench)
time.sleep(30)
- main.ONOSbench.handle.expect(":~")
+ main.ONOSbench.handle.expect(":~")
output = main.ONOSbench.handle.before
main.log.info(output)
output = output.splitlines()
- for line in output:
+ for line in output:
if "RESULT: " in line:
validFlag = True
print line
- resultLine = line.split(" ")
+ resultLine = line.split(" ")
for word in resultLine:
- if word == "min/max/avg/stdev":
+ if word == "min/max/avg/stdev":
resultsIndex = resultLine.index(word)
print resultsIndex
break
@@ -180,27 +180,27 @@
finalDataList = finalDataString.split("/")
avg = finalDataList[2]
stdev = finalDataList[3]
-
- main.log.info("Average: \t\t\t" + avg)
- main.log.info("Standard Deviation: \t" + stdev)
-
+
+ main.log.info("Average: \t\t\t" + avg)
+ main.log.info("Standard Deviation: \t" + stdev)
+
commit = main.ONOSbench.getVersion()
commit = (commit.split(" "))[1]
try:
dbFileName="/tmp/CbenchDB"
- dbfile = open(dbFileName, "w+")
- temp = "'" + commit + "',"
- temp += "'" + mode + "',"
+ dbfile = open(dbFileName, "w+")
+ temp = "'" + commit + "',"
+ temp += "'" + mode + "',"
temp += "'" + avg + "',"
- temp += "'" + stdev + "'\n"
+ temp += "'" + stdev + "'\n"
dbfile.write(temp)
dbfile.close()
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
except IOError:
main.log.warn("Error opening " + dbFileName + " to write results.")
-
+
stepResult = main.TRUE
break
if ( validFlag == False ):
diff --git a/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.py b/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.py
index a82acf4..525fe74 100644
--- a/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.py
+++ b/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.py
@@ -13,7 +13,7 @@
def __init__( self ):
self.default = ''
- def CASE1( self, main ):
+ def CASE1( self, main ):
import time
global init
@@ -32,8 +32,8 @@
BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
main.maxNodes = int(main.params[ 'max' ])
skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
-
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+
main.log.info("==========DEBUG VERSION 3===========")
# -- INIT SECTION, ONLY RUNS ONCE -- #
@@ -71,7 +71,7 @@
checkoutResult = main.TRUE
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
-
+
commit = main.ONOSbench.getVersion()
commit = (commit.split(" "))[1]
@@ -84,7 +84,7 @@
scale.remove(scale[0])
main.log.info("CLUSTER COUNT: " + str(clusterCount))
- #kill off all onos processes
+ #kill off all onos processes
main.log.step("Safety check, killing all ONOS processes")
main.log.step("before initiating enviornment setup")
for node in range(1, main.maxNodes + 1):
@@ -100,16 +100,16 @@
main.log.info("Creating cell file")
cellIp = []
for node in range (1, clusterCount + 1):
- cellIp.append(ONOSIp[node])
-
+ cellIp.append(ONOSIp[node])
+
main.ONOSbench.createCellFile(BENCHIp,cellName,"localhost",str(Apps), cellIp)
main.log.info("Cell Ip list: " + str(cellIp))
-
+
main.step( "Set Cell" )
- main.ONOSbench.setCell(cellName)
-
+ main.ONOSbench.setCell(cellName)
+
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.onosPackage()
main.step( "verify cells" )
verifyCellResult = main.ONOSbench.verifyCell()
@@ -127,21 +127,21 @@
break
if not isup:
main.log.report( "ONOS " + str(node) + " didn't start!" )
-
+
for node in range(1, clusterCount + 1):
exec "a = main.ONOS%scli.startOnosCli" %str(node)
a(ONOSIp[node])
-
+
main.log.info("Startup sequence complete")
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
def CASE2( self, main ):
#
- # This is the flow TP test
+ # This is the flow TP test
#
- import os.path
- import numpy
+ import os.path
+ import numpy
import math
- import time
+ import time
import datetime
import traceback
@@ -173,9 +173,9 @@
flowRuleBackup = str(main.params[ 'TEST' ][ 'enableFlowRuleStoreBackup' ])
main.log.info("Flow Rule Backup is set to:" + flowRuleBackup)
- servers = str(clusterCount)
-
- if clusterCount == 1:
+ servers = str(clusterCount)
+
+ if clusterCount == 1:
neighborList = ['0']
currentNeighbors = "r"
else:
@@ -183,7 +183,7 @@
neighborList = [str(clusterCount-1)]
currentNeighbors = "r"
else:
- neighborList = ['0']
+ neighborList = ['0']
main.log.info("neightborlist: " + str(neighborList))
@@ -192,32 +192,32 @@
for n in neighborList:
main.log.step("\tSTARTING TEST")
- main.log.step("\tLOADING FROM SERVERS: \t" + str(clusterCount) )
- main.log.step("\tNEIGHBORS:\t" + n )
+ main.log.step("\tLOADING FROM SERVERS: \t" + str(clusterCount) )
+ main.log.step("\tNEIGHBORS:\t" + n )
main.log.info("=============================================================")
main.log.info("=============================================================")
#write file to configure nil link
ipCSV = ""
for i in range (1, int(main.maxNodes) + 1):
tempstr = "ip" + str(i)
- ipCSV += main.params[ 'CTRL' ][ tempstr ]
+ ipCSV += main.params[ 'CTRL' ][ tempstr ]
if i < int(main.maxNodes):
ipCSV +=","
-
+
for i in range(3):
main.ONOSbench.onosCfgSet(ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "deviceCount 35")
main.ONOSbench.onosCfgSet(ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "topoShape linear")
- main.ONOSbench.onosCfgSet(ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "enabled true")
+ main.ONOSbench.onosCfgSet(ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "enabled true")
time.sleep(5)
main.ONOSbench.handle.sendline("onos $OC1 summary")
main.ONOSbench.handle.expect(":~")
check = main.ONOSbench.handle.before
- main.log.info("\nStart up check: \n" + check + "\n")
- if "SCC(s)=1," in check:
- break
+ main.log.info("\nStart up check: \n" + check + "\n")
+ if "SCC(s)=1," in check:
+ break
time.sleep(5)
-
+
#devide flows
flows = int(main.params[ 'TEST' ][ 'flows' ])
main.log.info("Flow Target = " + str(flows))
@@ -230,99 +230,99 @@
serverEnvVars = ""
for i in range (1,int(servers)+1):
serverEnvVars += ("-s " + ONOSIp[i] + " ")
-
+
data = [[""]*int(servers)]*int(sampleSize)
maxes = [""]*int(sampleSize)
flowCMD = "python3 " + homeDir + "/onos/tools/test/bin/"
flowCMD += testCMD[0] + " " + str(flows) + " " + testCMD[1]
- flowCMD += " " + str(n) + " " + str(serverEnvVars) + "-j"
+ flowCMD += " " + str(n) + " " + str(serverEnvVars) + "-j"
main.log.info(flowCMD)
#time.sleep(60)
-
- for test in range(0, warmUp + sampleSize):
- if test < warmUp:
+
+ for test in range(0, warmUp + sampleSize):
+ if test < warmUp:
main.log.info("Warm up " + str(test + 1) + " of " + str(warmUp))
- else:
- main.log.info("====== Test run: " + str(test-warmUp+1) + " ======")
+ else:
+ main.log.info("====== Test run: " + str(test-warmUp+1) + " ======")
main.ONOSbench.handle.sendline(flowCMD)
main.ONOSbench.handle.expect(":~")
rawResult = main.ONOSbench.handle.before
main.log.info("Raw results: \n" + rawResult + "\n")
- if "failed" in rawResult:
+ if "failed" in rawResult:
main.log.report("FLOW_TESTER.PY FAILURE")
main.log.report( " \n" + rawResult + " \n")
for i in range(clusterCount):
main.log.report("=======================================================")
- main.log.report(" ONOS " + str(i) + "LOG REPORT")
+ main.log.report(" ONOS " + str(i) + "LOG REPORT")
main.ONOSbench.logReport(ONOSIp[i], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
- main.ONOSbench.handle.sendline("onos $OC1 flows")
- main.ONOSbench.handle.expect(":~")
+ main.ONOSbench.handle.sendline("onos $OC1 flows")
+ main.ONOSbench.handle.expect(":~")
main.log.info(main.ONOSbench.handle.before)
break
-
+
########################################################################################
result = [""]*(clusterCount)
-
+
#print("rawResult: " + rawResult)
rawResult = rawResult.splitlines()
- for node in range(1, clusterCount + 1):
+ for node in range(1, clusterCount + 1):
for line in rawResult:
- #print("line: " + line)
+ #print("line: " + line)
if ONOSIp[node] in line and "server" in line:
- temp = line.split(" ")
+ temp = line.split(" ")
for word in temp:
- #print ("word: " + word)
- if "elapsed" in repr(word):
+ #print ("word: " + word)
+ if "elapsed" in repr(word):
index = temp.index(word) + 1
myParsed = (temp[index]).replace(",","")
myParsed = myParsed.replace("}","")
myParsed = int(myParsed)
result[node-1] = myParsed
main.log.info( ONOSIp[node] + " : " + str(myParsed))
- break
+ break
if test >= warmUp:
- for i in result:
- if i == "":
+ for i in result:
+ if i == "":
main.log.error("Missing data point, critical failure incoming")
print result
maxes[test-warmUp] = max(result)
main.log.info("Data collection iteration: " + str(test-warmUp) + " of " + str(sampleSize))
- main.log.info("Throughput time: " + str(maxes[test-warmUp]) + "(ms)")
+ main.log.info("Throughput time: " + str(maxes[test-warmUp]) + "(ms)")
data[test-warmUp] = result
- # wait for flows = 0
- for checkCount in range(0,5):
+ # wait for flows = 0
+ for checkCount in range(0,5):
time.sleep(10)
main.ONOSbench.handle.sendline("onos $OC1 summary")
main.ONOSbench.handle.expect(":~")
flowCheck = main.ONOSbench.handle.before
- if "flows=0," in flowCheck:
+ if "flows=0," in flowCheck:
main.log.info("Flows removed")
break
- else:
- for line in flowCheck.splitlines():
- if "flows=" in line:
- main.log.info("Current Summary: " + line)
- if checkCount == 2:
+ else:
+ for line in flowCheck.splitlines():
+ if "flows=" in line:
+ main.log.info("Current Summary: " + line)
+ if checkCount == 2:
main.log.info("Flows are stuck, moving on ")
time.sleep(5)
-
+
main.log.info("raw data: " + str(data))
main.log.info("maxes:" + str(maxes))
-
+
# report data
print("")
main.log.info("\t Results (measurments are in milliseconds)")
@@ -330,16 +330,16 @@
nodeString = ""
for i in range(1, int(servers) + 1):
- nodeString += ("\tNode " + str(i))
-
+ nodeString += ("\tNode " + str(i))
+
for test in range(0, sampleSize ):
main.log.info("\t Test iteration " + str(test + 1) )
main.log.info("\t------------------")
- main.log.info(nodeString)
+ main.log.info(nodeString)
resultString = ""
for i in range(0, int(servers) ):
- resultString += ("\t" + str(data[test][i]) )
+ resultString += ("\t" + str(data[test][i]) )
main.log.info(resultString)
print("\n")
@@ -348,19 +348,19 @@
main.log.info("Average of max value from each test iteration: " + str(avgOfMaxes))
stdOfMaxes = numpy.std(maxes)
- main.log.info("Standard Deviation of max values: " + str(stdOfMaxes))
+ main.log.info("Standard Deviation of max values: " + str(stdOfMaxes))
print("\n\n")
avgTP = int(main.params[ 'TEST' ][ 'flows' ]) / avgOfMaxes #result in kflows/second
-
+
tp = []
- for i in maxes:
+ for i in maxes:
tp.append((int(main.params[ 'TEST' ][ 'flows' ]) / i ))
stdTP = numpy.std(tp)
main.log.info("Average thoughput: " + str(avgTP) + " Kflows/second" )
- main.log.info("Standard deviation of throughput: " + str(stdTP) + " Kflows/second")
+ main.log.info("Standard deviation of throughput: " + str(stdTP) + " Kflows/second")
resultsLog = open("/tmp/flowTP1gDB","a")
resultString = ("'" + commit + "',")
@@ -369,9 +369,9 @@
resultString += (str(clusterCount) + ",")
resultString += (str(n) + ",")
resultString += (str(avgTP) + "," + str(stdTP) + "\n")
- resultsLog.write(resultString)
+ resultsLog.write(resultString)
resultsLog.close()
-
+
main.log.report("Result line to file: " + resultString)
-
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
+
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
diff --git a/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py b/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
index bf661fc..fb3f7db 100644
--- a/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
+++ b/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
@@ -35,7 +35,7 @@
BENCHUser = main.params[ 'BENCH' ][ 'user' ]
MN1Ip = main.params[ 'MN' ][ 'ip1' ]
maxNodes = int(main.params[ 'max' ])
- main.maxNodes = maxNodes
+ main.maxNodes = maxNodes
skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
cellName = main.params[ 'ENV' ][ 'cellName' ]
numSwitches = (main.params[ 'TEST' ][ 'numSwitches' ]).split(",")
@@ -46,12 +46,12 @@
main.warnings = [0]*11
main.errors = [0]*11
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
init = True
global clusterCount #number of nodes running
global ONOSIp #list of ONOS IP addresses
- global scale
+ global scale
global commit
clusterCount = 0
@@ -59,10 +59,10 @@
print ONOSIp
print main.ONOSbench.onosIps.values()
- scale = (main.params[ 'SCALE' ]).split(",")
+ scale = (main.params[ 'SCALE' ]).split(",")
clusterCount = int(scale[0])
- #Populate ONOSIp with ips from params
+ #Populate ONOSIp with ips from params
ONOSIp.extend(main.ONOSbench.getOnosIps())
#mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
@@ -80,31 +80,31 @@
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
- main.log.step("Grabbing commit number")
+ main.log.step("Grabbing commit number")
commit = main.ONOSbench.getVersion()
commit = (commit.split(" "))[1]
-
- main.log.step("Creating results file")
+
+ main.log.step("Creating results file")
resultsDB = open("/tmp/IntentEventTPDB", "w+")
resultsDB.close()
# -- END OF INIT SECTION --#
- main.log.step("Adjusting scale")
- print str(scale)
+ main.log.step("Adjusting scale")
+ print str(scale)
print str(ONOSIp)
clusterCount = int(scale[0])
- scale.remove(scale[0])
-
+ scale.remove(scale[0])
+
MN1Ip = ONOSIp[len(ONOSIp) -1]
BENCHIp = ONOSIp[len(ONOSIp) -2]
-
- #kill off all onos processes
+
+ #kill off all onos processes
main.log.step("Safety check, killing all ONOS processes")
main.log.step("before initiating enviornment setup")
for node in range(maxNodes):
main.ONOSbench.onosDie(ONOSIp[node])
-
+
MN1Ip = ONOSIp[len(ONOSIp) -1]
BENCHIp = ONOSIp[len(ONOSIp) -2]
@@ -117,13 +117,13 @@
time.sleep(10)
main.ONOSbench.handle.sendline(" ")
main.ONOSbench.handle.expect(":~")
-
+
#construct the cell file
main.log.info("Creating cell file")
cellIp = []
for node in range (clusterCount):
cellIp.append(ONOSIp[node])
-
+
main.ONOSbench.createCellFile("localhost",cellName,MN1Ip,str(Apps), cellIp)
main.step( "Set Cell" )
@@ -134,11 +134,11 @@
myDistribution.append(numSwitches[node])
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.onosPackage()
main.step( "verify cells" )
verifyCellResult = main.ONOSbench.verifyCell()
-
+
main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
for node in range(clusterCount):
main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
@@ -158,7 +158,7 @@
main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.store.flow.impl.NewDistributedFlowRuleStore", "backupEnabled false")
- devices = int(clusterCount)*10
+ devices = int(clusterCount)*10
main.log.step("Setting up null provider")
for i in range(3):
@@ -188,7 +188,7 @@
main.ONOSbench.handle.sendline("onos $OC1 summary")
main.ONOSbench.handle.expect(":~")
-
+
main.log.info("before" + main.ONOSbench.handle.before)
clusterCheck = main.ONOSbench.handle.before
print("\nBefore: " + str(clusterCheck))
@@ -206,7 +206,7 @@
lastOutput = clusterCheck
time.sleep(5)
main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
- def CASE2( self, main ):
+ def CASE2( self, main ):
import time
import json
import string
@@ -227,7 +227,7 @@
currentNeighbors = "a"
neighbors = ['0']
else:
- currentNeighbors = "r"
+ currentNeighbors = "r"
neighbors = ['a']
if clusterCount == 1:
@@ -243,21 +243,21 @@
debug = main.params[ 'debugMode' ]
numKeys = main.params[ 'TEST' ][ 'numKeys' ]
cyclePeriod = main.params[ 'TEST' ][ 'cyclePeriod' ]
- #neighbors = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")
+ #neighbors = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")
metricList = [intentsRate, intentsWithdrawn, intentsFailed]
- for n in range(0, len(neighbors)):
- if neighbors[n] == 'a':
+ for n in range(0, len(neighbors)):
+ if neighbors[n] == 'a':
neighbors[n] = str(clusterCount -1)
if int(clusterCount) == 1:
neighbors = neighbors.pop()
-
+
for n in neighbors:
- main.log.info("Run with " + n + " neighbors")
+ main.log.info("Run with " + n + " neighbors")
time.sleep(5)
main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller numKeys " + numKeys )
main.ONOSbench.handle.expect(":~")
- main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller numNeighbors " + n )
+ main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller numNeighbors " + n )
main.ONOSbench.handle.expect(":~")
main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller cyclePeriod " + cyclePeriod )
main.ONOSbench.handle.expect(":~")
@@ -321,9 +321,9 @@
main.ONOSbench.handle.sendline(cmd)
main.ONOSbench.handle.expect(":~")
main.log.info("Stopping intentperf" )
-
+
resultsDB = open("/tmp/IntentEventTPDB", "a")
- for node in groupResult:
+ for node in groupResult:
resultString = "'" + commit + "',"
resultString += "'1gig',"
@@ -333,8 +333,8 @@
resultString += str(node) + ","
resultString += str(0) + "\n" #no stddev
resultsDB.write(resultString)
-
- resultsDB.close()
-
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
+
+ resultsDB.close()
+
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
diff --git a/TestON/tests/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py b/TestON/tests/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
index ef92e58..582afb7 100644
--- a/TestON/tests/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
+++ b/TestON/tests/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
@@ -13,16 +13,16 @@
def __init__( self ):
self.default = ''
- def CASE1( self, main ):
-
- import time
- global init
- try:
- if type(init) is not bool:
- init = False
- except NameError:
- init = False
-
+ def CASE1( self, main ):
+
+ import time
+ global init
+ try:
+ if type(init) is not bool:
+ init = False
+ except NameError:
+ init = False
+
#Load values from params file
checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
gitPull = main.params[ 'GIT' ][ 'autopull' ]
@@ -33,23 +33,23 @@
MN1Ip = main.params[ 'MN' ][ 'ip1' ]
main.maxNodes = int(main.params[ 'max' ])
skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
switchCount = main.params[ 'TEST' ][ 'switchCount' ]
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
init = True
global clusterCount #number of nodes running
global ONOSIp #list of ONOS IP addresses
- global scale
- global commit
-
+ global scale
+ global commit
+
clusterCount = 0
ONOSIp = [ 0 ]
- scale = (main.params[ 'SCALE' ]).split(",")
+ scale = (main.params[ 'SCALE' ]).split(",")
clusterCount = int(scale[0])
- #Populate ONOSIp with ips from params
+ #Populate ONOSIp with ips from params
ONOSIp = [0]
ONOSIp.extend(main.ONOSbench.getOnosIps())
@@ -67,7 +67,7 @@
checkoutResult = main.TRUE
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
-
+
commit = main.ONOSbench.getVersion()
commit = (commit.split(" "))[1]
@@ -75,22 +75,22 @@
resultsDB.close()
# -- END OF INIT SECTION --#
-
- clusterCount = int(scale[0])
- scale.remove(scale[0])
- #kill off all onos processes
+ clusterCount = int(scale[0])
+ scale.remove(scale[0])
+
+ #kill off all onos processes
main.log.step("Safety check, killing all ONOS processes")
main.log.step("before initiating enviornment setup")
for node in range(1, main.maxNodes + 1):
main.ONOSbench.onosDie(ONOSIp[node])
-
+
#Uninstall everywhere
main.log.step( "Cleaning Enviornment..." )
for i in range(1, main.maxNodes + 1):
main.log.info(" Uninstalling ONOS " + str(i) )
main.ONOSbench.onosUninstall( ONOSIp[i] )
-
+
#construct the cell file
main.log.info("Creating cell file")
cellIp = []
@@ -101,13 +101,13 @@
main.step( "Set Cell" )
main.ONOSbench.setCell(cellName)
-
+
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.onosPackage()
main.step( "verify cells" )
verifyCellResult = main.ONOSbench.verifyCell()
-
+
main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
for node in range(1, clusterCount + 1):
main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
@@ -124,24 +124,24 @@
main.ONOS1cli.startOnosCli( ONOSIp[1] )
main.log.info("Startup sequence complete")
-
+
time.sleep(30)
-
+
for i in range(3):
- main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", ("deviceCount " + str(switchCount)) )
+ main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", ("deviceCount " + str(switchCount)) )
main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "topoShape linear")
main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "enabled true")
if main.ONOSbench.verifySummary(ONOSIp[1], switchCount):
break
- else:
- print "Failed- looping"
+ else:
+ print "Failed- looping"
main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
main.ONOSbench.handle.expect(":~")
main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
def CASE2( self, main ):
-
+
import time
import numpy
@@ -169,18 +169,18 @@
time.sleep(2)
links = "--"
- for i in range(8):
+ for i in range(8):
if debug: main.log.info("top of loop")
main.ONOSbench.handle.sendline("onos $OC1 links")
main.ONOSbench.handle.expect(":~")
links = main.ONOSbench.handle.before
if "=null:" in links:
- break
+ break
if debug: main.log.info(str(links))
- if i > 3:
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], "d")
- if i == 7:
- main.log.error("link data missing")
+ if i > 3:
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], "d")
+ if i == 7:
+ main.log.error("link data missing")
time.sleep(3)
links = links.splitlines()
@@ -236,21 +236,21 @@
if "withdraw" in line:
withdrawn.append(int(line.split(" ")[5]))
- for line in myRawResult:
- if "Failure:" in line:
+ for line in myRawResult:
+ if "Failure:" in line:
main.log.error("INTENT TEST FAILURE, ABORTING TESTCASE")
testStatus = "fail"
- if testStatus == "fail":
- break
-
+ if testStatus == "fail":
+ break
+
print("installed: " + str(installed))
print("withraw: " + str(withdrawn) + "\n")
- if withdrawn[len(withdrawn) -1] > 1000 or installed[len(installed) -1] > 1000:
+ if withdrawn[len(withdrawn) -1] > 1000 or installed[len(installed) -1] > 1000:
main.log.info("ABNORMAL VALUE, CHECKING LOG")
main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
- if testStatus == "fail":
- break
+ if testStatus == "fail":
+ break
main.log.report("----------------------------------------------------")
main.log.report("Scale: " + str(clusterCount) + "\tIntent batch size: " + str(intentSize))
main.log.report("Data samples: " + str(sampleSize) + "\tWarm up tests: " + str(warmUp))
diff --git a/TestON/tests/SCPFintentRerouteLat/SCPFintentRerouteLat.py b/TestON/tests/SCPFintentRerouteLat/SCPFintentRerouteLat.py
index 07871f9..3b74dcf 100644
--- a/TestON/tests/SCPFintentRerouteLat/SCPFintentRerouteLat.py
+++ b/TestON/tests/SCPFintentRerouteLat/SCPFintentRerouteLat.py
@@ -36,20 +36,20 @@
skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
cellName = main.params[ 'ENV' ][ 'cellName' ]
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
init = True
global clusterCount #number of nodes running
global ONOSIp #list of ONOS IP addresses
- global scale
+ global scale
global commit
clusterCount = 0
ONOSIp = [ 0 ]
- scale = (main.params[ 'SCALE' ]).split(",")
+ scale = (main.params[ 'SCALE' ]).split(",")
clusterCount = int(scale[0])
- #Populate ONOSIp with ips from params
+ #Populate ONOSIp with ips from params
ONOSIp = [0]
ONOSIp.extend(main.ONOSbench.getOnosIps())
@@ -68,7 +68,7 @@
checkoutResult = main.TRUE
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
-
+
commit = main.ONOSbench.getVersion()
commit = (commit.split(" "))[1]
@@ -76,22 +76,22 @@
resultsDB.close()
# -- END OF INIT SECTION --#
-
+
clusterCount = int(scale[0])
- scale.remove(scale[0])
-
- #kill off all onos processes
+ scale.remove(scale[0])
+
+ #kill off all onos processes
main.log.step("Safety check, killing all ONOS processes")
main.log.step("before initiating enviornment setup")
for node in range(1, main.maxNodes + 1):
main.ONOSbench.onosDie(ONOSIp[node])
-
+
#Uninstall everywhere
main.log.step( "Cleaning Enviornment..." )
for i in range(1, main.maxNodes + 1):
main.log.info(" Uninstalling ONOS " + str(i) )
main.ONOSbench.onosUninstall( ONOSIp[i] )
-
+
#construct the cell file
main.log.info("Creating cell file")
cellIp = []
@@ -102,13 +102,13 @@
main.step( "Set Cell" )
main.ONOSbench.setCell(cellName)
-
+
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.onosPackage()
main.step( "verify cells" )
verifyCellResult = main.ONOSbench.verifyCell()
-
+
main.log.report( "Initializing " + str( clusterCount ) + " node cluster." )
for node in range(1, clusterCount + 1):
main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
@@ -123,7 +123,7 @@
if not isup:
main.log.report( "ONOS " + str(node) + " didn't start!" )
main.log.info("Startup sequence complete")
-
+
deviceMastership = (main.params[ 'TEST' ][ "s" + str(clusterCount) ]).split(",")
print("Device mastership list: " + str(deviceMastership))
@@ -149,9 +149,9 @@
main.ONOSbench.handle.sendline(cmd)
main.ONOSbench.handle.expect(":~")
time.sleep(4)
-
- cmd = ( "onos $OC" + node + " roles|grep 00000" + str(index))
- main.log.info(cmd)
+
+ cmd = ( "onos $OC" + node + " roles|grep 00000" + str(index))
+ main.log.info(cmd)
main.ONOSbench.handle.sendline(cmd)
main.ONOSbench.handle.expect(":~")
check = main.ONOSbench.handle.before
@@ -163,7 +163,7 @@
main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
def CASE2( self, main ):
-
+
import time
import numpy
import datetime
@@ -233,7 +233,7 @@
#main.ONOSbench.logReport(ONOSIp[(clusterCount-1)], ["ERROR", "WARNING", "EXCEPT"], "d")
main.ONOSbench.sendline("onos $OC1 summary")
main.ONOSbench.sendline("onos $OC1 devices")
- main.ONOSbench.sendline("onos $OC1 links")
+ main.ONOSbench.sendline("onos $OC1 links")
main.ONOSbench.expect(":~")
main.log.info(main.ONOSbench.before)
@@ -265,7 +265,7 @@
break
cutTimestamp = (temp.split(" "))[0] + " " + (temp.split(" "))[1]
- if debug: main.log.info("Cut timestamp: " + cutTimestamp)
+ if debug: main.log.info("Cut timestamp: " + cutTimestamp)
#validate link count and flow count
for i in range(0, 40):
@@ -279,7 +279,7 @@
main.log.error("Link or flow count incorrect, data invalid." + linkCheck)
main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], "d")
- time.sleep(5) #trying to avoid negative values
+ time.sleep(5) #trying to avoid negative values
#intents events metrics installed timestamp
IEMtimestamps = [0]*(clusterCount + 1)
@@ -340,12 +340,12 @@
if debug: main.log.info(cmd)
main.ONOSbench.handle.sendline(cmd)
main.ONOSbench.handle.expect(":~")
-
+
#wait for intent withdraw
main.ONOSbench.handle.sendline(withdrawCmd)
- main.log.info(withdrawCmd)
+ main.log.info(withdrawCmd)
main.ONOSbench.handle.expect(":~")
- if debug: main.log.info(main.ONOSbench.handle.before)
+ if debug: main.log.info(main.ONOSbench.handle.before)
main.ONOSbench.handle.sendline("onos $OC1 intents|grep WITHDRAWN|wc -l")
main.ONOSbench.handle.expect(":~")
intentWithdrawCheck = main.ONOSbench.handle.before
@@ -373,7 +373,7 @@
for i in myResult:
latTemp.append(i[0])
nodeTemp.append(i[1])
-
+
mode = {}
for i in nodeTemp:
if i in mode:
@@ -398,7 +398,7 @@
main.log.report("________________________________________________________")
resultsDB = open("/tmp/IntentRerouteLatDB", "a")
- resultsDB.write("'" + commit + "',")
+ resultsDB.write("'" + commit + "',")
resultsDB.write(str(clusterCount) + ",")
resultsDB.write(str(intents) + ",")
resultsDB.write(str(average) + ",")
diff --git a/TestON/tests/SCPFswitchLat/SCPFswitchLat.py b/TestON/tests/SCPFswitchLat/SCPFswitchLat.py
index 81cbf16..439efff 100644
--- a/TestON/tests/SCPFswitchLat/SCPFswitchLat.py
+++ b/TestON/tests/SCPFswitchLat/SCPFswitchLat.py
@@ -37,11 +37,11 @@
testONpath = os.getcwd() #testON/bin
user = main.params[ 'CTRL' ][ 'user' ]
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
init = True
global clusterCount #number of nodes running
- global scale
+ global scale
global commit
global timeToPost
global runNum
@@ -66,7 +66,7 @@
clusterCount = 0
main.ONOSIp = main.ONOSbench.getOnosIps()
- scale = (main.params[ 'SCALE' ]).split(",")
+ scale = (main.params[ 'SCALE' ]).split(",")
clusterCount = int(scale[0])
#mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
@@ -84,10 +84,10 @@
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
- main.log.step("Grabbing commit number")
+ main.log.step("Grabbing commit number")
commit = main.ONOSbench.getVersion() ####
commit = (commit.split(" "))[1]
-
+
temp = testONpath.replace("bin","") + "tests/SCPFswitchLat/Dependency/"
main.ONOSbench.copyMininetFile("topo-perf-1sw.py", temp, user, "localhost" )
#main.ONOSbench.handle.expect(":~")
@@ -96,19 +96,19 @@
print switchEventResultPath
fSwitchLog = open(switchEventResultPath, "w+")
fSwitchLog.write("")
- fSwitchLog.close()
+ fSwitchLog.close()
# -- END OF INIT SECTION --#
- main.log.step("Adjusting scale")
+ main.log.step("Adjusting scale")
clusterCount = int(scale[0])
- scale.remove(scale[0])
-
- #kill off all onos processes
+ scale.remove(scale[0])
+
+ #kill off all onos processes
main.log.step("Safety check, killing all ONOS processes before initiating enviornment setup")
for node in range(main.maxNodes):
main.ONOSbench.onosDie(main.ONOSIp[node])
-
+
#Uninstall everywhere
main.log.step( "Cleaning Enviornment..." )
for i in range(main.maxNodes):
@@ -118,24 +118,24 @@
time.sleep(10)
main.ONOSbench.handle.sendline(" ")
main.ONOSbench.handle.expect(":~")
-
+
#construct the cell file
main.log.info("Creating cell file")
cellIp = []
for node in range (clusterCount):
cellIp.append(main.ONOSIp[node])
-
+
main.ONOSbench.createCellFile(main.ONOSbench.ip_address, cellName, MN1Ip, str(Apps), cellIp)
main.step( "Set Cell" )
main.ONOSbench.setCell(cellName)
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.onosPackage()
main.step( "verify cells" )
verifyCellResult = main.ONOSbench.verifyCell()
-
+
main.step('Starting mininet topology ')
main.Mininet1.startNet()
@@ -151,7 +151,7 @@
main.ONOSbench.handle.expect(":~")
print main.ONOSbench.handle.before
if "nodes=" in main.ONOSbench.handle.before:
- break
+ break
for node in range(clusterCount):
for i in range( 2 ):
@@ -164,26 +164,26 @@
main.log.info("Startup sequence complete")
#time.sleep(20)
-
+
main.step('Start onos cli')
- for i in range(0,clusterCount):
+ for i in range(0,clusterCount):
cli1 = CLIs[i].startOnosCli(main.ONOSIp[i])
main.step( 'Configuring application parameters' )
-
+
configName = 'org.onosproject.net.topology.impl.DefaultTopologyProvider'
configParam = 'maxEvents 1'
main.ONOSbench.onosCfgSet( main.ONOSIp[0], configName, configParam )
configParam = 'maxBatchMs 0'
main.ONOSbench.onosCfgSet( main.ONOSIp[0], configName, configParam )
configParam = 'maxIdleMs 0'
- main.ONOSbench.onosCfgSet( main.ONOSIp[0], configName, configParam )
+ main.ONOSbench.onosCfgSet( main.ONOSIp[0], configName, configParam )
def CASE2(self, main):
print "Cluster size: " + str(clusterCount)
"""
Assign s3 to ONOSbench and measure latency
-
+
There are 4 levels of latency measurements to this test:
1 ) End-to-end measurement: Complete end-to-end measurement
from TCP ( SYN/ACK ) handshake to Graph change
@@ -207,7 +207,7 @@
ONOSUser = main.params['CTRL']['user']
numIter = main.params['TEST']['numIter']
iterIgnore = int(main.params['TEST']['iterIgnore'])
-
+
deviceTimestampKey = main.params['JSON']['deviceTimestamp']
graphTimestampKey = main.params['JSON']['graphTimestamp']
@@ -218,7 +218,7 @@
thresholdObj = thresholdStr.split(',')
thresholdMin = int(thresholdObj[0])
thresholdMax = int(thresholdObj[1])
-
+
# Look for 'role-request' messages,
# which replaces the 'vendor' messages previously seen
# on OVS 2.0.1
@@ -238,7 +238,7 @@
# TCP Syn/Ack -> Feature Reply latency collection for each node
tcpToFeatureLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
# Feature Reply -> Role Request latency collection for each node
- featureToRoleRequestLatNodeIter = numpy.zeros((clusterCount,
+ featureToRoleRequestLatNodeIter = numpy.zeros((clusterCount,
int(numIter)))
# Role Request -> Role Reply latency collection for each node
roleRequestToRoleReplyLatNodeIter = numpy.zeros((clusterCount,
@@ -250,7 +250,7 @@
deviceToGraphLatNodeIter = numpy.zeros((clusterCount,
int(numIter)))
endToEndLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
-
+
# Switch disconnect measurement lists
# Mininet Fin / Ack -> Mininet Ack
finAckTransactionLatNodeIter = numpy.zeros((clusterCount,
@@ -262,7 +262,7 @@
deviceToGraphDiscLatNodeIter = numpy.zeros((clusterCount,
int(numIter)))
endToEndDiscLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
-
+
assertion = main.TRUE
localTime = time.strftime('%x %X')
localTime = localTime.replace('/', '')
@@ -276,7 +276,7 @@
main.log.report('Latency of adding one switch to controller')
main.log.report('First ' + str(iterIgnore) + ' iterations ignored' + ' for jvm warmup time')
main.log.report('Total iterations of test: ' + str(numIter))
-
+
for i in range(0, int(numIter)):
main.log.info('Starting tshark capture')
main.ONOSbench.tsharkGrep(tsharkTcpString, tsharkTcpOutput)
@@ -285,23 +285,23 @@
main.ONOSbench.tsharkGrep(tsharkFeatureReply, tsharkFeatureOutput)
time.sleep(10)
-
+
main.log.info('Assigning s3 to controller')
main.Mininet1.assignSwController(sw='s3',
ip=main.ONOSIp[0])
-
+
jsonStr = []
- for node in range (0, clusterCount):
+ for node in range (0, clusterCount):
metricsSwUp = CLIs[node].topologyEventsMetrics()
jsonStr.append(metricsSwUp)
-
+
time.sleep(10)
main.log.info('Stopping all Tshark processes')
main.ONOSbench.tsharkStop()
-
+
time.sleep(5)
-
+
'''
main.log.info('Copying over tshark files')
os.system('scp ' + ONOSUser + '@' + main.ONOSIp[0] +
@@ -321,7 +321,7 @@
tempText = tcpFile.readline()
tempText = tempText.split(' ')
main.log.info('Object read in from TCP capture: ' + str(tempText))
-
+
if len(tempText) > 1:
t0Tcp = float(tempText[1]) * 1000.0
else:
@@ -329,7 +329,7 @@
t0Tcp = 0
assertion = main.FALSE
tcpFile.close()
-
+
# Get Role reply output
ofFile = open(tsharkOfOutput, 'r')
lineOfp = ''
@@ -350,7 +350,7 @@
t0Ofp = 0
assertion = main.FALSE
ofFile.close()
-
+
# Get role request output
roleFile = open(tsharkRoleOutput, 'r')
tempText = roleFile.readline()
@@ -378,7 +378,7 @@
elif tempText[2] != ' ' and float(tempText[2]) > 1400000000.0:
temp = tempText[2]
else:
- temp = 0
+ temp = 0
featureTimestamp = float(temp) * 1000.0
else:
main.log.error('Tshark output file for feature reply' +
@@ -397,33 +397,33 @@
deviceTimestamp = jsonObj[deviceTimestampKey]['value']
else:
main.log.error( "Unexpected JSON object" )
- # If we could not obtain the JSON object,
+ # If we could not obtain the JSON object,
# set the timestamps to 0, which will be
# excluded from the measurement later on
# (realized as invalid)
graphTimestamp = 0
deviceTimestamp = 0
-
+
endToEnd = int(graphTimestamp) - int(t0Tcp)
-
+
# Below are measurement breakdowns of the end-to-end
- # measurement.
+ # measurement.
tcpToFeature = int(featureTimestamp) - int(t0Tcp)
featureToRole = int(roleTimestamp) - int(featureTimestamp)
roleToOfp = float(t0Ofp) - float(roleTimestamp)
ofpToDevice = float(deviceTimestamp) - float(t0Ofp)
- # Timestamps gathered from ONOS are millisecond
+ # Timestamps gathered from ONOS are millisecond
# precision. They are returned as integers, thus no
# need to be more precise than 'int'. However,
- # the processing seems to be mostly under 1 ms,
- # thus this may be a problem point to handle any
+ # the processing seems to be mostly under 1 ms,
+ # thus this may be a problem point to handle any
# submillisecond output that we are unsure of.
# For now, this will be treated as 0 ms if less than 1 ms
deviceToGraph = int(graphTimestamp) - int(deviceTimestamp)
-
+
if endToEnd >= thresholdMin and\
endToEnd < thresholdMax and i >= iterIgnore:
- endToEndLatNodeIter[node][i] = endToEnd
+ endToEndLatNodeIter[node][i] = endToEnd
main.log.info("ONOS "+str(nodeNum)+ " end-to-end: "+
str(endToEnd) + " ms")
else:
@@ -431,10 +431,10 @@
"measurement ignored due to excess in "+
"threshold or premature iteration: ")
main.log.info(str(endToEnd))
-
+
if tcpToFeature >= thresholdMin and\
tcpToFeature < thresholdMax and i >= iterIgnore:
- tcpToFeatureLatNodeIter[node][i] = tcpToFeature
+ tcpToFeatureLatNodeIter[node][i] = tcpToFeature
main.log.info("ONOS "+str(nodeNum)+ " tcp-to-feature: "+
str(tcpToFeature) + " ms")
else:
@@ -445,7 +445,7 @@
if featureToRole >= thresholdMin and\
featureToRole < thresholdMax and i >= iterIgnore:
- featureToRoleRequestLatNodeIter[node][i] = featureToRole
+ featureToRoleRequestLatNodeIter[node][i] = featureToRole
main.log.info("ONOS "+str(nodeNum)+ " feature-to-role: "+
str(featureToRole) + " ms")
else:
@@ -464,10 +464,10 @@
"measurement ignored due to excess in "+
"threshold or premature iteration: ")
main.log.info(str(roleToOfp))
-
+
if ofpToDevice >= thresholdMin and\
ofpToDevice < thresholdMax and i >= iterIgnore:
- roleReplyToDeviceLatNodeIter[node][i] = ofpToDevice
+ roleReplyToDeviceLatNodeIter[node][i] = ofpToDevice
main.log.info("ONOS "+str(nodeNum)+ " reply-to-device: "+
str(ofpToDevice) + " ms")
else:
@@ -489,26 +489,26 @@
"was set to 0 ms because of precision "+
"uncertainty. ")
else:
- main.log.info("ONOS "+str(nodeNum)+
+ main.log.info("ONOS "+str(nodeNum)+
" device-to-graph "+
"measurement ignored due to excess in "+
"threshold or premature iteration: ")
- main.log.info(str(deviceToGraph))
-
+ main.log.info(str(deviceToGraph))
+
# ********************
time.sleep(5)
-
+
# Get device id to remove
deviceIdJsonStr = main.ONOS1cli.devices()
-
+
main.log.info( "Device obj obtained: " + str(deviceIdJsonStr) )
deviceId = json.loads(deviceIdJsonStr)
deviceList = []
for device in deviceId:
deviceList.append(device['id'])
-
- # Measure switch down metrics
+
+ # Measure switch down metrics
# TCP FIN/ACK -> TCP FIN
# TCP FIN -> Device Event
# Device Event -> Graph Event
@@ -516,53 +516,53 @@
# The -A 1 grep option allows us to grab 1 extra line after the
# last tshark output grepped originally
- main.ONOSbench.tsharkGrep( tsharkFinAckSequence, tsharkFinAckOutput,
+ main.ONOSbench.tsharkGrep( tsharkFinAckSequence, tsharkFinAckOutput,
grepOptions = '-A 1' )
-
+
time.sleep( 5 )
removeJsonList = []
main.step('Remove switch from controller')
main.Mininet1.deleteSwController('s3')
- firstDevice = deviceList[0]
+ firstDevice = deviceList[0]
time.sleep( 5 )
-
+
# We need to get metrics before removing
# device from the store below.
for node in range(0, clusterCount):
metricsSwDown = CLIs[node].topologyEventsMetrics
jsonStr = metricsSwDown()
- removeJsonList.append( json.loads(jsonStr) )
-
+ removeJsonList.append( json.loads(jsonStr) )
+
main.ONOSbench.tsharkStop()
-
+
main.log.info( "Removing device " +str(firstDevice)+
" from ONOS" )
-
+
#if deviceId:
main.ONOS1cli.deviceRemove(firstDevice)
#main.log.info('Copying over tshark files')
#os.system('scp ' + ONOSUser + '@' + main.ONOSIp[0] + ':' + tsharkFinAckOutput + ' /tmp/')
-
+
time.sleep( 10 )
finAckOutputList = []
with open(tsharkFinAckOutput, 'r') as f:
tempLine = f.readlines()
main.log.info('Object read in from FinAck capture: ' +
"\n".join(tempLine))
-
+
index = 1
for line in tempLine:
obj = line.split(' ')
-
- # There are at least 3 objects in field (valid
+
+ # There are at least 3 objects in field (valid
# tshark output is lengthy)
if len(obj) > 2:
# If first index of object is like an epoch time
if obj[1] != ' ' and float(obj[1]) > 1400000000.0:
- temp = obj[1]
+ temp = obj[1]
elif obj[2] != ' 'and float(obj[2]) > 1400000000.0:
temp = obj[2]
elif obj[3] != ' 'and float(obj[3]) > 1400000000.0:
@@ -582,13 +582,13 @@
tFinAck = 0
tAck = 0
assertion = main.FALSE
-
+
index += 1
# with open() as f takes care of closing file
time.sleep(5)
-
+
for node in range(0, clusterCount):
nodeNum = node+1
jsonObj = removeJsonList[node]
@@ -599,26 +599,26 @@
main.log.info("Device timestamp: "+str(deviceTimestamp))
else:
main.log.error( "Unexpected JSON object" )
- # If we could not obtain the JSON object,
+ # If we could not obtain the JSON object,
# set the timestamps to 0, which will be
# excluded from the measurement later on
# (realized as invalid)
graphTimestamp = 0
deviceTimestamp = 0
-
+
finAckTransaction = float(tAck) - float(tFinAck)
ackToDevice = float(deviceTimestamp) - float(tAck)
deviceToGraph = float(graphTimestamp) - float(deviceTimestamp)
endToEndDisc = int(graphTimestamp) - int(tFinAck)
-
+
if endToEndDisc >= thresholdMin and\
endToEndDisc < thresholdMax and i >= iterIgnore:
endToEndDiscLatNodeIter[node][i] = endToEndDisc
- main.log.info("ONOS "+str(nodeNum) +
+ main.log.info("ONOS "+str(nodeNum) +
"end-to-end disconnection: "+
str(endToEndDisc) + " ms" )
else:
- main.log.info("ONOS " + str(nodeNum) +
+ main.log.info("ONOS " + str(nodeNum) +
" end-to-end disconnection "+
"measurement ignored due to excess in "+
"threshold or premature iteration: ")
@@ -626,7 +626,7 @@
if finAckTransaction >= thresholdMin and\
finAckTransaction < thresholdMax and i >= iterIgnore:
- finAckTransactionLatNodeIter[node][i] = finAckTransaction
+ finAckTransactionLatNodeIter[node][i] = finAckTransaction
main.log.info("ONOS "+str(nodeNum)+
" fin/ack transaction: "+
str(finAckTransaction) + " ms")
@@ -674,12 +674,12 @@
roleToOfpList = []
ofpToDeviceList = []
deviceToGraphList = []
-
+
finAckTransactionList = []
ackToDeviceList = []
deviceToGraphDiscList = []
endToEndDiscList = []
-
+
# LatNodeIter 2d arrays contain all iteration latency
# for each node of the current scale cluster size
# Switch connection measurements
@@ -704,7 +704,7 @@
for item in roleReplyToDeviceLatNodeIter[node]:
if item >= 0.0:
ofpToDeviceList.append(item)
-
+
for item in featureToRoleRequestLatNodeIter[node]:
if item > 0.0:
featureToRoleList.append(item)
@@ -717,7 +717,7 @@
for item in endToEndDiscLatNodeIter[node]:
if item > 0.0:
endToEndDiscList.append(item)
-
+
for item in finAckTransactionLatNodeIter[node]:
if item > 0.0:
finAckTransactionList.append(item)
@@ -738,13 +738,13 @@
featureToRoleAvg = round(numpy.mean(featureToRoleList), 2)
featureToRoleStdDev = round(numpy.std(featureToRoleList), 2)
-
+
roleToOfpAvg = round(numpy.mean(roleToOfpList), 2)
roleToOfpStdDev = round(numpy.std(roleToOfpList), 2)
ofpToDeviceAvg = round(numpy.mean(ofpToDeviceList), 2)
ofpToDeviceStdDev = round(numpy.std(ofpToDeviceList), 2)
-
+
deviceToGraphAvg = round(numpy.mean(deviceToGraphList), 2)
deviceToGraphStdDev = round(numpy.std(deviceToGraphList), 2)
@@ -753,55 +753,55 @@
finAckAvg = round(numpy.mean(finAckTransactionList), 2)
finAckStdDev = round(numpy.std(finAckTransactionList), 2)
-
+
ackToDeviceAvg = round(numpy.mean(ackToDeviceList), 2)
ackToDeviceStdDev = round(numpy.std(ackToDeviceList), 2)
-
+
deviceToGraphDiscAvg = round(numpy.mean(deviceToGraphDiscList), 2)
deviceToGraphDiscStdDev = round(numpy.std(deviceToGraphDiscList), 2)
main.log.report(' - Node ' + str(node + 1) + ' Summary - ')
main.log.report(' - Switch Connection Statistics - ')
-
+
main.log.report(' End-to-end Avg: ' + str(endToEndAvg) +
' ms' + ' End-to-end Std dev: ' +
str(endToEndStdDev) + ' ms')
-
+
main.log.report(' Tcp-to-feature-reply Avg: ' +
str(tcpToFeatureAvg) + ' ms')
main.log.report(' Tcp-to-feature-reply Std dev: '+
str(tcpToFeatureStdDev) + ' ms')
-
+
main.log.report(' Feature-reply-to-role-request Avg: ' +
str(featureToRoleAvg) + ' ms')
main.log.report(' Feature-reply-to-role-request Std Dev: ' +
str(featureToRoleStdDev) + ' ms')
-
+
main.log.report(' Role-request-to-role-reply Avg: ' +
str(roleToOfpAvg) +' ms')
main.log.report(' Role-request-to-role-reply Std dev: ' +
str(roleToOfpStdDev) + ' ms')
-
+
main.log.report(' Role-reply-to-device Avg: ' +
str(ofpToDeviceAvg) +' ms')
main.log.report(' Role-reply-to-device Std dev: ' +
str(ofpToDeviceStdDev) + ' ms')
-
+
main.log.report(' Device-to-graph Avg: ' +
str(deviceToGraphAvg) + ' ms')
main.log.report( 'Device-to-graph Std dev: ' +
str(deviceToGraphStdDev) + ' ms')
-
+
main.log.report(' - Switch Disconnection Statistics - ')
- main.log.report(' End-to-end switch disconnect Avg: ' +
+ main.log.report(' End-to-end switch disconnect Avg: ' +
str(endToEndDiscAvg) + ' ms')
main.log.report(' End-to-end switch disconnect Std dev: ' +
str(endToEndDiscStdDev) + ' ms')
main.log.report(' Fin/Ack-to-Ack Avg: ' + str(finAckAvg) + ' ms')
main.log.report(' Fin/Ack-to-Ack Std dev: ' +
str(finAckStdDev) + ' ms')
-
- main.log.report(' Ack-to-device Avg: ' + str(ackToDeviceAvg) +
+
+ main.log.report(' Ack-to-device Avg: ' + str(ackToDeviceAvg) +
' ms')
main.log.report(' Ack-to-device Std dev: ' + str(ackToDeviceStdDev) +
' ms')
@@ -815,8 +815,8 @@
dbCmdList.append(
"INSERT INTO switch_latency_details VALUES('" +
timeToPost + "','switch_latency_results'," +
- jenkinsBuildNumber + ',' + str(clusterCount) + ",'baremetal" +
- str(node + 1) + "'," +
+ jenkinsBuildNumber + ',' + str(clusterCount) + ",'baremetal" +
+ str(node + 1) + "'," +
str(endToEndAvg) + ',' +
str(tcpToFeatureAvg) + ',' +
str(featureToRoleAvg) + ',' +
@@ -826,7 +826,7 @@
str(endToEndDiscAvg) + ',' +
str(finAckAvg) + ',' +
str(ackToDeviceAvg) + ',' +
- str(deviceToGraphDiscAvg) +
+ str(deviceToGraphDiscAvg) +
');')
if debugMode == 'on':
@@ -836,13 +836,13 @@
for line in dbCmdList:
if line:
fResult.write(line + '\n')
- main.log.report(line)
+ main.log.report(line)
fResult.close()
-
+
assertion = main.TRUE
-
+
utilities.assert_equals(expect=main.TRUE, actual=assertion,
- onpass='Switch latency test successful',
+ onpass='Switch latency test successful',
onfail='Switch latency test failed')
main.Mininet1.stopNet()