blob: cb95b18ea8c195404741f694a9279b13d9fd3493 [file] [log] [blame]
Jeremy Ronquillob27ce4c2017-07-17 12:41:28 -07001"""
2Copyright 2016 Open Networking Foundation (ONF)
3
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
11 (at your option) any later version.
12
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"""
21
Flavio Castro5608a392016-06-22 17:02:35 -070022# In this test we perform a link failure and then test for connectivity
23# CASE1: 2x2 topo + link failure + IP connectivity test
24# CASE2: 4x4 topo + link failure + IP connectivity test
25# CASE4: 2x2 topo + 3-node ONOS CLUSTER + link failure + IP connectivity test
26# CASE5: 4x4 topo + 3-node ONOS CLUSTER + link failure + IP connectivity test
Flavio Castro94b211e2016-06-22 11:00:48 -070027
28class SRLinkFailure:
Flavio Castro94b211e2016-06-22 11:00:48 -070029 def __init__( self ):
30 self.default = ''
31
32 def CASE1( self, main ):
33 """
34 Sets up 1-node Onos-cluster
35 Start 2x2 Leaf-Spine topology
36 Pingall
37 Cause link failure
38 Pingall
39 """
Flavio Castro5608a392016-06-22 17:02:35 -070040 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
41 Testcaselib as run
42 if not hasattr( main, 'apps' ):
Flavio Castro94b211e2016-06-22 11:00:48 -070043 run.initTest( main )
44
45 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
46 main.case( description )
47
48 main.cfgName = '2x2'
Devin Lim142b5342017-07-20 15:22:39 -070049 main.Cluster.setRunningNode( 1 )
Flavio Castro94b211e2016-06-22 11:00:48 -070050 run.installOnos( main )
51 run.startMininet( main, 'cord_fabric.py' )
Flavio Castro5608a392016-06-22 17:02:35 -070052 # pre-configured routing and bridging test
Flavio Castro94b211e2016-06-22 11:00:48 -070053 run.checkFlows( main, minFlowCount=116 )
54 run.pingAll( main )
Flavio Castro5608a392016-06-22 17:02:35 -070055 # link failure
Flavio Castro94b211e2016-06-22 11:00:48 -070056 run.killLink( main, 'spine101', 'leaf2', switches='4', links='6' )
57 run.pingAll( main, "CASE1_Failure" )
Flavio Castro5608a392016-06-22 17:02:35 -070058 run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
Pierfb719b12016-09-19 14:51:44 -070059 'of:0000000000000002', '2', '3', '4', '8' )
Flavio Castro94b211e2016-06-22 11:00:48 -070060 run.pingAll( main, "CASE1_Recovery" )
Flavio Castro5608a392016-06-22 17:02:35 -070061 # TODO Dynamic config of hosts in subnet
62 # TODO Dynamic config of host not in subnet
63 # TODO Dynamic config of vlan xconnect
64 # TODO Vrouter integration
65 # TODO Mcast integration
Flavio Castro94b211e2016-06-22 11:00:48 -070066 run.cleanup( main )
67
68 def CASE2( self, main ):
69 """
70 Sets up 1-node Onos-cluster
71 Start 4x4 Leaf-Spine topology
72 Pingall
73 Cause link failure
74 Pingall
75 """
Flavio Castro5608a392016-06-22 17:02:35 -070076 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
77 Testcaselib as run
78 if not hasattr( main, 'apps' ):
Flavio Castro94b211e2016-06-22 11:00:48 -070079 run.initTest( main )
80 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
81 main.case( description )
82 main.cfgName = '4x4'
Devin Lim142b5342017-07-20 15:22:39 -070083 main.Cluster.setRunningNode( 1 )
Flavio Castro94b211e2016-06-22 11:00:48 -070084 run.installOnos( main )
85 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
Flavio Castro5608a392016-06-22 17:02:35 -070086 # pre-configured routing and bridging test
Flavio Castro94b211e2016-06-22 11:00:48 -070087 run.checkFlows( main, minFlowCount=350 )
88 run.pingAll( main )
Flavio Castro5608a392016-06-22 17:02:35 -070089 # link failure
Flavio Castro94b211e2016-06-22 11:00:48 -070090 run.killLink( main, 'spine101', 'leaf2', switches='8', links='30' )
91 run.pingAll( main, "CASE2_Failure" )
Flavio Castro5608a392016-06-22 17:02:35 -070092 run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
Pierfb719b12016-09-19 14:51:44 -070093 'of:0000000000000002', '2', '3', '8', '32' )
Flavio Castro94b211e2016-06-22 11:00:48 -070094 run.pingAll( main, "CASE2_Recovery" )
Flavio Castro5608a392016-06-22 17:02:35 -070095 # TODO Dynamic config of hosts in subnet
96 # TODO Dynamic config of host not in subnet
97 # TODO preconfigured xconnect
98 # TODO Vrouter integration
99 # TODO Mcast integration
Flavio Castro94b211e2016-06-22 11:00:48 -0700100 run.cleanup( main )
101
102 def CASE4( self, main ):
103 """
104 Sets up 3-node Onos-cluster
105 Start 2x2 Leaf-Spine topology
106 Pingall
107 Cause link failure
108 Pingall
109 """
Flavio Castro5608a392016-06-22 17:02:35 -0700110 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
111 Testcaselib as run
112 if not hasattr( main, 'apps' ):
Flavio Castro94b211e2016-06-22 11:00:48 -0700113 run.initTest( main )
114 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
115 main.case( description )
116 main.cfgName = '2x2'
Devin Lim142b5342017-07-20 15:22:39 -0700117 main.Cluster.setRunningNode( 3 )
Flavio Castro94b211e2016-06-22 11:00:48 -0700118 run.installOnos( main )
119 run.startMininet( main, 'cord_fabric.py' )
Flavio Castro5608a392016-06-22 17:02:35 -0700120 # pre-configured routing and bridging test
Flavio Castro94b211e2016-06-22 11:00:48 -0700121 run.checkFlows( main, minFlowCount=116 )
122 run.pingAll( main )
Flavio Castro5608a392016-06-22 17:02:35 -0700123 # link failure
Flavio Castro94b211e2016-06-22 11:00:48 -0700124 run.killLink( main, 'spine101', 'leaf2', switches='4', links='6' )
125 run.pingAll( main, "CASE3_Failure" )
Flavio Castro5608a392016-06-22 17:02:35 -0700126 run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
Pierfb719b12016-09-19 14:51:44 -0700127 'of:0000000000000002', '2', '3', '4', '8' )
Flavio Castro94b211e2016-06-22 11:00:48 -0700128 run.pingAll( main, "CASE3_Recovery" )
Flavio Castro5608a392016-06-22 17:02:35 -0700129 # TODO Dynamic config of hosts in subnet
130 # TODO Dynamic config of host not in subnet
131 # TODO Dynamic config of vlan xconnect
132 # TODO Vrouter integration
133 # TODO Mcast integration
Flavio Castro94b211e2016-06-22 11:00:48 -0700134 run.cleanup( main )
135
136 def CASE5( self, main ):
137 """
138 Sets up 1-node Onos-cluster
139 Start 4x4 Leaf-Spine topology
140 Pingall
141 Cause link failure
142 Pingall
143 """
Flavio Castro5608a392016-06-22 17:02:35 -0700144 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
145 Testcaselib as run
146 if not hasattr( main, 'apps' ):
Flavio Castro94b211e2016-06-22 11:00:48 -0700147 run.initTest( main )
148 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
149 main.case( description )
150 main.cfgName = '4x4'
Devin Lim142b5342017-07-20 15:22:39 -0700151 main.Cluster.setRunningNode( 3 )
Flavio Castro94b211e2016-06-22 11:00:48 -0700152 run.installOnos( main )
153 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
Flavio Castro5608a392016-06-22 17:02:35 -0700154 # pre-configured routing and bridging test
Flavio Castro94b211e2016-06-22 11:00:48 -0700155 run.checkFlows( main, minFlowCount=350 )
156 run.pingAll( main )
Flavio Castro5608a392016-06-22 17:02:35 -0700157 # link failure
Flavio Castro94b211e2016-06-22 11:00:48 -0700158 run.killLink( main, 'spine101', 'leaf2', switches='8', links='30' )
159 run.pingAll( main, "CASE2_Failure" )
Flavio Castro5608a392016-06-22 17:02:35 -0700160 run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101',
Pierfb719b12016-09-19 14:51:44 -0700161 'of:0000000000000002', '2', '3', '8', '32' )
Flavio Castro94b211e2016-06-22 11:00:48 -0700162 run.pingAll( main, "CASE2_Recovery" )
Flavio Castro5608a392016-06-22 17:02:35 -0700163 # TODO Dynamic config of hosts in subnet
164 # TODO Dynamic config of host not in subnet
165 # TODO preconfigured xconnect
166 # TODO Vrouter integration
167 # TODO Mcast integration
Flavio Castro94b211e2016-06-22 11:00:48 -0700168 run.cleanup( main )