blob: 435683e6955d6218d3ea9405982903c3558af24d [file] [log] [blame]
Jeremy Ronquillob27ce4c2017-07-17 12:41:28 -07001"""
2Copyright 2016 Open Networking Foundation (ONF)
3
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
11 (at your option) any later version.
12
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"""
21
Flavio Castro5608a392016-06-22 17:02:35 -070022# CASE1: 2x2 Leaf-Spine topo and test IP connectivity
23# CASE2: 4x4 topo + IP connectivity test
24# CASE3: Single switch topo + IP connectivity test
25# CASE4: 2x2 topo + 3-node ONOS CLUSTER + IP connectivity test
26# CASE5: 4x4 topo + 3-node ONOS CLUSTER + IP connectivity test
27# CASE6: Single switch + 3-node ONOS CLUSTER + IP connectivity test
Flavio Castrof7faa422016-06-14 11:02:09 -070028
29class SRSanity:
Flavio Castrof7faa422016-06-14 11:02:09 -070030 def __init__( self ):
31 self.default = ''
32
33 def CASE1( self, main ):
Flavio Castrof7faa422016-06-14 11:02:09 -070034 """
Flavio Castro0a05b8d2016-06-16 17:26:51 -070035 Sets up 1-node Onos-cluster
36 Start 2x2 Leaf-Spine topology
37 Pingall
Flavio Castrof7faa422016-06-14 11:02:09 -070038 """
Flavio Castro49c218d2016-06-21 16:55:57 -070039 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
40 Testcaselib as run
41 if not hasattr( main, 'apps' ):
42 run.initTest( main )
Flavio Castrof7faa422016-06-14 11:02:09 -070043
Flavio Castro0a05b8d2016-06-16 17:26:51 -070044 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
45 main.case( description )
Flavio Castrof7faa422016-06-14 11:02:09 -070046
Flavio Castro0a05b8d2016-06-16 17:26:51 -070047 main.cfgName = '2x2'
Devin Lim142b5342017-07-20 15:22:39 -070048 main.Cluster.setRunningNode( 1 )
Flavio Castro49c218d2016-06-21 16:55:57 -070049 run.installOnos( main )
50 run.startMininet( main, 'cord_fabric.py' )
51 # pre-configured routing and bridging test
52 run.checkFlows( main, minFlowCount=116 )
53 run.pingAll( main, "CASE1" )
54 # TODO Dynamic config of hosts in subnet
55 # TODO Dynamic config of host not in subnet
56 # TODO Dynamic config of vlan xconnect
57 # TODO Vrouter integration
58 # TODO Mcast integration
59 run.cleanup( main )
Flavio Castrof7faa422016-06-14 11:02:09 -070060
Flavio Castrof7faa422016-06-14 11:02:09 -070061 def CASE2( self, main ):
62 """
Flavio Castro0a05b8d2016-06-16 17:26:51 -070063 Sets up 1-node Onos-cluster
64 Start 4x4 Leaf-Spine topology
65 Pingall
Flavio Castrof7faa422016-06-14 11:02:09 -070066 """
Flavio Castro49c218d2016-06-21 16:55:57 -070067 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
68 Testcaselib as run
69 if not hasattr( main, 'apps' ):
70 run.initTest( main )
Flavio Castro0a05b8d2016-06-16 17:26:51 -070071 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
72 main.case( description )
73 main.cfgName = '4x4'
Devin Lim142b5342017-07-20 15:22:39 -070074 main.Cluster.setRunningNode( 1 )
Flavio Castro49c218d2016-06-21 16:55:57 -070075 run.installOnos( main )
76 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
77 # pre-configured routing and bridging test
78 run.checkFlows( main, minFlowCount=350 )
79 run.pingAll( main, 'CASE2' )
80 # TODO Dynamic config of hosts in subnet
81 # TODO Dynamic config of host not in subnet
82 # TODO Dynamic config of vlan xconnect
83 # TODO Vrouter integration
84 # TODO Mcast integration
85 run.cleanup( main )
Flavio Castrof7faa422016-06-14 11:02:09 -070086
87 def CASE3( self, main ):
88 """
Flavio Castro02b43632016-06-20 17:07:27 -070089 Sets up 1-node Onos-cluster
90 Start single switch topology
91 Pingall
92 """
Flavio Castro49c218d2016-06-21 16:55:57 -070093 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
94 Testcaselib as run
95 if not hasattr( main, 'apps' ):
96 run.initTest( main )
Flavio Castro02b43632016-06-20 17:07:27 -070097 description = "Bridging and Routing sanity test with single switch "
98 main.case( description )
99 main.cfgName = '0x1'
100 main.numCtrls = 1
Flavio Castro49c218d2016-06-21 16:55:57 -0700101 run.installOnos( main )
102 run.startMininet( main, 'cord_fabric.py', args="--leaf=1 --spine=0" )
103 # pre-configured routing and bridging test
104 run.checkFlows( main, minFlowCount=15 )
105 run.pingAll( main, 'CASE3' )
106 # TODO Dynamic config of hosts in subnet
107 # TODO Dynamic config of host not in subnet
108 # TODO Dynamic config of vlan xconnect
109 # TODO Vrouter integration
110 # TODO Mcast integration
111 run.cleanup( main )
Flavio Castro02b43632016-06-20 17:07:27 -0700112
113 def CASE4( self, main ):
114 """
Flavio Castro0a05b8d2016-06-16 17:26:51 -0700115 Sets up 3-node Onos-cluster
116 Start 2x2 Leaf-Spine topology
Flavio Castrof7faa422016-06-14 11:02:09 -0700117 Pingall
118 """
Flavio Castro49c218d2016-06-21 16:55:57 -0700119 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
120 Testcaselib as run
121 if not hasattr( main, 'apps' ):
122 run.initTest( main )
Flavio Castro0a05b8d2016-06-16 17:26:51 -0700123 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
Flavio Castrof7faa422016-06-14 11:02:09 -0700124 main.case( description )
Flavio Castro0a05b8d2016-06-16 17:26:51 -0700125 main.cfgName = '2x2'
Devin Lim142b5342017-07-20 15:22:39 -0700126 main.Cluster.setRunningNode( 3 )
Flavio Castro49c218d2016-06-21 16:55:57 -0700127 run.installOnos( main )
128 run.startMininet( main, 'cord_fabric.py' )
129 # pre-configured routing and bridging test
130 run.checkFlows( main, minFlowCount=116 )
131 run.pingAll( main, 'CASE4' )
132 # TODO Dynamic config of hosts in subnet
133 # TODO Dynamic config of host not in subnet
134 # TODO Dynamic config of vlan xconnect
135 # TODO Vrouter integration
136 # TODO Mcast integration
137 run.cleanup( main )
Flavio Castro02b43632016-06-20 17:07:27 -0700138
139 def CASE5( self, main ):
140 """
141 Sets up 3-node Onos-cluster
142 Start 4x4 Leaf-Spine topology
143 Pingall
144 """
Flavio Castro49c218d2016-06-21 16:55:57 -0700145 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
146 Testcaselib as run
147 if not hasattr( main, 'apps' ):
148 run.initTest( main )
Flavio Castro02b43632016-06-20 17:07:27 -0700149 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 Castro49c218d2016-06-21 16:55:57 -0700153 run.installOnos( main )
154 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
155 # pre-configured routing and bridging test
156 run.checkFlows( main, minFlowCount=350 )
157 run.pingAll( main, 'CASE5' )
158 # TODO Dynamic config of hosts in subnet
159 # TODO Dynamic config of host not in subnet
160 # TODO Dynamic config of vlan xconnect
161 # TODO Vrouter integration
162 # TODO Mcast integration
163 run.cleanup( main )
Flavio Castro02b43632016-06-20 17:07:27 -0700164
165 def CASE6( self, main ):
166 """
167 Sets up 3-node Onos-cluster
168 Start single switch topology
169 Pingall
170 """
Flavio Castro49c218d2016-06-21 16:55:57 -0700171 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
172 Testcaselib as run
173 if not hasattr( main, 'apps' ):
174 run.initTest( main )
Flavio Castro02b43632016-06-20 17:07:27 -0700175 description = "Bridging and Routing sanity test with single switch "
176 main.case( description )
177 main.cfgName = '0x1'
Devin Lim142b5342017-07-20 15:22:39 -0700178 main.Cluster.setRunningNode( 3 )
Flavio Castro49c218d2016-06-21 16:55:57 -0700179 run.installOnos( main )
180 run.startMininet( main, 'cord_fabric.py', args="--leaf=1 --spine=0" )
181 # pre-configured routing and bridging test
182 run.checkFlows( main, minFlowCount=15 )
183 run.pingAll( main, 'CASE4' )
184 # TODO Dynamic config of hosts in subnet
185 # TODO Dynamic config of host not in subnet
186 # TODO Dynamic config of vlan xconnect
187 # TODO Vrouter integration
188 # TODO Mcast integration
189 run.cleanup( main )