[ONOS-7039] [ONOS-7044] Fix PEP8 Warnings in TestON
Change-Id: Ied79ff9caff5487a6df50466307f757468d7ca3a
diff --git a/TestON/tests/SCPF/SCPFportLat/dependencies/portFunc.py b/TestON/tests/SCPF/SCPFportLat/dependencies/portFunc.py
index f773da3..4c94193 100644
--- a/TestON/tests/SCPF/SCPFportLat/dependencies/portFunc.py
+++ b/TestON/tests/SCPF/SCPFportLat/dependencies/portFunc.py
@@ -1,5 +1,5 @@
"""
-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>,
@@ -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,15 +18,13 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
import time
import json
-'''
+"""
Warp function for SCPFportLat test
-'''
-
+"""
def capturePortStatusPack( main, deviceName, interface, portStatus, resultDict, warmup ):
- '''
+ """
Change device port status and use tshark to capture openflow port package
Args:
main: TestON class
@@ -36,10 +34,10 @@
resultDict: put result to dictionary
warmup: if warmup, ignore results
- '''
+ """
main.log.info( "Clean up tshark" )
with open( main.tsharkResultPath, "w" ) as tshark:
- tshark.write("")
+ tshark.write( "" )
main.log.info( "Starting tshark capture" )
main.ONOSbench.tsharkGrep( main.ofportStatus, main.tsharkResultPath )
time.sleep( main.measurementSleep )
@@ -55,7 +53,7 @@
main.log.info( "Capture result:" + resultText )
resultText = resultText.split( " " )
if len( resultText ) > 1:
- tsharkResultTime = int( float( resultText[1] ) * 1000.0 )
+ tsharkResultTime = int( float( resultText[ 1 ] ) * 1000.0 )
resultFile.close()
for i in range( 1, main.Cluster.numCtrls + 1 ):
main.log.info( "================================================" )
@@ -92,9 +90,9 @@
else:
# put result to dictionary
if not warmup:
- resultDict[ portStatus ][ 'node' + str(i) ]['EtoE'].append( EtoE )
- resultDict[ portStatus ][ 'node' + str(i) ]['PtoD'].append( PtoD )
- resultDict[ portStatus ][ 'node' + str(i) ]['DtoL'].append( DtoL )
- resultDict[ portStatus ][ 'node' + str(i) ]['LtoG'].append( LtoG )
+ resultDict[ portStatus ][ 'node' + str( i ) ][ 'EtoE' ].append( EtoE )
+ resultDict[ portStatus ][ 'node' + str( i ) ][ 'PtoD' ].append( PtoD )
+ resultDict[ portStatus ][ 'node' + str( i ) ][ 'DtoL' ].append( DtoL )
+ resultDict[ portStatus ][ 'node' + str( i ) ][ 'LtoG' ].append( LtoG )
else:
main.log.error( "Unexpected tshark output file" )
diff --git a/TestON/tests/SCPF/SCPFportLat/dependencies/topo-perf-2sw.py b/TestON/tests/SCPF/SCPFportLat/dependencies/topo-perf-2sw.py
index 828e44a..7efed0c 100644
--- a/TestON/tests/SCPF/SCPFportLat/dependencies/topo-perf-2sw.py
+++ b/TestON/tests/SCPF/SCPFportLat/dependencies/topo-perf-2sw.py
@@ -1,5 +1,5 @@
"""
-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>,
@@ -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,18 +18,18 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
-'''
+"""
Simple 2 switch topology for topologoy performance test
-'''
-
+"""
from mininet.topo import Topo
+
class MyTopo( Topo ):
- def __init__(self):
- Topo.__init__(self)
- s1 = self.addSwitch( "s1", dpid="0000000000000001")
- s2 = self.addSwitch( "s2", dpid="0000000000000002")
+
+ def __init__( self ):
+ Topo.__init__( self )
+ s1 = self.addSwitch( "s1", dpid="0000000000000001" )
+ s2 = self.addSwitch( "s2", dpid="0000000000000002" )
h1 = self.addHost( "h1" )
h2 = self.addHost( "h2" )