Add tshark interface name to params
Change-Id: I03c87873abfc0da6b04be96cd1502e94a6110c8e
diff --git a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.params b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.params
index 6d7de4f..473e6c2 100644
--- a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.params
+++ b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.params
@@ -32,6 +32,7 @@
<defaultTopo>org.onosproject.net.topology.impl.DefaultTopologyProvider</defaultTopo>
</CFG>
<TSHARK>
+ <tsharkInterface>lo</tsharkInterface>
<tsharkReusltPath>/tmp/tshark_portStatus</tsharkReusltPath>
<ofpPortStatus>OpenFlow 146 Type: OFPT_PORT_STATUS</ofpPortStatus>
</TSHARK>
diff --git a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
index 2e972e8..33840f6 100644
--- a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
+++ b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
@@ -62,6 +62,7 @@
main.scale = ( main.params[ 'SCALE' ] ).split( "," )
main.ofportStatus = main.params[ 'TSHARK' ][ 'ofpPortStatus' ]
main.tsharkResultPath = main.params[ 'TSHARK' ][ 'tsharkReusltPath' ]
+ main.tsharkInterface = main.params[ 'TSHARK' ][ 'tsharkInterface' ]
main.sampleSize = int( main.params[ 'TEST' ][ 'sampleSize' ] )
main.warmUp = int( main.params[ 'TEST' ][ 'warmUp' ] )
main.maxProcessTime = int( main.params[ 'TEST' ][ 'maxProcessTime' ] )
@@ -160,7 +161,8 @@
main.interface,
"down",
resultDict,
- False )
+ False,
+ main.tsharkInterface )
time.sleep( 2 )
# PortUp iteration
main.portFunc.capturePortStatusPack( main,
@@ -168,7 +170,8 @@
main.interface,
"up",
resultDict,
- False )
+ False,
+ main.tsharkInterface )
else:
# if warm up, keep old result dictionary
main.portFunc.capturePortStatusPack( main,
@@ -176,13 +179,15 @@
main.interface,
"down",
resultDict,
- True )
+ True,
+ main.tsharkInterface )
main.portFunc.capturePortStatusPack( main,
main.device,
main.interface,
"up",
resultDict,
- True )
+ True,
+ main.tsharkInterface )
# Dictionary for result
maxDict = {}
diff --git a/TestON/tests/SCPF/SCPFportLat/dependencies/portFunc.py b/TestON/tests/SCPF/SCPFportLat/dependencies/portFunc.py
index 10dc7ce..2e5eb76 100644
--- a/TestON/tests/SCPF/SCPFportLat/dependencies/portFunc.py
+++ b/TestON/tests/SCPF/SCPFportLat/dependencies/portFunc.py
@@ -23,7 +23,7 @@
"""
Warp function for SCPFportLat test
"""
-def capturePortStatusPack( main, deviceName, interface, portStatus, resultDict, warmup ):
+def capturePortStatusPack( main, deviceName, interface, portStatus, resultDict, warmup, tsharkInterface ):
"""
Change device port status and use tshark to capture openflow port package
Args:
@@ -33,13 +33,14 @@
portStatus: up or down
resultDict: put result to dictionary
warmup: if warmup, ignore results
+ tsharkInterface: name of interface which tshark listens to
"""
main.log.info( "Clean up tshark" )
with open( main.tsharkResultPath, "w" ) as tshark:
tshark.write( "" )
main.log.info( "Starting tshark capture" )
- main.ONOSbench.tsharkGrep( main.ofportStatus, main.tsharkResultPath )
+ main.ONOSbench.tsharkGrep( main.ofportStatus, main.tsharkResultPath, interface=tsharkInterface )
time.sleep( main.measurementSleep )
main.log.info( "{} port {} {}".format( deviceName, interface, portStatus ) )
main.Mininet1.changeInterfaceStatus( deviceName, interface, portStatus )