[ONOS-7039] [ONOS-7044] Fix PEP8 Warnings in TestON
Change-Id: Ied79ff9caff5487a6df50466307f757468d7ca3a
diff --git a/TestON/tests/HA/dependencies/HA.py b/TestON/tests/HA/dependencies/HA.py
index 48b64c6..2227146 100644
--- a/TestON/tests/HA/dependencies/HA.py
+++ b/TestON/tests/HA/dependencies/HA.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
import json
import time
@@ -2795,7 +2794,7 @@
main.ONOSbench.createCellFile( main.ONOSbench.ip_address, cellName,
main.Mininet1.ip_address,
- cellAppString, ipList , main.ONOScli1.karafUser )
+ cellAppString, ipList, main.ONOScli1.karafUser )
main.step( "Applying cell variable to environment" )
cellResult = main.ONOSbench.setCell( cellName )
verifyResult = main.ONOSbench.verifyCell()
@@ -2814,7 +2813,7 @@
assert utilities.assert_equals, "utilities.assert_equals not defined"
main.case( "Running ONOS Constant State Tests" )
- OnosAfterWhich = [ "failure" , "scaliing" ]
+ OnosAfterWhich = [ "failure", "scaliing" ]
# Assert that each device has a master
self.checkRoleNotNull()
@@ -2981,7 +2980,7 @@
utilities.assert_equals(
expect=main.TRUE,
actual=sameIntents,
- onpass="Intents are consistent with before " + OnosAfterWhich[ afterWhich ] ,
+ onpass="Intents are consistent with before " + OnosAfterWhich[ afterWhich ],
onfail="The Intents changed during " + OnosAfterWhich[ afterWhich ] )
intentCheck = intentCheck and sameIntents
@@ -3032,7 +3031,6 @@
# we expect loss in dataplane connectivity
LossInPings = main.FALSE
"""
-
def compareTopo( self, main ):
"""
Compare topo
@@ -3086,7 +3084,7 @@
"Error with host ipAddresses on controller" +
controllerStr + ": " + str( host ) )
ipResult = main.FALSE
- ports = main.topoRelated.getAll( "ports" , True,
+ ports = main.topoRelated.getAll( "ports", True,
kwargs={ 'sleep': 5, 'attempts': 5,
'randomTime': True } )
links = main.topoRelated.getAll( "links", True,
diff --git a/TestON/tests/HA/dependencies/obelisk.py b/TestON/tests/HA/dependencies/obelisk.py
old mode 100755
new mode 100644
index 40cc242..c43941c
--- a/TestON/tests/HA/dependencies/obelisk.py
+++ b/TestON/tests/HA/dependencies/obelisk.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,63 +20,65 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
from mininet.topo import Topo
+
class ObeliskTopo( Topo ):
+
def __init__( self ):
Topo.__init__( self )
- topSwitch = self.addSwitch('s1',dpid='1000'.zfill(16))
- leftTopSwitch = self.addSwitch('s2',dpid='2000'.zfill(16))
- rightTopSwitch = self.addSwitch('s5',dpid='5000'.zfill(16))
- leftBotSwitch = self.addSwitch('s3',dpid='3000'.zfill(16))
- rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
- midBotSwitch = self.addSwitch('s28',dpid='2800'.zfill(16))
+ topSwitch = self.addSwitch( 's1', dpid='1000'.zfill( 16 ) )
+ leftTopSwitch = self.addSwitch( 's2', dpid='2000'.zfill( 16 ) )
+ rightTopSwitch = self.addSwitch( 's5', dpid='5000'.zfill( 16 ) )
+ leftBotSwitch = self.addSwitch( 's3', dpid='3000'.zfill( 16 ) )
+ rightBotSwitch = self.addSwitch( 's6', dpid='6000'.zfill( 16 ) )
+ midBotSwitch = self.addSwitch( 's28', dpid='2800'.zfill( 16 ) )
topHost = self.addHost( 'h1' )
- leftTopHost = self.addHost('h2')
- rightTopHost = self.addHost('h5')
- leftBotHost = self.addHost('h3')
- rightBotHost = self.addHost('h6')
- midBotHost = self.addHost('h28')
- self.addLink(topSwitch,topHost)
- self.addLink(leftTopSwitch,leftTopHost)
- self.addLink(rightTopSwitch,rightTopHost)
- self.addLink(leftBotSwitch,leftBotHost)
- self.addLink(rightBotSwitch,rightBotHost)
- self.addLink(midBotSwitch,midBotHost)
- self.addLink(leftTopSwitch,rightTopSwitch)
- self.addLink(topSwitch,leftTopSwitch)
- self.addLink(topSwitch,rightTopSwitch)
- self.addLink(leftTopSwitch,leftBotSwitch)
- self.addLink(rightTopSwitch,rightBotSwitch)
- self.addLink(leftBotSwitch,midBotSwitch)
- self.addLink(midBotSwitch,rightBotSwitch)
+ leftTopHost = self.addHost( 'h2' )
+ rightTopHost = self.addHost( 'h5' )
+ leftBotHost = self.addHost( 'h3' )
+ rightBotHost = self.addHost( 'h6' )
+ midBotHost = self.addHost( 'h28' )
+ self.addLink( topSwitch, topHost )
+ self.addLink( leftTopSwitch, leftTopHost )
+ self.addLink( rightTopSwitch, rightTopHost )
+ self.addLink( leftBotSwitch, leftBotHost )
+ self.addLink( rightBotSwitch, rightBotHost )
+ self.addLink( midBotSwitch, midBotHost )
+ self.addLink( leftTopSwitch, rightTopSwitch )
+ self.addLink( topSwitch, leftTopSwitch )
+ self.addLink( topSwitch, rightTopSwitch )
+ self.addLink( leftTopSwitch, leftBotSwitch )
+ self.addLink( rightTopSwitch, rightBotSwitch )
+ self.addLink( leftBotSwitch, midBotSwitch )
+ self.addLink( midBotSwitch, rightBotSwitch )
- agg1Switch = self.addSwitch('s4',dpid = '3004'.zfill(16))
- agg2Switch = self.addSwitch('s7',dpid = '6007'.zfill(16))
- agg1Host = self.addHost('h4')
- agg2Host = self.addHost('h7')
- self.addLink(agg1Switch,agg1Host)
- self.addLink(agg2Switch,agg2Host)
- self.addLink(agg1Switch, leftBotSwitch)
- self.addLink(agg2Switch, rightBotSwitch)
+ agg1Switch = self.addSwitch( 's4', dpid='3004'.zfill( 16 ) )
+ agg2Switch = self.addSwitch( 's7', dpid='6007'.zfill( 16 ) )
+ agg1Host = self.addHost( 'h4' )
+ agg2Host = self.addHost( 'h7' )
+ self.addLink( agg1Switch, agg1Host )
+ self.addLink( agg2Switch, agg2Host )
+ self.addLink( agg1Switch, leftBotSwitch )
+ self.addLink( agg2Switch, rightBotSwitch )
- for i in range(10):
- num = str(i+8)
- switch = self.addSwitch('s'+num,dpid = ('30'+num.zfill(2)).zfill(16))
- host = self.addHost('h'+num)
- self.addLink(switch, host)
- self.addLink(switch, agg1Switch)
+ for i in range( 10 ):
+ num = str( i + 8 )
+ switch = self.addSwitch( 's' + num, dpid=( '30' + num.zfill( 2 ) ).zfill( 16 ) )
+ host = self.addHost( 'h' + num )
+ self.addLink( switch, host )
+ self.addLink( switch, agg1Switch )
- for i in range(10):
- num = str(i+18)
- switch = self.addSwitch('s'+num,dpid = ('60'+num.zfill(2)).zfill(16))
- host = self.addHost('h'+num)
- self.addLink(switch, host)
- self.addLink(switch, agg2Switch)
+ for i in range( 10 ):
+ num = str( i + 18 )
+ switch = self.addSwitch( 's' + num, dpid=( '60' + num.zfill( 2 ) ).zfill( 16 ) )
+ host = self.addHost( 'h' + num )
+ self.addLink( switch, host )
+ self.addLink( switch, agg2Switch )
-topos = { 'obelisk': (lambda: ObeliskTopo() ) }
+topos = { 'obelisk': ( lambda: ObeliskTopo() ) }
+
def run():
topo = ObeliskTopo()