blob: 6c972b2f5458a2ad544ec87e063fe4afb53b3b84 [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 Castro519072e2016-06-23 13:30:48 -070021# CASE1: 2x2 topo + 3-node ONOS CLUSTER + IP connectivity test + Control plane resilience
22# CASE2: 4x4 topo + 3-node ONOS CLUSTER + IP connectivity test + Control plane resilience
23# CASE3: Single switch + 3-node ONOS CLUSTER + IP connectivity test + Control plane resilience
24
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070025
Flavio Castro519072e2016-06-23 13:30:48 -070026class SROnosFailure:
Jeremy Ronquillo23fb2162017-09-15 14:59:57 -070027
Flavio Castro519072e2016-06-23 13:30:48 -070028 def __init__( self ):
29 self.default = ''
30
31 def CASE1( self, main ):
32 """
33 Sets up 3-node Onos-cluster
34 Start 2x2 Leaf-Spine topology
35 Pingall
36 Induce ONOS Failure
37 Pingall
38 """
39 description = "ONOS Failure test with 2x2 Leaf-spine "
40 main.case( description )
41 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
42 Testcaselib as run
43 if not hasattr( main, 'apps' ):
44 run.initTest( main )
45 main.cfgName = '2x2'
Devin Lim142b5342017-07-20 15:22:39 -070046 main.Cluster.setRunningNode( 3 )
Flavio Castro519072e2016-06-23 13:30:48 -070047 run.installOnos( main )
48 run.startMininet( main, 'cord_fabric.py' )
49 # pre-configured routing and bridging test
50 run.checkFlows( main, minFlowCount=116 )
51 run.pingAll( main, "CASE1" )
52 run.killOnos( main, [ 0 ], '4', '8', '2' )
53 run.pingAll( main, 'CASE1_Failure' )
54 run.recoverOnos( main, [ 0 ], '4', '8', '3' )
55 run.checkFlows( main, minFlowCount=116 )
56 run.pingAll( main, 'CASE1_Failure' )
57 # TODO Dynamic config of hosts in subnet
58 # TODO Dynamic config of host not in subnet
59 # TODO Dynamic config of vlan xconnect
60 # TODO Vrouter integration
61 # TODO Mcast integration
62 run.cleanup( main )
63
64 def CASE2( self, main ):
65 """
66 Sets up 3-node Onos-cluster
67 Start 4x4 Leaf-Spine topology
68 Pingall
69 Induce ONOS Failure
70 Pingall
71 """
72 description = "ONOS Failure test with 4x4 Leaf-spine "
73 main.case( description )
74 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
75 Testcaselib as run
76 if not hasattr( main, 'apps' ):
77 run.initTest( main )
78 main.cfgName = '4x4'
Devin Lim142b5342017-07-20 15:22:39 -070079 main.Cluster.setRunningNode( 3 )
Flavio Castro519072e2016-06-23 13:30:48 -070080 run.installOnos( main )
81 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
82 # pre-configured routing and bridging test
83 run.checkFlows( main, minFlowCount=350 )
84 run.pingAll( main, 'CASE2' )
85 run.killOnos( main, [ 0 ], '8', '32', '2' )
86 run.pingAll( main, 'CASE2_Failure' )
87 run.recoverOnos( main, [ 0 ], '8', '32', '3' )
88 run.checkFlows( main, minFlowCount=350 )
89 run.pingAll( main, 'CASE3_Recovery' )
90 # TODO Dynamic config of hosts in subnet
91 # TODO Dynamic config of host not in subnet
92 # TODO Dynamic config of vlan xconnect
93 # TODO Vrouter integration
94 # TODO Mcast integration
95 run.cleanup( main )
96
97 def CASE3( self, main ):
98 """
99 Sets up 3-node Onos-cluster
100 Start single switch topology
101 Pingall
102 Induce ONOS Failure
103 Pingall
104 """
105 description = "ONOS Failure test with single switch "
106 main.case( description )
107 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
108 Testcaselib as run
109 if not hasattr( main, 'apps' ):
110 run.initTest( main )
111 main.cfgName = '0x1'
Devin Lim142b5342017-07-20 15:22:39 -0700112 main.Cluster.setRunningNode( 3 )
Flavio Castro519072e2016-06-23 13:30:48 -0700113 run.installOnos( main )
114 run.startMininet( main, 'cord_fabric.py', args="--leaf=1 --spine=0" )
115 # pre-configured routing and bridging test
116 run.checkFlows( main, minFlowCount=15 )
117 run.pingAll( main, 'CASE3' )
118 run.killOnos( main, [ 0 ], '1', '0', '2' )
119 run.pingAll( main, 'CASE3_Failure' )
120 run.recoverOnos( main, [ 0 ], '1', '0', '3' )
121 run.checkFlows( main, minFlowCount=15 )
122 run.pingAll( main, 'CASE3_Failure' )
123 # TODO Dynamic config of hosts in subnet
124 # TODO Dynamic config of host not in subnet
125 # TODO Dynamic config of vlan xconnect
126 # TODO Vrouter integration
127 # TODO Mcast integration
128 run.cleanup( main )