summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
d7c2974)
- Needed for trending
Change-Id: I3d576e39d6e3b91821050fbd4a8a95380275797b
Signed-off-by: Tibor Frank <tifrank@cisco.com>
"""This module implements initialization and cleanup of DPDK environment."""
"""This module implements initialization and cleanup of DPDK environment."""
-from resources.libraries.python.ssh import SSH
+from robot.api import logger
+
+from resources.libraries.python.ssh import SSH, exec_cmd_no_error
from resources.libraries.python.Constants import Constants
from resources.libraries.python.topology import NodeType, Topology
from resources.libraries.python.Constants import Constants
from resources.libraries.python.topology import NodeType, Topology
"""
arch = Topology.get_node_arch(node)
"""
arch = Topology.get_node_arch(node)
- ssh = SSH()
- ssh.connect(node)
+ command = ('{fwdir}/tests/dpdk/dpdk_scripts/install_dpdk.sh {arch}'.
+ format(fwdir=Constants.REMOTE_FW_DIR, arch=arch))
+ message = 'Install the DPDK failed!'
+ exec_cmd_no_error(node, command, timeout=600, message=message)
- ret_code, _, _ = ssh.exec_command(
- '{fwdir}/tests/dpdk/dpdk_scripts/install_dpdk.sh {arch}'.
- format(fwdir=Constants.REMOTE_FW_DIR, arch=arch), timeout=600)
+ command = ('cat {fwdir}/download_dir/dpdk*/VERSION'.
+ format(fwdir=Constants.REMOTE_FW_DIR))
+ message = 'Get DPDK version failed!'
+ stdout, _ = exec_cmd_no_error(node, command, message=message)
- if ret_code != 0:
- raise RuntimeError('Install the DPDK failed')
+ logger.info('DPDK Version: {version}'.format(version=stdout))
@staticmethod
def install_dpdk_test_on_all_duts(nodes):
@staticmethod
def install_dpdk_test_on_all_duts(nodes):
REGEX_VERSION_VPP = re.compile(r"(return STDOUT Version:\s*|"
r"VPP Version:\s*|VPP version:\s*)(.*)")
REGEX_VERSION_VPP = re.compile(r"(return STDOUT Version:\s*|"
r"VPP Version:\s*|VPP version:\s*)(.*)")
- REGEX_VERSION_DPDK = re.compile(r"(return STDOUT testpmd)([\d\D\n]*)"
- r"(RTE Version: 'DPDK )(.*)(')")
+ REGEX_VERSION_DPDK = re.compile(r"DPDK Version: (\d*.\d*)")
REGEX_TCP = re.compile(r'Total\s(rps|cps|throughput):\s([0-9]*).*$')
REGEX_TCP = re.compile(r'Total\s(rps|cps|throughput):\s([0-9]*).*$')
- if msg.message.count("return STDOUT testpmd"):
+ if msg.message.count("DPDK Version:"):
try:
self._version = str(re.search(
try:
self._version = str(re.search(
- self.REGEX_VERSION_DPDK, msg.message). group(4))
+ self.REGEX_VERSION_DPDK, msg.message). group(1))
self._data["metadata"]["version"] = self._version
except IndexError:
pass
self._data["metadata"]["version"] = self._version
except IndexError:
pass
self._lookup_kw_nr += 1
self._show_run_lookup_nr = 0
self._msg_type = "test-show-runtime"
self._lookup_kw_nr += 1
self._show_run_lookup_nr = 0
self._msg_type = "test-show-runtime"
- elif test_kw.name.count("Start The L2fwd Test") and not self._version:
+ elif test_kw.name.count("Install Dpdk Test") and not self._version:
self._msg_type = "dpdk-version"
else:
return
self._msg_type = "dpdk-version"
else:
return