Jeremy Ronquillo | b27ce4c | 2017-07-17 12:41:28 -0700 | [diff] [blame] | 1 | """ |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 2 | Copyright 2016 Open Networking Foundation ( ONF ) |
Jeremy Ronquillo | b27ce4c | 2017-07-17 12:41:28 -0700 | [diff] [blame] | 3 | |
| 4 | Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>, |
| 5 | the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>, |
| 6 | or 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 |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 11 | ( at your option ) any later version. |
Jeremy Ronquillo | b27ce4c | 2017-07-17 12:41:28 -0700 | [diff] [blame] | 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 | """ |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 21 | # In this test we perform a link failure and then test for connectivity |
| 22 | # CASE1: 2x2 topo + link failure + IP connectivity test |
| 23 | # CASE2: 4x4 topo + link failure + IP connectivity test |
| 24 | # CASE4: 2x2 topo + 3-node ONOS CLUSTER + link failure + IP connectivity test |
| 25 | # CASE5: 4x4 topo + 3-node ONOS CLUSTER + link failure + IP connectivity test |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 26 | |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 27 | |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 28 | class SRLinkFailure: |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 29 | |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 30 | def __init__( self ): |
| 31 | self.default = '' |
| 32 | |
| 33 | def CASE1( self, main ): |
| 34 | """ |
| 35 | Sets up 1-node Onos-cluster |
| 36 | Start 2x2 Leaf-Spine topology |
| 37 | Pingall |
| 38 | Cause link failure |
| 39 | Pingall |
| 40 | """ |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 41 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 42 | Testcaselib as run |
| 43 | if not hasattr( main, 'apps' ): |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 44 | run.initTest( main ) |
| 45 | |
| 46 | description = "Bridging and Routing sanity test with 2x2 Leaf-spine " |
| 47 | main.case( description ) |
| 48 | |
| 49 | main.cfgName = '2x2' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 50 | main.Cluster.setRunningNode( 1 ) |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 51 | run.installOnos( main ) |
| 52 | run.startMininet( main, 'cord_fabric.py' ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 53 | # pre-configured routing and bridging test |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 54 | run.checkFlows( main, minFlowCount=116 ) |
| 55 | run.pingAll( main ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 56 | # link failure |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 57 | run.killLink( main, 'spine101', 'leaf2', switches='4', links='6' ) |
| 58 | run.pingAll( main, "CASE1_Failure" ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 59 | run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101', |
Pier | fb719b1 | 2016-09-19 14:51:44 -0700 | [diff] [blame] | 60 | 'of:0000000000000002', '2', '3', '4', '8' ) |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 61 | run.pingAll( main, "CASE1_Recovery" ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 62 | # TODO Dynamic config of hosts in subnet |
| 63 | # TODO Dynamic config of host not in subnet |
| 64 | # TODO Dynamic config of vlan xconnect |
| 65 | # TODO Vrouter integration |
| 66 | # TODO Mcast integration |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 67 | run.cleanup( main ) |
| 68 | |
| 69 | def CASE2( self, main ): |
| 70 | """ |
| 71 | Sets up 1-node Onos-cluster |
| 72 | Start 4x4 Leaf-Spine topology |
| 73 | Pingall |
| 74 | Cause link failure |
| 75 | Pingall |
| 76 | """ |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 77 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 78 | Testcaselib as run |
| 79 | if not hasattr( main, 'apps' ): |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 80 | run.initTest( main ) |
| 81 | description = "Bridging and Routing sanity test with 4x4 Leaf-spine " |
| 82 | main.case( description ) |
| 83 | main.cfgName = '4x4' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 84 | main.Cluster.setRunningNode( 1 ) |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 85 | run.installOnos( main ) |
| 86 | run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 87 | # pre-configured routing and bridging test |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 88 | run.checkFlows( main, minFlowCount=350 ) |
| 89 | run.pingAll( main ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 90 | # link failure |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 91 | run.killLink( main, 'spine101', 'leaf2', switches='8', links='30' ) |
| 92 | run.pingAll( main, "CASE2_Failure" ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 93 | run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101', |
Pier | fb719b1 | 2016-09-19 14:51:44 -0700 | [diff] [blame] | 94 | 'of:0000000000000002', '2', '3', '8', '32' ) |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 95 | run.pingAll( main, "CASE2_Recovery" ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 96 | # TODO Dynamic config of hosts in subnet |
| 97 | # TODO Dynamic config of host not in subnet |
| 98 | # TODO preconfigured xconnect |
| 99 | # TODO Vrouter integration |
| 100 | # TODO Mcast integration |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 101 | run.cleanup( main ) |
| 102 | |
| 103 | def CASE4( self, main ): |
| 104 | """ |
| 105 | Sets up 3-node Onos-cluster |
| 106 | Start 2x2 Leaf-Spine topology |
| 107 | Pingall |
| 108 | Cause link failure |
| 109 | Pingall |
| 110 | """ |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 111 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 112 | Testcaselib as run |
| 113 | if not hasattr( main, 'apps' ): |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 114 | run.initTest( main ) |
| 115 | description = "Bridging and Routing sanity test with 2x2 Leaf-spine " |
| 116 | main.case( description ) |
| 117 | main.cfgName = '2x2' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 118 | main.Cluster.setRunningNode( 3 ) |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 119 | run.installOnos( main ) |
| 120 | run.startMininet( main, 'cord_fabric.py' ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 121 | # pre-configured routing and bridging test |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 122 | run.checkFlows( main, minFlowCount=116 ) |
| 123 | run.pingAll( main ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 124 | # link failure |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 125 | run.killLink( main, 'spine101', 'leaf2', switches='4', links='6' ) |
| 126 | run.pingAll( main, "CASE3_Failure" ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 127 | run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101', |
Pier | fb719b1 | 2016-09-19 14:51:44 -0700 | [diff] [blame] | 128 | 'of:0000000000000002', '2', '3', '4', '8' ) |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 129 | run.pingAll( main, "CASE3_Recovery" ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 130 | # TODO Dynamic config of hosts in subnet |
| 131 | # TODO Dynamic config of host not in subnet |
| 132 | # TODO Dynamic config of vlan xconnect |
| 133 | # TODO Vrouter integration |
| 134 | # TODO Mcast integration |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 135 | run.cleanup( main ) |
| 136 | |
| 137 | def CASE5( self, main ): |
| 138 | """ |
| 139 | Sets up 1-node Onos-cluster |
| 140 | Start 4x4 Leaf-Spine topology |
| 141 | Pingall |
| 142 | Cause link failure |
| 143 | Pingall |
| 144 | """ |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 145 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 146 | Testcaselib as run |
| 147 | if not hasattr( main, 'apps' ): |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 148 | run.initTest( main ) |
| 149 | description = "Bridging and Routing sanity test with 4x4 Leaf-spine " |
| 150 | main.case( description ) |
| 151 | main.cfgName = '4x4' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 152 | main.Cluster.setRunningNode( 3 ) |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 153 | run.installOnos( main ) |
| 154 | run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 155 | # pre-configured routing and bridging test |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 156 | run.checkFlows( main, minFlowCount=350 ) |
| 157 | run.pingAll( main ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 158 | # link failure |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 159 | run.killLink( main, 'spine101', 'leaf2', switches='8', links='30' ) |
| 160 | run.pingAll( main, "CASE2_Failure" ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 161 | run.restoreLink( main, 'spine101', 'leaf2', 'of:0000000000000101', |
Pier | fb719b1 | 2016-09-19 14:51:44 -0700 | [diff] [blame] | 162 | 'of:0000000000000002', '2', '3', '8', '32' ) |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 163 | run.pingAll( main, "CASE2_Recovery" ) |
Flavio Castro | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 164 | # TODO Dynamic config of hosts in subnet |
| 165 | # TODO Dynamic config of host not in subnet |
| 166 | # TODO preconfigured xconnect |
| 167 | # TODO Vrouter integration |
| 168 | # TODO Mcast integration |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 169 | run.cleanup( main ) |