Handle empty tshark file in switch latency test
Change-Id: I65bc47ca3eedc3fff7e07d3cf6e26b63bdf1cfb4
diff --git a/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py b/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
index 829c846..11fbc31 100644
--- a/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
+++ b/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
@@ -196,6 +196,12 @@
with open( main.tsharkResultPath[ switchStatus ][ d ], "r" ) as resultFile:
# grep tshark result timestamp
resultText = resultFile.readlines()
+ if not resultText:
+ main.log.warn( "Empty tshark result!" )
+ main.wrong[ 'TsharkValueIncorrect' ] += 1
+ main.wrong[ 'totalWrong' ] += 1
+ checkTotalWrongNum()
+ return
if d == "TCP":
# if TCP package, we should use the latest one package
resultText = resultText[ len( resultText ) - 1 ]