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