Initial pep8 compliant drivers
diff --git a/TestON/tests/PingallExample/PingallExample.py b/TestON/tests/PingallExample/PingallExample.py
index faf374f..2798a97 100644
--- a/TestON/tests/PingallExample/PingallExample.py
+++ b/TestON/tests/PingallExample/PingallExample.py
@@ -8,10 +8,10 @@
"""
class PingallExample:
- def __init__( self ) :
+ def __init__( self ):
self.default = ''
- def CASE1( self, main ) :
+ def CASE1( self, main ):
"""
CASE1 is to compile ONOS and push it to the test machines
@@ -29,73 +29,73 @@
main.case( "Setting up test environment" )
# load some vairables from the params file
- PULL_CODE = False
+ PULLCODE = False
if main.params[ 'Git' ] == 'True':
- PULL_CODE = True
- cell_name = main.params[ 'ENV' ][ 'cellName' ]
+ PULLCODE = True
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1_ip = main.params[ 'CTRL' ][ 'ip1' ]
+ ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
main.step( "Applying cell variable to environment" )
- cell_result = main.ONOSbench.set_cell( cell_name )
- verify_result = main.ONOSbench.verify_cell()
+ cellResult = main.ONOSbench.setCell( cellName )
+ verifyResult = main.ONOSbench.verifyCell()
main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onos_uninstall( ONOS1_ip )
+ main.ONOSbench.onosUninstall( ONOS1Ip )
- clean_install_result = main.TRUE
- git_pull_result = main.TRUE
+ cleanInstallResult = main.TRUE
+ gitPullResult = main.TRUE
main.step( "Compiling the latest version of ONOS" )
- if PULL_CODE:
+ if PULLCODE:
main.step( "Git checkout and pull master" )
- main.ONOSbench.git_checkout( "master" )
- git_pull_result = main.ONOSbench.git_pull()
+ main.ONOSbench.gitCheckout( "master" )
+ gitPullResult = main.ONOSbench.gitPull()
main.step( "Using mvn clean & install" )
- clean_install_result = main.TRUE
- if git_pull_result == main.TRUE:
- clean_install_result = main.ONOSbench.clean_install()
+ cleanInstallResult = main.TRUE
+ if gitPullResult == main.TRUE:
+ cleanInstallResult = main.ONOSbench.cleanInstall()
else:
main.log.warn( "Did not pull new code so skipping mvn " +
"clean install" )
- main.ONOSbench.get_version( report=True )
+ main.ONOSbench.getVersion( report=True )
- cell_result = main.ONOSbench.set_cell( cell_name )
- verify_result = main.ONOSbench.verify_cell()
+ cellResult = main.ONOSbench.setCell( cellName )
+ verifyResult = main.ONOSbench.verifyCell()
main.step( "Creating ONOS package" )
- package_result = main.ONOSbench.onos_package()
+ packageResult = main.ONOSbench.onosPackage()
main.step( "Installing ONOS package" )
- onos1_install_result = main.ONOSbench.onos_install( options="-f",
- node=ONOS1_ip )
+ onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
+ node=ONOS1Ip )
main.step( "Checking if ONOS is up yet" )
for i in range( 2 ):
- onos1_isup = main.ONOSbench.isup( ONOS1_ip )
- if onos1_isup:
+ onos1Isup = main.ONOSbench.isup( ONOS1Ip )
+ if onos1Isup:
break
- if not onos1_isup:
+ if not onos1Isup:
main.log.report( "ONOS1 didn't start!" )
# TODO: if it becomes an issue, we can retry this step a few times
- cli_result = main.ONOScli1.start_onos_cli( ONOS1_ip )
+ cliResult = main.ONOScli1.startOnosCli( ONOS1Ip )
- case1_result = ( clean_install_result and package_result and
- cell_result and verify_result and
- onos1_install_result and
- onos1_isup and cli_result )
+ case1Result = ( cleanInstallResult and packageResult and
+ cellResult and verifyResult and
+ onos1InstallResult and
+ onos1Isup and cliResult )
- utilities.assert_equals( expect=main.TRUE, actual=case1_result,
- onpass="Test startup successful",
- onfail="Test startup NOT successful" )
+ utilities.assert_equals( expect=main.TRUE, actual=case1Result,
+ onpass="Test startup successful",
+ onfail="Test startup NOT successful" )
- if case1_result == main.FALSE:
+ if case1Result == main.FALSE:
main.cleanup()
main.exit()
- def CASE2( self, main ) :
+ def CASE2( self, main ):
"""
Assign mastership to controller
"""
@@ -105,35 +105,35 @@
main.case( "Assigning Controller" )
main.step( "Assign switches to controller" )
- ONOS1_ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS1_port = main.params[ 'CTRL' ][ 'port1' ]
+ ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
+ ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
for i in range( 1, 14 ):
- main.Mininet1.assign_sw_controller(
+ main.Mininet1.assignSwController(
sw=str( i ),
- ip1=ONOS1_ip,
- port1=ONOS1_port )
+ ip1=ONOS1Ip,
+ port1=ONOS1Port )
- mastership_check = main.TRUE
+ mastershipCheck = main.TRUE
for i in range( 1, 14 ):
- response = main.Mininet1.get_sw_controller( "s" + str( i ) )
+ response = main.Mininet1.getSwController( "s" + str( i ) )
try:
main.log.info( str( response ) )
except:
main.log.info( repr( response ) )
- if re.search( "tcp:" + ONOS1_ip, response ):
- mastership_check = mastership_check and main.TRUE
+ if re.search( "tcp:" + ONOS1Ip, response ):
+ mastershipCheck = mastershipCheck and main.TRUE
else:
- mastership_check = main.FALSE
- if mastership_check == main.TRUE:
+ mastershipCheck = main.FALSE
+ if mastershipCheck == main.TRUE:
main.log.report( "Switch mastership assigned correctly" )
utilities.assert_equals(
expect=main.TRUE,
- actual=mastership_check,
+ actual=mastershipCheck,
onpass="Switch mastership assigned correctly",
onfail="Switches not assigned correctly to controllers" )
- def CASE3( self, main ) :
+ def CASE3( self, main ):
"""
Assign intents
"""
@@ -144,19 +144,19 @@
# install onos-app-fwd
main.log.info( "Install reactive forwarding app" )
- main.ONOScli1.feature_install( "onos-app-fwd" )
+ main.ONOScli1.featureInstall( "onos-app-fwd" )
# REACTIVE FWD test
- ping_result = main.FALSE
+ pingResult = main.FALSE
time1 = time.time()
- ping_result = main.Mininet1.pingall()
+ pingResult = main.Mininet1.pingall()
time2 = time.time()
main.log.info( "Time for pingall: %2f seconds" % ( time2 - time1 ) )
# uninstall onos-app-fwd
main.log.info( "Uninstall reactive forwarding app" )
- main.ONOScli1.feature_uninstall( "onos-app-fwd" )
+ main.ONOScli1.featureUninstall( "onos-app-fwd" )
- utilities.assert_equals( expect=main.TRUE, actual=ping_result,
- onpass="All hosts are reachable",
- onfail="Some pings failed" )
+ utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ onpass="All hosts are reachable",
+ onfail="Some pings failed" )