Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPDK MANA CentOS 7 changes #3373

Open
wants to merge 9 commits into
base: mcgov/dpdk-mana-merge
Choose a base branch
from
Prev Previous commit
Next Next commit
dpdk: build via devtools on RHEL<8.0.0
Signed-off-by: Pavel Boldin <pboldin@cloudlinux.com>
  • Loading branch information
paboldin committed Aug 10, 2024
commit 638a2828501f88312d21d61692f714da73ece872
7 changes: 5 additions & 2 deletions lisa/base_tools/mv.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
# Licensed under the MIT license.

from lisa.executable import Tool
from typing import Union


class Mv(Tool):
@@ -14,13 +15,15 @@ def can_install(self) -> bool:
return False

def move(
self, src_path: str, dest_path: str, overwrite: bool = False, sudo: bool = False
self, src_path: str, dest_path: str, overwrite: bool = False,
sudo: bool = False, ignore_error: bool = False
) -> None:
args = "-f" if overwrite else ""
expected_exit_code = None if ignore_error else 0
self.run(
f"{args} {src_path} {dest_path}",
sudo=sudo,
shell=True,
force_run=True,
expected_exit_code=0,
expected_exit_code=expected_exit_code,
)
28 changes: 26 additions & 2 deletions microsoft/testsuites/dpdk/dpdktestpmd.py
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
from lisa.executable import ExecutableResult, Tool
from lisa.features import Disk
from lisa.nic import NicInfo
from lisa.operating_system import Debian, Fedora, Suse, Ubuntu
from lisa.operating_system import Debian, Fedora, Suse, Ubuntu, Redhat
from lisa.tools import (
Chmod,
Dmesg,
@@ -531,7 +531,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
)

# if dpdk is already installed, find the binary and check the version
if self.find_testpmd_binary(assert_on_fail=False):
if self.find_testpmd_binary(assert_on_fail=False) or \
self.find_testpmd_binary(check_path='/usr/local/bin', assert_on_fail=False):
pkgconfig = self.node.tools[Pkgconfig]
if pkgconfig.package_info_exists(
self._dpdk_lib_name,
@@ -610,6 +611,29 @@ def _install(self) -> bool:
)
)

if isinstance(node.os, Redhat) and node.os.information.version < "8.0.0":
node.os.install_packages(["centos-release-scl"])
devtoolset_version = 8
devtoolset_pkg = f"devtoolset-{devtoolset_version}"
node.os.install_packages([devtoolset_pkg])
links = {
"gcc": ("gcc", "cc"),
"g++": ("g++", "c++"),
}
for binary in [alias
for aliases in links.values()
for alias in aliases
]:
node.tools[Mv].move(f"/bin/{binary}", f"/bin/{binary}_back",
overwrite=True, sudo=True, ignore_error=None)
devtoolset_binpath = f"/opt/rh/{devtoolset_pkg}/root/bin"
for binary, aliases in links.items():
for alias in aliases:
result = node.execute(
f"ln -s {devtoolset_binpath}/{binary} /bin/{alias}", sudo=True
)
result.assert_exit_code()

# before doing anything: determine if backport repo needs to be enabled
self._set_backport_repo_args()