diff options
author | Peter Mikus <pmikus@cisco.com> | 2018-05-10 08:38:06 +0200 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2018-05-10 16:51:51 +0000 |
commit | f1bb434e0392882a49f90ed1847f839e8bf46135 (patch) | |
tree | eccfe0d765e58f95e11676fc960e8d8d68a62aa1 /resources/libraries/python/DPDK/DPDKTools.py | |
parent | abd1c00c657242ac481526d7cccfb53b5a8d86bd (diff) |
Cleanup DPDK framework setup
Moving installation of DPDK into KW instead of framework setup. This will
unify the framework setup and allow future optimizations.
Change-Id: I360ba95a2858e73e4bbb12020567d5d174ab69ca
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources/libraries/python/DPDK/DPDKTools.py')
-rw-r--r-- | resources/libraries/python/DPDK/DPDKTools.py | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/resources/libraries/python/DPDK/DPDKTools.py b/resources/libraries/python/DPDK/DPDKTools.py index b0e67b7ab8..4bdc68ceee 100644 --- a/resources/libraries/python/DPDK/DPDKTools.py +++ b/resources/libraries/python/DPDK/DPDKTools.py @@ -89,5 +89,41 @@ class DPDKTools(object): ret_code, _, _ = ssh.exec_command_sudo(cmd, timeout=600) if ret_code != 0: - raise RuntimeError('Failed to cleanup the dpdk at node {name}' - .format(name=dut_node['host'])) + raise RuntimeError('Failed to cleanup the dpdk at node {name}'. + format(name=dut_node['host'])) + + @staticmethod + def install_dpdk_test(node): + """ + Prepare the DPDK test environment + + :param node: Dictionary created from topology + :type node: dict + :returns: nothing + :raise RuntimeError: If command returns nonzero return code. + """ + arch = Topology.get_node_arch(node) + + ssh = SSH() + ssh.connect(node) + + ret_code, _, _ = ssh.exec_command( + '{fwdir}/tests/dpdk/dpdk_scripts/install_dpdk.sh {arch}'. + format(fwdir=Constants.REMOTE_FW_DIR, arch=arch), timeout=600) + + if ret_code != 0: + raise RuntimeError('Install the DPDK failed') + + @staticmethod + def install_dpdk_test_on_all_duts(nodes): + """ + Prepare the DPDK test environment on all DUTs. + + :param nodes: Nodes from topology file. + :type nodes: dict + :returns: nothing + """ + for node in nodes.values(): + if node['type'] == NodeType.DUT: + DPDKTools.install_dpdk_test(node) + |