blob: 0bef93e467060b63b35f70e2a13531cae3230a4f [file] [log] [blame]
Flavio Castro5608a392016-06-22 17:02:35 -07001# In this test we perform a link failure and then test for connectivity
2# CASE1: 2x2 topo + link failure + IP connectivity test
3# CASE2: 4x4 topo + link failure + IP connectivity test
4# CASE4: 2x2 topo + 3-node ONOS CLUSTER + link failure + IP connectivity test
5# CASE5: 4x4 topo + 3-node ONOS CLUSTER + link failure + IP connectivity test
Flavio Castro94b211e2016-06-22 11:00:48 -07006
7class SRLinkFailure:
Flavio Castro94b211e2016-06-22 11:00:48 -07008 def __init__( self ):
9 self.default = ''
10
11 def CASE1( self, main ):
12 """
13 Sets up 1-node Onos-cluster
14 Start 2x2 Leaf-Spine topology
15 Pingall
16 Cause link failure
17 Pingall
18 """
Flavio Castro5608a392016-06-22 17:02:35 -070019 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
20 Testcaselib as run
21 if not hasattr( main, 'apps' ):
Flavio Castro94b211e2016-06-22 11:00:48 -070022 run.initTest( main )
23
24 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
25 main.case( description )
26
27 main.cfgName = '2x2'
28 main.numCtrls = 1
29 run.installOnos( main )
30 run.startMininet( main, 'cord_fabric.py' )
Flavio Castro5608a392016-06-22 17:02:35 -070031 # pre-configured routing and bridging test
Flavio Castro94b211e2016-06-22 11:00:48 -070032 run.checkFlows( main, minFlowCount=116 )
33 run.pingAll( main )
Flavio Castro5608a392016-06-22 17:02:35 -070034 # link failure
Flavio Castro94b211e2016-06-22 11:00:48 -070035 run.killLink( main, 'spine101', 'leaf2', switches='4', links='6' )
36 run.pingAll( main, "CASE1_Failure" )
Flavio Castro5608a392016-06-22 17:02:35 -070037 run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
Pierfb719b12016-09-19 14:51:44 -070038 'of:0000000000000002', '2', '3', '4', '8' )
Flavio Castro94b211e2016-06-22 11:00:48 -070039 run.pingAll( main, "CASE1_Recovery" )
Flavio Castro5608a392016-06-22 17:02:35 -070040 # TODO Dynamic config of hosts in subnet
41 # TODO Dynamic config of host not in subnet
42 # TODO Dynamic config of vlan xconnect
43 # TODO Vrouter integration
44 # TODO Mcast integration
Flavio Castro94b211e2016-06-22 11:00:48 -070045 run.cleanup( main )
46
47 def CASE2( self, main ):
48 """
49 Sets up 1-node Onos-cluster
50 Start 4x4 Leaf-Spine topology
51 Pingall
52 Cause link failure
53 Pingall
54 """
Flavio Castro5608a392016-06-22 17:02:35 -070055 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
56 Testcaselib as run
57 if not hasattr( main, 'apps' ):
Flavio Castro94b211e2016-06-22 11:00:48 -070058 run.initTest( main )
59 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
60 main.case( description )
61 main.cfgName = '4x4'
62 main.numCtrls = 1
63 run.installOnos( main )
64 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
Flavio Castro5608a392016-06-22 17:02:35 -070065 # pre-configured routing and bridging test
Flavio Castro94b211e2016-06-22 11:00:48 -070066 run.checkFlows( main, minFlowCount=350 )
67 run.pingAll( main )
Flavio Castro5608a392016-06-22 17:02:35 -070068 # link failure
Flavio Castro94b211e2016-06-22 11:00:48 -070069 run.killLink( main, 'spine101', 'leaf2', switches='8', links='30' )
70 run.pingAll( main, "CASE2_Failure" )
Flavio Castro5608a392016-06-22 17:02:35 -070071 run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
Pierfb719b12016-09-19 14:51:44 -070072 'of:0000000000000002', '2', '3', '8', '32' )
Flavio Castro94b211e2016-06-22 11:00:48 -070073 run.pingAll( main, "CASE2_Recovery" )
Flavio Castro5608a392016-06-22 17:02:35 -070074 # TODO Dynamic config of hosts in subnet
75 # TODO Dynamic config of host not in subnet
76 # TODO preconfigured xconnect
77 # TODO Vrouter integration
78 # TODO Mcast integration
Flavio Castro94b211e2016-06-22 11:00:48 -070079 run.cleanup( main )
80
81 def CASE4( self, main ):
82 """
83 Sets up 3-node Onos-cluster
84 Start 2x2 Leaf-Spine topology
85 Pingall
86 Cause link failure
87 Pingall
88 """
Flavio Castro5608a392016-06-22 17:02:35 -070089 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
90 Testcaselib as run
91 if not hasattr( main, 'apps' ):
Flavio Castro94b211e2016-06-22 11:00:48 -070092 run.initTest( main )
93 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
94 main.case( description )
95 main.cfgName = '2x2'
96 main.numCtrls = 3
97 run.installOnos( main )
98 run.startMininet( main, 'cord_fabric.py' )
Flavio Castro5608a392016-06-22 17:02:35 -070099 # pre-configured routing and bridging test
Flavio Castro94b211e2016-06-22 11:00:48 -0700100 run.checkFlows( main, minFlowCount=116 )
101 run.pingAll( main )
Flavio Castro5608a392016-06-22 17:02:35 -0700102 # link failure
Flavio Castro94b211e2016-06-22 11:00:48 -0700103 run.killLink( main, 'spine101', 'leaf2', switches='4', links='6' )
104 run.pingAll( main, "CASE3_Failure" )
Flavio Castro5608a392016-06-22 17:02:35 -0700105 run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
Pierfb719b12016-09-19 14:51:44 -0700106 'of:0000000000000002', '2', '3', '4', '8' )
Flavio Castro94b211e2016-06-22 11:00:48 -0700107 run.pingAll( main, "CASE3_Recovery" )
Flavio Castro5608a392016-06-22 17:02:35 -0700108 # TODO Dynamic config of hosts in subnet
109 # TODO Dynamic config of host not in subnet
110 # TODO Dynamic config of vlan xconnect
111 # TODO Vrouter integration
112 # TODO Mcast integration
Flavio Castro94b211e2016-06-22 11:00:48 -0700113 run.cleanup( main )
114
115 def CASE5( self, main ):
116 """
117 Sets up 1-node Onos-cluster
118 Start 4x4 Leaf-Spine topology
119 Pingall
120 Cause link failure
121 Pingall
122 """
Flavio Castro5608a392016-06-22 17:02:35 -0700123 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
124 Testcaselib as run
125 if not hasattr( main, 'apps' ):
Flavio Castro94b211e2016-06-22 11:00:48 -0700126 run.initTest( main )
127 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
128 main.case( description )
129 main.cfgName = '4x4'
130 main.numCtrls = 3
131 run.installOnos( main )
132 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
Flavio Castro5608a392016-06-22 17:02:35 -0700133 # pre-configured routing and bridging test
Flavio Castro94b211e2016-06-22 11:00:48 -0700134 run.checkFlows( main, minFlowCount=350 )
135 run.pingAll( main )
Flavio Castro5608a392016-06-22 17:02:35 -0700136 # link failure
Flavio Castro94b211e2016-06-22 11:00:48 -0700137 run.killLink( main, 'spine101', 'leaf2', switches='8', links='30' )
138 run.pingAll( main, "CASE2_Failure" )
Flavio Castro5608a392016-06-22 17:02:35 -0700139 run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
Pierfb719b12016-09-19 14:51:44 -0700140 'of:0000000000000002', '2', '3', '8', '32' )
Flavio Castro94b211e2016-06-22 11:00:48 -0700141 run.pingAll( main, "CASE2_Recovery" )
Flavio Castro5608a392016-06-22 17:02:35 -0700142 # TODO Dynamic config of hosts in subnet
143 # TODO Dynamic config of host not in subnet
144 # TODO preconfigured xconnect
145 # TODO Vrouter integration
146 # TODO Mcast integration
Flavio Castro94b211e2016-06-22 11:00:48 -0700147 run.cleanup( main )