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