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