- # workaroud - uninstall existing vpp installation until
- # start-testcase script is updated on all virl servers
- deb_pkgs_remove = "vpp*"
- cmd_u = 'apt-get purge -y "{0}"'.format(deb_pkgs_remove)
- r_rcode, _, r_err = ssh.exec_command_sudo(cmd_u, timeout=90)
- if int(r_rcode):
- raise RuntimeError('Failed to remove previous VPP'
- 'installation on host {0}:\n{1}'
- .format(node['host'], r_err))
- deb_pkgs = "*.deb ".join(str(vpp_pkg_dir + pkg)
- for pkg in vpp_deb_pkgs) + "*.deb"
- cmd_i = "dpkg -i --force-all {0}".format(deb_pkgs)
- ret_code, _, err = ssh.exec_command_sudo(cmd_i, timeout=90)
- if int(ret_code):
- raise RuntimeError('Failed to install VPP on host {0}:'
- '\n{1}'.format(node['host'], err))
- else:
- ssh.exec_command_sudo("dpkg -l | grep vpp")
- logger.info("VPP installed on node {0}".
- format(node['host']))
-
- ssh.disconnect(node)
-
- @staticmethod
- def verify_vpp_on_dut(node):
- """Verify that VPP is installed on DUT node.
-
- :param node: DUT node.
- :type node: dict
- :raises RuntimeError: If failed to restart VPP, get VPP version
- or get VPP interfaces.
- """
-
- logger.debug("Verify VPP on node {0}".format(node['host']))
-
- DUTSetup.vpp_show_version_verbose(node)
- DUTSetup.vpp_show_interfaces(node)
-
- @staticmethod
- def verify_vpp_on_all_duts(nodes):
- """Verify that VPP is installed on all DUT nodes.
-
- :param nodes: Nodes in the topology.
- :type nodes: dict
- """
-
- logger.debug("Verify VPP on all DUTs")
-
- DUTSetup.start_vpp_service_on_all_duts(nodes)
-
- for node in nodes.values():
- if node['type'] == NodeType.DUT:
- DUTSetup.verify_vpp_on_dut(node)
-
-
- @staticmethod
- def get_huge_page_size(node):
- """Get default size of huge pages in system.
-
- :param node: Node in the topology.
+ exec_cmd_no_error(
+ node, u"yum -y remove '*vpp*' || true",
+ timeout=120, sudo=True
+ )
+ # workaround to avoid installation of vpp-api-python
+ exec_cmd_no_error(
+ node, u"rm -f {vpp_pkg_dir}vpp-api-python.rpm",
+ timeout=120, sudo=True
+ )
+ exec_cmd_no_error(
+ node, f"rpm -ivh {vpp_pkg_dir}*.rpm",
+ timeout=120, sudo=True, message=message
+ )
+ exec_cmd_no_error(node, u"rpm -qai '*vpp*'", sudo=True)
+ DUTSetup.restart_service(node, Constants.VPP_UNIT)
+
+ @staticmethod
+ def running_in_container(node):
+ """This method tests if topology node is running inside container.
+
+ :param node: Topology node.