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 | # 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 |
Flavio Castro | f7faa42 | 2016-06-14 11:02:09 -0700 | [diff] [blame] | 28 | |
| 29 | class SRSanity: |
Flavio Castro | f7faa42 | 2016-06-14 11:02:09 -0700 | [diff] [blame] | 30 | def __init__( self ): |
| 31 | self.default = '' |
| 32 | |
| 33 | def CASE1( self, main ): |
Flavio Castro | f7faa42 | 2016-06-14 11:02:09 -0700 | [diff] [blame] | 34 | """ |
Flavio Castro | 0a05b8d | 2016-06-16 17:26:51 -0700 | [diff] [blame] | 35 | Sets up 1-node Onos-cluster |
| 36 | Start 2x2 Leaf-Spine topology |
| 37 | Pingall |
Flavio Castro | f7faa42 | 2016-06-14 11:02:09 -0700 | [diff] [blame] | 38 | """ |
Flavio Castro | 49c218d | 2016-06-21 16:55:57 -0700 | [diff] [blame] | 39 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 40 | Testcaselib as run |
| 41 | if not hasattr( main, 'apps' ): |
| 42 | run.initTest( main ) |
Flavio Castro | f7faa42 | 2016-06-14 11:02:09 -0700 | [diff] [blame] | 43 | |
Flavio Castro | 0a05b8d | 2016-06-16 17:26:51 -0700 | [diff] [blame] | 44 | description = "Bridging and Routing sanity test with 2x2 Leaf-spine " |
| 45 | main.case( description ) |
Flavio Castro | f7faa42 | 2016-06-14 11:02:09 -0700 | [diff] [blame] | 46 | |
Flavio Castro | 0a05b8d | 2016-06-16 17:26:51 -0700 | [diff] [blame] | 47 | main.cfgName = '2x2' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 48 | main.Cluster.setRunningNode( 1 ) |
Flavio Castro | 49c218d | 2016-06-21 16:55:57 -0700 | [diff] [blame] | 49 | run.installOnos( main ) |
| 50 | run.startMininet( main, 'cord_fabric.py' ) |
| 51 | # pre-configured routing and bridging test |
| 52 | run.checkFlows( main, minFlowCount=116 ) |
| 53 | run.pingAll( main, "CASE1" ) |
| 54 | # TODO Dynamic config of hosts in subnet |
| 55 | # TODO Dynamic config of host not in subnet |
| 56 | # TODO Dynamic config of vlan xconnect |
| 57 | # TODO Vrouter integration |
| 58 | # TODO Mcast integration |
| 59 | run.cleanup( main ) |
Flavio Castro | f7faa42 | 2016-06-14 11:02:09 -0700 | [diff] [blame] | 60 | |
Flavio Castro | f7faa42 | 2016-06-14 11:02:09 -0700 | [diff] [blame] | 61 | def CASE2( self, main ): |
| 62 | """ |
Flavio Castro | 0a05b8d | 2016-06-16 17:26:51 -0700 | [diff] [blame] | 63 | Sets up 1-node Onos-cluster |
| 64 | Start 4x4 Leaf-Spine topology |
| 65 | Pingall |
Flavio Castro | f7faa42 | 2016-06-14 11:02:09 -0700 | [diff] [blame] | 66 | """ |
Flavio Castro | 49c218d | 2016-06-21 16:55:57 -0700 | [diff] [blame] | 67 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 68 | Testcaselib as run |
| 69 | if not hasattr( main, 'apps' ): |
| 70 | run.initTest( main ) |
Flavio Castro | 0a05b8d | 2016-06-16 17:26:51 -0700 | [diff] [blame] | 71 | description = "Bridging and Routing sanity test with 4x4 Leaf-spine " |
| 72 | main.case( description ) |
| 73 | main.cfgName = '4x4' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 74 | main.Cluster.setRunningNode( 1 ) |
Flavio Castro | 49c218d | 2016-06-21 16:55:57 -0700 | [diff] [blame] | 75 | run.installOnos( main ) |
| 76 | run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" ) |
| 77 | # pre-configured routing and bridging test |
| 78 | run.checkFlows( main, minFlowCount=350 ) |
| 79 | run.pingAll( main, 'CASE2' ) |
| 80 | # TODO Dynamic config of hosts in subnet |
| 81 | # TODO Dynamic config of host not in subnet |
| 82 | # TODO Dynamic config of vlan xconnect |
| 83 | # TODO Vrouter integration |
| 84 | # TODO Mcast integration |
| 85 | run.cleanup( main ) |
Flavio Castro | f7faa42 | 2016-06-14 11:02:09 -0700 | [diff] [blame] | 86 | |
| 87 | def CASE3( self, main ): |
| 88 | """ |
Flavio Castro | 02b4363 | 2016-06-20 17:07:27 -0700 | [diff] [blame] | 89 | Sets up 1-node Onos-cluster |
| 90 | Start single switch topology |
| 91 | Pingall |
| 92 | """ |
Flavio Castro | 49c218d | 2016-06-21 16:55:57 -0700 | [diff] [blame] | 93 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 94 | Testcaselib as run |
| 95 | if not hasattr( main, 'apps' ): |
| 96 | run.initTest( main ) |
Flavio Castro | 02b4363 | 2016-06-20 17:07:27 -0700 | [diff] [blame] | 97 | description = "Bridging and Routing sanity test with single switch " |
| 98 | main.case( description ) |
| 99 | main.cfgName = '0x1' |
| 100 | main.numCtrls = 1 |
Flavio Castro | 49c218d | 2016-06-21 16:55:57 -0700 | [diff] [blame] | 101 | run.installOnos( main ) |
| 102 | run.startMininet( main, 'cord_fabric.py', args="--leaf=1 --spine=0" ) |
| 103 | # pre-configured routing and bridging test |
| 104 | run.checkFlows( main, minFlowCount=15 ) |
| 105 | run.pingAll( main, 'CASE3' ) |
| 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 ) |
Flavio Castro | 02b4363 | 2016-06-20 17:07:27 -0700 | [diff] [blame] | 112 | |
| 113 | def CASE4( self, main ): |
| 114 | """ |
Flavio Castro | 0a05b8d | 2016-06-16 17:26:51 -0700 | [diff] [blame] | 115 | Sets up 3-node Onos-cluster |
| 116 | Start 2x2 Leaf-Spine topology |
Flavio Castro | f7faa42 | 2016-06-14 11:02:09 -0700 | [diff] [blame] | 117 | Pingall |
| 118 | """ |
Flavio Castro | 49c218d | 2016-06-21 16:55:57 -0700 | [diff] [blame] | 119 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 120 | Testcaselib as run |
| 121 | if not hasattr( main, 'apps' ): |
| 122 | run.initTest( main ) |
Flavio Castro | 0a05b8d | 2016-06-16 17:26:51 -0700 | [diff] [blame] | 123 | description = "Bridging and Routing sanity test with 2x2 Leaf-spine " |
Flavio Castro | f7faa42 | 2016-06-14 11:02:09 -0700 | [diff] [blame] | 124 | main.case( description ) |
Flavio Castro | 0a05b8d | 2016-06-16 17:26:51 -0700 | [diff] [blame] | 125 | main.cfgName = '2x2' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 126 | main.Cluster.setRunningNode( 3 ) |
Flavio Castro | 49c218d | 2016-06-21 16:55:57 -0700 | [diff] [blame] | 127 | run.installOnos( main ) |
| 128 | run.startMininet( main, 'cord_fabric.py' ) |
| 129 | # pre-configured routing and bridging test |
| 130 | run.checkFlows( main, minFlowCount=116 ) |
| 131 | run.pingAll( main, 'CASE4' ) |
| 132 | # TODO Dynamic config of hosts in subnet |
| 133 | # TODO Dynamic config of host not in subnet |
| 134 | # TODO Dynamic config of vlan xconnect |
| 135 | # TODO Vrouter integration |
| 136 | # TODO Mcast integration |
| 137 | run.cleanup( main ) |
Flavio Castro | 02b4363 | 2016-06-20 17:07:27 -0700 | [diff] [blame] | 138 | |
| 139 | def CASE5( self, main ): |
| 140 | """ |
| 141 | Sets up 3-node Onos-cluster |
| 142 | Start 4x4 Leaf-Spine topology |
| 143 | Pingall |
| 144 | """ |
Flavio Castro | 49c218d | 2016-06-21 16:55:57 -0700 | [diff] [blame] | 145 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 146 | Testcaselib as run |
| 147 | if not hasattr( main, 'apps' ): |
| 148 | run.initTest( main ) |
Flavio Castro | 02b4363 | 2016-06-20 17:07:27 -0700 | [diff] [blame] | 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 | 49c218d | 2016-06-21 16:55:57 -0700 | [diff] [blame] | 153 | run.installOnos( main ) |
| 154 | run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" ) |
| 155 | # pre-configured routing and bridging test |
| 156 | run.checkFlows( main, minFlowCount=350 ) |
| 157 | run.pingAll( main, 'CASE5' ) |
| 158 | # TODO Dynamic config of hosts in subnet |
| 159 | # TODO Dynamic config of host not in subnet |
| 160 | # TODO Dynamic config of vlan xconnect |
| 161 | # TODO Vrouter integration |
| 162 | # TODO Mcast integration |
| 163 | run.cleanup( main ) |
Flavio Castro | 02b4363 | 2016-06-20 17:07:27 -0700 | [diff] [blame] | 164 | |
| 165 | def CASE6( self, main ): |
| 166 | """ |
| 167 | Sets up 3-node Onos-cluster |
| 168 | Start single switch topology |
| 169 | Pingall |
| 170 | """ |
Flavio Castro | 49c218d | 2016-06-21 16:55:57 -0700 | [diff] [blame] | 171 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 172 | Testcaselib as run |
| 173 | if not hasattr( main, 'apps' ): |
| 174 | run.initTest( main ) |
Flavio Castro | 02b4363 | 2016-06-20 17:07:27 -0700 | [diff] [blame] | 175 | description = "Bridging and Routing sanity test with single switch " |
| 176 | main.case( description ) |
| 177 | main.cfgName = '0x1' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 178 | main.Cluster.setRunningNode( 3 ) |
Flavio Castro | 49c218d | 2016-06-21 16:55:57 -0700 | [diff] [blame] | 179 | run.installOnos( main ) |
| 180 | run.startMininet( main, 'cord_fabric.py', args="--leaf=1 --spine=0" ) |
| 181 | # pre-configured routing and bridging test |
| 182 | run.checkFlows( main, minFlowCount=15 ) |
| 183 | run.pingAll( main, 'CASE4' ) |
| 184 | # TODO Dynamic config of hosts in subnet |
| 185 | # TODO Dynamic config of host not in subnet |
| 186 | # TODO Dynamic config of vlan xconnect |
| 187 | # TODO Vrouter integration |
| 188 | # TODO Mcast integration |
| 189 | run.cleanup( main ) |