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 | 519072e | 2016-06-23 13:30:48 -0700 | [diff] [blame] | 21 | # CASE1: 2x2 topo + 3-node ONOS CLUSTER + IP connectivity test + CLUSTER restart |
| 22 | # CASE2: 4x4 topo + 3-node ONOS CLUSTER + IP connectivity test + CLUSTER restart |
| 23 | # CASE3: Single switch + 3-node ONOS CLUSTER + IP connectivity test + CLUSTER restart |
| 24 | |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 25 | |
Flavio Castro | 519072e | 2016-06-23 13:30:48 -0700 | [diff] [blame] | 26 | class SRClusterRestart: |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 27 | |
Flavio Castro | 519072e | 2016-06-23 13:30:48 -0700 | [diff] [blame] | 28 | def __init__( self ): |
| 29 | self.default = '' |
| 30 | |
| 31 | def CASE1( self, main ): |
| 32 | """ |
| 33 | Sets up 3-node Onos-cluster |
| 34 | Start 2x2 Leaf-Spine topology |
| 35 | Pingall |
| 36 | Induce CLUSTER restart |
| 37 | Pingall |
| 38 | """ |
| 39 | description = "Cluster Restart test with 2x2 Leaf-spine " |
| 40 | main.case( description ) |
| 41 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 42 | Testcaselib as run |
| 43 | if not hasattr( main, 'apps' ): |
| 44 | run.initTest( main ) |
| 45 | main.cfgName = '2x2' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 46 | main.Cluster.setRunningNode( 3 ) |
Flavio Castro | 519072e | 2016-06-23 13:30:48 -0700 | [diff] [blame] | 47 | run.installOnos( main ) |
| 48 | run.startMininet( main, 'cord_fabric.py' ) |
| 49 | # pre-configured routing and bridging test |
| 50 | run.checkFlows( main, minFlowCount=116 ) |
| 51 | run.pingAll( main, "CASE1" ) |
| 52 | run.killOnos( main, [ 0, 1, 2 ], '4', '8', '0' ) |
| 53 | run.pingAll( main, 'CASE1_Failure', dumpflows=False ) |
| 54 | run.recoverOnos( main, [ 0, 1, 2 ], '4', '8', '3' ) |
| 55 | run.checkFlows( main, minFlowCount=116 ) |
| 56 | run.pingAll( main, 'CASE1_Failure' ) |
| 57 | # TODO Dynamic config of hosts in subnet |
| 58 | # TODO Dynamic config of host not in subnet |
| 59 | # TODO Dynamic config of vlan xconnect |
| 60 | # TODO Vrouter integration |
| 61 | # TODO Mcast integration |
| 62 | run.cleanup( main ) |
| 63 | |
| 64 | def CASE2( self, main ): |
| 65 | """ |
| 66 | Sets up 3-node Onos-cluster |
| 67 | Start 4x4 Leaf-Spine topology |
| 68 | Pingall |
| 69 | Induce Cluster Restart |
| 70 | Pingall |
| 71 | """ |
| 72 | description = "Cluster Restart test with 4x4 Leaf-spine " |
| 73 | main.case( description ) |
| 74 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 75 | Testcaselib as run |
| 76 | if not hasattr( main, 'apps' ): |
| 77 | run.initTest( main ) |
| 78 | main.cfgName = '4x4' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 79 | main.Cluster.setRunningNode( 3 ) |
Flavio Castro | 519072e | 2016-06-23 13:30:48 -0700 | [diff] [blame] | 80 | run.installOnos( main ) |
| 81 | run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" ) |
| 82 | # pre-configured routing and bridging test |
| 83 | run.checkFlows( main, minFlowCount=350 ) |
| 84 | run.pingAll( main, 'CASE2' ) |
| 85 | run.killOnos( main, [ 0, 1, 2 ], '8', '32', '0' ) |
| 86 | run.pingAll( main, 'CASE2_Failure', dumpflows=False ) |
| 87 | run.recoverOnos( main, [ 0, 1, 2 ], '8', '32', '3' ) |
| 88 | run.checkFlows( main, minFlowCount=350 ) |
| 89 | run.pingAll( main, 'CASE3_Recovery' ) |
| 90 | # TODO Dynamic config of hosts in subnet |
| 91 | # TODO Dynamic config of host not in subnet |
| 92 | # TODO Dynamic config of vlan xconnect |
| 93 | # TODO Vrouter integration |
| 94 | # TODO Mcast integration |
| 95 | run.cleanup( main ) |
| 96 | |
| 97 | def CASE3( self, main ): |
| 98 | """ |
| 99 | Sets up 3-node Onos-cluster |
| 100 | Start single switch topology |
| 101 | Pingall |
| 102 | Induce Cluster Restart |
| 103 | Pingall |
| 104 | """ |
| 105 | description = "Cluster Restart test with single switch " |
| 106 | main.case( description ) |
| 107 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 108 | Testcaselib as run |
| 109 | if not hasattr( main, 'apps' ): |
| 110 | run.initTest( main ) |
| 111 | main.cfgName = '0x1' |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 112 | main.Cluster.setRunningNode( 3 ) |
Flavio Castro | 519072e | 2016-06-23 13:30:48 -0700 | [diff] [blame] | 113 | run.installOnos( main ) |
| 114 | run.startMininet( main, 'cord_fabric.py', args="--leaf=1 --spine=0" ) |
| 115 | # pre-configured routing and bridging test |
| 116 | run.checkFlows( main, minFlowCount=15 ) |
| 117 | run.pingAll( main, 'CASE3' ) |
| 118 | run.killOnos( main, [ 0, 1, 2 ], '1', '0', '0' ) |
| 119 | run.pingAll( main, 'CASE3_Failure', dumpflows=False ) |
| 120 | run.recoverOnos( main, [ 0, 1, 2 ], '1', '0', '3' ) |
| 121 | run.checkFlows( main, minFlowCount=15 ) |
| 122 | run.pingAll( main, 'CASE3_Failure' ) |
| 123 | # TODO Dynamic config of hosts in subnet |
| 124 | # TODO Dynamic config of host not in subnet |
| 125 | # TODO Dynamic config of vlan xconnect |
| 126 | # TODO Vrouter integration |
| 127 | # TODO Mcast integration |
| 128 | run.cleanup( main ) |