class SDNIPperf: | |
def __init__( self ): | |
self.default = '' | |
global branchName | |
# This case is to setup ONOS | |
def CASE100( self, main ): | |
""" | |
CASE100 is to compile ONOS and push it to the test machines | |
Startup sequence: | |
cell <name> | |
onos-verify-cell | |
git pull | |
mvn clean install | |
onos-package | |
onos-install -f | |
onos-wait-for-start | |
""" | |
main.case( "Setting up test environment" ) | |
cellName = main.params[ 'ENV' ][ 'cellName' ] | |
ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ] | |
main.step( "Applying cell variable to environment" ) | |
cellResult = main.ONOSbench.setCell( cellName ) | |
verifyResult = main.ONOSbench.verifyCell() | |
branchName = main.ONOSbench.getBranchName() | |
main.log.info( "ONOS is on branch: " + branchName ) | |
main.log.report( "Uninstalling ONOS" ) | |
main.ONOSbench.onosUninstall( ONOS1Ip ) | |
cleanInstallResult = main.TRUE | |
gitPullResult = main.TRUE | |
main.step( "Git pull" ) | |
gitPullResult = main.FALSE | |
#Need to push some new code to ONOS before using the git pull | |
#gitPullResult = main.ONOSbench.gitPull() | |
main.step( "Using mvn clean & install" ) | |
if gitPullResult == main.TRUE: | |
cleanInstallResult = main.ONOSbench.cleanInstall() | |
else: | |
main.log.warn( "Did not pull new code so skipping mvn " + | |
"clean install" ) | |
cleanInstallResult = main.ONOSbench.cleanInstall( mciTimeout= 300 ) | |
main.ONOSbench.getVersion( report=True ) | |
main.step( "Creating ONOS package" ) | |
packageResult = main.ONOSbench.onosPackage( opTimeout=500 ) | |
main.step( "Installing ONOS package" ) | |
onos1InstallResult = main.ONOSbench.onosInstall( options="-f", | |
node=ONOS1Ip ) | |
main.step( "Checking if ONOS is up yet" ) | |
for i in range( 2 ): | |
onos1Isup = main.ONOSbench.isup( ONOS1Ip, timeout=420 ) | |
if onos1Isup: | |
break | |
if not onos1Isup: | |
main.log.report( "ONOS1 didn't start!" ) | |
cliResult = main.ONOScli.startOnosCli( ONOS1Ip, | |
commandlineTimeout=100, onosStartTimeout=600) | |
case1Result = ( cleanInstallResult and packageResult and | |
cellResult and verifyResult and | |
onos1InstallResult and | |
onos1Isup and cliResult ) | |
utilities.assert_equals( expect=main.TRUE, actual=case1Result, | |
onpass="ONOS startup successful", | |
onfail="ONOS startup NOT successful" ) | |
if case1Result == main.FALSE: | |
main.cleanup() | |
main.exit() | |
def CASE9( self, main ): | |
""" | |
Test the SDN-IP Performance | |
Test whether SDN-IP can boot with 600,000 routes from an external peer. | |
Since our goal for SDN-IP is to handle 600,000 routes, in this test case | |
we statically configure an external peer Quagga with 655360 routes. | |
Thus, we pre-know the routes and intents it should be, and then boot the | |
whole system and check whether the numbers of routes and intents from | |
ONOS CLI are correct. | |
""" | |
import time | |
import json | |
from operator import eq | |
from time import localtime, strftime | |
# We configured one external BGP peer with 655360 routes | |
routeNumberExpected = 655360 | |
m2SIntentsNumberExpected = 655360 | |
main.case("This case is to testing the performance of SDN-IP with \ | |
single ONOS instance" ) | |
time.sleep( 10 ) | |
main.step( "Get devices in the network" ) | |
listResult = main.ONOScli.devices( jsonFormat=False ) | |
main.log.info( listResult ) | |
main.step( "Get links in the network" ) | |
listResult = main.ONOScli.links ( jsonFormat=False ) | |
main.log.info( listResult ) | |
main.log.info( "Activate sdn-ip application" ) | |
main.ONOScli.activateApp( "org.onosproject.sdnip" ) | |
main.step("Sleep 1200 seconds") | |
# wait until SDN-IP receives all routes and ONOS installs all intents | |
time.sleep( float(main.params[ 'timers' ][ 'SystemBoot' ]) ) | |
main.step( "Checking routes installed" ) | |
main.log.info( "Total route number expected is:" ) | |
main.log.info( routeNumberExpected ) | |
routeNumberActual = main.ONOScli.ipv4RouteNumber() | |
main.log.info("Total route number actual is: ") | |
main.log.info(routeNumberActual) | |
utilities.assertEquals( | |
expect=routeNumberExpected, actual=routeNumberActual, | |
onpass="***Routes in SDN-IP are correct!***", | |
onfail="***Routes in SDN-IP are wrong!***" ) | |
main.step( "Checking MultiPointToSinglePointIntent intents installed" ) | |
main.log.info( "MultiPointToSinglePoint intent number expected is:" ) | |
main.log.info( m2SIntentsNumberExpected ) | |
m2SIntentsNumberActual = main.ONOScli.m2SIntentInstalledNumber() | |
main.log.info( "MultiPointToSinglePoint intent number actual is:" ) | |
main.log.info(m2SIntentsNumberActual) | |
utilities.assertEquals( | |
expect=True, | |
actual=eq( m2SIntentsNumberExpected, m2SIntentsNumberActual ), | |
onpass="***MultiPointToSinglePoint intent number is correct!***", | |
onfail="***MultiPointToSinglePoint intent number is wrong!***" ) |