blob: e8b6cf7a79142b97ec586ecadb4e370690a143a9 [file] [log] [blame]
Jeremy Ronquillob27ce4c2017-07-17 12:41:28 -07001"""
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -07002Copyright 2016 Open Networking Foundation ( ONF )
Jeremy Ronquillob27ce4c2017-07-17 12:41:28 -07003
4Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
5the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
6or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
7
8 TestON is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 2 of the License, or
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070011 ( at your option ) any later version.
Jeremy Ronquillob27ce4c2017-07-17 12:41:28 -070012
13 TestON is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with TestON. If not, see <http://www.gnu.org/licenses/>.
20"""
Flavio Castro5608a392016-06-22 17:02:35 -070021# In this test we perform a link failure and then test for connectivity
22# CASE1: 2x2 topo + link failure + IP connectivity test
23# CASE2: 4x4 topo + link failure + IP connectivity test
24# CASE4: 2x2 topo + 3-node ONOS CLUSTER + link failure + IP connectivity test
25# CASE5: 4x4 topo + 3-node ONOS CLUSTER + link failure + IP connectivity test
Flavio Castro94b211e2016-06-22 11:00:48 -070026
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070027
Flavio Castro94b211e2016-06-22 11:00:48 -070028class SRLinkFailure:
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070029
Flavio Castro94b211e2016-06-22 11:00:48 -070030 def __init__( self ):
31 self.default = ''
32
33 def CASE1( self, main ):
34 """
35 Sets up 1-node Onos-cluster
36 Start 2x2 Leaf-Spine topology
37 Pingall
38 Cause link failure
39 Pingall
40 """
Flavio Castro5608a392016-06-22 17:02:35 -070041 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
42 Testcaselib as run
43 if not hasattr( main, 'apps' ):
Flavio Castro94b211e2016-06-22 11:00:48 -070044 run.initTest( main )
45
46 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
47 main.case( description )
48
49 main.cfgName = '2x2'
Devin Lim142b5342017-07-20 15:22:39 -070050 main.Cluster.setRunningNode( 1 )
Flavio Castro94b211e2016-06-22 11:00:48 -070051 run.installOnos( main )
52 run.startMininet( main, 'cord_fabric.py' )
Flavio Castro5608a392016-06-22 17:02:35 -070053 # pre-configured routing and bridging test
Flavio Castro94b211e2016-06-22 11:00:48 -070054 run.checkFlows( main, minFlowCount=116 )
55 run.pingAll( main )
Flavio Castro5608a392016-06-22 17:02:35 -070056 # link failure
Flavio Castro94b211e2016-06-22 11:00:48 -070057 run.killLink( main, 'spine101', 'leaf2', switches='4', links='6' )
58 run.pingAll( main, "CASE1_Failure" )
Flavio Castro5608a392016-06-22 17:02:35 -070059 run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
Pierfb719b12016-09-19 14:51:44 -070060 'of:0000000000000002', '2', '3', '4', '8' )
Flavio Castro94b211e2016-06-22 11:00:48 -070061 run.pingAll( main, "CASE1_Recovery" )
Flavio Castro5608a392016-06-22 17:02:35 -070062 # TODO Dynamic config of hosts in subnet
63 # TODO Dynamic config of host not in subnet
64 # TODO Dynamic config of vlan xconnect
65 # TODO Vrouter integration
66 # TODO Mcast integration
Flavio Castro94b211e2016-06-22 11:00:48 -070067 run.cleanup( main )
68
69 def CASE2( self, main ):
70 """
71 Sets up 1-node Onos-cluster
72 Start 4x4 Leaf-Spine topology
73 Pingall
74 Cause link failure
75 Pingall
76 """
Flavio Castro5608a392016-06-22 17:02:35 -070077 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
78 Testcaselib as run
79 if not hasattr( main, 'apps' ):
Flavio Castro94b211e2016-06-22 11:00:48 -070080 run.initTest( main )
81 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
82 main.case( description )
83 main.cfgName = '4x4'
Devin Lim142b5342017-07-20 15:22:39 -070084 main.Cluster.setRunningNode( 1 )
Flavio Castro94b211e2016-06-22 11:00:48 -070085 run.installOnos( main )
86 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
Flavio Castro5608a392016-06-22 17:02:35 -070087 # pre-configured routing and bridging test
Flavio Castro94b211e2016-06-22 11:00:48 -070088 run.checkFlows( main, minFlowCount=350 )
89 run.pingAll( main )
Flavio Castro5608a392016-06-22 17:02:35 -070090 # link failure
Flavio Castro94b211e2016-06-22 11:00:48 -070091 run.killLink( main, 'spine101', 'leaf2', switches='8', links='30' )
92 run.pingAll( main, "CASE2_Failure" )
Flavio Castro5608a392016-06-22 17:02:35 -070093 run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
Pierfb719b12016-09-19 14:51:44 -070094 'of:0000000000000002', '2', '3', '8', '32' )
Flavio Castro94b211e2016-06-22 11:00:48 -070095 run.pingAll( main, "CASE2_Recovery" )
Flavio Castro5608a392016-06-22 17:02:35 -070096 # TODO Dynamic config of hosts in subnet
97 # TODO Dynamic config of host not in subnet
98 # TODO preconfigured xconnect
99 # TODO Vrouter integration
100 # TODO Mcast integration
Flavio Castro94b211e2016-06-22 11:00:48 -0700101 run.cleanup( main )
102
103 def CASE4( self, main ):
104 """
105 Sets up 3-node Onos-cluster
106 Start 2x2 Leaf-Spine topology
107 Pingall
108 Cause link failure
109 Pingall
110 """
Flavio Castro5608a392016-06-22 17:02:35 -0700111 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
112 Testcaselib as run
113 if not hasattr( main, 'apps' ):
Flavio Castro94b211e2016-06-22 11:00:48 -0700114 run.initTest( main )
115 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
116 main.case( description )
117 main.cfgName = '2x2'
Devin Lim142b5342017-07-20 15:22:39 -0700118 main.Cluster.setRunningNode( 3 )
Flavio Castro94b211e2016-06-22 11:00:48 -0700119 run.installOnos( main )
120 run.startMininet( main, 'cord_fabric.py' )
Flavio Castro5608a392016-06-22 17:02:35 -0700121 # pre-configured routing and bridging test
Flavio Castro94b211e2016-06-22 11:00:48 -0700122 run.checkFlows( main, minFlowCount=116 )
123 run.pingAll( main )
Flavio Castro5608a392016-06-22 17:02:35 -0700124 # link failure
Flavio Castro94b211e2016-06-22 11:00:48 -0700125 run.killLink( main, 'spine101', 'leaf2', switches='4', links='6' )
126 run.pingAll( main, "CASE3_Failure" )
Flavio Castro5608a392016-06-22 17:02:35 -0700127 run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
Pierfb719b12016-09-19 14:51:44 -0700128 'of:0000000000000002', '2', '3', '4', '8' )
Flavio Castro94b211e2016-06-22 11:00:48 -0700129 run.pingAll( main, "CASE3_Recovery" )
Flavio Castro5608a392016-06-22 17:02:35 -0700130 # TODO Dynamic config of hosts in subnet
131 # TODO Dynamic config of host not in subnet
132 # TODO Dynamic config of vlan xconnect
133 # TODO Vrouter integration
134 # TODO Mcast integration
Flavio Castro94b211e2016-06-22 11:00:48 -0700135 run.cleanup( main )
136
137 def CASE5( self, main ):
138 """
139 Sets up 1-node Onos-cluster
140 Start 4x4 Leaf-Spine topology
141 Pingall
142 Cause link failure
143 Pingall
144 """
Flavio Castro5608a392016-06-22 17:02:35 -0700145 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
146 Testcaselib as run
147 if not hasattr( main, 'apps' ):
Flavio Castro94b211e2016-06-22 11:00:48 -0700148 run.initTest( main )
149 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
150 main.case( description )
151 main.cfgName = '4x4'
Devin Lim142b5342017-07-20 15:22:39 -0700152 main.Cluster.setRunningNode( 3 )
Flavio Castro94b211e2016-06-22 11:00:48 -0700153 run.installOnos( main )
154 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
Flavio Castro5608a392016-06-22 17:02:35 -0700155 # pre-configured routing and bridging test
Flavio Castro94b211e2016-06-22 11:00:48 -0700156 run.checkFlows( main, minFlowCount=350 )
157 run.pingAll( main )
Flavio Castro5608a392016-06-22 17:02:35 -0700158 # link failure
Flavio Castro94b211e2016-06-22 11:00:48 -0700159 run.killLink( main, 'spine101', 'leaf2', switches='8', links='30' )
160 run.pingAll( main, "CASE2_Failure" )
Flavio Castro5608a392016-06-22 17:02:35 -0700161 run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
Pierfb719b12016-09-19 14:51:44 -0700162 'of:0000000000000002', '2', '3', '8', '32' )
Flavio Castro94b211e2016-06-22 11:00:48 -0700163 run.pingAll( main, "CASE2_Recovery" )
Flavio Castro5608a392016-06-22 17:02:35 -0700164 # TODO Dynamic config of hosts in subnet
165 # TODO Dynamic config of host not in subnet
166 # TODO preconfigured xconnect
167 # TODO Vrouter integration
168 # TODO Mcast integration
Flavio Castro94b211e2016-06-22 11:00:48 -0700169 run.cleanup( main )