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 | 5608a39 | 2016-06-22 17:02:35 -0700 | [diff] [blame] | 21 | # In this test we perform a link failure and then test for connectivity |
| 22 | # CASE1: 2x2 topo + link failure + IP connectivity test |
| 23 | # CASE2: 4x4 topo + link failure + IP connectivity test |
| 24 | # CASE4: 2x2 topo + 3-node ONOS CLUSTER + link failure + IP connectivity test |
| 25 | # CASE5: 4x4 topo + 3-node ONOS CLUSTER + link failure + IP connectivity test |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 26 | |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 27 | |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 28 | class SRLinkFailure: |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 29 | |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 30 | def __init__( self ): |
| 31 | self.default = '' |
| 32 | |
| 33 | def CASE1( self, main ): |
| 34 | """ |
| 35 | Sets up 1-node Onos-cluster |
| 36 | Start 2x2 Leaf-Spine topology |
| 37 | Pingall |
| 38 | Cause link failure |
| 39 | Pingall |
| 40 | """ |
Devin Lim | 57221b0 | 2018-02-14 15:45:36 -0800 | [diff] [blame] | 41 | try: |
| 42 | from tests.USECASE.SegmentRouting.SRLinkFailure.dependencies.SRLinkFailFuncs import SRLinkFailFuncs |
| 43 | except ImportError: |
| 44 | main.log.error( "SRLinkFailFuncs not found. Exiting the test" ) |
| 45 | main.cleanAndExit() |
| 46 | try: |
| 47 | main.funcs |
| 48 | except ( NameError, AttributeError ): |
| 49 | main.funcs = SRLinkFailFuncs() |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 50 | |
Devin Lim | 57221b0 | 2018-02-14 15:45:36 -0800 | [diff] [blame] | 51 | main.funcs.runTest( main, 1, 1, '2x2', 116 ) |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 52 | |
| 53 | def CASE2( self, main ): |
| 54 | """ |
| 55 | Sets up 1-node Onos-cluster |
| 56 | Start 4x4 Leaf-Spine topology |
| 57 | Pingall |
| 58 | Cause link failure |
| 59 | Pingall |
| 60 | """ |
Devin Lim | 57221b0 | 2018-02-14 15:45:36 -0800 | [diff] [blame] | 61 | try: |
| 62 | from tests.USECASE.SegmentRouting.SRLinkFailure.dependencies.SRLinkFailFuncs import SRLinkFailFuncs |
| 63 | except ImportError: |
| 64 | main.log.error( "SRLinkFailFuncs not found. Exiting the test" ) |
| 65 | main.cleanAndExit() |
| 66 | try: |
| 67 | main.funcs |
| 68 | except ( NameError, AttributeError ): |
| 69 | main.funcs = SRLinkFailFuncs() |
| 70 | |
| 71 | main.funcs.runTest( main, 2, 1, '4x4', 350 ) |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 72 | |
| 73 | def CASE4( self, main ): |
| 74 | """ |
| 75 | Sets up 3-node Onos-cluster |
| 76 | Start 2x2 Leaf-Spine topology |
| 77 | Pingall |
| 78 | Cause link failure |
| 79 | Pingall |
| 80 | """ |
Devin Lim | 57221b0 | 2018-02-14 15:45:36 -0800 | [diff] [blame] | 81 | try: |
| 82 | from tests.USECASE.SegmentRouting.SRLinkFailure.dependencies.SRLinkFailFuncs import SRLinkFailFuncs |
| 83 | except ImportError: |
| 84 | main.log.error( "SRLinkFailFuncs not found. Exiting the test" ) |
| 85 | main.cleanAndExit() |
| 86 | try: |
| 87 | main.funcs |
| 88 | except ( NameError, AttributeError ): |
| 89 | main.funcs = SRLinkFailFuncs() |
| 90 | |
| 91 | main.funcs.runTest( main, 3, 3, '2x2', 116 ) |
Flavio Castro | 94b211e | 2016-06-22 11:00:48 -0700 | [diff] [blame] | 92 | |
| 93 | def CASE5( self, main ): |
| 94 | """ |
| 95 | Sets up 1-node Onos-cluster |
| 96 | Start 4x4 Leaf-Spine topology |
| 97 | Pingall |
| 98 | Cause link failure |
| 99 | Pingall |
| 100 | """ |
Devin Lim | 57221b0 | 2018-02-14 15:45:36 -0800 | [diff] [blame] | 101 | try: |
| 102 | from tests.USECASE.SegmentRouting.SRLinkFailure.dependencies.SRLinkFailFuncs import SRLinkFailFuncs |
| 103 | except ImportError: |
| 104 | main.log.error( "SRLinkFailFuncs not found. Exiting the test" ) |
| 105 | main.cleanAndExit() |
| 106 | try: |
| 107 | main.funcs |
| 108 | except ( NameError, AttributeError ): |
| 109 | main.funcs = SRLinkFailFuncs() |
| 110 | |
| 111 | main.funcs.runTest( main, 4, 3, '4x4', 350 ) |