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 | ab163ca | 2016-07-07 14:05:00 -0700 | [diff] [blame] | 22 | # CASE1: 2x2 Leaf-Spine topo and test IP connectivity |
| 23 | # CASE2: 4x4 topo + IP connectivity test |
| 24 | # CASE3: Single switch topo + IP connectivity test |
| 25 | # CASE4: 2x2 topo + 3-node ONOS CLUSTER + IP connectivity test |
| 26 | # CASE5: 4x4 topo + 3-node ONOS CLUSTER + IP connectivity test |
| 27 | # CASE6: Single switch + 3-node ONOS CLUSTER + IP connectivity test |
| 28 | |
| 29 | class SRDynamic: |
| 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 | """ |
| 39 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 40 | Testcaselib as run |
| 41 | if not hasattr( main, 'apps' ): |
| 42 | run.initTest( main ) |
| 43 | |
| 44 | description = "Bridging and Routing sanity test with 2x2 Leaf-spine " |
| 45 | main.case( description ) |
| 46 | |
| 47 | main.cfgName = '2x2' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 48 | main.Cluster.setRunningNode( 1 ) |
Flavio Castro | ab163ca | 2016-07-07 14:05:00 -0700 | [diff] [blame] | 49 | run.installOnos( main, vlanCfg=False ) |
| 50 | run.startMininet( main, 'cord_fabric.py' ) |
| 51 | # pre-configured routing and bridging test |
| 52 | run.checkFlows( main, minFlowCount=116 ) |
| 53 | run.pingAll( main, dumpflows=False, ) |
| 54 | run.addHostCfg( main ) |
| 55 | run.checkFlows( main, minFlowCount=140, dumpflows=False ) |
| 56 | run.pingAll( main, "CASE1" ) |
| 57 | run.cleanup( main ) |
| 58 | |
| 59 | def CASE2( self, main ): |
| 60 | """ |
| 61 | Sets up 1-node Onos-cluster |
| 62 | Start 4x4 Leaf-Spine topology |
| 63 | Pingall |
| 64 | """ |
| 65 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 66 | Testcaselib as run |
| 67 | if not hasattr( main, 'apps' ): |
| 68 | run.initTest( main ) |
| 69 | description = "Bridging and Routing sanity test with 4x4 Leaf-spine " |
| 70 | main.case( description ) |
| 71 | main.cfgName = '4x4' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 72 | main.Cluster.setRunningNode( 1 ) |
Flavio Castro | ab163ca | 2016-07-07 14:05:00 -0700 | [diff] [blame] | 73 | run.installOnos( main, vlanCfg=False ) |
| 74 | run.startMininet( main, 'cord_fabric.py', |
| 75 | args="--leaf=4 --spine=4" ) |
| 76 | # pre-configured routing and bridging test |
| 77 | run.checkFlows( main, minFlowCount=350 ) |
| 78 | run.pingAll( main, dumpflows=False ) |
| 79 | run.addHostCfg( main ) |
| 80 | run.checkFlows( main, minFlowCount=380, dumpflows=False ) |
| 81 | run.pingAll( main, 'CASE2' ) |
| 82 | run.cleanup( main ) |
| 83 | |
| 84 | def CASE3( self, main ): |
| 85 | """ |
| 86 | Sets up 1-node Onos-cluster |
| 87 | Start single switch topology |
| 88 | Pingall |
| 89 | """ |
| 90 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 91 | Testcaselib as run |
| 92 | if not hasattr( main, 'apps' ): |
| 93 | run.initTest( main ) |
| 94 | description = "Bridging and Routing sanity test with single switch " |
| 95 | main.case( description ) |
| 96 | main.cfgName = '0x1' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 97 | main.Cluster.setRunningNode( 1 ) |
Flavio Castro | ab163ca | 2016-07-07 14:05:00 -0700 | [diff] [blame] | 98 | run.installOnos( main, vlanCfg=False ) |
| 99 | run.startMininet( main, 'cord_fabric.py', |
| 100 | args="--leaf=1 --spine=0" ) |
| 101 | # pre-configured routing and bridging test |
| 102 | run.checkFlows( main, minFlowCount=15 ) |
| 103 | run.pingAll( main, dumpflows=False ) |
| 104 | run.addHostCfg( main ) |
| 105 | run.checkFlows( main, minFlowCount=18, dumpflows=False ) |
| 106 | run.pingAll( main, 'CASE3' ) |
| 107 | run.cleanup( main ) |
| 108 | |
| 109 | def CASE4( self, main ): |
| 110 | """ |
| 111 | Sets up 3-node Onos-cluster |
| 112 | Start 2x2 Leaf-Spine topology |
| 113 | Pingall |
| 114 | """ |
| 115 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 116 | Testcaselib as run |
| 117 | if not hasattr( main, 'apps' ): |
| 118 | run.initTest( main ) |
| 119 | description = "Bridging and Routing sanity test with 2x2 Leaf-spine " |
| 120 | main.case( description ) |
| 121 | |
| 122 | main.cfgName = '2x2' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 123 | main.Cluster.setRunningNode( 3 ) |
Flavio Castro | ab163ca | 2016-07-07 14:05:00 -0700 | [diff] [blame] | 124 | run.installOnos( main, vlanCfg=False ) |
| 125 | run.startMininet( main, 'cord_fabric.py' ) |
| 126 | # pre-configured routing and bridging test |
| 127 | run.checkFlows( main, minFlowCount=116 ) |
| 128 | run.pingAll( main, dumpflows=False ) |
| 129 | run.addHostCfg( main ) |
| 130 | run.checkFlows( main, minFlowCount=140, dumpflows=False ) |
| 131 | run.pingAll( main, "CASE4" ) |
| 132 | run.killOnos( main, [ 0 ], '4', '8', '2' ) |
| 133 | run.delHostCfg( main ) |
| 134 | run.checkFlows( main, minFlowCount=116, dumpflows=False ) |
| 135 | run.pingAll( main, "CASE4_after" ) |
| 136 | run.cleanup( main ) |
| 137 | |
| 138 | def CASE5( self, main ): |
| 139 | """ |
| 140 | Sets up 3-node Onos-cluster |
| 141 | Start 4x4 Leaf-Spine topology |
| 142 | Pingall |
| 143 | """ |
| 144 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 145 | Testcaselib as run |
| 146 | if not hasattr( main, 'apps' ): |
| 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 | ab163ca | 2016-07-07 14:05:00 -0700 | [diff] [blame] | 152 | run.installOnos( main, vlanCfg=False ) |
| 153 | run.startMininet( main, 'cord_fabric.py', |
| 154 | args="--leaf=4 --spine=4" ) |
| 155 | # pre-configured routing and bridging test |
| 156 | run.checkFlows( main, minFlowCount=350 ) |
| 157 | run.pingAll( main, dumpflows=False ) |
| 158 | run.addHostCfg( main ) |
| 159 | run.checkFlows( main, minFlowCount=380, dumpflows=False ) |
| 160 | run.pingAll( main, 'CASE5' ) |
| 161 | run.killOnos( main, [ 0 ], '8', '32', '2' ) |
| 162 | run.delHostCfg( main ) |
| 163 | run.checkFlows( main, minFlowCount=350, dumpflows=False ) |
| 164 | run.pingAll( main, "CASE5_After" ) |
| 165 | run.cleanup( main ) |
| 166 | |
| 167 | def CASE6( self, main ): |
| 168 | """ |
| 169 | Sets up 3-node Onos-cluster |
| 170 | Start single switch topology |
| 171 | Pingall |
| 172 | """ |
| 173 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 174 | Testcaselib as run |
| 175 | if not hasattr( main, 'apps' ): |
| 176 | run.initTest( main ) |
| 177 | description = "Bridging and Routing sanity test with single switch " |
| 178 | main.case( description ) |
| 179 | main.cfgName = '0x1' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 180 | main.Cluster.setRunningNode( 3 ) |
Flavio Castro | ab163ca | 2016-07-07 14:05:00 -0700 | [diff] [blame] | 181 | run.installOnos( main, vlanCfg=False ) |
| 182 | run.startMininet( main, 'cord_fabric.py', |
| 183 | args="--leaf=1 --spine=0" ) |
| 184 | # pre-configured routing and bridging test |
| 185 | run.checkFlows( main, minFlowCount=15 ) |
| 186 | run.pingAll( main, dumpflows=False ) |
| 187 | run.addHostCfg( main ) |
| 188 | run.checkFlows( main, minFlowCount=20, dumpflows=False ) |
| 189 | run.pingAll( main, 'CASE6' ) |
| 190 | run.killOnos( main, [ 0 ], '1', '0', '2' ) |
| 191 | run.delHostCfg( main ) |
| 192 | run.checkFlows( main, minFlowCount=15, dumpflows=False ) |
| 193 | run.pingAll( main, "CASE6_After" ) |
| 194 | run.cleanup( main ) |