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 | """ |
| 20 | main.case( "Setting up test environment" ) |
| 21 | |
| 22 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 23 | ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] |
| 24 | |
| 25 | main.step( "Applying cell variable to environment" ) |
| 26 | cellResult = main.ONOSbench.setCell( cellName ) |
| 27 | verifyResult = main.ONOSbench.verifyCell() |
| 28 | |
| 29 | branchName = main.ONOSbench.getBranchName() |
| 30 | main.log.info( "ONOS is on branch: " + branchName ) |
| 31 | |
| 32 | main.log.report( "Uninstalling ONOS" ) |
| 33 | main.ONOSbench.onosUninstall( ONOS1Ip ) |
| 34 | |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 35 | main.step( "Git pull" ) |
| 36 | gitPullResult = main.FALSE |
| 37 | #Need to push some new code to ONOS before using the git pull |
| 38 | #gitPullResult = main.ONOSbench.gitPull() |
| 39 | |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 40 | main.ONOSbench.getVersion( report=True ) |
| 41 | |
| 42 | main.step( "Creating ONOS package" ) |
Jon Hall | bd60ea0 | 2016-08-23 10:03:59 -0700 | [diff] [blame] | 43 | packageResult = main.ONOSbench.buckBuild() |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 44 | |
| 45 | main.step( "Installing ONOS package" ) |
| 46 | onos1InstallResult = main.ONOSbench.onosInstall( options="-f", |
| 47 | node=ONOS1Ip ) |
| 48 | |
You Wang | f5de25b | 2017-01-06 15:13:01 -0800 | [diff] [blame] | 49 | main.step( "Set up ONOS secure SSH" ) |
| 50 | secureSshResult = main.ONOSbench.onosSecureSSH( node=ONOS1Ip ) |
| 51 | |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 52 | main.step( "Checking if ONOS is up yet" ) |
| 53 | for i in range( 2 ): |
| 54 | onos1Isup = main.ONOSbench.isup( ONOS1Ip, timeout=420 ) |
| 55 | if onos1Isup: |
| 56 | break |
| 57 | if not onos1Isup: |
| 58 | main.log.report( "ONOS1 didn't start!" ) |
| 59 | |
| 60 | cliResult = main.ONOScli.startOnosCli( ONOS1Ip, |
| 61 | commandlineTimeout=100, onosStartTimeout=600) |
| 62 | |
Devin Lim | 8d7c778 | 2017-06-07 16:21:20 -0700 | [diff] [blame^] | 63 | case1Result = ( packageResult and cellResult and |
| 64 | verifyResult and onos1InstallResult and |
Chiyu Cheng | ef10950 | 2016-11-21 15:51:38 -0800 | [diff] [blame] | 65 | onos1Isup and secureSshResult and |
| 66 | cliResult ) |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 67 | |
| 68 | utilities.assert_equals( expect=main.TRUE, actual=case1Result, |
| 69 | onpass="ONOS startup successful", |
| 70 | onfail="ONOS startup NOT successful" ) |
| 71 | |
| 72 | if case1Result == main.FALSE: |
| 73 | main.cleanup() |
| 74 | main.exit() |
| 75 | |
| 76 | def CASE9( self, main ): |
| 77 | """ |
| 78 | Test the SDN-IP Performance |
| 79 | Test whether SDN-IP can boot with 600,000 routes from an external peer. |
| 80 | Since our goal for SDN-IP is to handle 600,000 routes, in this test case |
| 81 | we statically configure an external peer Quagga with 655360 routes. |
| 82 | Thus, we pre-know the routes and intents it should be, and then boot the |
| 83 | whole system and check whether the numbers of routes and intents from |
| 84 | ONOS CLI are correct. |
| 85 | """ |
| 86 | import time |
| 87 | import json |
| 88 | from operator import eq |
| 89 | from time import localtime, strftime |
| 90 | |
| 91 | # We configured one external BGP peer with 655360 routes |
| 92 | routeNumberExpected = 655360 |
| 93 | m2SIntentsNumberExpected = 655360 |
| 94 | |
| 95 | main.case("This case is to testing the performance of SDN-IP with \ |
| 96 | single ONOS instance" ) |
| 97 | time.sleep( 10 ) |
| 98 | |
| 99 | main.step( "Get devices in the network" ) |
| 100 | listResult = main.ONOScli.devices( jsonFormat=False ) |
| 101 | main.log.info( listResult ) |
| 102 | |
| 103 | main.step( "Get links in the network" ) |
| 104 | listResult = main.ONOScli.links ( jsonFormat=False ) |
| 105 | main.log.info( listResult ) |
| 106 | |
| 107 | main.log.info( "Activate sdn-ip application" ) |
| 108 | main.ONOScli.activateApp( "org.onosproject.sdnip" ) |
| 109 | |
| 110 | main.step("Sleep 1200 seconds") |
| 111 | # wait until SDN-IP receives all routes and ONOS installs all intents |
pingping-lin | 6f919c3 | 2015-08-25 14:04:33 -0700 | [diff] [blame] | 112 | time.sleep( int(main.params[ 'timers' ][ 'SystemBoot' ]) ) |
pingping-lin | 4ed949d | 2015-08-13 17:15:48 -0700 | [diff] [blame] | 113 | |
| 114 | main.step( "Checking routes installed" ) |
| 115 | |
| 116 | main.log.info( "Total route number expected is:" ) |
| 117 | main.log.info( routeNumberExpected ) |
| 118 | |
| 119 | routeNumberActual = main.ONOScli.ipv4RouteNumber() |
| 120 | main.log.info("Total route number actual is: ") |
| 121 | main.log.info(routeNumberActual) |
| 122 | |
| 123 | utilities.assertEquals( |
| 124 | expect=routeNumberExpected, actual=routeNumberActual, |
| 125 | onpass="***Routes in SDN-IP are correct!***", |
| 126 | onfail="***Routes in SDN-IP are wrong!***" ) |
| 127 | |
| 128 | |
| 129 | main.step( "Checking MultiPointToSinglePointIntent intents installed" ) |
| 130 | |
| 131 | main.log.info( "MultiPointToSinglePoint intent number expected is:" ) |
| 132 | main.log.info( m2SIntentsNumberExpected ) |
| 133 | |
| 134 | m2SIntentsNumberActual = main.ONOScli.m2SIntentInstalledNumber() |
| 135 | main.log.info( "MultiPointToSinglePoint intent number actual is:" ) |
| 136 | main.log.info(m2SIntentsNumberActual) |
| 137 | |
| 138 | utilities.assertEquals( |
| 139 | expect=True, |
| 140 | actual=eq( m2SIntentsNumberExpected, m2SIntentsNumberActual ), |
| 141 | onpass="***MultiPointToSinglePoint intent number is correct!***", |
| 142 | onfail="***MultiPointToSinglePoint intent number is wrong!***" ) |