Fix Codestyle in Functionality tests
Change-Id: Iecb38eee560da85e02212e42cdf0f5f6b4634172
diff --git a/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py b/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
index 26dabed..b99d449 100644
--- a/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
+++ b/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
@@ -65,8 +65,8 @@
main.numLinks = int( main.params[ 'MININET' ][ 'links' ] )
main.cellData = {} # for creating cell file
main.hostsData = {}
+ main.RESTs = []
main.CLIs = []
- main.CLIs2 = []
main.ONOSip = []
main.scapyHostNames = main.params[ 'SCAPY' ][ 'HOSTNAMES' ].split( ',' )
main.scapyHosts = [] # List of scapy hosts for iterating
@@ -79,14 +79,14 @@
# Assigning ONOS cli handles to a list
try:
for i in range( 1, main.maxNodes + 1 ):
- main.CLIs.append( getattr( main, 'ONOSrest' + str( i ) ) )
- main.CLIs2.append( getattr( main, 'ONOScli' + str( i ) ) )
+ main.RESTs.append( getattr( main, 'ONOSrest' + str( i ) ) )
+ main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
except AttributeError:
main.log.warn( "A " + str( main.maxNodes ) + " node cluster " +
"was defined in env variables, but only " +
- str( len( main.CLIs ) ) +
+ str( len( main.RESTs ) ) +
" nodes were defined in the .topo file. " +
- "Using " + str( len( main.CLIs ) ) +
+ "Using " + str( len( main.RESTs ) ) +
" nodes for the test." )
# -- INIT SECTION, ONLY RUNS ONCE -- #
@@ -110,13 +110,13 @@
main.topology,
main.Mininet1.home + "custom/",
direction="to" )
- if main.CLIs and main.CLIs2:
+ if main.RESTs and main.CLIs:
stepResult = main.TRUE
else:
main.log.error( "Did not properly created list of ONOS CLI handle" )
stepResult = main.FALSE
except Exception as e:
- main.log.exception(e)
+ main.log.exception( e )
main.cleanup()
main.exit()
@@ -263,7 +263,7 @@
cliResult = main.TRUE
for i in range( main.numCtrls ):
cliResult = cliResult and \
- main.CLIs2[ i ].startOnosCli( main.ONOSip[ i ] )
+ main.CLIs[ i ].startOnosCli( main.ONOSip[ i ] )
stepResult = cliResult
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -475,7 +475,7 @@
Report errors/warnings/exceptions
'''
main.log.info( "Error report: \n" )
- main.ONOSbench.logReport( globalONOSip[0],
+ main.ONOSbench.logReport( globalONOSip[ 0 ],
[ "INFO", "FOLLOWER", "WARN", "flow", "ERROR" , "Except" ],
"s" )
#main.ONOSbench.logReport( globalONOSip[1], [ "INFO" ], "d" )
@@ -702,7 +702,7 @@
main.step( "Balancing mastership of switches" )
balanceResult = main.FALSE
- balanceResult = utilities.retry( f=main.CLIs2[ 0 ].balanceMasters, retValue=main.FALSE, args=[] )
+ balanceResult = utilities.retry( f=main.CLIs[ 0 ].balanceMasters, retValue=main.FALSE, args=[] )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -725,7 +725,7 @@
cmd = "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator"
- stepResult = main.CLIs2[ 0 ].setCfg( component=cmd,
+ stepResult = main.CLIs[ 0 ].setCfg( component=cmd,
propName="useFlowObjectives", value="true" )
utilities.assert_equals( expect=main.TRUE,
@@ -787,7 +787,7 @@
scpResult = main.TRUE
copyResult = main.TRUE
for i in range( main.numCtrls ):
- main.node = main.CLIs2[ i ]
+ main.node = main.CLIs[ i ]
ip = main.ONOSip[ i ]
main.node.ip_address = ip
scpResult = scpResult and main.ONOSbench.scp( main.node ,
@@ -834,9 +834,9 @@
# if you want to use the wrapper function
assert main, "There is no main"
try:
- assert main.CLIs
+ assert main.RESTs
except AssertionError:
- main.log.error( "There is no main.CLIs, skipping test cases" )
+ main.log.error( "There is no main.RESTs, skipping test cases" )
main.initialized = main.FALSE
main.skipCase()
try:
@@ -848,13 +848,13 @@
try:
assert main.numSwitch
except AssertionError:
- main.log.error( "Place the total number of switch topology in \
- main.numSwitch" )
+ main.log.error( "Place the total number of switch topology in "+\
+ main.numSwitch )
main.initialized = main.FALSE
main.skipCase()
# Save leader candidates
- intentLeadersOld = main.CLIs2[ 0 ].leaderCandidates()
+ intentLeadersOld = main.CLIs[ 0 ].leaderCandidates()
main.case( "Host Intents Test - " + str( main.numCtrls ) +
" NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
@@ -886,7 +886,7 @@
host2=host2,
sw1='s5',
sw2='s2',
- expectedLink = 18 )
+ expectedLink=18 )
utilities.assert_equals( expect=main.TRUE,
actual=testResult,
@@ -896,7 +896,7 @@
main.step( "DUALSTACK1: Add host intents between h3 and h11" )
main.assertReturnString = "Assertion Result for dualstack IPV4 with MAC addresses\n"
host1 = { "name":"h3", "id":"00:00:00:00:00:03/-1" }
- host2 = { "name":"h11","id":"00:00:00:00:00:0B/-1"}
+ host2 = { "name":"h11","id":"00:00:00:00:00:0B/-1" }
testResult = main.FALSE
installResult = main.intentFunction.installHostIntent( main,
name='DUALSTACK1',
@@ -913,12 +913,12 @@
host2=host2,
sw1='s5',
sw2='s2',
- expectedLink = 18 )
+ expectedLink=18 )
utilities.assert_equals( expect=main.TRUE,
actual=testResult,
onpass=main.assertReturnString,
- onfail=main.assertReturnString)
+ onfail=main.assertReturnString )
main.step( "DUALSTACK2: Add host intents between h1 and h11" )
main.assertReturnString = "Assertion Result for dualstack2 host intent\n"
@@ -940,7 +940,7 @@
host2=host2,
sw1='s5',
sw2='s2',
- expectedLink = 18 )
+ expectedLink=18 )
utilities.assert_equals( expect=main.TRUE,
actual=testResult,
@@ -967,7 +967,7 @@
host2=host2,
sw1='s5',
sw2='s2',
- expectedLink = 18 )
+ expectedLink=18 )
utilities.assert_equals( expect=main.TRUE,
actual=testResult,
@@ -994,7 +994,7 @@
host2=host2,
sw1='s5',
sw2='s2',
- expectedLink = 18 )
+ expectedLink=18 )
utilities.assert_equals( expect=main.TRUE,
actual=testResult,
@@ -1022,7 +1022,7 @@
# host2=host2,
# sw1='s5',
# sw2='s2',
- # expectedLink = 18 )
+ # expectedLink=18 )
# utilities.assert_equals( expect=main.TRUE,
# actual=testResult,
@@ -1032,8 +1032,8 @@
# Change the following to use the REST API when leader checking is
# supported by it
- main.step( "Confirm that ONOS leadership is unchanged")
- intentLeadersNew = main.CLIs2[ 0 ].leaderCandidates()
+ main.step( "Confirm that ONOS leadership is unchanged" )
+ intentLeadersNew = main.CLIs[ 0 ].leaderCandidates()
main.intentFunction.checkLeaderChange( intentLeadersOld,
intentLeadersNew )
@@ -1073,9 +1073,9 @@
# if you want to use the wrapper function
assert main, "There is no main"
try:
- assert main.CLIs
+ assert main.RESTs
except AssertionError:
- main.log.error( "There is no main.CLIs, skipping test cases" )
+ main.log.error( "There is no main.RESTs, skipping test cases" )
main.initialized = main.FALSE
main.skipCase()
try:
@@ -1087,8 +1087,8 @@
try:
assert main.numSwitch
except AssertionError:
- main.log.error( "Place the total number of switch topology in \
- main.numSwitch" )
+ main.log.error( "Place the total number of switch topology in "+\
+ main.numSwitch )
main.initialized = main.FALSE
main.skipCase()
@@ -1128,7 +1128,7 @@
recipients=recipients,
sw1="s5",
sw2="s2",
- expectedLink=18)
+ expectedLink=18 )
utilities.assert_equals( expect=main.TRUE,
actual=testResult,
@@ -1159,7 +1159,7 @@
recipients=recipients,
sw1="s5",
sw2="s2",
- expectedLink=18)
+ expectedLink=18 )
utilities.assert_equals( expect=main.TRUE,
actual=testResult,
@@ -1189,7 +1189,7 @@
recipients=recipients,
sw1="s5",
sw2="s2",
- expectedLink=18)
+ expectedLink=18 )
utilities.assert_equals( expect=main.TRUE,
actual=testResult,
@@ -1293,7 +1293,7 @@
recipients=recipients,
sw1="s5",
sw2="s2",
- expectedLink=18)
+ expectedLink=18 )
utilities.assert_equals( expect=main.TRUE,
actual=testResult,
@@ -1323,7 +1323,7 @@
recipients=recipients,
sw1="s5",
sw2="s2",
- expectedLink=18)
+ expectedLink=18 )
utilities.assert_equals( expect=main.TRUE,
actual=testResult,
@@ -1356,7 +1356,7 @@
recipients=recipients,
sw1="s5",
sw2="s2",
- expectedLink=18)
+ expectedLink=18 )
utilities.assert_equals( expect=main.TRUE,
actual=testResult,
@@ -1657,9 +1657,9 @@
# if you want to use the wrapper function
assert main, "There is no main"
try:
- assert main.CLIs
+ assert main.RESTs
except AssertionError:
- main.log.error( "There is no main.CLIs, skipping test cases" )
+ main.log.error( "There is no main.RESTs, skipping test cases" )
main.initialized = main.FALSE
main.skipCase()
try:
@@ -1671,16 +1671,16 @@
try:
assert main.numSwitch
except AssertionError:
- main.log.error( "Place the total number of switch topology in \
- main.numSwitch" )
+ main.log.error( "Place the total number of switch topology in " +\
+ main.numSwitch )
main.initialized = main.FALSE
main.skipCase()
main.case( "Test host mobility with host intents " )
main.step( "Testing host mobility by moving h1 from s5 to s6" )
h1PreMove = main.hostsData[ "h1" ][ "location" ][ 0:19 ]
- main.log.info( "Moving h1 from s5 to s6")
- main.Mininet1.moveHost( "h1","s5","s6" )
+ main.log.info( "Moving h1 from s5 to s6" )
+ main.Mininet1.moveHost( "h1", "s5", "s6" )
# Send discovery ping from moved host
# Moving the host brings down the default interfaces and creates a new one.
@@ -1712,7 +1712,7 @@
name='IPV4 Mobility IPV4',
onosNode='0',
host1=host1,
- host2=host2)
+ host2=host2 )
if installResult:
testResult = main.intentFunction.testHostIntent( main,
name='Host Mobility IPV4',
diff --git a/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py b/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
index 92d100f..1d4499c 100755
--- a/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
+++ b/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
@@ -23,7 +23,7 @@
ipAddresses="",
tcp="",
sw1="",
- sw2=""):
+ sw2="" ):
"""
Installs a Host Intent
@@ -46,7 +46,7 @@
host2 - Dictionary for host2
{ "name":"h16", "id":"of:0000000000000006/8" }
Optional:
- onosNode - ONOS node to install the intents in main.CLIs[ ]
+ onosNode - ONOS node to install the intents in main.RESTs[ ]
0 by default so that it will always use the first
ONOS node
ethType - Ethernet type eg. IPV4, IPV6
@@ -80,14 +80,14 @@
# Adding host intents
main.log.info( itemName + ": Adding host intents" )
- intent1 = main.CLIs[ onosNode ].addHostIntent( hostIdOne=host1.get( "id" ),
+ intent1 = main.RESTs[ onosNode ].addHostIntent( hostIdOne=host1.get( "id" ),
hostIdTwo=host2.get( "id" ),
vlanId=vlanId )
# Get all intents ID in the system, time delay right after intents are added
time.sleep( main.addIntentSleep )
- intentsId = main.CLIs[ 0 ].getIntentsId()
- except (KeyError, TypeError):
+ intentsId = main.RESTs[ 0 ].getIntentsId()
+ except( KeyError, TypeError ):
errorMsg = "There was a problem loading the hosts data."
if intentsId:
errorMsg += " There was a problem installing host to host intent."
@@ -116,7 +116,7 @@
onosNode=0,
sw1="s5",
sw2="s2",
- expectedLink=0):
+ expectedLink=0 ):
"""
Test a Host Intent
@@ -150,7 +150,7 @@
host2 - Dictionary for host2
{ "name":"h16", "id":"of:0000000000000006/8" }
Optional:
- onosNode - ONOS node to install the intents in main.CLIs[ ]
+ onosNode - ONOS node to install the intents in main.RESTs[ ]
0 by default so that it will always use the first
ONOS node
sw1 - First switch to bring down & up for rerouting purpose
@@ -185,7 +185,7 @@
senderNames = [ host1.get( "name" ), host2.get( "name" ) ]
recipientNames = [ host1.get( "name" ), host2.get( "name" ) ]
vlanId = host1.get( "vlanId" )
- except ( KeyError, TypeError ):
+ except( KeyError, TypeError ):
main.log.error( "There was a problem loading the hosts data." )
return main.FALSE
@@ -309,7 +309,7 @@
ipSrc="",
ipDst="",
tcpSrc="",
- tcpDst=""):
+ tcpDst="" ):
"""
Installs a Single to Single Point Intent
@@ -331,7 +331,7 @@
recipients - List of host dictionaries i.e.
[ { "name":"h16", "device":"of:0000000000000006/8", "mac":"00:00:00:00:00:10" } ]
Optional:
- onosNode - ONOS node to install the intents in main.CLIs[ ]
+ onosNode - ONOS node to install the intents in main.RESTs[ ]
0 by default so that it will always use the first
ONOS node
ethType - Ethernet type eg. IPV4, IPV6
@@ -384,7 +384,7 @@
ipSrc = senders[ 0 ].get( "ip" )
ipDst = recipients[ 0 ].get( "ip" )
- intent1 = main.CLIs[ onosNode ].addPointIntent(
+ intent1 = main.RESTs[ onosNode ].addPointIntent(
ingressDevice=ingressDevice,
egressDevice=egressDevice,
ingressPort=portIngress,
@@ -402,8 +402,8 @@
vlanId=vlanId )
time.sleep( main.addIntentSleep )
- intentsId = main.CLIs[ 0 ].getIntentsId()
- except (KeyError, TypeError):
+ intentsId = main.RESTs[ 0 ].getIntentsId()
+ except( KeyError, TypeError ):
errorMsg = "There was a problem loading the hosts data."
if intentsId:
errorMsg += " There was a problem installing Point to Point intent."
@@ -476,7 +476,7 @@
recipients - List of host dictionaries i.e.
{ "name":"h16", "device":"of:0000000000000006/8", "mac":"00:00:00:00:00:10" }
Optional:
- onosNode - ONOS node to install the intents in main.CLIs[ ]
+ onosNode - ONOS node to install the intents in main.RESTs[ ]
0 by default so that it will always use the first
ONOS node
ethType - Ethernet type eg. IPV4, IPV6
@@ -521,7 +521,7 @@
main.log.warn( "Device not given for recipient {0}. Loading from main.hostData".format( recipient.get( "name" ) ) )
recipient[ "device" ] = main.hostsData.get( recipient.get( "name" ) ).get( "location" )
vlanId=senders[ 0 ].get( "vlanId" )
- except (KeyError, TypeError):
+ except( KeyError, TypeError ):
main.log.error( "There was a problem loading the hosts data." )
return main.FALSE
@@ -697,7 +697,7 @@
host1 - Name of first host
host2 - Name of second host
Optional:
- onosNode - ONOS node to install the intents in main.CLIs[ ]
+ onosNode - ONOS node to install the intents in main.RESTs[ ]
0 by default so that it will always use the first
ONOS node
deviceId1 - ONOS device id of the first switch, the same as the
@@ -745,7 +745,7 @@
# Adding bidirectional point intents
main.log.info( itemName + ": Adding point intents" )
- intent1 = main.CLIs[ onosNode ].addPointIntent( ingressDevice=deviceId1,
+ intent1 = main.RESTs[ onosNode ].addPointIntent( ingressDevice=deviceId1,
egressDevice=deviceId2,
ingressPort=port1,
egressPort=port2,
@@ -760,7 +760,7 @@
tcpSrc=tcp1,
tcpDst="" )
- intent2 = main.CLIs[ onosNode ].addPointIntent( ingressDevice=deviceId2,
+ intent2 = main.RESTs[ onosNode ].addPointIntent( ingressDevice=deviceId2,
egressDevice=deviceId1,
ingressPort=port2,
egressPort=port1,
@@ -775,7 +775,7 @@
tcpSrc=tcp2,
tcpDst="" )
- intent3 = main.CLIs[ onosNode ].addPointIntent( ingressDevice=deviceId1,
+ intent3 = main.RESTs[ onosNode ].addPointIntent( ingressDevice=deviceId1,
egressDevice=deviceId2,
ingressPort=port1,
egressPort=port2,
@@ -790,7 +790,7 @@
tcpSrc="",
tcpDst=tcp2 )
- intent4 = main.CLIs[ onosNode ].addPointIntent( ingressDevice=deviceId2,
+ intent4 = main.RESTs[ onosNode ].addPointIntent( ingressDevice=deviceId2,
egressDevice=deviceId1,
ingressPort=port2,
egressPort=port1,
@@ -807,7 +807,7 @@
# Get all intents ID in the system, time delay right after intents are added
time.sleep( main.addIntentSleep )
- intentsId = main.CLIs[ 0 ].getIntentsId()
+ intentsId = main.RESTs[ 0 ].getIntentsId()
# Check intents state
time.sleep( main.checkIntentSleep )
intentResult = checkIntentState( main, intentsId )
@@ -934,7 +934,7 @@
name - Type of point intent to add eg. IPV4 | VLAN | Dualstack
hostNames - List of host names
Optional:
- onosNode - ONOS node to install the intents in main.CLIs[ ]
+ onosNode - ONOS node to install the intents in main.RESTs[ ]
0 by default so that it will always use the first
ONOS node
devices - List of device ids in the same order as the hosts
@@ -1040,7 +1040,7 @@
srcMac = ""
intentsId.append(
- main.CLIs[ onosNode ].addSinglepointToMultipointIntent(
+ main.RESTs[ onosNode ].addSinglepointToMultipointIntent(
ingressDevice=ingressDevice,
egressDeviceList=egressDeviceList,
portIngress=portIngress,
@@ -1176,7 +1176,7 @@
name - Type of point intent to add eg. IPV4 | VLAN | Dualstack
hostNames - List of host names
Optional:
- onosNode - ONOS node to install the intents in main.CLIs[ ]
+ onosNode - ONOS node to install the intents in main.RESTs[ ]
0 by default so that it will always use the first
ONOS node
devices - List of device ids in the same order as the hosts
@@ -1281,7 +1281,7 @@
dstMac = ""
intentsId.append(
- main.CLIs[ onosNode ].addMultipointToSinglepointIntent(
+ main.RESTs[ onosNode ].addMultipointToSinglepointIntent(
ingressDeviceList=ingressDeviceList,
egressDevice=egressDevice,
portIngressList=portIngressList,
@@ -1388,7 +1388,7 @@
appCheck = main.TRUE
getDataResult = main.TRUE
main.log.info( "Activating reactive forwarding app " )
- activateResult = main.CLIs[ 0 ].activateApp( "org.onosproject.fwd" )
+ activateResult = main.RESTs[ 0 ].activateApp( "org.onosproject.fwd" )
if not activateResult:
main.log.error( "Something went wrong installing fwd app" )
time.sleep( main.fwdSleep )
@@ -1398,7 +1398,7 @@
for i in xrange( len( hostList ) ):
main.Mininet1.pingallHosts( hostList[ i ] )
- hostsJson = json.loads( main.CLIs[ 0 ].hosts() )
+ hostsJson = json.loads( main.RESTs[ 0 ].hosts() )
hosts = main.Mininet1.getHosts().keys()
# TODO: Make better use of new getHosts function
for host in hosts:
@@ -1415,7 +1415,7 @@
main.hostsData[ host ][ 'ipAddresses' ] = hostj[ 'ipAddresses' ]
main.log.info( "Deactivating reactive forwarding app " )
- deactivateResult = main.CLIs[ 0 ].deactivateApp( "org.onosproject.fwd" )
+ deactivateResult = main.RESTs[ 0 ].deactivateApp( "org.onosproject.fwd" )
if activateResult and deactivateResult and main.hostsData:
main.log.info( "Successfully used fwd app to discover hosts " )
getDataResult = main.TRUE
@@ -1433,7 +1433,7 @@
main.log.info( itemName + ": Checking ONOS topology " )
for i in range( main.numCtrls ):
- statusResult = main.CLIs[ i ].checkStatus( main.numSwitch,
+ statusResult = main.RESTs[ i ].checkStatus( main.numSwitch,
expectedLink )\
and statusResult
if not statusResult:
@@ -1454,7 +1454,7 @@
main.log.info( itemName + ": Checking intents state" )
# First check of intents
for i in range( main.numCtrls ):
- tempResult = main.CLIs[ i ].checkIntentState( intentsId=intentsId )
+ tempResult = main.RESTs[ i ].checkIntentState( intentsId=intentsId )
results.append( tempResult )
expectedState = [ 'INSTALLED', 'INSTALLING' ]
@@ -1469,7 +1469,7 @@
# Second check of intents since some of the intents may be in
# INSTALLING state, they should be in INSTALLED at this time
for i in range( main.numCtrls ):
- tempResult = main.CLIs[ i ].checkIntentState( intentsId=intentsId )
+ tempResult = main.RESTs[ i ].checkIntentState( intentsId=intentsId )
results.append( tempResult )
if all( result == main.TRUE for result in results ):
main.log.info( itemName + ": Intents are installed correctly" )
@@ -1483,7 +1483,7 @@
def checkFlowsState( main ):
main.log.info( itemName + ": Check flows state" )
- checkFlowsResult = main.CLIs[ 0 ].checkFlowsState()
+ checkFlowsResult = main.RESTs[ 0 ].checkFlowsState()
return checkFlowsResult
def link( main, sw1, sw2, option):
@@ -1502,7 +1502,7 @@
onosSummary = []
removeIntentResult = main.TRUE
# Remove intents
- removeIntentResult = main.CLIs[ 0 ].removeAllIntents( )
+ removeIntentResult = main.RESTs[ 0 ].removeAllIntents( )
if removeIntentResult:
main.log.info( itemName + ": There are no more intents remaining, " +
@@ -1518,7 +1518,7 @@
flowsCount = []
main.log.info( itemName + ": Checking flows count in each ONOS node" )
for i in range( main.numCtrls ):
- flowsCount.append( len( json.loads( main.CLIs[ i ].flows() ) ) )
+ flowsCount.append( len( json.loads( main.RESTs[ i ].flows() ) ) )
if flowsCount:
if all( flows==flowsCount[ 0 ] for flows in flowsCount ):
@@ -1595,7 +1595,7 @@
return main.FALSE
if hostFails:
- main.log.error( "List of failed ONOS Nodes:" + ', '.join(map(str, hostFails )) )
+ main.log.error( "List of failed ONOS Nodes:" + ', '.join( map( str, hostFails ) ) )
return main.FALSE
else:
return main.TRUE
@@ -1606,7 +1606,7 @@
"""
import json
try:
- hostsJson = json.loads( main.CLIs[ 0 ].hosts() )
+ hostsJson = json.loads( main.RESTs[ 0 ].hosts() )
hosts = main.Mininet1.getHosts().keys()
# TODO: Make better use of new getHosts function
for host in hosts:
@@ -1650,7 +1650,7 @@
if not packetFilter:
packetFilter = 'ether host {}'
if useTCP:
- packetFilter += ' ip proto \\tcp tcp port {}'.format(main.params[ 'SDNIP' ][ 'dstPort' ])
+ packetFilter += ' ip proto \\tcp tcp port {}'.format( main.params[ 'SDNIP' ][ 'dstPort' ] )
if expectFailure:
timeout = 1
else:
@@ -1766,7 +1766,7 @@
"flow",
"ERROR",
"Except" ],
- "s" )
+ "s" )
main.log.info( "ERROR report: \n" )
for i in range( main.numCtrls ):
@@ -1792,7 +1792,7 @@
"""
import time
main.log.info( "Getting current flow durations" )
- flowsJson1 = main.CLIs[ 0 ].flows()
+ flowsJson1 = main.RESTs[ 0 ].flows()
try:
flowsJson1 = json.loads( flowsJson1 )
except ValueError:
@@ -1806,7 +1806,7 @@
main.log.info( "Sleeping for {} seconds".format( main.flowDurationSleep ) )
time.sleep( main.flowDurationSleep )
main.log.info( "Getting new flow durations" )
- flowsJson2 = main.CLIs[ 0 ].flows()
+ flowsJson2 = main.RESTs[ 0 ].flows()
try:
flowsJson2 = json.loads( flowsJson2 )
except ValueError:
@@ -1817,7 +1817,7 @@
waitFlowLife.append( flow[ 'life' ] )
main.log.info( "Determining whether flows where overwritten" )
if len( flowLife ) == len( waitFlowLife ):
- for i in range( len( flowLife) ):
+ for i in range( len( flowLife ) ):
if waitFlowLife[ i ] - flowLife[ i ] < main.flowDurationSleep:
return main.FALSE
else: