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