[ONOS-7039] [ONOS-7044] Fix PEP8 Warnings in TestON
Change-Id: Ied79ff9caff5487a6df50466307f757468d7ca3a
diff --git a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoRingIpv6.py b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoRingIpv6.py
old mode 100755
new mode 100644
index 982840e..09e0691
--- a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoRingIpv6.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoRingIpv6.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 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,7 +20,6 @@
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
from mininet.net import Mininet
from mininet.node import Host, RemoteController
@@ -32,13 +31,16 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class dualStackHost( Host ):
+
def config( self, v6Addr='1000::1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class ringTopo( Topo ):
def __init__( self, **opts ):
@@ -71,43 +73,44 @@
s10_host = self.addHost( 'h10', ip='10.1.0.10/24', cls=dualStackHost, v6Addr='1000::10/64' )
# add edges between switch and corresponding host
- self.addLink( s1 , s1_host )
- self.addLink( s2 , s2_host )
- self.addLink( s3 , s3_host )
- self.addLink( s4 , s4_host )
- self.addLink( s5 , s5_host )
- self.addLink( s6 , s6_host )
- self.addLink( s7 , s7_host )
- self.addLink( s8 , s8_host )
- self.addLink( s9 , s9_host )
- self.addLink( s10 , s10_host )
- self.addLink(s1, s2)
- self.addLink(s2, s3)
- self.addLink(s3, s4)
- self.addLink(s4, s5)
- self.addLink(s5, s6)
- self.addLink(s6, s7)
- self.addLink(s7, s8)
- self.addLink(s8, s9)
- self.addLink(s9, s10)
- self.addLink(s10, s1)
+ self.addLink( s1, s1_host )
+ self.addLink( s2, s2_host )
+ self.addLink( s3, s3_host )
+ self.addLink( s4, s4_host )
+ self.addLink( s5, s5_host )
+ self.addLink( s6, s6_host )
+ self.addLink( s7, s7_host )
+ self.addLink( s8, s8_host )
+ self.addLink( s9, s9_host )
+ self.addLink( s10, s10_host )
+ self.addLink( s1, s2 )
+ self.addLink( s2, s3 )
+ self.addLink( s3, s4 )
+ self.addLink( s4, s5 )
+ self.addLink( s5, s6 )
+ self.addLink( s6, s7 )
+ self.addLink( s7, s8 )
+ self.addLink( s8, s9 )
+ self.addLink( s9, s10 )
+ self.addLink( s10, s1 )
topos = { 'ring': ( lambda: ringTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = ringTopo()
- #if controller_ip == '':
- #controller_ip = '10.0.2.2';
+ # if controller_ip == '':
+ # controller_ip = '10.0.2.2';
# controller_ip = '127.0.0.1';
- network = Mininet(topo=topo, switch=OVSSwitch, autoSetMacs=True, controller=None)
+ network = Mininet( topo=topo, switch=OVSSwitch, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()