Flavio Castro | 0a05b8d | 2016-06-16 17:26:51 -0700 | [diff] [blame^] | 1 | # This test should always succeed. it runs cases 1,2,3,4 |
| 2 | #CASE1: Get and Build ONOS |
| 3 | #CASE2: Package and Install ONOS |
| 4 | #CASE3: Start Mininet and check flows |
| 5 | #CASE4: Ping all |
| 6 | #CASE5: Link Failure |
| 7 | #CASE6: Switch Failure |
| 8 | #CASE7: ONOS Failure |
| 9 | #CASE8: CLUSTER Failure |
| 10 | #CASE10: Logging |
| 11 | |
| 12 | class SRLinkDown: |
| 13 | |
| 14 | def __init__( self ): |
| 15 | self.default = '' |
| 16 | |
| 17 | def CASE1( self, main ): |
| 18 | """ |
| 19 | Sets up 1-node Onos-cluster |
| 20 | Start 2x2 Leaf-Spine topology |
| 21 | Pingall |
| 22 | """ |
| 23 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run |
| 24 | if not hasattr(main,'apps'): |
| 25 | run.initTest(main) |
| 26 | |
| 27 | description = "Bridging and Routing sanity test with 2x2 Leaf-spine " |
| 28 | main.case( description ) |
| 29 | |
| 30 | main.cfgName = '2x2' |
| 31 | main.numCtrls = 1 |
| 32 | run.installOnos(main) |
| 33 | run.startMininet(main, 'cord_fabric.py') |
| 34 | #pre-configured routing and bridging test |
| 35 | run.checkFlows(main, flowCount=116) |
| 36 | run.pingAll(main) |
| 37 | run.killLink(main, 'spine101', 'leaf2', switches='4', links='6') |
| 38 | run.pingAll(main, "CASE1_AfterLinkDown") |
| 39 | run.restoreLink(main, 'spine101', 'leaf2','of:0000000000000101', |
| 40 | 'of:0000000000000002', '2', '1', '4', '8') |
| 41 | run.pingAll(main, "CASE1_AfterLinkUp") |
| 42 | #TODO Dynamic config of hosts in subnet |
| 43 | #TODO Dynamic config of host not in subnet |
| 44 | #TODO Dynamic config of vlan xconnect |
| 45 | #TODO Vrouter integration |
| 46 | #TODO Mcast integration |
| 47 | run.cleanup(main) |
| 48 | |
| 49 | def CASE2( self, main ): |
| 50 | """ |
| 51 | Sets up 1-node Onos-cluster |
| 52 | Start 4x4 Leaf-Spine topology |
| 53 | Pingall |
| 54 | """ |
| 55 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run |
| 56 | if not hasattr(main,'apps'): |
| 57 | run.initTest(main) |
| 58 | description = "Bridging and Routing sanity test with 4x4 Leaf-spine " |
| 59 | main.case( description ) |
| 60 | main.cfgName = '4x4' |
| 61 | main.numCtrls = 1 |
| 62 | run.installOnos(main) |
| 63 | run.startMininet(main, 'cord_fabric.py', args="--leaf=4 --spine=4") |
| 64 | #pre-configured routing and bridging test |
| 65 | run.checkFlows(main, flowCount=350) |
| 66 | run.pingAll(main) |
| 67 | run.killLink(main, 'spine101', 'leaf2', switches='8', links='30') |
| 68 | run.pingAll(main, "CASE2_AfterLinkDown") |
| 69 | run.restoreLink(main, 'spine101', 'leaf2','of:0000000000000101', |
| 70 | 'of:0000000000000002', '2', '1', '8', '32') |
| 71 | run.pingAll(main, "CASE2_AfterLinkUp") |
| 72 | #TODO Dynamic config of hosts in subnet |
| 73 | #TODO Dynamic config of host not in subnet |
| 74 | #TODO preconfigured xconnect |
| 75 | #TODO Vrouter integration |
| 76 | #TODO Mcast integration |
| 77 | run.cleanup(main) |
| 78 | |
| 79 | def CASE3( self, main ): |
| 80 | """ |
| 81 | Sets up 3-node Onos-cluster |
| 82 | Start 2x2 Leaf-Spine topology |
| 83 | Pingall |
| 84 | """ |
| 85 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run |
| 86 | if not hasattr(main,'apps'): |
| 87 | run.initTest(main) |
| 88 | description = "Bridging and Routing sanity test with 2x2 Leaf-spine " |
| 89 | main.case( description ) |
| 90 | main.cfgName = '2x2' |
| 91 | main.numCtrls = 3 |
| 92 | run.installOnos(main) |
| 93 | run.startMininet(main, 'cord_fabric.py') |
| 94 | #pre-configured routing and bridging test |
| 95 | run.checkFlows(main, flowCount=116) |
| 96 | run.pingAll(main) |
| 97 | run.killLink(main, 'spine101', 'leaf2', switches='4', links='6') |
| 98 | run.pingAll(main, "CASE3_AfterLinkDown") |
| 99 | run.restoreLink(main, 'spine101', 'leaf2','of:0000000000000101', |
| 100 | 'of:0000000000000002', '2', '1', '4', '8') |
| 101 | run.pingAll(main, "CASE3_AfterLinkUp") |
| 102 | #TODO Dynamic config of hosts in subnet |
| 103 | #TODO Dynamic config of host not in subnet |
| 104 | #TODO Dynamic config of vlan xconnect |
| 105 | #TODO Vrouter integration |
| 106 | #TODO Mcast integration |
| 107 | run.cleanup(main) |