aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/presentation
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2020-01-29 16:30:05 +0100
committerTibor Frank <tifrank@cisco.com>2020-01-30 06:31:45 +0000
commit07f414a2ec7be30b457b0b1aea26ee89e17125c8 (patch)
treec5b2e446c7c32d0422878a1296024c1f09e60795 /resources/tools/presentation
parentdeae6f05b363d39bf7f354bb6b0b02489ad5859d (diff)
PAL: Latency processing
Very ugly solution for now. It will be replaced by using JSON structure for test results soon. Change-Id: If5b63de94bf02e7fc2a518c1f6a94f42dcec9e07 Signed-off-by: Tibor Frank <tifrank@cisco.com> (cherry picked from commit 20e972ce413e727b0a3d89d04460534cb454f107)
Diffstat (limited to 'resources/tools/presentation')
-rw-r--r--resources/tools/presentation/input_data_parser.py60
1 files changed, 44 insertions, 16 deletions
diff --git a/resources/tools/presentation/input_data_parser.py b/resources/tools/presentation/input_data_parser.py
index 574f4950de..268224f0c6 100644
--- a/resources/tools/presentation/input_data_parser.py
+++ b/resources/tools/presentation/input_data_parser.py
@@ -209,9 +209,20 @@ class ExecutionChecker(ResultVisitor):
r'PDR_LOWER:\s(\d+.\d+).*\n.*\n'
r'PDR_UPPER:\s(\d+.\d+)')
- REGEX_NDRPDR_LAT = re.compile(r'LATENCY.*\[\'(.*)\', \'(.*)\'\]\s\n.*\n.*\n'
- r'LATENCY.*\[\'(.*)\', \'(.*)\'\]')
-
+ # TODO: Remove when not needed
+ REGEX_NDRPDR_LAT_BASE = re.compile(
+ r'LATENCY.*\[\'(.*)\', \'(.*)\'\]\s\n.*\n.*\n'
+ r'LATENCY.*\[\'(.*)\', \'(.*)\'\]'
+ )
+ REGEX_NDRPDR_LAT = re.compile(
+ r'LATENCY.*\[\'(.*)\', \'(.*)\'\]\s\n.*\n.*\n'
+ r'LATENCY.*\[\'(.*)\', \'(.*)\'\]\s\n.*\n'
+ r'Latency.*\[\'(.*)\', \'(.*)\'\]\s\n'
+ r'Latency.*\[\'(.*)\', \'(.*)\'\]\s\n'
+ r'Latency.*\[\'(.*)\', \'(.*)\'\]\s\n'
+ r'Latency.*\[\'(.*)\', \'(.*)\'\]'
+ )
+ # TODO: Remove when not needed
REGEX_NDRPDR_LAT_LONG = re.compile(
r'LATENCY.*\[\'(.*)\', \'(.*)\'\]\s\n.*\n.*\n'
r'LATENCY.*\[\'(.*)\', \'(.*)\'\]\s\n.*\n'
@@ -628,18 +639,6 @@ class ExecutionChecker(ResultVisitor):
u"direction1": copy.copy(latency_default),
u"direction2": copy.copy(latency_default)
},
- u"NDR10": {
- u"direction1": copy.copy(latency_default),
- u"direction2": copy.copy(latency_default)
- },
- u"NDR50": {
- u"direction1": copy.copy(latency_default),
- u"direction2": copy.copy(latency_default)
- },
- u"NDR90": {
- u"direction1": copy.copy(latency_default),
- u"direction2": copy.copy(latency_default)
- },
u"PDR10": {
u"direction1": copy.copy(latency_default),
u"direction2": copy.copy(latency_default)
@@ -654,10 +653,12 @@ class ExecutionChecker(ResultVisitor):
},
}
+ # TODO: Rewrite when long and base are not needed
groups = re.search(self.REGEX_NDRPDR_LAT_LONG, msg)
if groups is None:
groups = re.search(self.REGEX_NDRPDR_LAT, msg)
-
+ if groups is None:
+ groups = re.search(self.REGEX_NDRPDR_LAT_BASE, msg)
if groups is None:
return latency, u"FAIL"
@@ -698,6 +699,33 @@ class ExecutionChecker(ResultVisitor):
pass
try:
+ latency[u"PDR90"][u"direction1"] = process_latency(groups.group(5))
+ latency[u"PDR90"][u"direction2"] = process_latency(groups.group(6))
+ latency[u"PDR50"][u"direction1"] = process_latency(groups.group(7))
+ latency[u"PDR50"][u"direction2"] = process_latency(groups.group(8))
+ latency[u"PDR10"][u"direction1"] = process_latency(groups.group(9))
+ latency[u"PDR10"][u"direction2"] = process_latency(groups.group(10))
+ latency[u"LAT0"][u"direction1"] = process_latency(groups.group(11))
+ latency[u"LAT0"][u"direction2"] = process_latency(groups.group(12))
+ if groups.lastindex == 12:
+ return latency, u"PASS"
+ except (IndexError, ValueError):
+ pass
+
+ # TODO: Remove when not needed
+ latency[u"NDR10"] = {
+ u"direction1": copy.copy(latency_default),
+ u"direction2": copy.copy(latency_default)
+ }
+ latency[u"NDR50"] = {
+ u"direction1": copy.copy(latency_default),
+ u"direction2": copy.copy(latency_default)
+ }
+ latency[u"NDR90"] = {
+ u"direction1": copy.copy(latency_default),
+ u"direction2": copy.copy(latency_default)
+ }
+ try:
latency[u"LAT0"][u"direction1"] = process_latency(groups.group(5))
latency[u"LAT0"][u"direction2"] = process_latency(groups.group(6))
latency[u"NDR10"][u"direction1"] = process_latency(groups.group(7))