blob: dfc6e6c05d2879af7011b27a84bc39256da72eac [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 """
Devin Lim57221b02018-02-14 15:45:36 -080041 try:
42 from tests.USECASE.SegmentRouting.SRLinkFailure.dependencies.SRLinkFailFuncs import SRLinkFailFuncs
43 except ImportError:
44 main.log.error( "SRLinkFailFuncs not found. Exiting the test" )
45 main.cleanAndExit()
46 try:
47 main.funcs
48 except ( NameError, AttributeError ):
49 main.funcs = SRLinkFailFuncs()
Flavio Castro94b211e2016-06-22 11:00:48 -070050
Devin Lim57221b02018-02-14 15:45:36 -080051 main.funcs.runTest( main, 1, 1, '2x2', 116 )
Flavio Castro94b211e2016-06-22 11:00:48 -070052
53 def CASE2( self, main ):
54 """
55 Sets up 1-node Onos-cluster
56 Start 4x4 Leaf-Spine topology
57 Pingall
58 Cause link failure
59 Pingall
60 """
Devin Lim57221b02018-02-14 15:45:36 -080061 try:
62 from tests.USECASE.SegmentRouting.SRLinkFailure.dependencies.SRLinkFailFuncs import SRLinkFailFuncs
63 except ImportError:
64 main.log.error( "SRLinkFailFuncs not found. Exiting the test" )
65 main.cleanAndExit()
66 try:
67 main.funcs
68 except ( NameError, AttributeError ):
69 main.funcs = SRLinkFailFuncs()
70
71 main.funcs.runTest( main, 2, 1, '4x4', 350 )
Flavio Castro94b211e2016-06-22 11:00:48 -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.SRLinkFailure.dependencies.SRLinkFailFuncs import SRLinkFailFuncs
83 except ImportError:
84 main.log.error( "SRLinkFailFuncs not found. Exiting the test" )
85 main.cleanAndExit()
86 try:
87 main.funcs
88 except ( NameError, AttributeError ):
89 main.funcs = SRLinkFailFuncs()
90
91 main.funcs.runTest( main, 3, 3, '2x2', 116 )
Flavio Castro94b211e2016-06-22 11:00:48 -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.SRLinkFailure.dependencies.SRLinkFailFuncs import SRLinkFailFuncs
103 except ImportError:
104 main.log.error( "SRLinkFailFuncs not found. Exiting the test" )
105 main.cleanAndExit()
106 try:
107 main.funcs
108 except ( NameError, AttributeError ):
109 main.funcs = SRLinkFailFuncs()
110
111 main.funcs.runTest( main, 4, 3, '4x4', 350 )