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