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 | """ |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 21 | # In this test we perform several failures and then test for connectivity |
| 22 | # CASE1: 2x2 topo + 3 ONOS + | ONOS failure + IP connectivity test | x failures |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 23 | # CASE2: 2x2 topo + 3 ONOS + | ONOS ( random instance ) failure + IP connectivity test | x failures |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 24 | # CASE3: 4x4 topo + 3 ONOS + | ONOS failure + IP connectivity test | x failures |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 25 | # CASE4: 4x4 topo + 3 ONOS + | ONOS ( random instance ) failure + IP connectivity test | x failures |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 26 | # CASE5: 2x2 topo + 3 ONOS + | ONOS failure + Spine failure + IP connectivity test | x failures |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 27 | # CASE6: 2x2 topo + 3 ONOS + | ONOS ( random instance ) failure + Spine ( random switch ) failure + IP connectivity test | x failures |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 28 | # CASE7: 4x4 topo + 3 ONOS + | ONOS failure + Spine failure + IP connectivity test | x failures |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 29 | # CASE8: 4x4 topo + 3 ONOS + | ONOS ( random instance ) failure + Spine ( random switch ) failure + IP connectivity test | x failures |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 30 | |
| 31 | |
| 32 | class SRHighAvailability: |
| 33 | |
| 34 | def __init__( self ): |
| 35 | self.default = '' |
| 36 | |
| 37 | def CASE1( self, main ): |
| 38 | """ |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 39 | 1 ) Sets up 3-nodes Onos-cluster |
| 40 | 2 ) Start 2x2 Leaf-Spine topology |
| 41 | 3 ) Pingall |
| 42 | 4 ) Cause sequential ONOS failure |
| 43 | 5 ) Pingall |
| 44 | 6 ) Repeat 3 ), 4 ), 5 ) 'failures' times |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 45 | """ |
Devin Lim | 57221b0 | 2018-02-14 15:45:36 -0800 | [diff] [blame] | 46 | try: |
| 47 | from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs |
| 48 | except ImportError: |
| 49 | main.log.error( "SRHAFuncs not found. Exiting the test" ) |
| 50 | main.cleanAndExit() |
| 51 | try: |
| 52 | main.funcs |
| 53 | except ( NameError, AttributeError ): |
| 54 | main.funcs = SRHAFuncs() |
| 55 | main.funcs.runTest( main, 1, 3, '2x2', |
| 56 | 116, False, False ) |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 57 | |
| 58 | def CASE2( self, main ): |
| 59 | """ |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 60 | 1 ) Sets up 3-nodes Onos-cluster |
| 61 | 2 ) Start 2x2 Leaf-Spine topology |
| 62 | 3 ) Pingall |
| 63 | 4 ) Cause random ONOS failure |
| 64 | 5 ) Pingall |
| 65 | 6 ) Repeat 3 ), 4 ), 5 ) 'failures' times |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 66 | """ |
Devin Lim | 57221b0 | 2018-02-14 15:45:36 -0800 | [diff] [blame] | 67 | try: |
| 68 | from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs |
| 69 | except ImportError: |
| 70 | main.log.error( "SRHAFuncs not found. Exiting the test" ) |
| 71 | main.cleanAndExit() |
| 72 | try: |
| 73 | main.funcs |
| 74 | except ( NameError, AttributeError ): |
| 75 | main.funcs = SRHAFuncs() |
| 76 | main.funcs.runTest( main, 2, 3, '2x2', |
| 77 | 116, True, False ) |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 78 | |
| 79 | def CASE3( self, main ): |
| 80 | """ |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 81 | 1 ) Sets up 3-nodes Onos-cluster |
| 82 | 2 ) Start 4x4 Leaf-Spine topology |
| 83 | 3 ) Pingall |
| 84 | 4 ) Cause sequential ONOS failure |
| 85 | 5 ) Pingall |
| 86 | 6 ) Repeat 3 ), 4 ), 5 ) 'failures' times |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 87 | """ |
Devin Lim | 57221b0 | 2018-02-14 15:45:36 -0800 | [diff] [blame] | 88 | try: |
| 89 | from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs |
| 90 | except ImportError: |
| 91 | main.log.error( "SRHAFuncs not found. Exiting the test" ) |
| 92 | main.cleanAndExit() |
| 93 | try: |
| 94 | main.funcs |
| 95 | except ( NameError, AttributeError ): |
| 96 | main.funcs = SRHAFuncs() |
| 97 | main.funcs.runTest( main, 3, 3, '4x4', |
| 98 | 350, False, False ) |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 99 | |
| 100 | def CASE4( self, main ): |
| 101 | """ |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 102 | 1 ) Sets up 3-nodes Onos-cluster |
| 103 | 2 ) Start 4x4 Leaf-Spine topology |
| 104 | 3 ) Pingall |
| 105 | 4 ) Cause random ONOS failure |
| 106 | 5 ) Pingall |
| 107 | 6 ) Repeat 3 ), 4 ), 5 ) 'failures' times |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 108 | """ |
Devin Lim | 57221b0 | 2018-02-14 15:45:36 -0800 | [diff] [blame] | 109 | try: |
| 110 | from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs |
| 111 | except ImportError: |
| 112 | main.log.error( "SRHAFuncs not found. Exiting the test" ) |
| 113 | main.cleanAndExit() |
| 114 | try: |
| 115 | main.funcs |
| 116 | except ( NameError, AttributeError ): |
| 117 | main.funcs = SRHAFuncs() |
| 118 | main.funcs.runTest( main, 4, 3, '4x4', |
| 119 | 350, True, False ) |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 120 | |
| 121 | def CASE5( self, main ): |
| 122 | """ |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 123 | 1 ) Sets up 3-nodes Onos-cluster |
| 124 | 2 ) Start 2x2 Leaf-Spine topology |
| 125 | 3 ) Pingall |
| 126 | 4 ) Cause sequential ONOS failure |
| 127 | 5 ) Pingall |
| 128 | 6 ) Cause sequential Spine failure |
| 129 | 7 ) Pingall |
| 130 | 8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ), 'failures' times |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 131 | """ |
Devin Lim | 57221b0 | 2018-02-14 15:45:36 -0800 | [diff] [blame] | 132 | try: |
| 133 | from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs |
| 134 | except ImportError: |
| 135 | main.log.error( "SRHAFuncs not found. Exiting the test" ) |
| 136 | main.cleanAndExit() |
| 137 | try: |
| 138 | main.funcs |
| 139 | except ( NameError, AttributeError ): |
| 140 | main.funcs = SRHAFuncs() |
| 141 | main.funcs.runTest( main, 5, 3, '2x2', |
| 142 | 116, False, True ) |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 143 | |
| 144 | def CASE6( self, main ): |
| 145 | """ |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 146 | 1 ) Sets up 3-nodes Onos-cluster |
| 147 | 2 ) Start 2x2 Leaf-Spine topology |
| 148 | 3 ) Pingall |
| 149 | 4 ) Cause random ONOS failure |
| 150 | 5 ) Pingall |
| 151 | 6 ) Cause random Spine failure |
| 152 | 7 ) Pingall |
| 153 | 8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ) 'failures' times |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 154 | """ |
Devin Lim | 57221b0 | 2018-02-14 15:45:36 -0800 | [diff] [blame] | 155 | try: |
| 156 | from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs |
| 157 | except ImportError: |
| 158 | main.log.error( "SRHAFuncs not found. Exiting the test" ) |
| 159 | main.cleanAndExit() |
| 160 | try: |
| 161 | main.funcs |
| 162 | except ( NameError, AttributeError ): |
| 163 | main.funcs = SRHAFuncs() |
| 164 | main.funcs.runTest( main, 6, 3, '2x2', |
| 165 | 116, True, True ) |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 166 | |
| 167 | def CASE7( self, main ): |
| 168 | """ |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 169 | 1 ) Sets up 3-nodes Onos-cluster |
| 170 | 2 ) Start 4x4 Leaf-Spine topology |
| 171 | 3 ) Pingall |
| 172 | 4 ) Cause sequential ONOS failure |
| 173 | 5 ) Pingall |
| 174 | 6 ) Cause sequential Spine failure |
| 175 | 7 ) Pingall |
| 176 | 8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ), 'failures' times |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 177 | """ |
Devin Lim | 57221b0 | 2018-02-14 15:45:36 -0800 | [diff] [blame] | 178 | try: |
| 179 | from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs |
| 180 | except ImportError: |
| 181 | main.log.error( "SRHAFuncs not found. Exiting the test" ) |
| 182 | main.cleanAndExit() |
| 183 | try: |
| 184 | main.funcs |
| 185 | except ( NameError, AttributeError ): |
| 186 | main.funcs = SRHAFuncs() |
| 187 | main.funcs.runTest( main, 7, 3, '4x4', |
| 188 | 350, False, True ) |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 189 | |
| 190 | def CASE8( self, main ): |
| 191 | """ |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 192 | 1 ) Sets up 3-nodes Onos-cluster |
| 193 | 2 ) Start 4x4 Leaf-Spine topology |
| 194 | 3 ) Pingall |
| 195 | 4 ) Cause random ONOS failure |
| 196 | 5 ) Pingall |
| 197 | 6 ) Cause random Spine failure |
| 198 | 7 ) Pingall |
| 199 | 8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ), 'failures' times |
Pier | a2a7e1b | 2016-10-04 11:51:43 -0700 | [diff] [blame] | 200 | """ |
Devin Lim | 57221b0 | 2018-02-14 15:45:36 -0800 | [diff] [blame] | 201 | try: |
| 202 | from tests.USECASE.SegmentRouting.SRHighAvailability.dependencies.SRHAFuncs import SRHAFuncs |
| 203 | except ImportError: |
| 204 | main.log.error( "SRHAFuncs not found. Exiting the test" ) |
| 205 | main.cleanAndExit() |
| 206 | try: |
| 207 | main.funcs |
| 208 | except ( NameError, AttributeError ): |
| 209 | main.funcs = SRHAFuncs() |
| 210 | main.funcs.runTest( main, 8, 3, '4x4', |
| 211 | 350, True, True ) |