blob: 1af681c3b726a7b6c372cdfd7f8e49cddc82f933 [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 Castroab163ca2016-07-07 14:05:00 -070021# CASE1: 2x2 Leaf-Spine topo and test IP connectivity
22# CASE2: 4x4 topo + IP connectivity test
23# CASE3: Single switch topo + IP connectivity test
24# CASE4: 2x2 topo + 3-node ONOS CLUSTER + IP connectivity test
25# CASE5: 4x4 topo + 3-node ONOS CLUSTER + IP connectivity test
26# CASE6: Single switch + 3-node ONOS CLUSTER + IP connectivity test
27
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070028
Flavio Castroab163ca2016-07-07 14:05:00 -070029class SRDynamic:
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070030
Flavio Castroab163ca2016-07-07 14:05:00 -070031 def __init__( self ):
32 self.default = ''
33
34 def CASE1( self, main ):
35 """
36 Sets up 1-node Onos-cluster
37 Start 2x2 Leaf-Spine topology
38 Pingall
39 """
40 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
41 Testcaselib as run
42 if not hasattr( main, 'apps' ):
43 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 Castroab163ca2016-07-07 14:05:00 -070050 run.installOnos( main, vlanCfg=False )
51 run.startMininet( main, 'cord_fabric.py' )
52 # pre-configured routing and bridging test
53 run.checkFlows( main, minFlowCount=116 )
54 run.pingAll( main, dumpflows=False, )
55 run.addHostCfg( main )
56 run.checkFlows( main, minFlowCount=140, dumpflows=False )
57 run.pingAll( main, "CASE1" )
58 run.cleanup( main )
59
60 def CASE2( self, main ):
61 """
62 Sets up 1-node Onos-cluster
63 Start 4x4 Leaf-Spine topology
64 Pingall
65 """
66 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
67 Testcaselib as run
68 if not hasattr( main, 'apps' ):
69 run.initTest( main )
70 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
71 main.case( description )
72 main.cfgName = '4x4'
Devin Lim142b5342017-07-20 15:22:39 -070073 main.Cluster.setRunningNode( 1 )
Flavio Castroab163ca2016-07-07 14:05:00 -070074 run.installOnos( main, vlanCfg=False )
75 run.startMininet( main, 'cord_fabric.py',
76 args="--leaf=4 --spine=4" )
77 # pre-configured routing and bridging test
78 run.checkFlows( main, minFlowCount=350 )
79 run.pingAll( main, dumpflows=False )
80 run.addHostCfg( main )
81 run.checkFlows( main, minFlowCount=380, dumpflows=False )
82 run.pingAll( main, 'CASE2' )
83 run.cleanup( main )
84
85 def CASE3( self, main ):
86 """
87 Sets up 1-node Onos-cluster
88 Start single switch topology
89 Pingall
90 """
91 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
92 Testcaselib as run
93 if not hasattr( main, 'apps' ):
94 run.initTest( main )
95 description = "Bridging and Routing sanity test with single switch "
96 main.case( description )
97 main.cfgName = '0x1'
Devin Lim142b5342017-07-20 15:22:39 -070098 main.Cluster.setRunningNode( 1 )
Flavio Castroab163ca2016-07-07 14:05:00 -070099 run.installOnos( main, vlanCfg=False )
100 run.startMininet( main, 'cord_fabric.py',
101 args="--leaf=1 --spine=0" )
102 # pre-configured routing and bridging test
103 run.checkFlows( main, minFlowCount=15 )
104 run.pingAll( main, dumpflows=False )
105 run.addHostCfg( main )
106 run.checkFlows( main, minFlowCount=18, dumpflows=False )
107 run.pingAll( main, 'CASE3' )
108 run.cleanup( main )
109
110 def CASE4( self, main ):
111 """
112 Sets up 3-node Onos-cluster
113 Start 2x2 Leaf-Spine topology
114 Pingall
115 """
116 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
117 Testcaselib as run
118 if not hasattr( main, 'apps' ):
119 run.initTest( main )
120 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
121 main.case( description )
122
123 main.cfgName = '2x2'
Devin Lim142b5342017-07-20 15:22:39 -0700124 main.Cluster.setRunningNode( 3 )
Flavio Castroab163ca2016-07-07 14:05:00 -0700125 run.installOnos( main, vlanCfg=False )
126 run.startMininet( main, 'cord_fabric.py' )
127 # pre-configured routing and bridging test
128 run.checkFlows( main, minFlowCount=116 )
129 run.pingAll( main, dumpflows=False )
130 run.addHostCfg( main )
131 run.checkFlows( main, minFlowCount=140, dumpflows=False )
132 run.pingAll( main, "CASE4" )
133 run.killOnos( main, [ 0 ], '4', '8', '2' )
134 run.delHostCfg( main )
135 run.checkFlows( main, minFlowCount=116, dumpflows=False )
136 run.pingAll( main, "CASE4_after" )
137 run.cleanup( main )
138
139 def CASE5( self, main ):
140 """
141 Sets up 3-node Onos-cluster
142 Start 4x4 Leaf-Spine topology
143 Pingall
144 """
145 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
146 Testcaselib as run
147 if not hasattr( main, 'apps' ):
148 run.initTest( main )
149 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
150 main.case( description )
151 main.cfgName = '4x4'
Devin Lim142b5342017-07-20 15:22:39 -0700152 main.Cluster.setRunningNode( 3 )
Flavio Castroab163ca2016-07-07 14:05:00 -0700153 run.installOnos( main, vlanCfg=False )
154 run.startMininet( main, 'cord_fabric.py',
155 args="--leaf=4 --spine=4" )
156 # pre-configured routing and bridging test
157 run.checkFlows( main, minFlowCount=350 )
158 run.pingAll( main, dumpflows=False )
159 run.addHostCfg( main )
160 run.checkFlows( main, minFlowCount=380, dumpflows=False )
161 run.pingAll( main, 'CASE5' )
162 run.killOnos( main, [ 0 ], '8', '32', '2' )
163 run.delHostCfg( main )
164 run.checkFlows( main, minFlowCount=350, dumpflows=False )
165 run.pingAll( main, "CASE5_After" )
166 run.cleanup( main )
167
168 def CASE6( self, main ):
169 """
170 Sets up 3-node Onos-cluster
171 Start single switch topology
172 Pingall
173 """
174 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
175 Testcaselib as run
176 if not hasattr( main, 'apps' ):
177 run.initTest( main )
178 description = "Bridging and Routing sanity test with single switch "
179 main.case( description )
180 main.cfgName = '0x1'
Devin Lim142b5342017-07-20 15:22:39 -0700181 main.Cluster.setRunningNode( 3 )
Flavio Castroab163ca2016-07-07 14:05:00 -0700182 run.installOnos( main, vlanCfg=False )
183 run.startMininet( main, 'cord_fabric.py',
184 args="--leaf=1 --spine=0" )
185 # pre-configured routing and bridging test
186 run.checkFlows( main, minFlowCount=15 )
187 run.pingAll( main, dumpflows=False )
188 run.addHostCfg( main )
189 run.checkFlows( main, minFlowCount=20, dumpflows=False )
190 run.pingAll( main, 'CASE6' )
191 run.killOnos( main, [ 0 ], '1', '0', '2' )
192 run.delHostCfg( main )
193 run.checkFlows( main, minFlowCount=15, dumpflows=False )
194 run.pingAll( main, "CASE6_After" )
195 run.cleanup( main )