Fix switchLat test
- TCP package now using openflow SYN package
- If we greped more than one TCP packages, we use the latest one
Change-Id: I3dcfd442bcf796e6b963e523748e553ff9a1c44f
diff --git a/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.params b/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.params
index 519debc..fe3896e 100644
--- a/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.params
+++ b/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.params
@@ -45,7 +45,7 @@
<TSHARK>
<up>
- <TCP>TCP 74 openflow</TCP> #1
+ <TCP>openflow\ \[SYN\]</TCP> #1
<RQ>OF 1.3 90 of_role_request</RQ> #2
<RR>OF 1.3 90 of_role_reply</RR> #3
<Feature>OF 1.3 98 of_features_reply</Feature>#4
diff --git a/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py b/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
index 853668d..d174cdd 100644
--- a/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
+++ b/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
@@ -83,7 +83,11 @@
with open(main.tsharkResultPath[switchStatus][d], "r") as resultFile:
# grep tshark result timestamp
resultText = resultFile.readlines()
- resultText = resultText[0]
+ if d == "TCP":
+ # if TCP package, we should use the latest one package
+ resultText = resultText[len(resultText) - 1:]
+ else:
+ resultText = resultText[0]
main.log.info("Capture result:" + resultText)
resultText = resultText.strip()
resultText = resultText.split( " " )
@@ -242,5 +246,5 @@
resultDict[switchStatus]['node' + str(i)][ 'A_D' ].append( A_Dtemp )
resultDict[switchStatus]['node' + str(i)][ 'D_G' ].append( D_Gtemp )
resultDict[switchStatus]['node' + str(i)][ 'E_E' ].append( E_Etemp )
-
+ main.CLIs[0].removeDevice(["of:0000000000000001"])