Merge "[ONOS-7112] investigate SCPFswitchLat failure and fix the issue"
diff --git a/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py b/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
index fa168f6..4e230c0 100644
--- a/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
+++ b/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
@@ -170,13 +170,23 @@
"up", resultDict, True )
main.switchFunc.captureOfPack( main, main.device, main.ofPackage,
"down", resultDict, True )
+ main.log.warn( "Before devices : " + str( main.Cluster.active( 0 ).CLI.devices() ) )
main.Cluster.active( 0 ).CLI.removeDevice( "of:0000000000000001" )
+ main.log.warn( "After devices : " + str( main.Cluster.active( 0 ).CLI.devices() ) )
+ while main.Cluster.active( 0 ).CLI.devices() != "[]":
+ main.log.error( "DEVICE NOT REMOVED !!!!!")
+ main.Cluster.active( 0 ).CLI.removeDevice( "of:0000000000000001" )
else:
main.switchFunc.captureOfPack( main, main.device, main.ofPackage,
"up", resultDict, False )
main.switchFunc.captureOfPack( main, main.device, main.ofPackage,
"down", resultDict, False )
+ main.log.warn( "Before devices : " + str( main.Cluster.active( 0 ).CLI.devices() ) )
main.Cluster.active( 0 ).CLI.removeDevice( "of:0000000000000001" )
+ main.log.warn("After devices : " + str(main.Cluster.active(0).CLI.devices()))
+ while main.Cluster.active( 0 ).CLI.devices() != "[]":
+ main.log.error( "DEVICE NOT REMOVED !!!!!")
+ main.Cluster.active( 0 ).CLI.removeDevice( "of:0000000000000001" )
# Dictionary for result
maxDict = {}
diff --git a/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py b/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
index 7a159ba..a96fc20 100644
--- a/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
+++ b/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
@@ -131,7 +131,7 @@
"""
if result < int( main.resultRange[ 'Min' ] ) or result > int( main.resultRange[ 'Max' ] ):
- main.log.debug( str( result ) + " is not meet the requirement" )
+ main.log.warn( str( result ) + " is not meet the requirement" )
return 0
return 1
@@ -290,8 +290,15 @@
# get onos metrics timestamps
try:
response = json.loads( main.Cluster.active( i - 1 ).CLI.topologyEventsMetrics() )
+
+ # Just to show the other event times.
+ main.log.info( "ONOS{} device Event timestamp: {}".format(
+ i, int( response.get( "topologyDeviceEventTimestamp" ).get( "value" ) ) ) )
+ main.log.info( "ONOS{} graph reason Event timestamp: {}".format(
+ i, int( response.get( "topologyGraphReasonsEventTimestamp" ).get( "value" ) ) ) )
+
DeviceTime = getTimestampFromLog( i - 1, searchTerm=main.searchTerm[ switchStatus ] )
- main.log.info( "ONOS{} device Event timestamp: {}".format( i, "%.2f" % DeviceTime ) )
+ main.log.info( "ONOS{} device from karaf log: {}".format( i, DeviceTime ) )
GraphTime = int( response.get( "topologyGraphEventTimestamp" ).get( "value" ) )
main.log.info( "ONOS{} Graph Event timestamp: {}".format( i, GraphTime ) )
except TypeError:
@@ -370,8 +377,14 @@
# get onos metrics timestamps
try:
response = json.loads( main.Cluster.active( i - 1 ).CLI.topologyEventsMetrics() )
+ # Just to show the other event times.
+ main.log.info( "ONOS{} device Event timestamp: {}".format(
+ i, int( response.get( "topologyDeviceEventTimestamp" ).get( "value" ) ) ) )
+ main.log.info( "ONOS{} graph reason Event timestamp: {}".format(
+ i, int( response.get( "topologyGraphReasonsEventTimestamp" ).get( "value" ) ) ) )
+
DeviceTime = getTimestampFromLog( i - 1, searchTerm=main.searchTerm[ switchStatus ] )
- main.log.info( "ONOS{} device Event timestamp: {}".format( i, DeviceTime ) )
+ main.log.info( "ONOS{} device from karaf log: {}".format( i, DeviceTime ) )
GraphTime = int( response.get( "topologyGraphEventTimestamp" ).get( "value" ) )
main.log.info( "ONOS{} Graph Event timestamp: {}".format( i, GraphTime ) )
except TypeError: