blob: 61a909898d21eb9e735925009e3f37a785ab0f64 [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 """
Devin Lim57221b02018-02-14 15:45:36 -080041 try:
42 from tests.USECASE.SegmentRouting.SRSwitchFailure.dependencies.SRSwitchFailureFuncs import SRSwitchFailureFuncs
43 except ImportError:
44 main.log.error( "SRSanityFuncs not found. Exiting the test" )
45 main.cleanAndExit()
46 try:
47 main.funcs
48 except ( NameError, AttributeError ):
49 main.funcs = SRSwitchFailureFuncs()
50 main.funcs.runTest( main, 1, 1,
51 '2x2', 116 )
Flavio Castro5608a392016-06-22 17:02:35 -070052
53 def CASE2( self, main ):
54 """
55 Sets up 1-node Onos-cluster
56 Start 4x4 Leaf-Spine topology
57 Pingall
58 Cause switch failure
59 Pingall
60 """
Devin Lim57221b02018-02-14 15:45:36 -080061 try:
62 from tests.USECASE.SegmentRouting.SRSwitchFailure.dependencies.SRSwitchFailureFuncs import SRSwitchFailureFuncs
63 except ImportError:
64 main.log.error( "SRSanityFuncs not found. Exiting the test" )
65 main.cleanAndExit()
66 try:
67 main.funcs
68 except ( NameError, AttributeError ):
69 main.funcs = SRSwitchFailureFuncs()
70 main.funcs.runTest( main, 2, 1,
71 '4x4', 350 )
Flavio Castro5608a392016-06-22 17:02:35 -070072
73 def CASE4( self, main ):
74 """
75 Sets up 3-node Onos-cluster
76 Start 2x2 Leaf-Spine topology
77 Pingall
78 Cause link failure
79 Pingall
80 """
Devin Lim57221b02018-02-14 15:45:36 -080081 try:
82 from tests.USECASE.SegmentRouting.SRSwitchFailure.dependencies.SRSwitchFailureFuncs import SRSwitchFailureFuncs
83 except ImportError:
84 main.log.error( "SRSanityFuncs not found. Exiting the test" )
85 main.cleanAndExit()
86 try:
87 main.funcs
88 except ( NameError, AttributeError ):
89 main.funcs = SRSwitchFailureFuncs()
90 main.funcs.runTest( main, 4, 3,
91 '2x2', 116 )
Flavio Castro5608a392016-06-22 17:02:35 -070092
93 def CASE5( self, main ):
94 """
95 Sets up 1-node Onos-cluster
96 Start 4x4 Leaf-Spine topology
97 Pingall
98 Cause link failure
99 Pingall
100 """
Devin Lim57221b02018-02-14 15:45:36 -0800101 try:
102 from tests.USECASE.SegmentRouting.SRSwitchFailure.dependencies.SRSwitchFailureFuncs import SRSwitchFailureFuncs
103 except ImportError:
104 main.log.error( "SRSanityFuncs not found. Exiting the test" )
105 main.cleanAndExit()
106 try:
107 main.funcs
108 except ( NameError, AttributeError ):
109 main.funcs = SRSwitchFailureFuncs()
110 main.funcs.runTest( main, 5, 3,
111 '4x4', 350 )