Jeremy Ronquillo | b27ce4c | 2017-07-17 12:41:28 -0700 | [diff] [blame] | 1 | """ |
| 2 | Copyright 2015 Open Networking Foundation (ONF) |
| 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 |
| 11 | (at your option) any later version. |
| 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 | """ |
| 21 | |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 22 | class SDNIPperf: |
| 23 | |
| 24 | def __init__( self ): |
| 25 | self.default = '' |
| 26 | global branchName |
| 27 | |
| 28 | # This case is to setup ONOS |
| 29 | def CASE100( self, main ): |
| 30 | """ |
| 31 | CASE100 is to compile ONOS and push it to the test machines |
| 32 | Startup sequence: |
| 33 | cell <name> |
| 34 | onos-verify-cell |
| 35 | git pull |
| 36 | mvn clean install |
| 37 | onos-package |
| 38 | onos-install -f |
| 39 | onos-wait-for-start |
| 40 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 41 | try: |
| 42 | from tests.dependencies.ONOSSetup import ONOSSetup |
| 43 | main.testSetUp = ONOSSetup() |
| 44 | except ImportError: |
| 45 | main.log.error( "ONOSSetup not found. exiting the test" ) |
| 46 | main.exit() |
| 47 | main.testSetUp.envSetupDescription() |
| 48 | stepResult = main.FALSE |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 49 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 50 | try: |
| 51 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 52 | ONOS1Ip = main.params['CTRL']['ip1'] |
| 53 | stepResult = main.testSetUp.envSetup( specificIp=ONOS1Ip ) |
| 54 | except Exception as e: |
| 55 | main.testSetUp.envSetupException( e ) |
| 56 | main.testSetUp.evnSetupConclusion( stepResult ) |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 57 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 58 | case1Result = main.testSetUp.ONOSSetUp( "", newCell=False, cellname=cellName ) |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 59 | |
| 60 | if case1Result == main.FALSE: |
| 61 | main.cleanup() |
| 62 | main.exit() |
| 63 | |
| 64 | def CASE9( self, main ): |
| 65 | """ |
| 66 | Test the SDN-IP Performance |
| 67 | Test whether SDN-IP can boot with 600,000 routes from an external peer. |
| 68 | Since our goal for SDN-IP is to handle 600,000 routes, in this test case |
| 69 | we statically configure an external peer Quagga with 655360 routes. |
| 70 | Thus, we pre-know the routes and intents it should be, and then boot the |
| 71 | whole system and check whether the numbers of routes and intents from |
| 72 | ONOS CLI are correct. |
| 73 | """ |
| 74 | import time |
| 75 | import json |
| 76 | from operator import eq |
| 77 | from time import localtime, strftime |
| 78 | |
| 79 | # We configured one external BGP peer with 655360 routes |
| 80 | routeNumberExpected = 655360 |
| 81 | m2SIntentsNumberExpected = 655360 |
| 82 | |
| 83 | main.case("This case is to testing the performance of SDN-IP with \ |
| 84 | single ONOS instance" ) |
| 85 | time.sleep( 10 ) |
| 86 | |
| 87 | main.step( "Get devices in the network" ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 88 | listResult = main.ONOScli1.devices( jsonFormat=False ) |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 89 | main.log.info( listResult ) |
| 90 | |
| 91 | main.step( "Get links in the network" ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 92 | listResult = main.ONOScli1.links ( jsonFormat=False ) |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 93 | main.log.info( listResult ) |
| 94 | |
| 95 | main.log.info( "Activate sdn-ip application" ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 96 | main.ONOScli1.activateApp( "org.onosproject.sdnip" ) |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 97 | |
| 98 | main.step("Sleep 1200 seconds") |
| 99 | # wait until SDN-IP receives all routes and ONOS installs all intents |
pingping-lin | 6f919c3 | 2015-08-25 14:04:33 -0700 | [diff] [blame] | 100 | time.sleep( int(main.params[ 'timers' ][ 'SystemBoot' ]) ) |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 101 | |
| 102 | main.step( "Checking routes installed" ) |
| 103 | |
| 104 | main.log.info( "Total route number expected is:" ) |
| 105 | main.log.info( routeNumberExpected ) |
| 106 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 107 | routeNumberActual = main.ONOScli1.ipv4RouteNumber() |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 108 | main.log.info("Total route number actual is: ") |
| 109 | main.log.info(routeNumberActual) |
| 110 | |
| 111 | utilities.assertEquals( |
| 112 | expect=routeNumberExpected, actual=routeNumberActual, |
| 113 | onpass="***Routes in SDN-IP are correct!***", |
| 114 | onfail="***Routes in SDN-IP are wrong!***" ) |
| 115 | |
| 116 | |
| 117 | main.step( "Checking MultiPointToSinglePointIntent intents installed" ) |
| 118 | |
| 119 | main.log.info( "MultiPointToSinglePoint intent number expected is:" ) |
| 120 | main.log.info( m2SIntentsNumberExpected ) |
| 121 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 122 | m2SIntentsNumberActual = main.ONOScli1.m2SIntentInstalledNumber() |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 123 | main.log.info( "MultiPointToSinglePoint intent number actual is:" ) |
| 124 | main.log.info(m2SIntentsNumberActual) |
| 125 | |
| 126 | utilities.assertEquals( |
| 127 | expect=True, |
| 128 | actual=eq( m2SIntentsNumberExpected, m2SIntentsNumberActual ), |
| 129 | onpass="***MultiPointToSinglePoint intent number is correct!***", |
| 130 | onfail="***MultiPointToSinglePoint intent number is wrong!***" ) |