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