blob: 19ee08c675182ea8e1a888318872d606e6a172db [file] [log] [blame]
Flavio Castro5608a392016-06-22 17:02:35 -07001# In this test we perform a switch failure and then test for connectivity
2# CASE1: 2x2 topo + swtich failure + IP connectivity test
3# CASE2: 4x4 topo + switch failure + IP connectivity test
4# CASE4: 2x2 topo + 3-node ONOS CLUSTER + switch failure + IP connectivity test
5# CASE5: 4x4 topo + 3-node ONOS CLUSTER + switch failure + IP connectivity test
6
7class SRSwitchFailure:
8 def __init__( self ):
9 self.default = ''
10
11 def CASE1( self, main ):
12 """
13 Sets up 1-node Onos-cluster
14 Start 2x2 Leaf-Spine topology
15 Pingall
16 Cause switch failure
17 Pingall
18 """
19 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
20 Testcaselib as run
21 if not hasattr( main, 'apps' ):
22 run.initTest( main )
23
24 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
25 main.case( description )
26
27 main.cfgName = '2x2'
28 main.numCtrls = 1
29 run.installOnos( main )
30 run.startMininet( main, 'cord_fabric.py' )
31 # pre-configured routing and bridging test
32 run.checkFlows( main, minFlowCount=116 )
33 run.pingAll( main )
34 # switch failure\
35 switch = main.params[ 'kill' ][ 'switch' ]
36 run.killSwitch( main, switch, switches='3', links='4' )
37 run.pingAll( main, "CASE1_Failure" )
38 run.recoverSwitch( main, switch, switches='4', links='8' )
39 run.checkFlows( main, minFlowCount=116 )
40 run.pingAll( main, "CASE1_Recovery" )
41 # TODO Dynamic config of hosts in subnet
42 # TODO Dynamic config of host not in subnet
43 # TODO Dynamic config of vlan xconnect
44 # TODO Vrouter integration
45 # TODO Mcast integration
46 run.cleanup( main )
47
48 def CASE2( self, main ):
49 """
50 Sets up 1-node Onos-cluster
51 Start 4x4 Leaf-Spine topology
52 Pingall
53 Cause switch failure
54 Pingall
55 """
56 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
57 Testcaselib as run
Flavio Castroc0a2c5e2016-07-13 17:19:21 -070058 import time
Flavio Castro5608a392016-06-22 17:02:35 -070059 if not hasattr( main, 'apps' ):
60 run.initTest( main )
61 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
62 main.case( description )
63 main.cfgName = '4x4'
64 main.numCtrls = 1
65 run.installOnos( main )
66 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
67 # pre-configured routing and bridging test
68 run.checkFlows( main, minFlowCount=350 )
69 run.pingAll( main )
70 # switch failure
71 switch = main.params[ 'kill' ][ 'switch' ]
72 run.killSwitch( main, switch, switches='7', links='24' )
Flavio Castroc0a2c5e2016-07-13 17:19:21 -070073 time.sleep( main.switchSleep )
Flavio Castro5608a392016-06-22 17:02:35 -070074 run.pingAll( main, "CASE2_Failure" )
75 run.recoverSwitch( main, switch, switches='8', links='32' )
76 run.checkFlows( main, minFlowCount=350 )
77 run.pingAll( main, "CASE2_Recovery" )
78 # TODO Dynamic config of hosts in subnet
79 # TODO Dynamic config of host not in subnet
80 # TODO preconfigured xconnect
81 # TODO Vrouter integration
82 # TODO Mcast integration
83 run.cleanup( main )
84
85 def CASE4( self, main ):
86 """
87 Sets up 3-node Onos-cluster
88 Start 2x2 Leaf-Spine topology
89 Pingall
90 Cause link failure
91 Pingall
92 """
93 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
94 Testcaselib as run
95 if not hasattr( main, 'apps' ):
96 run.initTest( main )
97 description = "Bridging and Routing sanity test with 2x2 Leaf-spine "
98 main.case( description )
99 main.cfgName = '2x2'
100 main.numCtrls = 3
101 run.installOnos( main )
102 run.startMininet( main, 'cord_fabric.py' )
103 # pre-configured routing and bridging test
104 run.checkFlows( main, minFlowCount=116 )
105 run.pingAll( main )
106 # switch failure
107 switch = main.params[ 'kill' ][ 'switch' ]
108 run.killSwitch( main, switch, switches='3', links='4' )
109 run.pingAll( main, "CASE3_Failure" )
110 run.recoverSwitch( main, switch, switches='4', links='8' )
111 run.checkFlows( main, minFlowCount=116 )
112 run.pingAll( main, "CASE3_Recovery" )
113 # TODO Dynamic config of hosts in subnet
114 # TODO Dynamic config of host not in subnet
115 # TODO Dynamic config of vlan xconnect
116 # TODO Vrouter integration
117 # TODO Mcast integration
118 run.cleanup( main )
119
120 def CASE5( self, main ):
121 """
122 Sets up 1-node Onos-cluster
123 Start 4x4 Leaf-Spine topology
124 Pingall
125 Cause link failure
126 Pingall
127 """
128 from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
129 Testcaselib as run
Flavio Castroc0a2c5e2016-07-13 17:19:21 -0700130 import time
Flavio Castro5608a392016-06-22 17:02:35 -0700131 if not hasattr( main, 'apps' ):
132 run.initTest( main )
133 description = "Bridging and Routing sanity test with 4x4 Leaf-spine "
134 main.case( description )
135 main.cfgName = '4x4'
136 main.numCtrls = 3
137 run.installOnos( main )
138 run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
139 # pre-configured routing and bridging test
140 run.checkFlows( main, minFlowCount=350 )
141 run.pingAll( main )
142 # switch failure
143 switch = main.params[ 'kill' ][ 'switch' ]
144 run.killSwitch( main, switch, switches='7', links='24' )
Flavio Castroc0a2c5e2016-07-13 17:19:21 -0700145 time.sleep( main.switchSleep )
Flavio Castro5608a392016-06-22 17:02:35 -0700146 run.pingAll( main, "CASE4_Failure" )
147 run.recoverSwitch( main, switch, switches='8', links='32' )
148 run.checkFlows( main, minFlowCount=350 )
149 run.pingAll( main, "CASE4_Recovery" )
150 # TODO Dynamic config of hosts in subnet
151 # TODO Dynamic config of host not in subnet
152 # TODO preconfigured xconnect
153 # TODO Vrouter integration
154 # TODO Mcast integration
155 run.cleanup( main )