diff options
author | Tibor Frank <tifrank@cisco.com> | 2020-01-29 16:30:05 +0100 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2020-01-30 06:28:18 +0000 |
commit | 20e972ce413e727b0a3d89d04460534cb454f107 (patch) | |
tree | fcb697a9d3edda4080f9fcdf16ca4de839eb8430 /resources | |
parent | 401c24914d84058d06ef9b7a4f893662dfeb0dcb (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>
Diffstat (limited to 'resources')
-rw-r--r-- | resources/tools/presentation/input_data_parser.py | 60 |
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)) |