Merge "Initial CHO commit"
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index cbe291b..f198df4 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -2107,7 +2107,9 @@
def getOnosIPfromCell(self):
'''
Returns the ONOS node names and their IP addresses as defined in the cell and applied to shell environment
- Example output return: [['OC1', '10.128.40.41'], ['OC2', '10.128.40.42'], ['OC3', '10.128.40.43']]
+ Example output return: ['10.128.40.41','10.128.40.42','10.128.40.43']. This will work even if the Mininet is
+ not part of the cell definition and also if there are multiple mininets, just by using static hostname
+ in TOPO file.
'''
import re
try:
@@ -2132,8 +2134,7 @@
continue
else:
onosIP = cellOutput[i].split("=")
- # below step could be changed to return only IP if node name is not needed.
- ipList.append(onosIP)
+ ipList.append(onosIP[1])
return ipList
except pexpect.ExceptionPexpect as e:
main.log.error( self.name + ": Pexpect exception found of type " +
diff --git a/TestON/tests/OnosCHO/Dependencies/topoAtt.py b/TestON/tests/OnosCHO/Dependencies/topoAtt.py
new file mode 100755
index 0000000..0247458
--- /dev/null
+++ b/TestON/tests/OnosCHO/Dependencies/topoAtt.py
@@ -0,0 +1,183 @@
+#!/usr/bin/python
+
+"""
+Custom topology for Mininet
+"""
+from mininet.topo import Topo
+from mininet.net import Mininet
+from mininet.node import RemoteController
+from mininet.node import Node
+from mininet.node import CPULimitedHost
+from mininet.link import TCLink
+from mininet.cli import CLI
+from mininet.log import setLogLevel
+from mininet.util import dumpNodeConnections
+from mininet.node import ( UserSwitch, OVSSwitch, OVSLegacyKernelSwitch, IVSSwitch )
+
+class attTopo( Topo ):
+
+ def __init__( self, **opts ):
+ "Create a topology."
+
+ # Initialize Topology
+ Topo.__init__( self, **opts )
+
+ # add nodes, switches first...
+ NY54 = self.addSwitch( 's1' )
+ CMBR = self.addSwitch( 's2' )
+ CHCG = self.addSwitch( 's3' )
+ CLEV = self.addSwitch( 's4' )
+ RLGH = self.addSwitch( 's5' )
+ ATLN = self.addSwitch( 's6' )
+ PHLA = self.addSwitch( 's7' )
+ WASH = self.addSwitch( 's8' )
+ NSVL = self.addSwitch( 's9' )
+ STLS = self.addSwitch( 's10' )
+ NWOR = self.addSwitch( 's11' )
+ HSTN = self.addSwitch( 's12' )
+ SNAN = self.addSwitch( 's13' )
+ DLLS = self.addSwitch( 's14' )
+ ORLD = self.addSwitch( 's15' )
+ DNVR = self.addSwitch( 's16' )
+ KSCY = self.addSwitch( 's17' )
+ SNFN = self.addSwitch( 's18' )
+ SCRM = self.addSwitch( 's19' )
+ PTLD = self.addSwitch( 's20' )
+ STTL = self.addSwitch( 's21' )
+ SLKC = self.addSwitch( 's22' )
+ LA03 = self.addSwitch( 's23' )
+ SNDG = self.addSwitch( 's24' )
+ PHNX = self.addSwitch( 's25' )
+
+ # ... and now hosts
+ NY54_host = self.addHost( 'h1' )
+ CMBR_host = self.addHost( 'h2' )
+ CHCG_host = self.addHost( 'h3' )
+ CLEV_host = self.addHost( 'h4' )
+ RLGH_host = self.addHost( 'h5' )
+ ATLN_host = self.addHost( 'h6' )
+ PHLA_host = self.addHost( 'h7' )
+ WASH_host = self.addHost( 'h8' )
+ NSVL_host = self.addHost( 'h9' )
+ STLS_host = self.addHost( 'h10' )
+ NWOR_host = self.addHost( 'h11' )
+ HSTN_host = self.addHost( 'h12' )
+ SNAN_host = self.addHost( 'h13' )
+ DLLS_host = self.addHost( 'h14' )
+ ORLD_host = self.addHost( 'h15' )
+ DNVR_host = self.addHost( 'h16' )
+ KSCY_host = self.addHost( 'h17' )
+ SNFN_host = self.addHost( 'h18' )
+ SCRM_host = self.addHost( 'h19' )
+ PTLD_host = self.addHost( 'h20' )
+ STTL_host = self.addHost( 'h21' )
+ SLKC_host = self.addHost( 'h22' )
+ LA03_host = self.addHost( 'h23' )
+ SNDG_host = self.addHost( 'h24' )
+ PHNX_host = self.addHost( 'h25' )
+
+ # add edges between switch and corresponding host
+ self.addLink( NY54 , NY54_host )
+ self.addLink( CMBR , CMBR_host )
+ self.addLink( CHCG , CHCG_host )
+ self.addLink( CLEV , CLEV_host )
+ self.addLink( RLGH , RLGH_host )
+ self.addLink( ATLN , ATLN_host )
+ self.addLink( PHLA , PHLA_host )
+ self.addLink( WASH , WASH_host )
+ self.addLink( NSVL , NSVL_host )
+ self.addLink( STLS , STLS_host )
+ self.addLink( NWOR , NWOR_host )
+ self.addLink( HSTN , HSTN_host )
+ self.addLink( SNAN , SNAN_host )
+ self.addLink( DLLS , DLLS_host )
+ self.addLink( ORLD , ORLD_host )
+ self.addLink( DNVR , DNVR_host )
+ self.addLink( KSCY , KSCY_host )
+ self.addLink( SNFN , SNFN_host )
+ self.addLink( SCRM , SCRM_host )
+ self.addLink( PTLD , PTLD_host )
+ self.addLink( STTL , STTL_host )
+ self.addLink( SLKC , SLKC_host )
+ self.addLink( LA03 , LA03_host )
+ self.addLink( SNDG , SNDG_host )
+ self.addLink( PHNX , PHNX_host )
+
+ # add edges between switches
+ self.addLink( NY54 , CMBR, bw=10, delay='0.979030824185ms')
+ self.addLink( NY54 , CHCG, bw=10, delay='0.806374975652ms')
+ self.addLink( NY54 , PHLA, bw=10, delay='0.686192970166ms')
+ self.addLink( NY54 , WASH, bw=10, delay='0.605826192092ms')
+ self.addLink( CMBR , PHLA, bw=10, delay='1.4018238197ms')
+ self.addLink( CHCG , CLEV, bw=10, delay='0.232315346482ms')
+ self.addLink( CHCG , PHLA, bw=10, delay='1.07297714274ms')
+ self.addLink( CHCG , STLS, bw=10, delay='1.12827896944ms')
+ self.addLink( CHCG , DNVR, bw=10, delay='1.35964770335ms')
+ self.addLink( CHCG , KSCY, bw=10, delay='1.5199778541ms')
+ self.addLink( CHCG , SNFN, bw=10, delay='0.620743405435ms')
+ self.addLink( CHCG , STTL, bw=10, delay='0.93027212534ms')
+ self.addLink( CHCG , SLKC, bw=10, delay='0.735621751348ms')
+ self.addLink( CLEV , NSVL, bw=10, delay='0.523419372248ms')
+ self.addLink( CLEV , STLS, bw=10, delay='1.00360290845ms')
+ self.addLink( CLEV , PHLA, bw=10, delay='0.882912133249ms')
+ self.addLink( RLGH , ATLN, bw=10, delay='1.1644489729ms')
+ self.addLink( RLGH , WASH, bw=10, delay='1.48176810502ms')
+ self.addLink( ATLN , WASH, bw=10, delay='0.557636936322ms')
+ self.addLink( ATLN , NSVL, bw=10, delay='1.32869749865ms')
+ self.addLink( ATLN , STLS, bw=10, delay='0.767705554748ms')
+ self.addLink( ATLN , DLLS, bw=10, delay='0.544782086448ms')
+ self.addLink( ATLN , ORLD, bw=10, delay='1.46119152532ms')
+ self.addLink( PHLA , WASH, bw=10, delay='0.372209320106ms')
+ self.addLink( NSVL , STLS, bw=10, delay='1.43250491305ms')
+ self.addLink( NSVL , DLLS, bw=10, delay='1.67698215288ms')
+ self.addLink( STLS , DLLS, bw=10, delay='0.256389964194ms')
+ self.addLink( STLS , KSCY, bw=10, delay='0.395511571791ms')
+ self.addLink( STLS , LA03, bw=10, delay='0.257085227363ms')
+ self.addLink( NWOR , HSTN, bw=10, delay='0.0952906633914ms')
+ self.addLink( NWOR , DLLS, bw=10, delay='1.60231329739ms')
+ self.addLink( NWOR , ORLD, bw=10, delay='0.692731063896ms')
+ self.addLink( HSTN , SNAN, bw=10, delay='0.284150653798ms')
+ self.addLink( HSTN , DLLS, bw=10, delay='1.65690128332ms')
+ self.addLink( HSTN , ORLD, bw=10, delay='0.731886304782ms')
+ self.addLink( SNAN , PHNX, bw=10, delay='1.34258627257ms')
+ self.addLink( SNAN , DLLS, bw=10, delay='1.50063532341ms')
+ self.addLink( DLLS , DNVR, bw=10, delay='0.251471593235ms')
+ self.addLink( DLLS , KSCY, bw=10, delay='0.18026026737ms')
+ self.addLink( DLLS , SNFN, bw=10, delay='0.74304274592ms')
+ self.addLink( DLLS , LA03, bw=10, delay='0.506439293357ms')
+ self.addLink( DNVR , KSCY, bw=10, delay='0.223328790403ms')
+ self.addLink( DNVR , SNFN, bw=10, delay='0.889017541903ms')
+ self.addLink( DNVR , SLKC, bw=10, delay='0.631898982721ms')
+ self.addLink( KSCY , SNFN, bw=10, delay='0.922778522233ms')
+ self.addLink( SNFN , SCRM, bw=10, delay='0.630352278097ms')
+ self.addLink( SNFN , PTLD, bw=10, delay='0.828572513655ms')
+ self.addLink( SNFN , STTL, bw=10, delay='1.54076081649ms')
+ self.addLink( SNFN , SLKC, bw=10, delay='0.621507502625ms')
+ self.addLink( SNFN , LA03, bw=10, delay='0.602936230151ms')
+ self.addLink( SCRM , SLKC, bw=10, delay='0.461350343644ms')
+ self.addLink( PTLD , STTL, bw=10, delay='1.17591515181ms')
+ self.addLink( SLKC , LA03, bw=10, delay='0.243225267023ms')
+ self.addLink( LA03 , SNDG, bw=10, delay='0.681264950821ms')
+ self.addLink( LA03 , PHNX, bw=10, delay='0.343709457969ms')
+ self.addLink( LA03 , PHNX, bw=10, delay='0.343709457969ms')
+ self.addLink( SNDG , PHNX, bw=10, delay='0.345064487693ms')
+
+topos = { 'att': ( lambda: attTopo() ) }
+
+# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
+def setupNetwork():
+ "Create network"
+ topo = attTopo()
+ #if controller_ip == '':
+ #controller_ip = '10.0.2.2';
+ # controller_ip = '127.0.0.1';
+ network = Mininet(topo=topo, link=TCLink, autoSetMacs=True, controller=None)
+ network.start()
+ CLI( network )
+ network.stop()
+
+if __name__ == '__main__':
+ setLogLevel('info')
+ #setLogLevel('debug')
+ setupNetwork()
diff --git a/TestON/tests/OnosCHO/Dependencies/topoChordal.py b/TestON/tests/OnosCHO/Dependencies/topoChordal.py
new file mode 100755
index 0000000..38eb6a1
--- /dev/null
+++ b/TestON/tests/OnosCHO/Dependencies/topoChordal.py
@@ -0,0 +1,422 @@
+#!/usr/bin/python
+"""
+"""
+from mininet.topo import Topo
+from mininet.net import Mininet
+from mininet.node import RemoteController
+from mininet.node import Node
+from mininet.node import CPULimitedHost
+from mininet.link import TCLink
+from mininet.cli import CLI
+from mininet.log import setLogLevel
+from mininet.util import dumpNodeConnections
+from mininet.node import ( UserSwitch, OVSSwitch, OVSLegacyKernelSwitch, IVSSwitch )
+
+class chordalTopo( Topo ):
+
+ def __init__( self, **opts ):
+ "Create a topology."
+
+ # Initialize Topology
+ Topo.__init__( self, **opts )
+
+ # add nodes, switches first...
+ 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' )
+ s8 = self.addSwitch( 's8' )
+ s9 = self.addSwitch( 's9' )
+ s10 = self.addSwitch( 's10' )
+ s11 = self.addSwitch( 's11' )
+ s12 = self.addSwitch( 's12' )
+ s13 = self.addSwitch( 's13' )
+ s14 = self.addSwitch( 's14' )
+ s15 = self.addSwitch( 's15' )
+ s16 = self.addSwitch( 's16' )
+ s17 = self.addSwitch( 's17' )
+ s18 = self.addSwitch( 's18' )
+ s19 = self.addSwitch( 's19' )
+ s20 = self.addSwitch( 's20' )
+ s21 = self.addSwitch( 's21' )
+ s22 = self.addSwitch( 's22' )
+ s23 = self.addSwitch( 's23' )
+ s24 = self.addSwitch( 's24' )
+ s25 = self.addSwitch( 's25' )
+
+ # ... and now hosts
+ s1_host = self.addHost( 'h1' )
+ s2_host = self.addHost( 'h2' )
+ s3_host = self.addHost( 'h3' )
+ s4_host = self.addHost( 'h4' )
+ s5_host = self.addHost( 'h5' )
+ s6_host = self.addHost( 'h6' )
+ s7_host = self.addHost( 'h7' )
+ s8_host = self.addHost( 'h8' )
+ s9_host = self.addHost( 'h9' )
+ s10_host = self.addHost( 'h10' )
+ s11_host = self.addHost( 'h11' )
+ s12_host = self.addHost( 'h12' )
+ s13_host = self.addHost( 'h13' )
+ s14_host = self.addHost( 'h14' )
+ s15_host = self.addHost( 'h15' )
+ s16_host = self.addHost( 'h16' )
+ s17_host = self.addHost( 'h17' )
+ s18_host = self.addHost( 'h18' )
+ s19_host = self.addHost( 'h19' )
+ s20_host = self.addHost( 'h20' )
+ s21_host = self.addHost( 'h21' )
+ s22_host = self.addHost( 'h22' )
+ s23_host = self.addHost( 'h23' )
+ s24_host = self.addHost( 'h24' )
+ s25_host = self.addHost( 'h25' )
+
+ # add edges between switch and corresponding host
+ self.addLink( s1 , s1_host )
+ self.addLink( s2 , s2_host )
+ self.addLink( s3 , s3_host )
+ self.addLink( s4 , s4_host )
+ self.addLink( s5 , s5_host )
+ self.addLink( s6 , s6_host )
+ self.addLink( s7 , s7_host )
+ self.addLink( s8 , s8_host )
+ self.addLink( s9 , s9_host )
+ self.addLink( s10 , s10_host )
+ self.addLink( s11 , s11_host )
+ self.addLink( s12 , s12_host )
+ self.addLink( s13 , s13_host )
+ self.addLink( s14 , s14_host )
+ self.addLink( s15 , s15_host )
+ self.addLink( s16 , s16_host )
+ self.addLink( s17 , s17_host )
+ self.addLink( s18 , s18_host )
+ self.addLink( s19 , s19_host )
+ self.addLink( s20 , s20_host )
+ self.addLink( s21 , s21_host )
+ self.addLink( s22 , s22_host )
+ self.addLink( s23 , s23_host )
+ self.addLink( s24 , s24_host )
+ self.addLink( s25 , s25_host )
+ self.addLink(s1, s2)
+ self.addLink(s1, s3)
+ self.addLink(s1, s4)
+ self.addLink(s1, s5)
+ self.addLink(s1, s6)
+ self.addLink(s1, s7)
+ self.addLink(s1, s8)
+ self.addLink(s1, s9)
+ self.addLink(s1, s10)
+ self.addLink(s1, s11)
+ self.addLink(s1, s12)
+ self.addLink(s1, s13)
+ self.addLink(s1, s14)
+ self.addLink(s1, s15)
+ self.addLink(s1, s16)
+ self.addLink(s1, s17)
+ self.addLink(s1, s18)
+ self.addLink(s1, s19)
+ self.addLink(s1, s20)
+ self.addLink(s1, s21)
+ self.addLink(s1, s22)
+ self.addLink(s1, s23)
+ self.addLink(s1, s24)
+ self.addLink(s1, s25)
+ self.addLink(s2, s3)
+ self.addLink(s2, s4)
+ self.addLink(s2, s5)
+ self.addLink(s2, s6)
+ self.addLink(s2, s7)
+ self.addLink(s2, s8)
+ self.addLink(s2, s9)
+ self.addLink(s2, s10)
+ self.addLink(s2, s11)
+ self.addLink(s2, s12)
+ self.addLink(s2, s13)
+ self.addLink(s2, s14)
+ self.addLink(s2, s15)
+ self.addLink(s2, s16)
+ self.addLink(s2, s17)
+ self.addLink(s2, s18)
+ self.addLink(s2, s19)
+ self.addLink(s2, s20)
+ self.addLink(s2, s21)
+ self.addLink(s2, s22)
+ self.addLink(s2, s23)
+ self.addLink(s2, s24)
+ self.addLink(s2, s25)
+ self.addLink(s3, s4)
+ self.addLink(s3, s5)
+ self.addLink(s3, s6)
+ self.addLink(s3, s7)
+ self.addLink(s3, s8)
+ self.addLink(s3, s9)
+ self.addLink(s3, s10)
+ self.addLink(s3, s11)
+ self.addLink(s3, s12)
+ self.addLink(s3, s13)
+ self.addLink(s3, s14)
+ self.addLink(s3, s15)
+ self.addLink(s3, s16)
+ self.addLink(s3, s17)
+ self.addLink(s3, s18)
+ self.addLink(s3, s19)
+ self.addLink(s3, s20)
+ self.addLink(s3, s21)
+ self.addLink(s3, s22)
+ self.addLink(s3, s23)
+ self.addLink(s3, s24)
+ self.addLink(s3, s25)
+ self.addLink(s4, s5)
+ self.addLink(s4, s6)
+ self.addLink(s4, s7)
+ self.addLink(s4, s8)
+ self.addLink(s4, s9)
+ self.addLink(s4, s10)
+ self.addLink(s4, s11)
+ self.addLink(s4, s12)
+ self.addLink(s4, s13)
+ self.addLink(s4, s14)
+ self.addLink(s4, s15)
+ self.addLink(s4, s16)
+ self.addLink(s4, s17)
+ self.addLink(s4, s18)
+ self.addLink(s4, s19)
+ self.addLink(s4, s20)
+ self.addLink(s4, s21)
+ self.addLink(s4, s22)
+ self.addLink(s4, s23)
+ self.addLink(s4, s24)
+ self.addLink(s4, s25)
+ self.addLink(s5, s6)
+ self.addLink(s5, s7)
+ self.addLink(s5, s8)
+ self.addLink(s5, s9)
+ self.addLink(s5, s10)
+ self.addLink(s5, s11)
+ self.addLink(s5, s12)
+ self.addLink(s5, s13)
+ self.addLink(s5, s14)
+ self.addLink(s5, s15)
+ self.addLink(s5, s16)
+ self.addLink(s5, s17)
+ self.addLink(s5, s18)
+ self.addLink(s5, s19)
+ self.addLink(s5, s20)
+ self.addLink(s5, s21)
+ self.addLink(s5, s22)
+ self.addLink(s5, s23)
+ self.addLink(s5, s24)
+ self.addLink(s5, s25)
+ self.addLink(s6, s7)
+ self.addLink(s6, s8)
+ self.addLink(s6, s9)
+ self.addLink(s6, s10)
+ self.addLink(s6, s11)
+ self.addLink(s6, s12)
+ self.addLink(s6, s13)
+ self.addLink(s6, s14)
+ self.addLink(s6, s15)
+ self.addLink(s6, s16)
+ self.addLink(s6, s17)
+ self.addLink(s6, s18)
+ self.addLink(s6, s19)
+ self.addLink(s6, s20)
+ self.addLink(s6, s21)
+ self.addLink(s6, s22)
+ self.addLink(s6, s23)
+ self.addLink(s6, s24)
+ self.addLink(s6, s25)
+ self.addLink(s7, s8)
+ self.addLink(s7, s9)
+ self.addLink(s7, s10)
+ self.addLink(s7, s11)
+ self.addLink(s7, s12)
+ self.addLink(s7, s13)
+ self.addLink(s7, s14)
+ self.addLink(s7, s15)
+ self.addLink(s7, s16)
+ self.addLink(s7, s17)
+ self.addLink(s7, s18)
+ self.addLink(s7, s19)
+ self.addLink(s7, s20)
+ self.addLink(s7, s21)
+ self.addLink(s7, s22)
+ self.addLink(s7, s23)
+ self.addLink(s7, s24)
+ self.addLink(s7, s25)
+ self.addLink(s8, s9)
+ self.addLink(s8, s10)
+ self.addLink(s8, s11)
+ self.addLink(s8, s12)
+ self.addLink(s8, s13)
+ self.addLink(s8, s14)
+ self.addLink(s8, s15)
+ self.addLink(s8, s16)
+ self.addLink(s8, s17)
+ self.addLink(s8, s18)
+ self.addLink(s8, s19)
+ self.addLink(s8, s20)
+ self.addLink(s8, s21)
+ self.addLink(s8, s22)
+ self.addLink(s8, s23)
+ self.addLink(s8, s24)
+ self.addLink(s8, s25)
+ self.addLink(s9, s10)
+ self.addLink(s9, s11)
+ self.addLink(s9, s12)
+ self.addLink(s9, s13)
+ self.addLink(s9, s14)
+ self.addLink(s9, s15)
+ self.addLink(s9, s16)
+ self.addLink(s9, s17)
+ self.addLink(s9, s18)
+ self.addLink(s9, s19)
+ self.addLink(s9, s20)
+ self.addLink(s9, s21)
+ self.addLink(s9, s22)
+ self.addLink(s9, s23)
+ self.addLink(s9, s24)
+ self.addLink(s9, s25)
+ self.addLink(s10, s11)
+ self.addLink(s10, s12)
+ self.addLink(s10, s13)
+ self.addLink(s10, s14)
+ self.addLink(s10, s15)
+ self.addLink(s10, s16)
+ self.addLink(s10, s17)
+ self.addLink(s10, s18)
+ self.addLink(s10, s19)
+ self.addLink(s10, s20)
+ self.addLink(s10, s21)
+ self.addLink(s10, s22)
+ self.addLink(s10, s23)
+ self.addLink(s10, s24)
+ self.addLink(s10, s25)
+ self.addLink(s11, s12)
+ self.addLink(s11, s13)
+ self.addLink(s11, s14)
+ self.addLink(s11, s15)
+ self.addLink(s11, s16)
+ self.addLink(s11, s17)
+ self.addLink(s11, s18)
+ self.addLink(s11, s19)
+ self.addLink(s11, s20)
+ self.addLink(s11, s21)
+ self.addLink(s11, s22)
+ self.addLink(s11, s23)
+ self.addLink(s11, s24)
+ self.addLink(s11, s25)
+ self.addLink(s12, s13)
+ self.addLink(s12, s14)
+ self.addLink(s12, s15)
+ self.addLink(s12, s16)
+ self.addLink(s12, s17)
+ self.addLink(s12, s18)
+ self.addLink(s12, s19)
+ self.addLink(s12, s20)
+ self.addLink(s12, s21)
+ self.addLink(s12, s22)
+ self.addLink(s12, s23)
+ self.addLink(s12, s24)
+ self.addLink(s12, s25)
+ self.addLink(s13, s14)
+ self.addLink(s13, s15)
+ self.addLink(s13, s16)
+ self.addLink(s13, s17)
+ self.addLink(s13, s18)
+ self.addLink(s13, s19)
+ self.addLink(s13, s20)
+ self.addLink(s13, s21)
+ self.addLink(s13, s22)
+ self.addLink(s13, s23)
+ self.addLink(s13, s24)
+ self.addLink(s13, s25)
+ self.addLink(s14, s15)
+ self.addLink(s14, s16)
+ self.addLink(s14, s17)
+ self.addLink(s14, s18)
+ self.addLink(s14, s19)
+ self.addLink(s14, s20)
+ self.addLink(s14, s21)
+ self.addLink(s14, s22)
+ self.addLink(s14, s23)
+ self.addLink(s14, s24)
+ self.addLink(s14, s25)
+ self.addLink(s15, s16)
+ self.addLink(s15, s17)
+ self.addLink(s15, s18)
+ self.addLink(s15, s19)
+ self.addLink(s15, s20)
+ self.addLink(s15, s21)
+ self.addLink(s15, s22)
+ self.addLink(s15, s23)
+ self.addLink(s15, s24)
+ self.addLink(s15, s25)
+ self.addLink(s16, s17)
+ self.addLink(s16, s18)
+ self.addLink(s16, s19)
+ self.addLink(s16, s20)
+ self.addLink(s16, s21)
+ self.addLink(s16, s22)
+ self.addLink(s16, s23)
+ self.addLink(s16, s24)
+ self.addLink(s16, s25)
+ self.addLink(s17, s18)
+ self.addLink(s17, s19)
+ self.addLink(s17, s20)
+ self.addLink(s17, s21)
+ self.addLink(s17, s22)
+ self.addLink(s17, s23)
+ self.addLink(s17, s24)
+ self.addLink(s17, s25)
+ self.addLink(s18, s19)
+ self.addLink(s18, s20)
+ self.addLink(s18, s21)
+ self.addLink(s18, s22)
+ self.addLink(s18, s23)
+ self.addLink(s18, s24)
+ self.addLink(s18, s25)
+ self.addLink(s19, s20)
+ self.addLink(s19, s21)
+ self.addLink(s19, s22)
+ self.addLink(s19, s23)
+ self.addLink(s19, s24)
+ self.addLink(s19, s25)
+ self.addLink(s20, s21)
+ self.addLink(s20, s22)
+ self.addLink(s20, s23)
+ self.addLink(s20, s24)
+ self.addLink(s20, s25)
+ self.addLink(s21, s22)
+ self.addLink(s21, s23)
+ self.addLink(s21, s24)
+ self.addLink(s21, s25)
+ self.addLink(s22, s23)
+ self.addLink(s22, s24)
+ self.addLink(s22, s25)
+ self.addLink(s23, s24)
+ self.addLink(s23, s25)
+ self.addLink(s24, s25)
+
+topos = { 'chordal': ( lambda: chordalTopo() ) }
+
+# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
+def setupNetwork():
+ "Create network"
+ topo = chordalTopo()
+ #if controller_ip == '':
+ #controller_ip = '10.0.2.2';
+ # controller_ip = '127.0.0.1';
+ network = Mininet(topo=topo, switch=OVSSwitch,autoSetMacs=True, controller=None)
+ network.start()
+ CLI( network )
+ network.stop()
+
+if __name__ == '__main__':
+ setLogLevel('info')
+ #setLogLevel('debug')
+ setupNetwork()
diff --git a/TestON/tests/OnosCHO/Dependencies/topoSpine.py b/TestON/tests/OnosCHO/Dependencies/topoSpine.py
new file mode 100755
index 0000000..56fe745
--- /dev/null
+++ b/TestON/tests/OnosCHO/Dependencies/topoSpine.py
@@ -0,0 +1,436 @@
+#!/usr/bin/python
+
+from mininet.topo import Topo
+from mininet.net import Mininet
+from mininet.node import Controller, RemoteController, OVSController
+from mininet.node import CPULimitedHost, Host, Node
+from mininet.cli import CLI
+from mininet.log import setLogLevel, info
+from mininet.link import TCLink, Intf
+from subprocess import call
+from mininet.log import setLogLevel
+from mininet.util import dumpNodeConnections
+from mininet.node import ( UserSwitch, OVSSwitch, OVSLegacyKernelSwitch, IVSSwitch )
+
+class spineTopo( Topo ):
+
+ def __init__( self, **opts ):
+ "Create a topology."
+
+ # Initialize Topology
+ Topo.__init__( self, **opts )
+
+ # add nodes, Leaf switches
+ 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' )
+ s8 = self.addSwitch( 's8' )
+ s9 = self.addSwitch( 's9' )
+ s10 = self.addSwitch( 's10' )
+ s11 = self.addSwitch( 's11' )
+ s12 = self.addSwitch( 's12' )
+ s13 = self.addSwitch( 's13' )
+ s14 = self.addSwitch( 's14' )
+
+ # add nodes, Spine switches first...
+ s15 = self.addSwitch( 's15' )
+ s16 = self.addSwitch( 's16' )
+ s17 = self.addSwitch( 's17' )
+ s18 = self.addSwitch( 's18' )
+ s19 = self.addSwitch( 's19' )
+ s20 = self.addSwitch( 's20' )
+ s21 = self.addSwitch( 's21' )
+ s22 = self.addSwitch( 's22' )
+ s23 = self.addSwitch( 's23' )
+ s24 = self.addSwitch( 's24' )
+ s25 = self.addSwitch( 's25' )
+ s26 = self.addSwitch( 's26' )
+ s27 = self.addSwitch( 's27' )
+ s28 = self.addSwitch( 's28' )
+ s29 = self.addSwitch( 's29' )
+ s30 = self.addSwitch( 's30' )
+ s31 = self.addSwitch( 's31' )
+ s32 = self.addSwitch( 's32' )
+ s33 = self.addSwitch( 's33' )
+ s34 = self.addSwitch( 's34' )
+ s35 = self.addSwitch( 's35' )
+ s36 = self.addSwitch( 's36' )
+ s37 = self.addSwitch( 's37' )
+ s38 = self.addSwitch( 's38' )
+ s39 = self.addSwitch( 's39' )
+ s40 = self.addSwitch( 's40' )
+ s41 = self.addSwitch( 's41' )
+ s42 = self.addSwitch( 's42' )
+ s43 = self.addSwitch( 's43' )
+ s44 = self.addSwitch( 's44' )
+ s45 = self.addSwitch( 's45' )
+ s46 = self.addSwitch( 's46' )
+ s47 = self.addSwitch( 's47' )
+ s48 = self.addSwitch( 's48' )
+ s49 = self.addSwitch( 's49' )
+ s50 = self.addSwitch( 's50' )
+ s51 = self.addSwitch( 's51' )
+ s52 = self.addSwitch( 's52' )
+ s53 = self.addSwitch( 's53' )
+ s54 = self.addSwitch( 's54' )
+ s55 = self.addSwitch( 's55' )
+ s56 = self.addSwitch( 's56' )
+ s57 = self.addSwitch( 's57' )
+ s58 = self.addSwitch( 's58' )
+ s59 = self.addSwitch( 's59' )
+ s60 = self.addSwitch( 's60' )
+ s61 = self.addSwitch( 's61' )
+ s62 = self.addSwitch( 's62' )
+ s63 = self.addSwitch( 's63' )
+ s64 = self.addSwitch( 's64' )
+ s65 = self.addSwitch( 's65' )
+ s66 = self.addSwitch( 's66' )
+ s67 = self.addSwitch( 's67' )
+ s68 = self.addSwitch( 's68' )
+ s69 = self.addSwitch( 's69' )
+ s70 = self.addSwitch( 's70' )
+ s71 = self.addSwitch( 's71' )
+ s72 = self.addSwitch( 's72' )
+ s73 = self.addSwitch( 's73' )
+ s74 = self.addSwitch( 's74' )
+ s75 = self.addSwitch( 's75' )
+ s76 = self.addSwitch( 's76' )
+ s77 = self.addSwitch( 's77' )
+ s78 = self.addSwitch( 's78' )
+
+ # ... and now hosts
+ #s1_host = self.addHost( 'h1' )
+ #s2_host = self.addHost( 'h2' )
+ #s3_host = self.addHost( 'h3' )
+ #s4_host = self.addHost( 'h4' )
+ #s5_host = self.addHost( 'h5' )
+ #s6_host = self.addHost( 'h6' )
+ #s7_host = self.addHost( 'h7' )
+ #s8_host = self.addHost( 'h8' )
+ #s9_host = self.addHost( 'h9' )
+ #s10_host = self.addHost( 'h10' )
+ s11_host = self.addHost( 'h11' )
+ s12_host = self.addHost( 'h12' )
+ s13_host = self.addHost( 'h13' )
+ s14_host = self.addHost( 'h14' )
+ s15_host = self.addHost( 'h15' )
+ s16_host = self.addHost( 'h16' )
+ s17_host = self.addHost( 'h17' )
+ s18_host = self.addHost( 'h18' )
+ s19_host = self.addHost( 'h19' )
+ s20_host = self.addHost( 'h20' )
+ s21_host = self.addHost( 'h21' )
+ s22_host = self.addHost( 'h22' )
+ s23_host = self.addHost( 'h23' )
+ s24_host = self.addHost( 'h24' )
+ s25_host = self.addHost( 'h25' )
+ s26_host = self.addHost( 'h26' )
+ s27_host = self.addHost( 'h27' )
+ s28_host = self.addHost( 'h28' )
+ s29_host = self.addHost( 'h29' )
+ s30_host = self.addHost( 'h30' )
+ s31_host = self.addHost( 'h31' )
+ s32_host = self.addHost( 'h32' )
+ s33_host = self.addHost( 'h33' )
+ s34_host = self.addHost( 'h34' )
+ s35_host = self.addHost( 'h35' )
+ s36_host = self.addHost( 'h36' )
+ s37_host = self.addHost( 'h37' )
+ s38_host = self.addHost( 'h38' )
+ s39_host = self.addHost( 'h39' )
+ s40_host = self.addHost( 'h40' )
+ s41_host = self.addHost( 'h41' )
+ s42_host = self.addHost( 'h42' )
+ s43_host = self.addHost( 'h43' )
+ s44_host = self.addHost( 'h44' )
+ s45_host = self.addHost( 'h45' )
+ s46_host = self.addHost( 'h46' )
+ s47_host = self.addHost( 'h47' )
+ s48_host = self.addHost( 'h48' )
+ s49_host = self.addHost( 'h49' )
+ s50_host = self.addHost( 'h50' )
+ s51_host = self.addHost( 'h51' )
+ s52_host = self.addHost( 'h52' )
+ s53_host = self.addHost( 'h53' )
+ s54_host = self.addHost( 'h54' )
+ s55_host = self.addHost( 'h55' )
+ s56_host = self.addHost( 'h56' )
+ s57_host = self.addHost( 'h57' )
+ s58_host = self.addHost( 'h58' )
+ s59_host = self.addHost( 'h59' )
+ s60_host = self.addHost( 'h60' )
+ s61_host = self.addHost( 'h61' )
+ s62_host = self.addHost( 'h62' )
+ s63_host = self.addHost( 'h63' )
+ s64_host = self.addHost( 'h64' )
+ s65_host = self.addHost( 'h65' )
+ s66_host = self.addHost( 'h66' )
+ s67_host = self.addHost( 'h67' )
+ s68_host = self.addHost( 'h68' )
+ s69_host = self.addHost( 'h69' )
+ s70_host = self.addHost( 'h70' )
+ s71_host = self.addHost( 'h71' )
+ s72_host = self.addHost( 'h72' )
+ s73_host = self.addHost( 'h73' )
+ s74_host = self.addHost( 'h74' )
+ s75_host = self.addHost( 'h75' )
+ s76_host = self.addHost( 'h76' )
+ s77_host = self.addHost( 'h77' )
+ s78_host = self.addHost( 'h78' )
+
+ # add edges between switch and corresponding host
+ #self.addLink( s1 , s1_host )
+ #self.addLink( s2 , s2_host )
+ #self.addLink( s3 , s3_host )
+ #self.addLink( s4 , s4_host )
+ #self.addLink( s5 , s5_host )
+ #self.addLink( s6 , s6_host )
+ #self.addLink( s7 , s7_host )
+ #self.addLink( s8 , s8_host )
+ #self.addLink( s9 , s9_host )
+ #self.addLink( s10 , s10_host )
+ self.addLink( s11 , s11_host )
+ self.addLink( s12 , s12_host )
+ self.addLink( s13 , s13_host )
+ self.addLink( s14 , s14_host )
+ self.addLink( s15 , s15_host )
+ self.addLink( s16 , s16_host )
+ self.addLink( s17 , s17_host )
+ self.addLink( s18 , s18_host )
+ self.addLink( s19 , s19_host )
+ self.addLink( s20 , s20_host )
+ self.addLink( s21 , s21_host )
+ self.addLink( s22 , s22_host )
+ self.addLink( s23 , s23_host )
+ self.addLink( s24 , s24_host )
+ self.addLink( s25 , s25_host )
+ self.addLink( s26 , s26_host )
+ self.addLink( s27 , s27_host )
+ self.addLink( s28 , s28_host )
+ self.addLink( s29 , s29_host )
+ self.addLink( s30 , s30_host )
+ self.addLink( s31 , s31_host )
+ self.addLink( s32 , s32_host )
+ self.addLink( s33 , s33_host )
+ self.addLink( s34 , s34_host )
+ self.addLink( s35 , s35_host )
+ self.addLink( s36 , s36_host )
+ self.addLink( s37 , s37_host )
+ self.addLink( s38 , s38_host )
+ self.addLink( s39 , s39_host )
+ self.addLink( s40 , s40_host )
+ self.addLink( s41 , s41_host )
+ self.addLink( s42 , s42_host )
+ self.addLink( s43 , s43_host )
+ self.addLink( s44 , s44_host )
+ self.addLink( s45 , s45_host )
+ self.addLink( s46 , s46_host )
+ self.addLink( s47 , s47_host )
+ self.addLink( s48 , s48_host )
+ self.addLink( s49 , s49_host )
+ self.addLink( s50 , s50_host )
+ self.addLink( s51 , s51_host )
+ self.addLink( s52 , s52_host )
+ self.addLink( s53 , s53_host )
+ self.addLink( s54 , s54_host )
+ self.addLink( s55 , s55_host )
+ self.addLink( s56 , s56_host )
+ self.addLink( s57 , s57_host )
+ self.addLink( s58 , s58_host )
+ self.addLink( s59 , s59_host )
+ self.addLink( s60 , s60_host )
+ self.addLink( s61 , s61_host )
+ self.addLink( s62 , s62_host )
+ self.addLink( s63 , s63_host )
+ self.addLink( s64 , s64_host )
+ self.addLink( s65 , s65_host )
+ self.addLink( s66 , s66_host )
+ self.addLink( s67 , s67_host )
+ self.addLink( s68 , s68_host )
+ self.addLink( s69 , s69_host )
+ self.addLink( s70 , s70_host )
+ self.addLink( s71 , s71_host )
+ self.addLink( s72 , s72_host )
+ self.addLink( s73 , s73_host )
+ self.addLink( s74 , s74_host )
+ self.addLink( s75 , s75_host )
+ self.addLink( s76 , s76_host )
+ self.addLink( s77 , s77_host )
+ self.addLink( s78 , s78_host )
+
+ #info( '*** Add Leaf links\n')
+ self.addLink(s1, s9)
+ self.addLink(s2, s10)
+ self.addLink(s3, s9)
+ self.addLink(s4, s10)
+ self.addLink(s5, s9)
+ self.addLink(s6, s10)
+ self.addLink(s7, s9)
+ self.addLink(s8, s10)
+ self.addLink(s9, s11)
+ self.addLink(s9, s12)
+ self.addLink(s10, s13)
+ self.addLink(s10, s14)
+ self.addLink(s11, s12)
+ self.addLink(s13, s14)
+
+ #info( '*** Add Spine-1 links\n')
+ self.addLink(s15, s1)
+ self.addLink(s15, s2)
+ self.addLink(s16, s1)
+ self.addLink(s16, s2)
+ self.addLink(s17, s1)
+ self.addLink(s17, s2)
+ self.addLink(s18, s1)
+ self.addLink(s18, s2)
+ self.addLink(s19, s1)
+ self.addLink(s19, s2)
+ self.addLink(s20, s1)
+ self.addLink(s20, s2)
+ self.addLink(s21, s1)
+ self.addLink(s21, s2)
+ self.addLink(s22, s1)
+ self.addLink(s22, s2)
+ self.addLink(s23, s1)
+ self.addLink(s23, s2)
+ self.addLink(s24, s1)
+ self.addLink(s24, s2)
+ self.addLink(s25, s1)
+ self.addLink(s25, s2)
+ self.addLink(s26, s1)
+ self.addLink(s26, s2)
+ self.addLink(s27, s1)
+ self.addLink(s27, s2)
+ self.addLink(s28, s1)
+ self.addLink(s28, s2)
+ self.addLink(s29, s1)
+ self.addLink(s29, s2)
+ self.addLink(s30, s1)
+ self.addLink(s30, s2)
+
+ #info( '*** Add Spine-2 links\n')
+ self.addLink(s31, s3)
+ self.addLink(s31, s4)
+ self.addLink(s32, s3)
+ self.addLink(s32, s4)
+ self.addLink(s33, s3)
+ self.addLink(s33, s4)
+ self.addLink(s34, s3)
+ self.addLink(s34, s4)
+ self.addLink(s35, s3)
+ self.addLink(s35, s4)
+ self.addLink(s36, s3)
+ self.addLink(s36, s4)
+ self.addLink(s37, s3)
+ self.addLink(s37, s4)
+ self.addLink(s38, s3)
+ self.addLink(s38, s4)
+ self.addLink(s39, s3)
+ self.addLink(s39, s4)
+ self.addLink(s40, s3)
+ self.addLink(s40, s4)
+ self.addLink(s41, s3)
+ self.addLink(s41, s4)
+ self.addLink(s42, s3)
+ self.addLink(s42, s4)
+ self.addLink(s43, s3)
+ self.addLink(s43, s4)
+ self.addLink(s44, s3)
+ self.addLink(s44, s4)
+ self.addLink(s45, s3)
+ self.addLink(s45, s4)
+ self.addLink(s46, s3)
+ self.addLink(s46, s4)
+
+ #info( '*** Add Spine-3 links\n')
+ self.addLink(s47, s5)
+ self.addLink(s47, s6)
+ self.addLink(s48, s5)
+ self.addLink(s48, s6)
+ self.addLink(s49, s5)
+ self.addLink(s49, s6)
+ self.addLink(s50, s5)
+ self.addLink(s50, s6)
+ self.addLink(s51, s5)
+ self.addLink(s51, s6)
+ self.addLink(s52, s5)
+ self.addLink(s52, s6)
+ self.addLink(s53, s5)
+ self.addLink(s53, s6)
+ self.addLink(s54, s5)
+ self.addLink(s54, s6)
+ self.addLink(s55, s5)
+ self.addLink(s55, s6)
+ self.addLink(s56, s5)
+ self.addLink(s56, s6)
+ self.addLink(s57, s5)
+ self.addLink(s57, s6)
+ self.addLink(s58, s5)
+ self.addLink(s58, s6)
+ self.addLink(s59, s5)
+ self.addLink(s59, s6)
+ self.addLink(s60, s5)
+ self.addLink(s60, s6)
+ self.addLink(s61, s5)
+ self.addLink(s61, s6)
+ self.addLink(s62, s5)
+ self.addLink(s62, s6)
+
+ #info( '*** Add Spine-4 links\n')
+ self.addLink(s63, s7)
+ self.addLink(s63, s8)
+ self.addLink(s64, s7)
+ self.addLink(s64, s8)
+ self.addLink(s65, s7)
+ self.addLink(s65, s8)
+ self.addLink(s66, s7)
+ self.addLink(s66, s8)
+ self.addLink(s67, s7)
+ self.addLink(s67, s8)
+ self.addLink(s68, s7)
+ self.addLink(s68, s8)
+ self.addLink(s69, s7)
+ self.addLink(s69, s8)
+ self.addLink(s70, s7)
+ self.addLink(s70, s8)
+ self.addLink(s71, s7)
+ self.addLink(s71, s8)
+ self.addLink(s72, s7)
+ self.addLink(s72, s8)
+ self.addLink(s73, s7)
+ self.addLink(s73, s8)
+ self.addLink(s74, s7)
+ self.addLink(s74, s8)
+ self.addLink(s75, s7)
+ self.addLink(s75, s8)
+ self.addLink(s76, s7)
+ self.addLink(s76, s8)
+ self.addLink(s77, s7)
+ self.addLink(s77, s8)
+ self.addLink(s78, s7)
+ self.addLink(s78, s8)
+
+topos = { 'spine': ( lambda: spineTopo() ) }
+
+# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
+def setupNetwork():
+ "Create network"
+ topo = spineTopo()
+ #if controller_ip == '':
+ #controller_ip = '10.0.2.2';
+ # controller_ip = '127.0.0.1';
+ network = Mininet(topo=topo, switch=OVSSwitch, link=TCLink, autoSetMacs = True, controller=None)
+ network.start()
+ CLI( network )
+ network.stop()
+
+if __name__ == '__main__':
+ setLogLevel('info')
+ #setLogLevel('debug')
+ setupNetwork()
+
diff --git a/TestON/tests/OnosCHO/OnosCHO.params b/TestON/tests/OnosCHO/OnosCHO.params
new file mode 100644
index 0000000..a630a2c
--- /dev/null
+++ b/TestON/tests/OnosCHO/OnosCHO.params
@@ -0,0 +1,94 @@
+<PARAMS>
+ # 1,20,3,[40,5,60,70,80,10,90,71,81,10,93,10]*50,21,3,[41,5,61,72,82,10,91,73,83,10,94,10]*50,22,3,[42,5,62,10,92,10,95,10,98,10]*50
+ # 1. Starts ONOS cluster with 5 nodes
+ # 20. Starts Att Topology
+ # 21. Starts Chordal Topology
+ # 22. Starts Spine-Leaf Topology
+ # 3. Checks the consistency of ONOS and Mininet's topologies
+ # 4X. Reactive forwarding | host discovery
+ # 5. ONOS Topology verification
+ # 6X. host intents
+ # 7X. Bring random links down( Unique for each topology)
+ # 8X. Bring random links back up
+ # 9X Point,Multi-single,Single-Multi Intents
+
+ <testcases>1,20,3,40,5,60</testcases>
+ <ENV>
+ <cellName>choTest3</cellName>
+ <debugWait>300</debugWait>
+ </ENV>
+ <GIT>
+ #autoPull 'on' or 'off'
+ <autoPull>off</autoPull>
+ <branch>master</branch>
+ </GIT>
+ <TOPO1>
+ <topo>~/mininet/custom/topoAtt.py</topo>
+ <numSwitches>25</numSwitches>
+ <numHosts>25</numHosts>
+ <numLinks>114</numLinks>
+ <numPaths>1</numPaths>
+ </TOPO1>
+
+ <TOPO2>
+ <topo>~/mininet/custom/topoChordal.py</topo>
+ <numSwitches>25</numSwitches>
+ <numHosts>25</numHosts>
+ <numLinks>600</numLinks>
+ <numPaths>1</numPaths>
+ </TOPO2>
+
+ <TOPO3>
+ <topo>~/mininet/custom/topoSpine.py</topo>
+ <numSwitches>78</numSwitches>
+ <numHosts>68</numHosts>
+ <numLinks>284</numLinks>
+ <numPaths>1</numPaths>
+ </TOPO3>
+
+ <CTRL>
+ <numCtrl>3</numCtrl>
+ <ip1>OC1</ip1>
+ <port1>6633</port1>
+ <ip2>OC2</ip2>
+ <port2>6633</port2>
+ <ip3>OC3</ip3>
+ <port3>6633</port3>
+ </CTRL>
+
+ <HOSTS>
+ <startMAC>00:00:00:00:00:01</startMAC>
+ <endMAC>00:00:00:00:00:19</endMAC>
+ </HOSTS>
+
+ <ATTCORELINKS>
+ <toggleLinks>1</toggleLinks>
+
+ <linkS3a>s3</linkS3a>
+ <linkS3b>s1,s4,s7,s10,s16,s17,s18,s21,s22</linkS3b>
+ #######s1,s4,s7,s10,s16,s17,s18,s21,s22########
+
+ <linkS14a>s14</linkS14a>
+ <linkS14b>s6,s9,s10,s11,s12,s13,s16,s17,s23</linkS14b>
+ ########s6,s9,s10,s11,s12,s13,s16,s17,s18,s23########
+
+ <linkS18a>s18</linkS18a>
+ <linkS18b>s14,s16,s17,s19,s20,s21,s22,s23</linkS18b>
+ #######s3,s14,s16,s17,s19,s20,s21,s22,s23########
+ </ATTCORELINKS>
+
+ <SPINECORELINKS>
+ <linkS9>s9</linkS9>
+ <linkS9top>s1,s3,s5,s7</linkS9top>
+ <linkS9bot>s11,s12</linkS9bot>
+ <linkS10>s10</linkS10>
+ <linkS10top>s2,s4,s6,s8</linkS10top>
+ <linkS10bot>s13,s14</linkS10bot>
+ </SPINECORELINKS>
+
+ <timers>
+ <LinkDiscovery>10</LinkDiscovery>
+ <SwitchDiscovery>10</SwitchDiscovery>
+ </timers>
+
+</PARAMS>
diff --git a/TestON/tests/OnosCHO/OnosCHO.py b/TestON/tests/OnosCHO/OnosCHO.py
new file mode 100644
index 0000000..8899845
--- /dev/null
+++ b/TestON/tests/OnosCHO/OnosCHO.py
@@ -0,0 +1,2380 @@
+import sys
+import os
+import re
+import time
+import json
+import itertools
+
+
+class OnosCHO:
+
+ def __init__( self ):
+ self.default = ''
+
+ def CASE1( self, main ):
+ """
+ Startup sequence:
+ git pull
+ mvn clean install
+ onos-package
+ apply cell <name>
+ onos-verify-cell
+ onos-uninstall
+ onos-install
+ onos-start-cli
+ """
+ import time
+
+ global intentState
+ main.threadID = 0
+ main.pingTimeout = 300
+ main.numCtrls = main.params[ 'CTRL' ][ 'numCtrl' ]
+ cell_name = main.params[ 'ENV' ][ 'cellName' ]
+ git_pull = main.params[ 'GIT' ][ 'autoPull' ]
+ git_branch = main.params[ 'GIT' ][ 'branch' ]
+ main.newTopo = ""
+ main.CLIs = []
+ main.onosIPs = []
+ main.onosPorts = []
+
+ for i in range( 1, int(main.numCtrls) + 1 ):
+ main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
+ main.onosPorts.append( main.params[ 'CTRL' ][ 'port' + str( i ) ] )
+
+ main.case( "Set up test environment" )
+ main.log.report( "Set up test environment" )
+ main.log.report( "_______________________" )
+
+ main.step( "Git checkout and pull " + git_branch )
+ if git_pull == 'on':
+ checkout_result = main.ONOSbench.gitCheckout( git_branch )
+ pull_result = main.ONOSbench.gitPull()
+ cp_result = ( checkout_result and pull_result )
+ else:
+ checkout_result = main.TRUE
+ pull_result = main.TRUE
+ main.log.info( "Skipped git checkout and pull" )
+ cp_result = ( checkout_result and pull_result )
+ utilities.assert_equals( expect=main.TRUE, actual=cp_result,
+ onpass="Test step PASS",
+ onfail="Test step FAIL" )
+
+ main.step( "mvn clean & install" )
+ if git_pull == 'on':
+ mvn_result = main.ONOSbench.cleanInstall()
+ utilities.assert_equals( expect=main.TRUE, actual=mvn_result,
+ onpass="Test step PASS",
+ onfail="Test step FAIL" )
+ else:
+ mvn_result = main.TRUE
+ main.log.info("Skipped mvn clean install as git pull is disabled in params file")
+
+ main.ONOSbench.getVersion( report=True )
+
+ main.step( "Apply Cell environment for ONOS" )
+ cell_result = main.ONOSbench.setCell( cell_name )
+ onosNodes = main.ONOSbench.getOnosIPfromCell()
+ main.onosIPs = onosNodes
+ utilities.assert_equals( expect=main.TRUE, actual=cell_result,
+ onpass="Test step PASS",
+ onfail="Test step FAIL" )
+
+ main.step( "Create ONOS package" )
+ packageResult = main.ONOSbench.onosPackage()
+ utilities.assert_equals( expect=main.TRUE, actual=packageResult,
+ onpass="Test step PASS",
+ onfail="Test step FAIL" )
+
+ main.step( "Uninstall ONOS package on all Nodes" )
+ uninstallResult = main.TRUE
+ for i in range( int( main.numCtrls ) ):
+ main.log.info( "Uninstalling package on ONOS Node IP: " + main.onosIPs[i] )
+ u_result = main.ONOSbench.onosUninstall( main.onosIPs[i] )
+ utilities.assert_equals( expect=main.TRUE, actual=u_result,
+ onpass="Test step PASS",
+ onfail="Test step FAIL" )
+ uninstallResult = ( uninstallResult and u_result )
+
+ main.step( "Install ONOS package on all Nodes" )
+ installResult = main.TRUE
+ for i in range( int( main.numCtrls ) ):
+ main.log.info( "Intsalling package on ONOS Node IP: " + main.onosIPs[i] )
+ i_result = main.ONOSbench.onosInstall( node=main.onosIPs[i] )
+ utilities.assert_equals( expect=main.TRUE, actual=i_result,
+ onpass="Test step PASS",
+ onfail="Test step FAIL" )
+ installResult = ( installResult and i_result )
+
+ main.step( "Verify ONOS nodes UP status" )
+ statusResult = main.TRUE
+ for i in range( int( main.numCtrls ) ):
+ main.log.info( "ONOS Node " + main.onosIPs[i] + " status:" )
+ onos_status = main.ONOSbench.onosStatus( node=main.onosIPs[i] )
+ utilities.assert_equals( expect=main.TRUE, actual=onos_status,
+ onpass="Test step PASS",
+ onfail="Test step FAIL" )
+ statusResult = ( statusResult and onos_status )
+
+ main.step( "Start ONOS CLI on all nodes" )
+ cliResult = main.TRUE
+ karafTimeout = "3600000"
+ main.log.step(" Start ONOS cli using thread ")
+ startCliResult = main.TRUE
+ pool = []
+ time1 = time.time()
+ for i in range( int( main.numCtrls) ):
+ t = main.Thread( target=main.CLIs[i].startOnosCli,
+ threadID=main.threadID,
+ name="startOnosCli",
+ args=[ main.onosIPs[i], karafTimeout ] )
+ pool.append(t)
+ t.start()
+ main.threadID = main.threadID + 1
+ for t in pool:
+ 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()
+ main.exit()
+ else:
+ main.log.info("Successful CLI startup")
+ startCliResult = main.TRUE
+ case1Result = installResult and uninstallResult and statusResult and startCliResult
+ time.sleep(30)
+ main.log.info("Time for connecting to CLI: %2f seconds" %(time2-time1))
+ utilities.assert_equals( expect=main.TRUE, actual=case1Result,
+ onpass="Set up test environment PASS",
+ onfail="Set up test environment FAIL" )
+
+ def CASE20( self, main ):
+ """
+ This test script Loads a new Topology (Att) on CHO setup and balances all switches
+ """
+ import re
+ import time
+ import copy
+
+ main.numMNswitches = int ( main.params[ 'TOPO1' ][ 'numSwitches' ] )
+ main.numMNlinks = int ( main.params[ 'TOPO1' ][ 'numLinks' ] )
+ main.numMNhosts = int ( main.params[ 'TOPO1' ][ 'numHosts' ] )
+ main.pingTimeout = 300
+ main.log.report(
+ "Load Att topology and Balance all Mininet switches across controllers" )
+ main.log.report(
+ "________________________________________________________________________" )
+ 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']:
+ stopStatus = main.Mininet1.stopNet( fileName = "topoSpine" )
+
+ 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(
+ sw="s" + str( i ),
+ ip=main.onosIPs,
+ port=main.onosPorts )
+
+ switch_mastership = main.TRUE
+ for i in range( 1, ( main.numMNswitches + 1 ) ):
+ response = main.Mininet1.getSwController( "s" + str( i ) )
+ print( "Response is " + str( response ) )
+ if re.search( "tcp:" + main.onosIPs[0], response ):
+ switch_mastership = switch_mastership and main.TRUE
+ else:
+ switch_mastership = main.FALSE
+
+ if switch_mastership == main.TRUE:
+ main.log.report( "Controller assignment successfull" )
+ else:
+ main.log.report( "Controller assignment failed" )
+
+ time.sleep(30) # waiting here to make sure topology converges across all nodes
+
+ main.step( "Balance devices across controllers" )
+ balanceResult = main.ONOScli1.balanceMasters()
+ # giving some breathing time for ONOS to complete re-balance
+ time.sleep( 5 )
+
+ topology_output = main.ONOScli1.topology()
+ topology_result = main.ONOSbench.getTopology( topology_output )
+ case2Result = ( switch_mastership and startStatus )
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case2Result,
+ onpass="Starting new Att topology test PASS",
+ onfail="Starting new Att topology test FAIL" )
+
+ def CASE21( self, main ):
+ """
+ This test script Loads a new Topology (Chordal) on CHO setup and balances all switches
+ """
+ import re
+ import time
+ import copy
+
+ main.newTopo = main.params['TOPO2']['topo']
+ main.numMNswitches = int ( main.params[ 'TOPO2' ][ 'numSwitches' ] )
+ main.numMNlinks = int ( main.params[ 'TOPO2' ][ 'numLinks' ] )
+ main.numMNhosts = int ( main.params[ 'TOPO2' ][ 'numHosts' ] )
+ main.pingTimeout = 300
+ main.log.report(
+ "Load Chordal topology and Balance all Mininet switches across controllers" )
+ main.log.report(
+ "________________________________________________________________________" )
+ main.case(
+ "Assign and Balance all Mininet switches across controllers" )
+
+ main.step( "Stop any previous Mininet network topology" )
+ stopStatus = main.Mininet1.stopNet(fileName = "topoAtt" )
+
+ main.step( "Start Mininet with Chordal topology" )
+ 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(
+ sw="s" + str( i ),
+ ip=main.onosIPs,
+ port=main.onosPorts )
+
+ switch_mastership = main.TRUE
+ for i in range( 1, ( main.numMNswitches + 1 ) ):
+ response = main.Mininet1.getSwController( "s" + str( i ) )
+ print( "Response is " + str( response ) )
+ if re.search( "tcp:" + main.onosIPs[0], response ):
+ switch_mastership = switch_mastership and main.TRUE
+ else:
+ switch_mastership = main.FALSE
+
+ if switch_mastership == main.TRUE:
+ 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
+ time.sleep( 5 )
+
+ case21Result = switch_mastership
+ time.sleep(30)
+ utilities.assert_equals(
+ expect=main.TRUE,
+ 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
+ """
+ import re
+ import time
+ import copy
+
+ main.newTopo = main.params['TOPO3']['topo']
+ main.numMNswitches = int ( main.params[ 'TOPO3' ][ 'numSwitches' ] )
+ 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(
+ "________________________________________________________________________" )
+ main.case(
+ "Assign and Balance all Mininet switches across controllers" )
+ main.step( "Stop any previous Mininet network topology" )
+ stopStatus = main.Mininet1.stopNet(fileName = "topoChordal" )
+ main.step( "Start Mininet with Spine topology" )
+ startStatus = main.Mininet1.startNet(topoFile = main.newTopo)
+ time.sleep(60)
+ main.step( "Assign switches to controllers" )
+
+ for i in range( 1, ( main.numMNswitches + 1 ) ): # 1 to ( num of switches +1 )
+ main.Mininet1.assignSwController(
+ sw="s" + str( i ),
+ ip=main.onosIPs,
+ port=main.onosPorts )
+
+ switch_mastership = main.TRUE
+ for i in range( 1, ( main.numMNswitches + 1 ) ):
+ response = main.Mininet1.getSwController( "s" + str( i ) )
+ print( "Response is " + str( response ) )
+ if re.search( "tcp:" + main.onosIPs[0], response ):
+ switch_mastership = switch_mastership and main.TRUE
+ else:
+ switch_mastership = main.FALSE
+
+ if switch_mastership == main.TRUE:
+ main.log.report( "Controller assignment successfull" )
+ else:
+ main.log.report( "Controller assignment failed" )
+ time.sleep( 5 )
+
+ main.step( "Balance devices across controllers" )
+ for i in range( int( main.numCtrls ) ):
+ balanceResult = main.ONOScli1.balanceMasters()
+ # giving some breathing time for ONOS to complete re-balance
+ time.sleep( 3 )
+
+ case22Result = switch_mastership
+ time.sleep(60)
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case22Result,
+ onpass="Starting new Spine topology test PASS",
+ onfail="Starting new Spine topology test FAIL" )
+
+ def CASE3( self, main ):
+ """
+ This Test case will be extended to collect and store more data related
+ ONOS state.
+ """
+ import re
+ import copy
+ main.deviceDPIDs = []
+ main.hostMACs = []
+ main.deviceLinks = []
+ main.deviceActiveLinksCount = []
+ main.devicePortsEnabledCount = []
+
+ main.log.report(
+ "Collect and Store topology details from ONOS before running any Tests" )
+ main.log.report(
+ "____________________________________________________________________" )
+ main.case( "Collect and Store Topology Details from ONOS" )
+ main.step( "Collect and store current number of switches and links" )
+ topology_output = main.ONOScli1.topology()
+ topology_result = main.ONOSbench.getTopology( topology_output )
+ numOnosDevices = topology_result[ 'devices' ]
+ numOnosLinks = topology_result[ 'links' ]
+ topoResult = main.TRUE
+
+ if ( ( main.numMNswitches == int(numOnosDevices) ) and ( main.numMNlinks == int(numOnosLinks) ) ):
+ main.step( "Store Device DPIDs" )
+ for i in range( 1, (main.numMNswitches+1) ):
+ main.deviceDPIDs.append( "of:00000000000000" + format( i, '02x' ) )
+ print "Device DPIDs in Store: \n", str( main.deviceDPIDs )
+
+ main.step( "Store Host MACs" )
+ for i in range( 1, ( main.numMNhosts + 1 ) ):
+ main.hostMACs.append( "00:00:00:00:00:" + format( i, '02x' ) + "/-1" )
+ print "Host MACs in Store: \n", str( main.hostMACs )
+ main.MACsDict = {}
+ print "Creating dictionary of DPID and HostMacs"
+ for i in range(len(main.hostMACs)):
+ main.MACsDict[main.deviceDPIDs[i]] = main.hostMACs[i].split('/')[0]
+ print main.MACsDict
+ main.step( "Collect and store all Devices Links" )
+ linksResult = main.ONOScli1.links( jsonFormat=False )
+ ansi_escape = re.compile( r'\x1b[^m]*m' )
+ linksResult = ansi_escape.sub( '', linksResult )
+ linksResult = linksResult.replace( " links", "" ).replace( "\r\r", "" )
+ linksResult = linksResult.splitlines()
+ main.deviceLinks = copy.copy( linksResult )
+ print "Device Links Stored: \n", str( main.deviceLinks )
+ # this will be asserted to check with the params provided count of
+ # links
+ print "Length of Links Store", len( main.deviceLinks )
+
+ main.step( "Collect and store each Device ports enabled Count" )
+ time1 = time.time()
+ for i in xrange(1,(main.numMNswitches + 1), int( main.numCtrls ) ):
+ pool = []
+ for cli in main.CLIs:
+ if i >= main.numMNswitches + 1:
+ break
+ dpid = "of:00000000000000" + format( i,'02x' )
+ t = main.Thread(target = cli.getDevicePortsEnabledCount,threadID = main.threadID, name = "getDevicePortsEnabledCount",args = [dpid])
+ t.start()
+ pool.append(t)
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ portResult = thread.result
+ main.devicePortsEnabledCount.append( portResult )
+ print "Device Enabled Port Counts Stored: \n", str( main.devicePortsEnabledCount )
+ time2 = time.time()
+ main.log.info("Time for counting enabled ports of the switches: %2f seconds" %(time2-time1))
+
+ 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:
+ if i >= main.numMNswitches + 1:
+ break
+ dpid = "of:00000000000000" + format( i,'02x' )
+ t = main.Thread( target = cli.getDeviceLinksActiveCount,
+ threadID = main.threadID,
+ name = "getDevicePortsEnabledCount",
+ args = [dpid])
+ t.start()
+ pool.append(t)
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ linkCountResult = thread.result
+ main.deviceActiveLinksCount.append( linkCountResult )
+ print "Device Active Links Count Stored: \n", str( main.deviceActiveLinksCount )
+ time2 = time.time()
+ 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" %
+ ( 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
+ main.cleanup()
+ main.exit()
+
+ # just returning TRUE for now as this one just collects data
+ case3Result = topoResult
+ utilities.assert_equals( expect=main.TRUE, actual=case3Result,
+ onpass="Saving ONOS topology data test PASS",
+ onfail="Saving ONOS topology data test FAIL" )
+
+ def CASE40( self, main ):
+ """
+ Verify Reactive forwarding (Att Topology)
+ """
+ import re
+ import copy
+ import time
+ main.log.report( "Verify Reactive forwarding (Att Topology)" )
+ main.log.report( "______________________________________________" )
+ main.case( "Enable Reactive forwarding and Verify ping all" )
+ main.step( "Enable Reactive forwarding" )
+ installResult = main.TRUE
+ # Activate fwd app
+ appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+ appCheck = main.TRUE
+ pool = []
+ for cli in main.CLIs:
+ t = main.Thread( target=cli.appToIDCheck,
+ name="appToIDCheck-" + str( i ),
+ args=[] )
+ pool.append( t )
+ t.start()
+ for t in pool:
+ t.join()
+ appCheck = appCheck and t.result
+ utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+ onpass="App Ids seem to be correct",
+ onfail="Something is wrong with app Ids" )
+ 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" )
+ ping_result = main.FALSE
+ time1 = time.time()
+ ping_result = main.Mininet1.pingall( timeout=main.pingTimeout )
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+
+ if ping_result == main.TRUE:
+ main.log.report( "Pingall Test in Reactive mode successful" )
+ else:
+ 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 = []
+ for cli in main.CLIs:
+ t = main.Thread( target=cli.appToIDCheck,
+ name="appToIDCheck-" + str( i ),
+ args=[] )
+ pool.append( t )
+ t.start()
+
+ for t in pool:
+ t.join()
+ appCheck = appCheck and t.result
+ utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+ onpass="App Ids seem to be correct",
+ onfail="Something is wrong with app Ids" )
+ if appCheck != main.TRUE:
+ main.log.warn( main.CLIs[0].apps() )
+ main.log.warn( main.CLIs[0].appIDs() )
+
+ # Waiting for reative flows to be cleared.
+ time.sleep( 30 )
+ case40Result = installResult and uninstallResult and ping_result
+ utilities.assert_equals( expect=main.TRUE, actual=case40Result,
+ onpass="Reactive Mode Pingall test PASS",
+ onfail="Reactive Mode Pingall test FAIL" )
+
+ def CASE41( self, main ):
+ """
+ Verify Reactive forwarding (Chordal Topology)
+ """
+ import re
+ import copy
+ import time
+ main.log.report( "Verify Reactive forwarding (Chordal Topology)" )
+ main.log.report( "______________________________________________" )
+ main.case( "Enable Reactive forwarding and Verify ping all" )
+ main.step( "Enable Reactive forwarding" )
+ installResult = main.TRUE
+ # Activate fwd app
+ appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+
+ appCheck = main.TRUE
+ pool = []
+ for cli in main.CLIs:
+ t = main.Thread( target=cli.appToIDCheck,
+ name="appToIDCheck-" + str( i ),
+ args=[] )
+ pool.append( t )
+ t.start()
+ for t in pool:
+ t.join()
+ appCheck = appCheck and t.result
+ utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+ onpass="App Ids seem to be correct",
+ onfail="Something is wrong with app Ids" )
+ 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" )
+ ping_result = main.FALSE
+ time1 = time.time()
+ ping_result = main.Mininet1.pingall( timeout=main.pingTimeout )
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+
+ if ping_result == main.TRUE:
+ main.log.report( "Pingall Test in Reactive mode successful" )
+ else:
+ 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 = []
+ for cli in main.CLIs:
+ t = main.Thread( target=cli.appToIDCheck,
+ name="appToIDCheck-" + str( i ),
+ args=[] )
+ pool.append( t )
+ t.start()
+
+ for t in pool:
+ t.join()
+ appCheck = appCheck and t.result
+ utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+ onpass="App Ids seem to be correct",
+ onfail="Something is wrong with app Ids" )
+ if appCheck != main.TRUE:
+ main.log.warn( main.CLIs[0].apps() )
+ main.log.warn( main.CLIs[0].appIDs() )
+
+ # Waiting for reative flows to be cleared.
+ time.sleep( 30 )
+ case41Result = installResult and uninstallResult and ping_result
+ utilities.assert_equals( expect=main.TRUE, actual=case41Result,
+ onpass="Reactive Mode Pingall test PASS",
+ onfail="Reactive Mode Pingall test FAIL" )
+
+ def CASE42( self, main ):
+ """
+ Verify Reactive forwarding (Spine Topology)
+ """
+ import re
+ import copy
+ import time
+ main.log.report( "Verify Reactive forwarding (Spine Topology)" )
+ main.log.report( "______________________________________________" )
+ main.case( "Enable Reactive forwarding and Verify ping all" )
+ main.step( "Enable Reactive forwarding" )
+ installResult = main.TRUE
+ # Activate fwd app
+ appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+
+ appCheck = main.TRUE
+ pool = []
+ for cli in main.CLIs:
+ t = main.Thread( target=cli.appToIDCheck,
+ name="appToIDCheck-" + str( i ),
+ args=[] )
+ pool.append( t )
+ t.start()
+ for t in pool:
+ t.join()
+ appCheck = appCheck and t.result
+ utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+ onpass="App Ids seem to be correct",
+ onfail="Something is wrong with app Ids" )
+ 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" )
+ ping_result = main.FALSE
+ time1 = time.time()
+ ping_result = main.Mininet1.pingall( timeout=main.pingTimeout )
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+
+ if ping_result == main.TRUE:
+ main.log.report( "Pingall Test in Reactive mode successful" )
+ else:
+ 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 = []
+ for cli in main.CLIs:
+ t = main.Thread( target=cli.appToIDCheck,
+ name="appToIDCheck-" + str( i ),
+ args=[] )
+ pool.append( t )
+ t.start()
+
+ for t in pool:
+ t.join()
+ appCheck = appCheck and t.result
+ utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+ onpass="App Ids seem to be correct",
+ onfail="Something is wrong with app Ids" )
+ if appCheck != main.TRUE:
+ main.log.warn( main.CLIs[0].apps() )
+ main.log.warn( main.CLIs[0].appIDs() )
+
+ # Waiting for reative flows to be cleared.
+ time.sleep( 30 )
+ case42Result = installResult and uninstallResult and ping_result
+ utilities.assert_equals( expect=main.TRUE, actual=case42Result,
+ onpass="Reactive Mode Pingall test PASS",
+ onfail="Reactive Mode Pingall test FAIL" )
+
+ def CASE5( self, main ):
+ """
+ Compare current ONOS topology with reference data
+ """
+ import re
+
+ devicesDPIDTemp = []
+ hostMACsTemp = []
+ deviceLinksTemp = []
+ deviceActiveLinksCountTemp = []
+ devicePortsEnabledCountTemp = []
+
+ main.log.report(
+ "Compare ONOS topology with reference data in Stores" )
+ main.log.report( "__________________________________________________" )
+ main.case( "Compare ONOS topology with reference data" )
+
+ main.step( "Compare current Device ports enabled with reference" )
+ time1 = time.time()
+ for i in xrange( 1,(main.numMNswitches + 1), int( main.numCtrls ) ):
+ pool = []
+ for cli in main.CLIs:
+ if i >= main.numMNswitches + 1:
+ break
+ dpid = "of:00000000000000" + format( i,'02x' )
+ t = main.Thread(target = cli.getDevicePortsEnabledCount,
+ threadID = main.threadID,
+ name = "getDevicePortsEnabledCount",
+ args = [dpid])
+ t.start()
+ pool.append(t)
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ portResult = thread.result
+ #portTemp = re.split( r'\t+', portResult )
+ #portCount = portTemp[ 1 ].replace( "\r\r\n\x1b[32m", "" )
+ devicePortsEnabledCountTemp.append( portResult )
+
+ 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 ) )
+ main.log.info (
+ "Device Enabled ports ACTUAL: %s" %
+ str( devicePortsEnabledCountTemp ) )
+
+ if ( cmp( main.devicePortsEnabledCount,
+ devicePortsEnabledCountTemp ) == 0 ):
+ stepResult1 = main.TRUE
+ else:
+ stepResult1 = main.FALSE
+
+ main.step( "Compare Device active links with reference" )
+ time1 = time.time()
+ for i in xrange( 1, ( main.numMNswitches + 1) , int( main.numCtrls ) ):
+ pool = []
+ for cli in main.CLIs:
+ if i >= main.numMNswitches + 1:
+ break
+ dpid = "of:00000000000000" + format( i,'02x' )
+ t = main.Thread(target = cli.getDeviceLinksActiveCount,
+ threadID = main.threadID,
+ name = "getDeviceLinksActiveCount",
+ args = [dpid])
+ t.start()
+ pool.append(t)
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ linkCountResult = thread.result
+ #linkCountTemp = re.split( r'\t+', linkCountResult )
+ #linkCount = linkCountTemp[ 1 ].replace( "\r\r\n\x1b[32m", "" )
+ deviceActiveLinksCountTemp.append( linkCountResult )
+
+ time2 = time.time()
+ main.log.info("Time for counting all enabled links of the switches: %2f seconds" %(time2-time1))
+ main.log.info (
+ "Device Active links EXPECTED: %s" %
+ str( main.deviceActiveLinksCount ) )
+ main.log.info (
+ "Device Active links ACTUAL: %s" % str( deviceActiveLinksCountTemp ) )
+ if ( cmp( main.deviceActiveLinksCount, deviceActiveLinksCountTemp ) == 0 ):
+ stepResult2 = main.TRUE
+ else:
+ stepResult2 = main.FALSE
+
+ """
+ place holder for comparing devices, hosts, paths and intents if required.
+ Links and ports data would be incorrect with out devices anyways.
+ """
+ case5Result = ( stepResult1 and stepResult2 )
+ utilities.assert_equals( expect=main.TRUE, actual=case5Result,
+ onpass="Compare Topology test PASS",
+ onfail="Compare Topology test FAIL" )
+
+ def CASE60( self ):
+ """
+ Install 300 host intents and verify ping all (Att Topology)
+ """
+ main.log.report( "Add 300 host intents and verify pingall (Att Topology)" )
+ main.log.report( "_______________________________________" )
+ import itertools
+ import time
+ main.case( "Install 300 host intents" )
+ main.step( "Add host Intents" )
+ intentResult = main.TRUE
+ 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:
+ if i >= len( hostCombos ):
+ break
+ t = main.Thread( target=cli.addHostIntent,
+ threadID=main.threadID,
+ name="addHostIntent",
+ args=[hostCombos[i][0],hostCombos[i][1]])
+ pool.append(t)
+ t.start()
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ intentIdList.append(thread.result)
+ time2 = time.time()
+ main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
+
+ intentResult = main.TRUE
+ intentsJson = main.ONOScli2.intents()
+ getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+ intentsJson = intentsJson)
+ print "len of intent ID", str(len(intentIdList))
+ print "len of intent state results", str(len(getIntentStateResult))
+ print getIntentStateResult
+ # Takes awhile for all the onos to get the intents
+ time.sleep( 30 )
+ """intentState = main.TRUE
+ for i in getIntentStateResult:
+ if getIntentStateResult.get( 'state' ) != 'INSTALLED':
+ """
+
+
+ main.step( "Verify Ping across all hosts" )
+ pingResult = main.FALSE
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ case60Result = ( intentResult and pingResult )
+ waitForDebug = int (main.params[ 'ENV' ][ 'debugWait' ])
+ time.sleep(waitForDebug)
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case60Result,
+ onpass="Install 300 Host Intents and Ping All test PASS",
+ onfail="Install 300 Host Intents and Ping All test FAIL" )
+
+ def CASE61( self ):
+ """
+ Install 600 host intents and verify ping all for Chordal Topology
+ """
+ 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 ) )
+
+ intentIdList = []
+ time1 = time.time()
+
+ for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
+ pool = []
+ for cli in main.CLIs:
+ if i >= len( hostCombos ):
+ break
+ t = main.Thread( target=cli.addHostIntent,
+ threadID=main.threadID,
+ name="addHostIntent",
+ args=[hostCombos[i][0],hostCombos[i][1]])
+ pool.append(t)
+ t.start()
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ intentIdList.append(thread.result)
+ time2 = time.time()
+ main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
+ intentResult = main.TRUE
+ intentsJson = main.ONOScli2.intents()
+ getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+ intentsJson = intentsJson)
+ print getIntentStateResult
+
+ main.step( "Verify Ping across all hosts" )
+ pingResult = main.FALSE
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ case14Result = ( intentResult and pingResult )
+
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case14Result,
+ onpass="Install 300 Host Intents and Ping All test PASS",
+ onfail="Install 300 Host Intents and Ping All test FAIL" )
+
+ def CASE62( self ):
+ """
+ Install 2278 host intents and verify ping all for Spine Topology
+ """
+ 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 ) )
+ main.pingTimeout = 300
+ intentIdList = []
+ time1 = time.time()
+ for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
+ pool = []
+ for cli in main.CLIs:
+ if i >= len( hostCombos ):
+ break
+ t = main.Thread( target=cli.addHostIntent,
+ threadID=main.threadID,
+ name="addHostIntent",
+ args=[hostCombos[i][0],hostCombos[i][1]])
+ pool.append(t)
+ t.start()
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ intentIdList.append(thread.result)
+ time2 = time.time()
+ main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
+ intentResult = main.TRUE
+ intentsJson = main.ONOScli2.intents()
+ getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+ intentsJson = intentsJson)
+ print getIntentStateResult
+
+ main.step( "Verify Ping across all hosts" )
+ pingResult = main.FALSE
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ case15Result = ( intentResult and pingResult )
+
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case15Result,
+ onpass="Install 2278 Host Intents and Ping All test PASS",
+ onfail="Install 2278 Host Intents and Ping All test FAIL" )
+
+ def CASE70( self, main ):
+ """
+ Randomly bring some core links down and verify ping all ( Host Intents-Att Topo)
+ """
+ import random
+ main.randomLink1 = []
+ main.randomLink2 = []
+ main.randomLink3 = []
+ link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
+ link1End2 = main.params[ 'ATTCORELINKS' ][ 'linkS3b' ].split( ',' )
+ link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
+ link2End2 = main.params[ 'ATTCORELINKS' ][ 'linkS14b' ].split( ',' )
+ link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
+ link3End2 = main.params[ 'ATTCORELINKS' ][ 'linkS18b' ].split( ',' )
+ switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
+ link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+
+ main.log.report( "Randomly bring some core links down and verify ping all (Host Intents-Att Topo)" )
+ main.log.report( "___________________________________________________________________________" )
+ main.case( "Host intents - Randomly bring some core links down and verify ping all" )
+ main.step( "Verify number of Switch links to toggle on each Core Switch are between 1 - 5" )
+ if ( int( switchLinksToToggle ) ==
+ 0 or int( switchLinksToToggle ) > 5 ):
+ main.log.info( "Please check your PARAMS file. Valid range for number of switch links to toggle is between 1 to 5" )
+ #main.cleanup()
+ #main.exit()
+ else:
+ main.log.info( "User provided Core switch links range to toggle is correct, proceeding to run the test" )
+
+ main.step( "Cut links on Core devices using user provided range" )
+ main.randomLink1 = random.sample( link1End2, int( switchLinksToToggle ) )
+ main.randomLink2 = random.sample( link2End2, int( switchLinksToToggle ) )
+ main.randomLink3 = random.sample( link3End2, int( switchLinksToToggle ) )
+ for i in range( int( switchLinksToToggle ) ):
+ main.Mininet1.link(
+ END1=link1End1,
+ END2=main.randomLink1[ i ],
+ OPTION="down" )
+ time.sleep( link_sleep )
+ main.Mininet1.link(
+ END1=link2End1,
+ END2=main.randomLink2[ i ],
+ OPTION="down" )
+ time.sleep( link_sleep )
+ main.Mininet1.link(
+ END1=link3End1,
+ END2=main.randomLink3[ i ],
+ OPTION="down" )
+ time.sleep( link_sleep )
+
+ topology_output = main.ONOScli2.topology()
+ linkDown = main.ONOSbench.checkStatus(
+ topology_output, main.numMNswitches, str(
+ int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 ) )
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=linkDown,
+ onpass="Link Down discovered properly",
+ onfail="Link down was not discovered in " +
+ str( link_sleep ) +
+ " seconds" )
+
+ main.step( "Verify Ping across all hosts" )
+ pingResultLinkDown = main.FALSE
+ time1 = time.time()
+ pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout )
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ caseResult70 = linkDown and pingResultLinkDown
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult70,
+ onpass="Random Link cut Test PASS",
+ onfail="Random Link cut Test FAIL" )
+
+ def CASE80( self, main ):
+ """
+ Bring the core links up that are down and verify ping all ( Host Intents-Att Topo )
+ """
+ import random
+ link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
+ link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
+ link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
+ link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+ switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
+
+ main.log.report(
+ "Bring the core links up that are down and verify ping all (Host Intents-Att Topo" )
+ main.log.report(
+ "__________________________________________________________________" )
+ main.case(
+ "Host intents - Bring the core links up that are down and verify ping all" )
+ main.step( "Bring randomly cut links on Core devices up" )
+ for i in range( int( switchLinksToToggle ) ):
+ main.Mininet1.link(
+ END1=link1End1,
+ END2=main.randomLink1[ i ],
+ OPTION="up" )
+ time.sleep( link_sleep )
+ main.Mininet1.link(
+ END1=link2End1,
+ END2=main.randomLink2[ i ],
+ OPTION="up" )
+ time.sleep( link_sleep )
+ main.Mininet1.link(
+ END1=link3End1,
+ END2=main.randomLink3[ i ],
+ OPTION="up" )
+ time.sleep( link_sleep )
+
+ topology_output = main.ONOScli2.topology()
+ linkUp = main.ONOSbench.checkStatus(
+ topology_output,
+ main.numMNswitches,
+ str( main.numMNlinks ) )
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=linkUp,
+ onpass="Link up discovered properly",
+ onfail="Link up was not discovered in " +
+ str( link_sleep ) +
+ " seconds" )
+
+ main.step( "Verify Ping across all hosts" )
+ pingResultLinkUp = main.FALSE
+ time1 = time.time()
+ pingResultLinkUp = main.Mininet1.pingall( timeout=main.pingTimeout )
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ caseResult80 = linkUp and pingResultLinkUp
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult80,
+ onpass="Link Up Test PASS",
+ onfail="Link Up Test FAIL" )
+
+ def CASE71( self, main ):
+ """
+ Randomly bring some core links down and verify ping all ( Point Intents-Att Topo)
+ """
+ import random
+ main.randomLink1 = []
+ main.randomLink2 = []
+ main.randomLink3 = []
+ link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
+ link1End2 = main.params[ 'ATTCORELINKS' ][ 'linkS3b' ].split( ',' )
+ link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
+ link2End2 = main.params[ 'ATTCORELINKS' ][ 'linkS14b' ].split( ',' )
+ link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
+ link3End2 = main.params[ 'ATTCORELINKS' ][ 'linkS18b' ].split( ',' )
+ switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
+ link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+
+ main.log.report( "Randomly bring some core links down and verify ping all (Point Intents-Att Topo)" )
+ main.log.report( "___________________________________________________________________________" )
+ main.case( "Point intents - Randomly bring some core links down and verify ping all" )
+ main.step( "Verify number of Switch links to toggle on each Core Switch are between 1 - 5" )
+ if ( int( switchLinksToToggle ) ==
+ 0 or int( switchLinksToToggle ) > 5 ):
+ main.log.info( "Please check your PARAMS file. Valid range for number of switch links to toggle is between 1 to 5" )
+ #main.cleanup()
+ #main.exit()
+ else:
+ main.log.info( "User provided Core switch links range to toggle is correct, proceeding to run the test" )
+
+ main.step( "Cut links on Core devices using user provided range" )
+ main.randomLink1 = random.sample( link1End2, int( switchLinksToToggle ) )
+ main.randomLink2 = random.sample( link2End2, int( switchLinksToToggle ) )
+ main.randomLink3 = random.sample( link3End2, int( switchLinksToToggle ) )
+ for i in range( int( switchLinksToToggle ) ):
+ main.Mininet1.link(
+ END1=link1End1,
+ END2=main.randomLink1[ i ],
+ OPTION="down" )
+ time.sleep( link_sleep )
+ main.Mininet1.link(
+ END1=link2End1,
+ END2=main.randomLink2[ i ],
+ OPTION="down" )
+ time.sleep( link_sleep )
+ main.Mininet1.link(
+ END1=link3End1,
+ END2=main.randomLink3[ i ],
+ OPTION="down" )
+ time.sleep( link_sleep )
+
+ topology_output = main.ONOScli2.topology()
+ linkDown = main.ONOSbench.checkStatus(
+ topology_output, main.numMNswitches, str(
+ int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 ) )
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=linkDown,
+ onpass="Link Down discovered properly",
+ onfail="Link down was not discovered in " +
+ str( link_sleep ) +
+ " seconds" )
+
+ main.step( "Verify Ping across all hosts" )
+ pingResultLinkDown = main.FALSE
+ time1 = time.time()
+ pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ caseResult71 = linkDown and pingResultLinkDown
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult71,
+ onpass="Random Link cut Test PASS",
+ onfail="Random Link cut Test FAIL" )
+
+ def CASE81( self, main ):
+ """
+ Bring the core links up that are down and verify ping all ( Point Intents-Att Topo )
+ """
+ import random
+ link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
+ link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
+ link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
+ link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+ switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
+
+ main.log.report(
+ "Bring the core links up that are down and verify ping all ( Point Intents-Att Topo" )
+ main.log.report(
+ "__________________________________________________________________" )
+ main.case(
+ "Point intents - Bring the core links up that are down and verify ping all" )
+ main.step( "Bring randomly cut links on Core devices up" )
+ for i in range( int( switchLinksToToggle ) ):
+ main.Mininet1.link(
+ END1=link1End1,
+ END2=main.randomLink1[ i ],
+ OPTION="up" )
+ time.sleep( link_sleep )
+ main.Mininet1.link(
+ END1=link2End1,
+ END2=main.randomLink2[ i ],
+ OPTION="up" )
+ time.sleep( link_sleep )
+ main.Mininet1.link(
+ END1=link3End1,
+ END2=main.randomLink3[ i ],
+ OPTION="up" )
+ time.sleep( link_sleep )
+
+ topology_output = main.ONOScli2.topology()
+ linkUp = main.ONOSbench.checkStatus(
+ topology_output,
+ main.numMNswitches,
+ str( main.numMNlinks ) )
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=linkUp,
+ onpass="Link up discovered properly",
+ onfail="Link up was not discovered in " +
+ str( link_sleep ) +
+ " seconds" )
+
+ main.step( "Verify Ping across all hosts" )
+ pingResultLinkUp = main.FALSE
+ time1 = time.time()
+ pingResultLinkUp = main.Mininet1.pingall(timeout = main.pingTimeout )
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ caseResult81 = linkUp and pingResultLinkUp
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult81,
+ onpass="Link Up Test PASS",
+ onfail="Link Up Test FAIL" )
+
+ def CASE72( self, main ):
+ """
+ Randomly bring some links down and verify ping all ( Host Intents-Chordal Topo)
+ """
+ import random
+ 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" )
+ switches = []
+ switchesComb = []
+ for i in range( main.numMNswitches ):
+ switches.append('s%d'%(i+1))
+ switchesLinksComb = list(itertools.combinations(switches,2))
+ 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],
+ END2=switch[1],
+ OPTION="down")
+ time.sleep( link_sleep )
+
+ topology_output = main.ONOScli2.topology()
+ linkDown = main.ONOSbench.checkStatus(
+ topology_output, main.numMNswitches, str(
+ int( main.numMNlinks ) - 5 * 2 ) )
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=linkDown,
+ onpass="Link Down discovered properly",
+ onfail="Link down was not discovered in " +
+ str( link_sleep ) +
+ " seconds" )
+
+ main.step( "Verify Ping across all hosts" )
+ pingResultLinkDown = main.FALSE
+ time1 = time.time()
+ pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ caseResult71 = pingResultLinkDown
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult71,
+ onpass="Random Link cut Test PASS",
+ onfail="Random Link cut Test FAIL" )
+
+ def CASE82( self, main ):
+ """
+ Bring the core links up that are down and verify ping all ( Host Intents Chordal Topo )
+ """
+ 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(
+ "__________________________________________________________________" )
+ 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],
+ END2=switch[1],
+ OPTION="up")
+ time.sleep( link_sleep )
+
+ topology_output = main.ONOScli2.topology()
+ linkUp = main.ONOSbench.checkStatus(
+ topology_output,
+ main.numMNswitches,
+ str( main.numMNlinks ) )
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=linkUp,
+ onpass="Link up discovered properly",
+ onfail="Link up was not discovered in " +
+ str( link_sleep ) +
+ " seconds" )
+
+ main.step( "Verify Ping across all hosts" )
+ pingResultLinkUp = main.FALSE
+ time1 = time.time()
+ pingResultLinkUp = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ caseResult82 = linkUp and pingResultLinkUp
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult82,
+ onpass="Link Up Test PASS",
+ onfail="Link Up Test FAIL" )
+
+ def CASE73( self, main ):
+ """
+ Randomly bring some links down and verify ping all ( Point Intents-Chordal Topo)
+ """
+ import random
+ 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" )
+ switches = []
+ switchesComb = []
+ for i in range( main.numMNswitches ):
+ switches.append('s%d'%(i+1))
+ switchesLinksComb = list(itertools.combinations(switches,2))
+ 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],
+ END2=switch[1],
+ OPTION="down")
+ time.sleep( link_sleep )
+
+ topology_output = main.ONOScli2.topology()
+ linkDown = main.ONOSbench.checkStatus(
+ topology_output, main.numMNswitches, str(
+ int( main.numMNlinks ) - 5 * 2 ) )
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=linkDown,
+ onpass="Link Down discovered properly",
+ onfail="Link down was not discovered in " +
+ str( link_sleep ) +
+ " seconds" )
+
+ main.step( "Verify Ping across all hosts" )
+ pingResultLinkDown = main.FALSE
+ time1 = time.time()
+ pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ caseResult73 = pingResultLinkDown
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult73,
+ onpass="Random Link cut Test PASS",
+ onfail="Random Link cut Test FAIL" )
+
+ def CASE83( self, main ):
+ """
+ Bring the core links up that are down and verify ping all ( Point Intents Chordal Topo )
+ """
+ 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(
+ "__________________________________________________________________" )
+ 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],
+ END2=switch[1],
+ OPTION="up")
+ time.sleep( link_sleep )
+
+ topology_output = main.ONOScli2.topology()
+ linkUp = main.ONOSbench.checkStatus(
+ topology_output,
+ main.numMNswitches,
+ str( main.numMNlinks ) )
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=linkUp,
+ onpass="Link up discovered properly",
+ onfail="Link up was not discovered in " +
+ str( link_sleep ) +
+ " seconds" )
+
+ main.step( "Verify Ping across all hosts" )
+ pingResultLinkUp = main.FALSE
+ time1 = time.time()
+ pingResultLinkUp = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ caseResult83 = linkUp and pingResultLinkUp
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult83,
+ onpass="Link Up Test PASS",
+ onfail="Link Up Test FAIL" )
+
+ def CASE74( self, main ):
+ """
+ Randomly bring some core links down and verify ping all ( Host Intents-Spine Topo)
+ """
+ import random
+ main.randomLink1 = []
+ main.randomLink2 = []
+ main.randomLink3 = []
+ main.randomLink4 = []
+ link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ]
+ link1End2top = main.params[ 'SPINECORELINKS' ][ 'linkS9top' ].split( ',' )
+ link1End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS9bot' ].split( ',' )
+ link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
+ link2End2top = main.params[ 'SPINECORELINKS' ][ 'linkS10top' ].split( ',' )
+ 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)
+ linkIndexS10 = random.sample(linkIndex,1)[0]
+ main.randomLink1 = link1End2top[linkIndexS9]
+ main.randomLink2 = link2End2top[linkIndexS10]
+ main.randomLink3 = random.sample(link1End2bot,1)[0]
+ main.randomLink4 = random.sample(link2End2bot,1)[0]
+ # main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="down" )
+ # main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="down" )
+ main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="down" )
+ time.sleep( link_sleep )
+ main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="down" )
+ time.sleep( link_sleep )
+
+ topology_output = main.ONOScli2.topology()
+ linkDown = main.ONOSbench.checkStatus(
+ topology_output, main.numMNswitches, str(
+ int( main.numMNlinks ) - 8 ))
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=linkDown,
+ onpass="Link Down discovered properly",
+ onfail="Link down was not discovered in " +
+ str( link_sleep ) +
+ " seconds" )
+
+ main.step( "Verify Ping across all hosts" )
+ pingResultLinkDown = main.FALSE
+ time1 = time.time()
+ pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ caseResult74 = linkDown and pingResultLinkDown
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult74,
+ onpass="Random Link cut Test PASS",
+ onfail="Random Link cut Test FAIL" )
+
+ def CASE84( self, main ):
+ """
+ Bring the core links up that are down and verify ping all ( Host Intents-Spine Topo )
+ """
+ import random
+ link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ]
+ link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
+ link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+ main.log.report(
+ "Bring the core links up that are down and verify ping all (Host Intents-Spine Topo" )
+ main.log.report(
+ "__________________________________________________________________" )
+ main.case(
+ "Host intents - Bring the core links up that are down and verify ping all" )
+
+ #main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="up" )
+ #main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="up" )
+ main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="up" )
+ time.sleep( link_sleep )
+ main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="up" )
+ time.sleep( link_sleep )
+
+ topology_output = main.ONOScli2.topology()
+ linkUp = main.ONOSbench.checkStatus(
+ topology_output,
+ main.numMNswitches,
+ str( main.numMNlinks ) )
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=linkUp,
+ onpass="Link up discovered properly",
+ onfail="Link up was not discovered in " +
+ str( link_sleep ) +
+ " seconds" )
+
+ main.step( "Verify Ping across all hosts" )
+ pingResultLinkUp = main.FALSE
+ time1 = time.time()
+ pingResultLinkUp = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ caseResult84 = linkUp and pingResultLinkUp
+ 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)
+ """
+ main.log.report( "Add 600 point intents and verify pingall (Att Topology)" )
+ main.log.report( "_______________________________________" )
+ import itertools
+ import time
+ main.case( "Install 600 point intents" )
+ main.step( "Add point Intents" )
+ intentResult = main.TRUE
+ deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
+
+ intentIdList = []
+ time1 = time.time()
+ for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
+ pool = []
+ for cli in main.CLIs:
+ if i >= len( deviceCombos ):
+ break
+ t = main.Thread( target=cli.addPointIntent,
+ threadID=main.threadID,
+ name="addPointIntent",
+ args=[deviceCombos[i][0],deviceCombos[i][1],1,1,"IPV4",main.MACsDict.get(deviceCombos[i][0]),main.MACsDict.get(deviceCombos[i][1])])
+ pool.append(t)
+ #time.sleep(1)
+ t.start()
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ intentIdList.append(thread.result)
+ time2 = time.time()
+ main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+ intentResult = main.TRUE
+ intentsJson = main.ONOScli2.intents()
+ getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+ intentsJson = intentsJson)
+ print getIntentStateResult
+ # Takes awhile for all the onos to get the intents
+ time.sleep(60)
+ main.step( "Verify Ping across all hosts" )
+ pingResult = main.FALSE
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ onpass="PING tALL PASS",
+ onfail="PING ALL FAIL" )
+
+ case90Result = ( intentResult and pingResult )
+
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case90Result,
+ onpass="Install 600 point Intents and Ping All test PASS",
+ onfail="Install 600 point Intents and Ping All test FAIL" )
+
+ def CASE91( self ):
+ """
+ Install 600 point intents and verify ping all (Chordal Topology)
+ """
+ main.log.report( "Add 600 point intents and verify pingall (Chordal Topology)" )
+ main.log.report( "_______________________________________" )
+ import itertools
+ import time
+ main.case( "Install 600 point intents" )
+ main.step( "Add point Intents" )
+ intentResult = main.TRUE
+ deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
+
+ intentIdList = []
+ time1 = time.time()
+ for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
+ pool = []
+ for cli in main.CLIs:
+ if i >= len( deviceCombos ):
+ break
+ t = main.Thread( target=cli.addPointIntent,
+ threadID=main.threadID,
+ name="addPointIntent",
+ args=[deviceCombos[i][0],deviceCombos[i][1],1,1,"IPV4","",main.MACsDict.get(deviceCombos[i][1])])
+ pool.append(t)
+ #time.sleep(1)
+ t.start()
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ intentIdList.append(thread.result)
+ time2 = time.time()
+ main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+ intentResult = main.TRUE
+ intentsJson = main.ONOScli2.intents()
+ getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+ intentsJson = intentsJson)
+ print getIntentStateResult
+ # Takes awhile for all the onos to get the intents
+ time.sleep(30)
+ main.step( "Verify Ping across all hosts" )
+ pingResult = main.FALSE
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ onpass="PING ALL PASS",
+ 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)
+ """
+ main.log.report( "Add 4556 point intents and verify pingall (Spine Topology)" )
+ main.log.report( "_______________________________________" )
+ import itertools
+ import time
+ main.case( "Install 4556 point intents" )
+ main.step( "Add point Intents" )
+ intentResult = main.TRUE
+ main.pingTimeout = 600
+ for i in range(len(main.hostMACs)):
+ main.MACsDict[main.deviceDPIDs[i+10]] = main.hostMACs[i].split('/')[0]
+ print main.MACsDict
+ deviceCombos = list( itertools.permutations( main.deviceDPIDs[10:], 2 ) )
+ intentIdList = []
+ time1 = time.time()
+ for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
+ pool = []
+ for cli in main.CLIs:
+ if i >= len( deviceCombos ):
+ break
+ t = main.Thread( target=cli.addPointIntent,
+ threadID=main.threadID,
+ name="addPointIntent",
+ args=[deviceCombos[i][0],deviceCombos[i][1],1,1,"IPV4","",main.MACsDict.get(deviceCombos[i][1])])
+ pool.append(t)
+ #time.sleep(1)
+ t.start()
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ intentIdList.append(thread.result)
+ time2 = time.time()
+ main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+ intentResult = main.TRUE
+ intentsJson = main.ONOScli2.intents()
+ getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+ intentsJson = intentsJson)
+ #print getIntentStateResult
+ # Takes awhile for all the onos to get the intents
+ time.sleep(60)
+ main.step( "Verify Ping across all hosts" )
+ pingResult = main.FALSE
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ onpass="PING ALL PASS",
+ 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
+ for att topology
+ """
+ import copy
+ import time
+ main.log.report( "Install multi-single point intents and verify Ping all" )
+ main.log.report( "___________________________________________" )
+ main.case( "Install multi-single point intents and Ping all" )
+ deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
+ portIngressList = ['1']*(len(deviceDPIDsCopy) - 1)
+ intentIdList = []
+ print "MACsDict", main.MACsDict
+ time1 = time.time()
+ for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
+ pool = []
+ for cli in main.CLIs:
+ egressDevice = deviceDPIDsCopy[i]
+ ingressDeviceList = copy.copy(deviceDPIDsCopy)
+ ingressDeviceList.remove(egressDevice)
+ if i >= len( deviceDPIDsCopy ):
+ break
+ t = main.Thread( target=cli.addMultipointToSinglepointIntent,
+ threadID=main.threadID,
+ name="addMultipointToSinglepointIntent",
+ args =[ingressDeviceList,egressDevice,portIngressList,'1','IPV4','',main.MACsDict.get(egressDevice)])
+ pool.append(t)
+ #time.sleep(1)
+ t.start()
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ intentIdList.append(thread.result)
+ time2 = time.time()
+ main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+ time.sleep(30)
+ print "getting all intents ID"
+ intentIdTemp = main.ONOScli1.getAllIntentsId()
+ print intentIdTemp
+ print len(intentIdList)
+ print intentIdList
+ checkIntentStateResult = main.TRUE
+ print "Checking intents state"
+ checkIntentStateResult = main.ONOScli1.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
+ checkIntentStateResult = main.ONOScli2.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
+ 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 " )
+
+ print "Checking flows state "
+ checkFlowsState = main.ONOScli1.checkFlowsState()
+ time.sleep(50)
+ main.step( "Verify Ping across all hosts" )
+ pingResult = main.FALSE
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+ checkFlowsState = main.ONOScli1.checkFlowsState()
+ case93Result = pingResult
+ utilities.assert_equals(
+ expect=main.TRUE,
+ 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
+ for Chordal topology
+ """
+ import copy
+ import time
+ main.log.report( "Install multi-single point intents and verify Ping all" )
+ main.log.report( "___________________________________________" )
+ main.case( "Install multi-single point intents and Ping all" )
+ deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
+ portIngressList = ['1']*(len(deviceDPIDsCopy) - 1)
+ intentIdList = []
+ print "MACsDict", main.MACsDict
+ time1 = time.time()
+ for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
+ pool = []
+ for cli in main.CLIs:
+ egressDevice = deviceDPIDsCopy[i]
+ ingressDeviceList = copy.copy(deviceDPIDsCopy)
+ ingressDeviceList.remove(egressDevice)
+ if i >= len( deviceDPIDsCopy ):
+ break
+ t = main.Thread( target=cli.addMultipointToSinglepointIntent,
+ threadID=main.threadID,
+ name="addMultipointToSinglepointIntent",
+ args =[ingressDeviceList,egressDevice,portIngressList,'1','IPV4','',main.MACsDict.get(egressDevice)])
+ pool.append(t)
+ #time.sleep(1)
+ t.start()
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ intentIdList.append(thread.result)
+ time2 = time.time()
+ 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
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+
+ case94Result = pingResult
+ utilities.assert_equals(
+ expect=main.TRUE,
+ 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 ):
+ """
+ Install single-multi point intents and verify Ping all works
+ for att topology
+ """
+ import copy
+ main.log.report( "Install single-multi point intents and verify Ping all" )
+ main.log.report( "___________________________________________" )
+ main.case( "Install single-multi point intents and Ping all" )
+ deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
+ portEgressList = ['1']*(len(deviceDPIDsCopy) - 1)
+ intentIdList = []
+ print "MACsDict", main.MACsDict
+ time1 = time.time()
+ for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
+ pool = []
+ for cli in main.CLIs:
+ ingressDevice = deviceDPIDsCopy[i]
+ egressDeviceList = copy.copy(deviceDPIDsCopy)
+ egressDeviceList.remove(ingressDevice)
+ if i >= len( deviceDPIDsCopy ):
+ break
+ t = main.Thread( target=cli.addSinglepointToMultipointIntent,
+ threadID=main.threadID,
+ name="addSinglepointToMultipointIntent",
+ args =[ingressDevice,egressDeviceList,'1',portEgressList,'IPV4',main.MACsDict.get(ingressDevice)])
+ pool.append(t)
+ #time.sleep(1)
+ t.start()
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ intentIdList.append(thread.result)
+ time2 = time.time()
+ 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
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+
+ case96Result = pingResult
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case96Result,
+ onpass="Install 25 single to multi point Intents and Ping All test PASS",
+ onfail="Install 25 single to multi point Intents and Ping All test FAIL" )
+
+ def CASE97( self ):
+ """
+ Install single-multi point intents and verify Ping all works
+ for Chordal topology
+ """
+ import copy
+ main.log.report( "Install single-multi point intents and verify Ping all" )
+ main.log.report( "___________________________________________" )
+ main.case( "Install single-multi point intents and Ping all" )
+ deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
+ portEgressList = ['1']*(len(deviceDPIDsCopy) - 1)
+ intentIdList = []
+ print "MACsDict", main.MACsDict
+ time1 = time.time()
+ for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
+ pool = []
+ for cli in main.CLIs:
+ ingressDevice = deviceDPIDsCopy[i]
+ egressDeviceList = copy.copy(deviceDPIDsCopy)
+ egressDeviceList.remove(ingressDevice)
+ if i >= len( deviceDPIDsCopy ):
+ break
+ t = main.Thread( target=cli.addSinglepointToMultipointIntent,
+ threadID=main.threadID,
+ name="addSinglepointToMultipointIntent",
+ args =[ingressDevice,egressDeviceList,'1',portEgressList,'IPV4',main.MACsDict.get(ingressDevice),''])
+ pool.append(t)
+ #time.sleep(1)
+ t.start()
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ intentIdList.append(thread.result)
+ time2 = time.time()
+ 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
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+
+ case97Result = pingResult
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case97Result,
+ onpass="Install 25 single to multi point Intents and Ping All test PASS",
+ onfail="Install 25 single to multi point Intents and Ping All test FAIL" )
+
+ def CASE98( self ):
+ """
+ Install single-multi point intents and verify Ping all works
+ for Spine topology
+ """
+ import copy
+ main.log.report( "Install single-multi point intents and verify Ping all" )
+ main.log.report( "___________________________________________" )
+ main.case( "Install single-multi point intents and Ping all" )
+ deviceDPIDsCopy = copy.copy( main.deviceDPIDs )
+ deviceDPIDsCopy = deviceDPIDsCopy[ 10: ]
+ portEgressList = [ '1' ]*(len(deviceDPIDsCopy) - 1)
+ intentIdList = []
+ MACsDictCopy = {}
+ for i in range( len( deviceDPIDsCopy ) ):
+ MACsDictCopy[ deviceDPIDsCopy[ i ] ] = main.hostMACs[i].split( '/' )[ 0 ]
+
+ print "deviceDPIDsCopy", deviceDPIDsCopy
+ print ""
+ print "MACsDictCopy", MACsDictCopy
+ time1 = time.time()
+ for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
+ pool = []
+ for cli in main.CLIs:
+ if i >= len( deviceDPIDsCopy ):
+ break
+ ingressDevice = deviceDPIDsCopy[i]
+ egressDeviceList = copy.copy(deviceDPIDsCopy)
+ egressDeviceList.remove(ingressDevice)
+ t = main.Thread( target=cli.addSinglepointToMultipointIntent,
+ threadID=main.threadID,
+ name="addSinglepointToMultipointIntent",
+ args =[ingressDevice,egressDeviceList,'1',portEgressList,'IPV4',MACsDictCopy.get(ingressDevice),''])
+ pool.append(t)
+ #time.sleep(1)
+ t.start()
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ intentIdList.append(thread.result)
+ time2 = time.time()
+ 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
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+
+ case98Result = pingResult
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case98Result,
+ onpass="Install 25 single to multi point Intents and Ping All test PASS",
+ onfail="Install 25 single to multi point Intents and Ping All test FAIL" )
+
+ def CASE10( self ):
+ import time
+ """
+ Remove all Intents
+ """
+ main.log.report( "Remove all intents that were installed previously" )
+ main.log.report( "______________________________________________" )
+ main.log.info( "Remove all intents" )
+ main.case( "Removing intents" )
+ main.step( "Obtain the intent id's first" )
+ intentsList = main.ONOScli1.getAllIntentIds()
+ ansi_escape = re.compile( r'\x1b[^m]*m' )
+ intentsList = ansi_escape.sub( '', intentsList )
+ intentsList = intentsList.replace(
+ " onos:intents | grep id=",
+ "" ).replace(
+ "id=",
+ "" ).replace(
+ "\r\r",
+ "" )
+ intentsList = intentsList.splitlines()
+ #intentsList = intentsList[ 1: ]
+ intentIdList = []
+ step1Result = main.TRUE
+ moreIntents = main.TRUE
+ removeIntentCount = 0
+ intentsCount = len(intentsList)
+ main.log.info ( "Current number of intents: " + str(intentsCount) )
+ if ( len( intentsList ) > 1 ):
+ results = main.TRUE
+ main.log.info("Removing intent...")
+ while moreIntents:
+ #This is a work around for a major issue. We cycle through intents removal for up to 5 times.
+ if removeIntentCount == 5:
+ break
+ removeIntentCount = removeIntentCount + 1
+ intentsList1 = main.ONOScli1.getAllIntentIds()
+ if len( intentsList1 ) == 0:
+ break
+ ansi_escape = re.compile( r'\x1b[^m]*m' )
+ intentsList1 = ansi_escape.sub( '', intentsList1 )
+ intentsList1 = intentsList1.replace(
+ " onos:intents | grep id=",
+ "" ).replace(
+ " state=",
+ "" ).replace(
+ "\r\r",
+ "" )
+ intentsList1 = intentsList1.splitlines()
+ #intentsList1 = intentsList1[ 1: ]
+ main.log.info ( "Round %d intents to remove: " %(removeIntentCount) )
+ print intentsList1
+ intentIdList1 = []
+ if ( len( intentsList1 ) > 0 ):
+ moreIntents = main.TRUE
+ for i in range( len( intentsList1 ) ):
+ intentsTemp1 = intentsList1[ i ].split( ',' )
+ intentIdList1.append( intentsTemp1[ 0 ].split('=')[1] )
+ main.log.info ( "Leftover Intent IDs: " + str(intentIdList1) )
+ main.log.info ( "Length of Leftover Intents list: " + str(len(intentIdList1)) )
+ time1 = time.time()
+ for i in xrange( 0, len( intentIdList1 ), int(main.numCtrls) ):
+ pool = []
+ for cli in main.CLIs:
+ if i >= len( intentIdList1 ):
+ break
+ t = main.Thread( target=cli.removeIntent,
+ threadID=main.threadID,
+ name="removeIntent",
+ args=[intentIdList1[i],'org.onosproject.cli',False,False])
+ pool.append(t)
+ t.start()
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ intentIdList.append(thread.result)
+ #time.sleep(2)
+ time2 = time.time()
+ main.log.info("Time for removing host intents: %2f seconds" %(time2-time1))
+ time.sleep(10)
+ main.log.info("Purging WITHDRAWN Intents")
+ purgeResult = main.ONOScli2.purgeWithdrawnIntents()
+ else:
+ time.sleep(10)
+ if len( main.ONOScli1.intents()):
+ continue
+ break
+ time.sleep(10)
+ else:
+ print "Removed %d intents" %(intentsCount)
+ step1Result = main.TRUE
+ else:
+ print "No Intent IDs found in Intents list: ", intentsList
+ step1Result = main.FALSE
+
+ print main.ONOScli1.intents()
+ caseResult10 = step1Result
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult10,
+ onpass="Intent removal test successful",
+ onfail="Intent removal test failed" )
+
+ def CASE12( self, main ):
+ """
+ Enable onos-app-ifwd, Verify Intent based Reactive forwarding through ping all and Disable it
+ """
+ import re
+ import copy
+ import time
+
+ Thread = imp.load_source('Thread','/home/admin/ONLabTest/TestON/tests/OnosCHO/Thread.py')
+ threadID = 0
+
+ main.log.report( "Enable Intent based Reactive forwarding and Verify ping all" )
+ main.log.report( "_____________________________________________________" )
+ main.case( "Enable Intent based Reactive forwarding and Verify ping all" )
+ main.step( "Enable intent based Reactive forwarding" )
+ installResult = main.FALSE
+ feature = "onos-app-ifwd"
+
+ pool = []
+ time1 = time.time()
+ for cli,feature in main.CLIs:
+ t = main.Thread(target=cli,threadID=threadID,
+ name="featureInstall",args=[feature])
+ 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()
+ #main.exit()
+ else:
+ 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()
+ ping_result = main.Mininet1.pingall(timeout=600)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+
+ if ping_result == main.TRUE:
+ main.log.report( "Pingall Test in Reactive mode successful" )
+ else:
+ main.log.report( "Pingall Test in Reactive mode failed" )
+
+ main.step( "Disable Intent based Reactive forwarding" )
+ uninstallResult = main.FALSE
+
+ pool = []
+ time1 = time.time()
+ for cli,feature in main.CLIs:
+ t = main.Thread(target=cli,threadID=threadID,
+ name="featureUninstall",args=[feature])
+ 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
+ #main.cleanup()
+ #main.exit()
+ else:
+ main.log.info("Successful feature:uninstall onos-app-ifwd")
+ uninstallResult = main.TRUE
+ main.log.info("Time for feature:uninstall onos-app-ifwd: %2f seconds" %(time2-time1))
+
+ # Waiting for reative flows to be cleared.
+ time.sleep( 10 )
+
+ case11Result = installResult and ping_result and uninstallResult
+ utilities.assert_equals( expect=main.TRUE, actual=case11Result,
+ onpass="Intent based Reactive forwarding Pingall test PASS",
+ onfail="Intent based Reactive forwarding Pingall test FAIL" )
+
+ def CASE99(self):
+ import time
+ # WORK AROUND FOR ONOS-581. STOP ONOS BEFORE ASSIGNING CONTROLLERS AT MININET & START ONCE DONE
+ main.step( "Stop ONOS on all Nodes" )
+ stopResult = main.TRUE
+ for i in range( 1, int( main.numCtrls ) + 1 ):
+ ONOS_ip = main.params[ 'CTRL' ][ 'ip' + str( i ) ]
+ main.log.info( "Stopping ONOS Node IP: " + ONOS_ip )
+ sresult = main.ONOSbench.onosStop( ONOS_ip )
+ utilities.assert_equals( expect=main.TRUE, actual=sresult,
+ onpass="Test step PASS",
+ onfail="Test step FAIL" )
+ stopResult = ( stopResult and sresult )
+
+ main.step( "Start ONOS on all Nodes" )
+ startResult = main.TRUE
+ for i in range( 1, int( main.numCtrls ) + 1 ):
+ ONOS_ip = main.params[ 'CTRL' ][ 'ip' + str( i ) ]
+ main.log.info( "Starting ONOS Node IP: " + ONOS_ip )
+ sresult = main.ONOSbench.onosStart( ONOS_ip )
+ utilities.assert_equals( expect=main.TRUE, actual=sresult,
+ onpass="Test step PASS",
+ onfail="Test step FAIL" )
+ startResult = ( startResult and sresult )
+
+ main.step( "Start ONOS CLI on all nodes" )
+ cliResult = main.TRUE
+ time.sleep( 30 )
+ main.log.step(" Start ONOS cli using thread ")
+ pool = []
+ time1 = time.time()
+ for i in range( int( main.numCtrls ) ):
+ t = main.Thread(target=main.CLIs[i].startOnosCli,
+ threadID=main.threadID,
+ name="startOnosCli",
+ args=main.onosIPs[i])
+ pool.append(t)
+ t.start()
+ main.threadID = main.threadID + 1
+ for t in pool:
+ t.join()
+ cliResult = cliResult and t.result
+ time2 = time.time()
+
+ if not cliResult:
+ main.log.info("ONOS CLI did not start up properly")
+ #main.cleanup()
+ #main.exit()
+ else:
+ main.log.info("Successful CLI startup")
+ main.log.info("Time for connecting to CLI: %2f seconds" %(time2-time1))
+
+ case99Result = ( startResult and cliResult )
+ time.sleep(30)
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case99Result,
+ onpass="Starting new Chordal topology test PASS",
+ onfail="Starting new Chordal topology test FAIL" )
diff --git a/TestON/tests/OnosCHO/OnosCHO.topo b/TestON/tests/OnosCHO/OnosCHO.topo
new file mode 100644
index 0000000..46c738f
--- /dev/null
+++ b/TestON/tests/OnosCHO/OnosCHO.topo
@@ -0,0 +1,52 @@
+<TOPOLOGY>
+ <COMPONENT>
+
+ <ONOSbench>
+ <host>localhost</host>
+ <user>admin</user>
+ <password></password>
+ <type>OnosDriver</type>
+ <connect_order>1</connect_order>
+ <COMPONENTS>
+ <home>~/ONOS</home>
+ </COMPONENTS>
+ </ONOSbench>
+
+ <ONOScli1>
+ <host>localhost</host>
+ <user>admin</user>
+ <password></password>
+ <type>OnosCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOScli1>
+
+ <ONOScli2>
+ <host>localhost</host>
+ <user>admin</user>
+ <password></password>
+ <type>OnosCliDriver</type>
+ <connect_order>3</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOScli2>
+
+ <ONOScli3>
+ <host>localhost</host>
+ <user>admin</user>
+ <password></password>
+ <type>OnosCliDriver</type>
+ <connect_order>4</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOScli3>
+
+ <Mininet1>
+ <host>chONOS-MN</host>
+ <user>admin</user>
+ <password></password>
+ <type>MininetCliDriver</type>
+ <connect_order>12</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/OnosCHO/README b/TestON/tests/OnosCHO/README
new file mode 100644
index 0000000..4b92d14
--- /dev/null
+++ b/TestON/tests/OnosCHO/README
@@ -0,0 +1 @@
+#This README file be updated soon
diff --git a/TestON/tests/OnosCHO/__init__.py b/TestON/tests/OnosCHO/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/OnosCHO/__init__.py