Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame^] | 1 | #In this test we perform a link failure and then test for connectivity |
| 2 | #CASE1: 2x2 topo + link failure + IP connectivity test |
| 3 | #CASE2: 4x4 topo + link failure + IP connectivity test |
| 4 | #CASE4: 2x2 topo + 3-node ONOS CLUSTER + link failure + IP connectivity test |
| 5 | #CASE5: 4x4 topo + 3-node ONOS CLUSTER + link failure + IP connectivity test |
| 6 | |
| 7 | class SRLinkFailure: |
| 8 | |
| 9 | def __init__( self ): |
| 10 | self.default = '' |
| 11 | |
| 12 | def CASE1( self, main ): |
| 13 | """ |
| 14 | Sets up 1-node Onos-cluster |
| 15 | Start 2x2 Leaf-Spine topology |
| 16 | Pingall |
| 17 | Cause link failure |
| 18 | Pingall |
| 19 | """ |
| 20 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import 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 | #link failure |
| 35 | run.killLink( main, 'spine101', 'leaf2', switches='4', links='6' ) |
| 36 | run.pingAll( main, "CASE1_Failure" ) |
| 37 | run.restoreLink( main, 'spine101', 'leaf2','of:0000000000000101', |
| 38 | 'of:0000000000000002', '2', '1', '4', '8' ) |
| 39 | run.pingAll( main, "CASE1_Recovery" ) |
| 40 | #TODO Dynamic config of hosts in subnet |
| 41 | #TODO Dynamic config of host not in subnet |
| 42 | #TODO Dynamic config of vlan xconnect |
| 43 | #TODO Vrouter integration |
| 44 | #TODO Mcast integration |
| 45 | run.cleanup( main ) |
| 46 | |
| 47 | def CASE2( self, main ): |
| 48 | """ |
| 49 | Sets up 1-node Onos-cluster |
| 50 | Start 4x4 Leaf-Spine topology |
| 51 | Pingall |
| 52 | Cause link failure |
| 53 | Pingall |
| 54 | """ |
| 55 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run |
| 56 | if not hasattr( main,'apps' ): |
| 57 | run.initTest( main ) |
| 58 | description = "Bridging and Routing sanity test with 4x4 Leaf-spine " |
| 59 | main.case( description ) |
| 60 | main.cfgName = '4x4' |
| 61 | main.numCtrls = 1 |
| 62 | run.installOnos( main ) |
| 63 | run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" ) |
| 64 | #pre-configured routing and bridging test |
| 65 | run.checkFlows( main, minFlowCount=350 ) |
| 66 | run.pingAll( main ) |
| 67 | #link failure |
| 68 | run.killLink( main, 'spine101', 'leaf2', switches='8', links='30' ) |
| 69 | run.pingAll( main, "CASE2_Failure" ) |
| 70 | run.restoreLink( main, 'spine101', 'leaf2','of:0000000000000101', |
| 71 | 'of:0000000000000002', '2', '1', '8', '32' ) |
| 72 | run.pingAll( main, "CASE2_Recovery" ) |
| 73 | #TODO Dynamic config of hosts in subnet |
| 74 | #TODO Dynamic config of host not in subnet |
| 75 | #TODO preconfigured xconnect |
| 76 | #TODO Vrouter integration |
| 77 | #TODO Mcast integration |
| 78 | run.cleanup( main ) |
| 79 | |
| 80 | def CASE4( self, main ): |
| 81 | """ |
| 82 | Sets up 3-node Onos-cluster |
| 83 | Start 2x2 Leaf-Spine topology |
| 84 | Pingall |
| 85 | Cause link failure |
| 86 | Pingall |
| 87 | """ |
| 88 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run |
| 89 | if not hasattr( main,'apps' ): |
| 90 | run.initTest( main ) |
| 91 | description = "Bridging and Routing sanity test with 2x2 Leaf-spine " |
| 92 | main.case( description ) |
| 93 | main.cfgName = '2x2' |
| 94 | main.numCtrls = 3 |
| 95 | run.installOnos( main ) |
| 96 | run.startMininet( main, 'cord_fabric.py' ) |
| 97 | #pre-configured routing and bridging test |
| 98 | run.checkFlows( main, minFlowCount=116 ) |
| 99 | run.pingAll( main ) |
| 100 | #link failure |
| 101 | run.killLink( main, 'spine101', 'leaf2', switches='4', links='6' ) |
| 102 | run.pingAll( main, "CASE3_Failure" ) |
| 103 | run.restoreLink( main, 'spine101', 'leaf2','of:0000000000000101', |
| 104 | 'of:0000000000000002', '2', '1', '4', '8' ) |
| 105 | run.pingAll( main, "CASE3_Recovery" ) |
| 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 ) |
| 112 | |
| 113 | def CASE5( self, main ): |
| 114 | """ |
| 115 | Sets up 1-node Onos-cluster |
| 116 | Start 4x4 Leaf-Spine topology |
| 117 | Pingall |
| 118 | Cause link failure |
| 119 | Pingall |
| 120 | """ |
| 121 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run |
| 122 | if not hasattr( main,'apps' ): |
| 123 | run.initTest( main ) |
| 124 | description = "Bridging and Routing sanity test with 4x4 Leaf-spine " |
| 125 | main.case( description ) |
| 126 | main.cfgName = '4x4' |
| 127 | main.numCtrls = 3 |
| 128 | run.installOnos( main ) |
| 129 | run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" ) |
| 130 | #pre-configured routing and bridging test |
| 131 | run.checkFlows( main, minFlowCount=350 ) |
| 132 | run.pingAll( main ) |
| 133 | #link failure |
| 134 | run.killLink( main, 'spine101', 'leaf2', switches='8', links='30' ) |
| 135 | run.pingAll( main, "CASE2_Failure" ) |
| 136 | run.restoreLink( main, 'spine101', 'leaf2','of:0000000000000101', |
| 137 | 'of:0000000000000002', '2', '1', '8', '32' ) |
| 138 | run.pingAll( main, "CASE2_Recovery" ) |
| 139 | #TODO Dynamic config of hosts in subnet |
| 140 | #TODO Dynamic config of host not in subnet |
| 141 | #TODO preconfigured xconnect |
| 142 | #TODO Vrouter integration |
| 143 | #TODO Mcast integration |
| 144 | run.cleanup( main ) |