diff options
author | Tibor Frank <tifrank@cisco.com> | 2018-06-05 12:25:32 +0200 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2018-06-08 11:31:48 +0000 |
commit | 8b7416d72f67a8ccd408d81a56d8ae1094305d18 (patch) | |
tree | bd3aa9c69e3e360fd01cdefefa81b5e76469c9ee /resources/tools/presentation/input_data_parser.py | |
parent | d947e9de7ba6641145f00bece0ff61a4ef48d804 (diff) |
CSIT-1116: Add dpdk mrr tests to trending
- Add static content
- Add models to specification
- Add plots
- Add dpdk tests to dashboard
- Add dpdk to csv and pretty ASCII tables
- Get DPDK version from output.xml
Change-Id: I2d9a911d882c205f82432125b601b125807f0ca0
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/input_data_parser.py')
-rw-r--r-- | resources/tools/presentation/input_data_parser.py | 63 |
1 files changed, 55 insertions, 8 deletions
diff --git a/resources/tools/presentation/input_data_parser.py b/resources/tools/presentation/input_data_parser.py index beec34c106..0bb2b6ce71 100644 --- a/resources/tools/presentation/input_data_parser.py +++ b/resources/tools/presentation/input_data_parser.py @@ -176,7 +176,10 @@ class ExecutionChecker(ResultVisitor): REGEX_TOLERANCE = re.compile(r'^[\D\d]*LOSS_ACCEPTANCE:\s(\d*\.\d*)\s' r'[\D\d]*') - REGEX_VERSION = re.compile(r"(return STDOUT Version:\s*)(.*)") + REGEX_VERSION_VPP = re.compile(r"(return STDOUT Version:\s*)(.*)") + + REGEX_VERSION_DPDK = re.compile(r"(return STDOUT testpmd)([\d\D\n]*)" + r"(RTE Version: 'DPDK )(.*)(')") REGEX_TCP = re.compile(r'Total\s(rps|cps|throughput):\s([0-9]*).*$') @@ -197,6 +200,9 @@ class ExecutionChecker(ResultVisitor): # VPP version self._version = None + # Timestamp + self._timestamp = None + # Number of VAT History messages found: # 0 - no message # 1 - VAT History of DUT1 @@ -227,7 +233,9 @@ class ExecutionChecker(ResultVisitor): # Dictionary defining the methods used to parse different types of # messages self.parse_msg = { - "setup-version": self._get_version, + "timestamp": self._get_timestamp, + "vpp-version": self._get_vpp_version, + "dpdk-version": self._get_dpdk_version, "teardown-vat-history": self._get_vat_history, "test-show-runtime": self._get_show_run } @@ -241,7 +249,7 @@ class ExecutionChecker(ResultVisitor): """ return self._data - def _get_version(self, msg): + def _get_vpp_version(self, msg): """Called when extraction of VPP version is required. :param msg: Message to process. @@ -250,12 +258,41 @@ class ExecutionChecker(ResultVisitor): """ if msg.message.count("return STDOUT Version:"): - self._version = str(re.search(self.REGEX_VERSION, msg.message). + self._version = str(re.search(self.REGEX_VERSION_VPP, msg.message). group(2)) self._data["metadata"]["version"] = self._version - self._data["metadata"]["generated"] = msg.timestamp self._msg_type = None + def _get_dpdk_version(self, msg): + """Called when extraction of DPDK version is required. + + :param msg: Message to process. + :type msg: Message + :returns: Nothing. + """ + + if msg.message.count("return STDOUT testpmd"): + try: + self._version = str(re.search( + self.REGEX_VERSION_DPDK, msg.message). group(4)) + self._data["metadata"]["version"] = self._version + except IndexError: + pass + finally: + self._msg_type = None + + def _get_timestamp(self, msg): + """Called when extraction of timestamp is required. + + :param msg: Message to process. + :type msg: Message + :returns: Nothing. + """ + + self._timestamp = msg.timestamp[:14] + self._data["metadata"]["generated"] = self._timestamp + self._msg_type = None + def _get_vat_history(self, msg): """Called when extraction of VAT command history is required. @@ -557,7 +594,11 @@ class ExecutionChecker(ResultVisitor): self._lookup_kw_nr += 1 self._show_run_lookup_nr = 0 self._msg_type = "test-show-runtime" - test_kw.messages.visit(self) + elif test_kw.name.count("Start The L2fwd Test") and not self._version: + self._msg_type = "dpdk-version" + else: + return + test_kw.messages.visit(self) def end_test_kw(self, test_kw): """Called when keyword ends. Default implementation does nothing. @@ -591,8 +632,14 @@ class ExecutionChecker(ResultVisitor): """ if setup_kw.name.count("Show Vpp Version On All Duts") \ and not self._version: - self._msg_type = "setup-version" - setup_kw.messages.visit(self) + self._msg_type = "vpp-version" + + elif setup_kw.name.count("Setup performance global Variables") \ + and not self._timestamp: + self._msg_type = "timestamp" + else: + return + setup_kw.messages.visit(self) def end_setup_kw(self, setup_kw): """Called when keyword ends. Default implementation does nothing. |