blob: 19700335e58a57302febdbd8b1c1f0a9470d3c02 [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"""
Piera2a7e1b2016-10-04 11:51:43 -070021# In this test we perform several failures and then test for connectivity
22# CASE1: 2x2 topo + 3 ONOS + | ONOS failure + IP connectivity test | x failures
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070023# CASE2: 2x2 topo + 3 ONOS + | ONOS ( random instance ) failure + IP connectivity test | x failures
Piera2a7e1b2016-10-04 11:51:43 -070024# CASE3: 4x4 topo + 3 ONOS + | ONOS failure + IP connectivity test | x failures
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070025# CASE4: 4x4 topo + 3 ONOS + | ONOS ( random instance ) failure + IP connectivity test | x failures
Piera2a7e1b2016-10-04 11:51:43 -070026# CASE5: 2x2 topo + 3 ONOS + | ONOS failure + Spine failure + IP connectivity test | x failures
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070027# CASE6: 2x2 topo + 3 ONOS + | ONOS ( random instance ) failure + Spine ( random switch ) failure + IP connectivity test | x failures
Piera2a7e1b2016-10-04 11:51:43 -070028# CASE7: 4x4 topo + 3 ONOS + | ONOS failure + Spine failure + IP connectivity test | x failures
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070029# CASE8: 4x4 topo + 3 ONOS + | ONOS ( random instance ) failure + Spine ( random switch ) failure + IP connectivity test | x failures
Piera2a7e1b2016-10-04 11:51:43 -070030
31
32class SRHighAvailability:
33
34 def __init__( self ):
35 self.default = ''
36
37 def CASE1( self, main ):
38 """
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070039 1 ) Sets up 3-nodes Onos-cluster
40 2 ) Start 2x2 Leaf-Spine topology
41 3 ) Pingall
42 4 ) Cause sequential ONOS failure
43 5 ) Pingall
44 6 ) Repeat 3 ), 4 ), 5 ) 'failures' times
Piera2a7e1b2016-10-04 11:51:43 -070045 """
Devin Lim57221b02018-02-14 15:45:36 -080046 try:
47 from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
48 except ImportError:
49 main.log.error( "SRHAFuncs not found. Exiting the test" )
50 main.cleanAndExit()
51 try:
52 main.funcs
53 except ( NameError, AttributeError ):
54 main.funcs = SRHAFuncs()
55 main.funcs.runTest( main, 1, 3, '2x2',
56 116, False, False )
Piera2a7e1b2016-10-04 11:51:43 -070057
58 def CASE2( self, main ):
59 """
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070060 1 ) Sets up 3-nodes Onos-cluster
61 2 ) Start 2x2 Leaf-Spine topology
62 3 ) Pingall
63 4 ) Cause random ONOS failure
64 5 ) Pingall
65 6 ) Repeat 3 ), 4 ), 5 ) 'failures' times
Piera2a7e1b2016-10-04 11:51:43 -070066 """
Devin Lim57221b02018-02-14 15:45:36 -080067 try:
68 from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
69 except ImportError:
70 main.log.error( "SRHAFuncs not found. Exiting the test" )
71 main.cleanAndExit()
72 try:
73 main.funcs
74 except ( NameError, AttributeError ):
75 main.funcs = SRHAFuncs()
76 main.funcs.runTest( main, 2, 3, '2x2',
77 116, True, False )
Piera2a7e1b2016-10-04 11:51:43 -070078
79 def CASE3( self, main ):
80 """
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070081 1 ) Sets up 3-nodes Onos-cluster
82 2 ) Start 4x4 Leaf-Spine topology
83 3 ) Pingall
84 4 ) Cause sequential ONOS failure
85 5 ) Pingall
86 6 ) Repeat 3 ), 4 ), 5 ) 'failures' times
Piera2a7e1b2016-10-04 11:51:43 -070087 """
Devin Lim57221b02018-02-14 15:45:36 -080088 try:
89 from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
90 except ImportError:
91 main.log.error( "SRHAFuncs not found. Exiting the test" )
92 main.cleanAndExit()
93 try:
94 main.funcs
95 except ( NameError, AttributeError ):
96 main.funcs = SRHAFuncs()
97 main.funcs.runTest( main, 3, 3, '4x4',
98 350, False, False )
Piera2a7e1b2016-10-04 11:51:43 -070099
100 def CASE4( self, main ):
101 """
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -0700102 1 ) Sets up 3-nodes Onos-cluster
103 2 ) Start 4x4 Leaf-Spine topology
104 3 ) Pingall
105 4 ) Cause random ONOS failure
106 5 ) Pingall
107 6 ) Repeat 3 ), 4 ), 5 ) 'failures' times
Piera2a7e1b2016-10-04 11:51:43 -0700108 """
Devin Lim57221b02018-02-14 15:45:36 -0800109 try:
110 from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
111 except ImportError:
112 main.log.error( "SRHAFuncs not found. Exiting the test" )
113 main.cleanAndExit()
114 try:
115 main.funcs
116 except ( NameError, AttributeError ):
117 main.funcs = SRHAFuncs()
118 main.funcs.runTest( main, 4, 3, '4x4',
119 350, True, False )
Piera2a7e1b2016-10-04 11:51:43 -0700120
121 def CASE5( self, main ):
122 """
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -0700123 1 ) Sets up 3-nodes Onos-cluster
124 2 ) Start 2x2 Leaf-Spine topology
125 3 ) Pingall
126 4 ) Cause sequential ONOS failure
127 5 ) Pingall
128 6 ) Cause sequential Spine failure
129 7 ) Pingall
130 8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ), 'failures' times
Piera2a7e1b2016-10-04 11:51:43 -0700131 """
Devin Lim57221b02018-02-14 15:45:36 -0800132 try:
133 from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
134 except ImportError:
135 main.log.error( "SRHAFuncs not found. Exiting the test" )
136 main.cleanAndExit()
137 try:
138 main.funcs
139 except ( NameError, AttributeError ):
140 main.funcs = SRHAFuncs()
141 main.funcs.runTest( main, 5, 3, '2x2',
142 116, False, True )
Piera2a7e1b2016-10-04 11:51:43 -0700143
144 def CASE6( self, main ):
145 """
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -0700146 1 ) Sets up 3-nodes Onos-cluster
147 2 ) Start 2x2 Leaf-Spine topology
148 3 ) Pingall
149 4 ) Cause random ONOS failure
150 5 ) Pingall
151 6 ) Cause random Spine failure
152 7 ) Pingall
153 8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ) 'failures' times
Piera2a7e1b2016-10-04 11:51:43 -0700154 """
Devin Lim57221b02018-02-14 15:45:36 -0800155 try:
156 from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
157 except ImportError:
158 main.log.error( "SRHAFuncs not found. Exiting the test" )
159 main.cleanAndExit()
160 try:
161 main.funcs
162 except ( NameError, AttributeError ):
163 main.funcs = SRHAFuncs()
164 main.funcs.runTest( main, 6, 3, '2x2',
165 116, True, True )
Piera2a7e1b2016-10-04 11:51:43 -0700166
167 def CASE7( self, main ):
168 """
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -0700169 1 ) Sets up 3-nodes Onos-cluster
170 2 ) Start 4x4 Leaf-Spine topology
171 3 ) Pingall
172 4 ) Cause sequential ONOS failure
173 5 ) Pingall
174 6 ) Cause sequential Spine failure
175 7 ) Pingall
176 8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ), 'failures' times
Piera2a7e1b2016-10-04 11:51:43 -0700177 """
Devin Lim57221b02018-02-14 15:45:36 -0800178 try:
179 from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
180 except ImportError:
181 main.log.error( "SRHAFuncs not found. Exiting the test" )
182 main.cleanAndExit()
183 try:
184 main.funcs
185 except ( NameError, AttributeError ):
186 main.funcs = SRHAFuncs()
187 main.funcs.runTest( main, 7, 3, '4x4',
188 350, False, True )
Piera2a7e1b2016-10-04 11:51:43 -0700189
190 def CASE8( self, main ):
191 """
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -0700192 1 ) Sets up 3-nodes Onos-cluster
193 2 ) Start 4x4 Leaf-Spine topology
194 3 ) Pingall
195 4 ) Cause random ONOS failure
196 5 ) Pingall
197 6 ) Cause random Spine failure
198 7 ) Pingall
199 8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ), 'failures' times
Piera2a7e1b2016-10-04 11:51:43 -0700200 """
Devin Lim57221b02018-02-14 15:45:36 -0800201 try:
202 from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs
203 except ImportError:
204 main.log.error( "SRHAFuncs not found. Exiting the test" )
205 main.cleanAndExit()
206 try:
207 main.funcs
208 except ( NameError, AttributeError ):
209 main.funcs = SRHAFuncs()
210 main.funcs.runTest( main, 8, 3, '4x4',
211 350, True, True )