blob: d0d79c845a5c74e89c69c7b55665712be3343630 [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 switch failure and then test for connectivity
22# CASE1: 2x2 topo + swtich failure + IP connectivity test
23# CASE2: 4x4 topo + switch failure + IP connectivity test
24# CASE4: 2x2 topo + 3-node ONOS CLUSTER + switch failure + IP connectivity test
25# CASE5: 4x4 topo + 3-node ONOS CLUSTER + switch failure + IP connectivity test
26
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070027
Flavio Castro5608a392016-06-22 17:02:35 -070028class SRSwitchFailure:
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070029
Flavio Castro5608a392016-06-22 17:02:35 -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 switch failure
39 Pingall
40 """
41 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
42 Testcaselib as run
43 if not hasattr( main, 'apps' ):
44 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 Castro5608a392016-06-22 17:02:35 -070051 run.installOnos( main )
52 run.startMininet( main, 'cord_fabric.py' )
53 # pre-configured routing and bridging test
54 run.checkFlows( main, minFlowCount=116 )
55 run.pingAll( main )
56 # switch failure\
57 switch = main.params[ 'kill' ][ 'switch' ]
58 run.killSwitch( main, switch, switches='3', links='4' )
59 run.pingAll( main, "CASE1_Failure" )
60 run.recoverSwitch( main, switch, switches='4', links='8' )
61 run.checkFlows( main, minFlowCount=116 )
62 run.pingAll( main, "CASE1_Recovery" )
63 # TODO Dynamic config of hosts in subnet
64 # TODO Dynamic config of host not in subnet
65 # TODO Dynamic config of vlan xconnect
66 # TODO Vrouter integration
67 # TODO Mcast integration
68 run.cleanup( main )
69
70 def CASE2( self, main ):
71 """
72 Sets up 1-node Onos-cluster
73 Start 4x4 Leaf-Spine topology
74 Pingall
75 Cause switch failure
76 Pingall
77 """
78 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
79 Testcaselib as run
Flavio Castroc0a2c5e2016-07-13 17:19:21 -070080 import time
Flavio Castro5608a392016-06-22 17:02:35 -070081 if not hasattr( main, 'apps' ):
82 run.initTest( main )
83 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
84 main.case( description )
85 main.cfgName = '4x4'
Devin Lim142b5342017-07-20 15:22:39 -070086 main.Cluster.setRunningNode( 1 )
Flavio Castro5608a392016-06-22 17:02:35 -070087 run.installOnos( main )
88 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
89 # pre-configured routing and bridging test
90 run.checkFlows( main, minFlowCount=350 )
91 run.pingAll( main )
92 # switch failure
93 switch = main.params[ 'kill' ][ 'switch' ]
94 run.killSwitch( main, switch, switches='7', links='24' )
Flavio Castroc0a2c5e2016-07-13 17:19:21 -070095 time.sleep( main.switchSleep )
Flavio Castro5608a392016-06-22 17:02:35 -070096 run.pingAll( main, "CASE2_Failure" )
97 run.recoverSwitch( main, switch, switches='8', links='32' )
98 run.checkFlows( main, minFlowCount=350 )
99 run.pingAll( main, "CASE2_Recovery" )
100 # TODO Dynamic config of hosts in subnet
101 # TODO Dynamic config of host not in subnet
102 # TODO preconfigured xconnect
103 # TODO Vrouter integration
104 # TODO Mcast integration
105 run.cleanup( main )
106
107 def CASE4( self, main ):
108 """
109 Sets up 3-node Onos-cluster
110 Start 2x2 Leaf-Spine topology
111 Pingall
112 Cause link failure
113 Pingall
114 """
115 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
116 Testcaselib as run
117 if not hasattr( main, 'apps' ):
118 run.initTest( main )
119 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
120 main.case( description )
121 main.cfgName = '2x2'
Devin Lim142b5342017-07-20 15:22:39 -0700122 main.Cluster.setRunningNode( 3 )
Flavio Castro5608a392016-06-22 17:02:35 -0700123 run.installOnos( main )
124 run.startMininet( main, 'cord_fabric.py' )
125 # pre-configured routing and bridging test
126 run.checkFlows( main, minFlowCount=116 )
127 run.pingAll( main )
128 # switch failure
129 switch = main.params[ 'kill' ][ 'switch' ]
130 run.killSwitch( main, switch, switches='3', links='4' )
131 run.pingAll( main, "CASE3_Failure" )
132 run.recoverSwitch( main, switch, switches='4', links='8' )
133 run.checkFlows( main, minFlowCount=116 )
134 run.pingAll( main, "CASE3_Recovery" )
135 # TODO Dynamic config of hosts in subnet
136 # TODO Dynamic config of host not in subnet
137 # TODO Dynamic config of vlan xconnect
138 # TODO Vrouter integration
139 # TODO Mcast integration
140 run.cleanup( main )
141
142 def CASE5( self, main ):
143 """
144 Sets up 1-node Onos-cluster
145 Start 4x4 Leaf-Spine topology
146 Pingall
147 Cause link failure
148 Pingall
149 """
150 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
151 Testcaselib as run
Flavio Castroc0a2c5e2016-07-13 17:19:21 -0700152 import time
Flavio Castro5608a392016-06-22 17:02:35 -0700153 if not hasattr( main, 'apps' ):
154 run.initTest( main )
155 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
156 main.case( description )
157 main.cfgName = '4x4'
Devin Lim142b5342017-07-20 15:22:39 -0700158 main.Cluster.setRunningNode( 3 )
Flavio Castro5608a392016-06-22 17:02:35 -0700159 run.installOnos( main )
160 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
161 # pre-configured routing and bridging test
162 run.checkFlows( main, minFlowCount=350 )
163 run.pingAll( main )
164 # switch failure
165 switch = main.params[ 'kill' ][ 'switch' ]
166 run.killSwitch( main, switch, switches='7', links='24' )
Flavio Castroc0a2c5e2016-07-13 17:19:21 -0700167 time.sleep( main.switchSleep )
Flavio Castro5608a392016-06-22 17:02:35 -0700168 run.pingAll( main, "CASE4_Failure" )
169 run.recoverSwitch( main, switch, switches='8', links='32' )
170 run.checkFlows( main, minFlowCount=350 )
171 run.pingAll( main, "CASE4_Recovery" )
172 # TODO Dynamic config of hosts in subnet
173 # TODO Dynamic config of host not in subnet
174 # TODO preconfigured xconnect
175 # TODO Vrouter integration
176 # TODO Mcast integration
177 run.cleanup( main )