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