blob: 2919500b49d56b2d49552bf53fb33f0ef60329cb [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# 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
Flavio Castrof7faa422016-06-14 11:02:09 -070027
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070028
Flavio Castrof7faa422016-06-14 11:02:09 -070029class SRSanity:
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070030
Flavio Castrof7faa422016-06-14 11:02:09 -070031 def __init__( self ):
32 self.default = ''
33
34 def CASE1( self, main ):
Flavio Castrof7faa422016-06-14 11:02:09 -070035 """
Flavio Castro0a05b8d2016-06-16 17:26:51 -070036 Sets up 1-node Onos-cluster
37 Start 2x2 Leaf-Spine topology
38 Pingall
Flavio Castrof7faa422016-06-14 11:02:09 -070039 """
Flavio Castro49c218d2016-06-21 16:55:57 -070040 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
41 Testcaselib as run
42 if not hasattr( main, 'apps' ):
43 run.initTest( main )
Flavio Castrof7faa422016-06-14 11:02:09 -070044
Flavio Castro0a05b8d2016-06-16 17:26:51 -070045 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
46 main.case( description )
Flavio Castrof7faa422016-06-14 11:02:09 -070047
Flavio Castro0a05b8d2016-06-16 17:26:51 -070048 main.cfgName = '2x2'
Devin Lim142b5342017-07-20 15:22:39 -070049 main.Cluster.setRunningNode( 1 )
Flavio Castro49c218d2016-06-21 16:55:57 -070050 run.installOnos( main )
51 run.startMininet( main, 'cord_fabric.py' )
52 # pre-configured routing and bridging test
53 run.checkFlows( main, minFlowCount=116 )
54 run.pingAll( main, "CASE1" )
55 # TODO Dynamic config of hosts in subnet
56 # TODO Dynamic config of host not in subnet
57 # TODO Dynamic config of vlan xconnect
58 # TODO Vrouter integration
59 # TODO Mcast integration
60 run.cleanup( main )
Flavio Castrof7faa422016-06-14 11:02:09 -070061
Flavio Castrof7faa422016-06-14 11:02:09 -070062 def CASE2( self, main ):
63 """
Flavio Castro0a05b8d2016-06-16 17:26:51 -070064 Sets up 1-node Onos-cluster
65 Start 4x4 Leaf-Spine topology
66 Pingall
Flavio Castrof7faa422016-06-14 11:02:09 -070067 """
Flavio Castro49c218d2016-06-21 16:55:57 -070068 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
69 Testcaselib as run
70 if not hasattr( main, 'apps' ):
71 run.initTest( main )
Flavio Castro0a05b8d2016-06-16 17:26:51 -070072 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
73 main.case( description )
74 main.cfgName = '4x4'
Devin Lim142b5342017-07-20 15:22:39 -070075 main.Cluster.setRunningNode( 1 )
Flavio Castro49c218d2016-06-21 16:55:57 -070076 run.installOnos( main )
77 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
78 # pre-configured routing and bridging test
79 run.checkFlows( main, minFlowCount=350 )
80 run.pingAll( main, 'CASE2' )
81 # TODO Dynamic config of hosts in subnet
82 # TODO Dynamic config of host not in subnet
83 # TODO Dynamic config of vlan xconnect
84 # TODO Vrouter integration
85 # TODO Mcast integration
86 run.cleanup( main )
Flavio Castrof7faa422016-06-14 11:02:09 -070087
88 def CASE3( self, main ):
89 """
Flavio Castro02b43632016-06-20 17:07:27 -070090 Sets up 1-node Onos-cluster
91 Start single switch topology
92 Pingall
93 """
Flavio Castro49c218d2016-06-21 16:55:57 -070094 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
95 Testcaselib as run
96 if not hasattr( main, 'apps' ):
97 run.initTest( main )
Flavio Castro02b43632016-06-20 17:07:27 -070098 description = "Bridging and Routing sanity test with single switch "
99 main.case( description )
100 main.cfgName = '0x1'
101 main.numCtrls = 1
Flavio Castro49c218d2016-06-21 16:55:57 -0700102 run.installOnos( main )
103 run.startMininet( main, 'cord_fabric.py', args="--leaf=1 --spine=0" )
104 # pre-configured routing and bridging test
105 run.checkFlows( main, minFlowCount=15 )
106 run.pingAll( main, 'CASE3' )
107 # TODO Dynamic config of hosts in subnet
108 # TODO Dynamic config of host not in subnet
109 # TODO Dynamic config of vlan xconnect
110 # TODO Vrouter integration
111 # TODO Mcast integration
112 run.cleanup( main )
Flavio Castro02b43632016-06-20 17:07:27 -0700113
114 def CASE4( self, main ):
115 """
Flavio Castro0a05b8d2016-06-16 17:26:51 -0700116 Sets up 3-node Onos-cluster
117 Start 2x2 Leaf-Spine topology
Flavio Castrof7faa422016-06-14 11:02:09 -0700118 Pingall
119 """
Flavio Castro49c218d2016-06-21 16:55:57 -0700120 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
121 Testcaselib as run
122 if not hasattr( main, 'apps' ):
123 run.initTest( main )
Flavio Castro0a05b8d2016-06-16 17:26:51 -0700124 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
Flavio Castrof7faa422016-06-14 11:02:09 -0700125 main.case( description )
Flavio Castro0a05b8d2016-06-16 17:26:51 -0700126 main.cfgName = '2x2'
Devin Lim142b5342017-07-20 15:22:39 -0700127 main.Cluster.setRunningNode( 3 )
Flavio Castro49c218d2016-06-21 16:55:57 -0700128 run.installOnos( main )
129 run.startMininet( main, 'cord_fabric.py' )
130 # pre-configured routing and bridging test
131 run.checkFlows( main, minFlowCount=116 )
132 run.pingAll( main, 'CASE4' )
133 # TODO Dynamic config of hosts in subnet
134 # TODO Dynamic config of host not in subnet
135 # TODO Dynamic config of vlan xconnect
136 # TODO Vrouter integration
137 # TODO Mcast integration
138 run.cleanup( main )
Flavio Castro02b43632016-06-20 17:07:27 -0700139
140 def CASE5( self, main ):
141 """
142 Sets up 3-node Onos-cluster
143 Start 4x4 Leaf-Spine topology
144 Pingall
145 """
Flavio Castro49c218d2016-06-21 16:55:57 -0700146 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
147 Testcaselib as run
148 if not hasattr( main, 'apps' ):
149 run.initTest( main )
Flavio Castro02b43632016-06-20 17:07:27 -0700150 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
151 main.case( description )
152 main.cfgName = '4x4'
Devin Lim142b5342017-07-20 15:22:39 -0700153 main.Cluster.setRunningNode( 3 )
Flavio Castro49c218d2016-06-21 16:55:57 -0700154 run.installOnos( main )
155 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
156 # pre-configured routing and bridging test
157 run.checkFlows( main, minFlowCount=350 )
158 run.pingAll( main, 'CASE5' )
159 # TODO Dynamic config of hosts in subnet
160 # TODO Dynamic config of host not in subnet
161 # TODO Dynamic config of vlan xconnect
162 # TODO Vrouter integration
163 # TODO Mcast integration
164 run.cleanup( main )
Flavio Castro02b43632016-06-20 17:07:27 -0700165
166 def CASE6( self, main ):
167 """
168 Sets up 3-node Onos-cluster
169 Start single switch topology
170 Pingall
171 """
Flavio Castro49c218d2016-06-21 16:55:57 -0700172 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
173 Testcaselib as run
174 if not hasattr( main, 'apps' ):
175 run.initTest( main )
Flavio Castro02b43632016-06-20 17:07:27 -0700176 description = "Bridging and Routing sanity test with single switch "
177 main.case( description )
178 main.cfgName = '0x1'
Devin Lim142b5342017-07-20 15:22:39 -0700179 main.Cluster.setRunningNode( 3 )
Flavio Castro49c218d2016-06-21 16:55:57 -0700180 run.installOnos( main )
181 run.startMininet( main, 'cord_fabric.py', args="--leaf=1 --spine=0" )
182 # pre-configured routing and bridging test
183 run.checkFlows( main, minFlowCount=15 )
184 run.pingAll( main, 'CASE4' )
185 # TODO Dynamic config of hosts in subnet
186 # TODO Dynamic config of host not in subnet
187 # TODO Dynamic config of vlan xconnect
188 # TODO Vrouter integration
189 # TODO Mcast integration
190 run.cleanup( main )