Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 1 | # 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 | |
| 7 | class 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 |
| 58 | if not hasattr( main, 'apps' ): |
| 59 | run.initTest( main ) |
| 60 | description = "Bridging and Routing sanity test with 4x4 Leaf-spine " |
| 61 | main.case( description ) |
| 62 | main.cfgName = '4x4' |
| 63 | main.numCtrls = 1 |
| 64 | run.installOnos( main ) |
| 65 | run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" ) |
| 66 | # pre-configured routing and bridging test |
| 67 | run.checkFlows( main, minFlowCount=350 ) |
| 68 | run.pingAll( main ) |
| 69 | # switch failure |
| 70 | switch = main.params[ 'kill' ][ 'switch' ] |
| 71 | run.killSwitch( main, switch, switches='7', links='24' ) |
| 72 | run.pingAll( main, "CASE2_Failure" ) |
| 73 | run.recoverSwitch( main, switch, switches='8', links='32' ) |
| 74 | run.checkFlows( main, minFlowCount=350 ) |
| 75 | run.pingAll( main, "CASE2_Recovery" ) |
| 76 | # TODO Dynamic config of hosts in subnet |
| 77 | # TODO Dynamic config of host not in subnet |
| 78 | # TODO preconfigured xconnect |
| 79 | # TODO Vrouter integration |
| 80 | # TODO Mcast integration |
| 81 | run.cleanup( main ) |
| 82 | |
| 83 | def CASE4( self, main ): |
| 84 | """ |
| 85 | Sets up 3-node Onos-cluster |
| 86 | Start 2x2 Leaf-Spine topology |
| 87 | Pingall |
| 88 | Cause link failure |
| 89 | Pingall |
| 90 | """ |
| 91 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 92 | Testcaselib as run |
| 93 | if not hasattr( main, 'apps' ): |
| 94 | run.initTest( main ) |
| 95 | description = "Bridging and Routing sanity test with 2x2 Leaf-spine " |
| 96 | main.case( description ) |
| 97 | main.cfgName = '2x2' |
| 98 | main.numCtrls = 3 |
| 99 | run.installOnos( main ) |
| 100 | run.startMininet( main, 'cord_fabric.py' ) |
| 101 | # pre-configured routing and bridging test |
| 102 | run.checkFlows( main, minFlowCount=116 ) |
| 103 | run.pingAll( main ) |
| 104 | # switch failure |
| 105 | switch = main.params[ 'kill' ][ 'switch' ] |
| 106 | run.killSwitch( main, switch, switches='3', links='4' ) |
| 107 | run.pingAll( main, "CASE3_Failure" ) |
| 108 | run.recoverSwitch( main, switch, switches='4', links='8' ) |
| 109 | run.checkFlows( main, minFlowCount=116 ) |
| 110 | run.pingAll( main, "CASE3_Recovery" ) |
| 111 | # TODO Dynamic config of hosts in subnet |
| 112 | # TODO Dynamic config of host not in subnet |
| 113 | # TODO Dynamic config of vlan xconnect |
| 114 | # TODO Vrouter integration |
| 115 | # TODO Mcast integration |
| 116 | run.cleanup( main ) |
| 117 | |
| 118 | def CASE5( self, main ): |
| 119 | """ |
| 120 | Sets up 1-node Onos-cluster |
| 121 | Start 4x4 Leaf-Spine topology |
| 122 | Pingall |
| 123 | Cause link failure |
| 124 | Pingall |
| 125 | """ |
| 126 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 127 | Testcaselib as run |
| 128 | if not hasattr( main, 'apps' ): |
| 129 | run.initTest( main ) |
| 130 | description = "Bridging and Routing sanity test with 4x4 Leaf-spine " |
| 131 | main.case( description ) |
| 132 | main.cfgName = '4x4' |
| 133 | main.numCtrls = 3 |
| 134 | run.installOnos( main ) |
| 135 | run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" ) |
| 136 | # pre-configured routing and bridging test |
| 137 | run.checkFlows( main, minFlowCount=350 ) |
| 138 | run.pingAll( main ) |
| 139 | # switch failure |
| 140 | switch = main.params[ 'kill' ][ 'switch' ] |
| 141 | run.killSwitch( main, switch, switches='7', links='24' ) |
| 142 | run.pingAll( main, "CASE4_Failure" ) |
| 143 | run.recoverSwitch( main, switch, switches='8', links='32' ) |
| 144 | run.checkFlows( main, minFlowCount=350 ) |
| 145 | run.pingAll( main, "CASE4_Recovery" ) |
| 146 | # TODO Dynamic config of hosts in subnet |
| 147 | # TODO Dynamic config of host not in subnet |
| 148 | # TODO preconfigured xconnect |
| 149 | # TODO Vrouter integration |
| 150 | # TODO Mcast integration |
| 151 | run.cleanup( main ) |