diff --git a/lisa/features/infiniband.py b/lisa/features/infiniband.py index bda8da21f0..54f673c289 100644 --- a/lisa/features/infiniband.py +++ b/lisa/features/infiniband.py @@ -288,7 +288,6 @@ def _install_dependencies(self) -> None: "rdma-core-devel", "libibverbs", "libibverbs-utils", - "build-essential", "ucx", "ucx-ib", "ucx-rdmacm", @@ -341,6 +340,13 @@ def _install_dependencies(self) -> None: ubuntu_required_packages.append(package) node.os.install_packages(ubuntu_required_packages) elif isinstance(node.os, CBLMariner): + if node.os.information.version >= "4.0.0": + # build-essential not available on Azure Linux 4.0 + cblmariner_required_packages.extend( + ["kernel-headers", "binutils", "glibc-devel", "gcc", "make"] + ) + else: + cblmariner_required_packages.append("build-essential") node.os.install_packages(cblmariner_required_packages) else: raise UnsupportedDistroException( diff --git a/lisa/microsoft/testsuites/core/azure_image_standard.py b/lisa/microsoft/testsuites/core/azure_image_standard.py index 3eb60b4384..e0f053bd34 100644 --- a/lisa/microsoft/testsuites/core/azure_image_standard.py +++ b/lisa/microsoft/testsuites/core/azure_image_standard.py @@ -520,7 +520,10 @@ def verify_network_file_configuration(self, node: Node) -> None: f"networking=yes should be present in {network_file_path}", ).contains("networking=yes".upper()) elif isinstance(node.os, CBLMariner): - network_file_path = "/etc/systemd/networkd.conf" + if node.os.information.version >= "4.0.0": + network_file_path = "/usr/lib/systemd/networkd.conf" + else: + network_file_path = "/etc/systemd/networkd.conf" file_exists = node.shell.exists(PurePosixPath(network_file_path)) assert_that( file_exists, diff --git a/lisa/microsoft/testsuites/kselftest/kselftest.py b/lisa/microsoft/testsuites/kselftest/kselftest.py index 9c87572471..a547f0e301 100644 --- a/lisa/microsoft/testsuites/kselftest/kselftest.py +++ b/lisa/microsoft/testsuites/kselftest/kselftest.py @@ -34,7 +34,6 @@ _MARINER_OS_PACKAGES = [ "bison", "flex", - "build-essential", "openssl-devel", "bc", "dwarves", @@ -162,7 +161,13 @@ def _install(self) -> bool: self.node.os.install_packages(_UBUNTU_OS_PACKAGES) elif isinstance(self.node.os, CBLMariner): # clone kernel, build kernel, then build kselftests - self.node.os.install_packages(_MARINER_OS_PACKAGES) + packages = list(_MARINER_OS_PACKAGES) + if self.node.os.information.version >= "4.0.0": + # build-essential not available on Azure Linux 4.0 + packages.extend(["gcc", "make"]) + else: + packages.append("build-essential") + self.node.os.install_packages(packages) uname = self.node.tools[Uname] uname_result = uname.get_linux_information(force_run=False) diff --git a/lisa/microsoft/testsuites/ltp/ltp.py b/lisa/microsoft/testsuites/ltp/ltp.py index 8f973ef370..b6722730c1 100644 --- a/lisa/microsoft/testsuites/ltp/ltp.py +++ b/lisa/microsoft/testsuites/ltp/ltp.py @@ -385,15 +385,23 @@ def _install_dependencies(self) -> None: ] ) elif isinstance(self.node.os, CBLMariner): - self.node.os.install_packages( - [ - "kernel-headers", - "binutils", - "diffutils", - "glibc-devel", - "zlib-devel", - ] - ) + packages = [ + "kernel-headers", + "binutils", + "diffutils", + "glibc-devel", + ] + if self.node.os.information.version >= "4.0.0": + packages.extend([ + "libaio-devel", + "libattr", + "libcap-devel", + "pkgconf", + "zlib-ng-compat-devel", + ]) + else: + packages.append("zlib-devel") + self.node.os.install_packages(packages) else: raise LisaException(f"{self.node.os} is not supported") diff --git a/lisa/microsoft/testsuites/xfstests/xfstests.py b/lisa/microsoft/testsuites/xfstests/xfstests.py index d421bfa2c7..4a09e99477 100644 --- a/lisa/microsoft/testsuites/xfstests/xfstests.py +++ b/lisa/microsoft/testsuites/xfstests/xfstests.py @@ -699,6 +699,18 @@ class Xfstests(Tool): "psmisc", "perl-CPAN", ] + # CBL Mariner 4.0 Dependencies + mariner_4_dep = [ + "libattr-devel", + "binutils", + "kernel-headers", + "perl-CPAN", + "diffutils", + "btrfs-progs-devel", + "zlib-ng-compat-devel", + "libblkid-devel", + "libmount-devel", + ] # Regular expression for parsing xfstests output # Example: # Passed all 35 tests @@ -941,7 +953,11 @@ def _install_dep(self) -> None: elif isinstance(self.node.os, Suse): package_list.extend(self.suse_dep) elif isinstance(self.node.os, CBLMariner): - package_list.extend(self.mariner_dep) + if self.node.os.information.version >= "4.0.0": + package_list.extend(self.fedora_dep) + package_list.extend(self.mariner_4_dep) + else: + package_list.extend(self.mariner_dep) else: raise LisaException( f"Current distro {self.node.os.name} doesn't support xfstests." @@ -1067,6 +1083,21 @@ def _install( file=str(code_path / "src" / "Makefile"), ) + # Temporary Workaround to test xfs in Azurelinux 4.0 + # DO NOT MERGE + if ( + isinstance(self.node.os, CBLMariner) + and self.node.os.information.version >= "4.0.0" + ): + self.node.execute( + "ln -sf /usr/bin/pkgconf" + " /usr/bin/$(rpm --eval" + " '%{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}')" + "-pkg-config", + sudo=True, + shell=True, + ) + # Regenerate configure script to fix PKG_CHECK_MODULES macro expansion issue. # The pre-generated configure script in xfstests-dev git repo may have # unexpanded PKG_CHECK_MODULES macros if it was generated without pkg-config. diff --git a/lisa/operating_system.py b/lisa/operating_system.py index 74bd1d5c34..dbab48760f 100644 --- a/lisa/operating_system.py +++ b/lisa/operating_system.py @@ -2068,7 +2068,7 @@ def name_pattern(cls) -> Pattern[str]: def __init__(self, node: Any) -> None: super().__init__(node) - self._dnf_tool_name: str + self._dnf_tool_name: str = "dnf" def _initialize_package_installation(self) -> None: self.set_kill_user_processes() @@ -2136,9 +2136,15 @@ def _create_local_repo(self, source_tarball: Path) -> None: # the SSH session is reset def set_kill_user_processes(self) -> None: sed = self._node.tools[Sed] + # Azure Linux 4.0 moved logind.conf to /usr/lib/systemd/ + logind_conf = "/etc/systemd/logind.conf" + if not self._node.shell.exists( + self._node.get_pure_path(logind_conf) + ): + logind_conf = "/usr/lib/systemd/logind.conf" sed.append( text="KillUserProcesses=no", - file="/etc/systemd/logind.conf", + file=logind_conf, sudo=True, ) self._node.tools[Service].restart_service("systemd-logind") diff --git a/lisa/tools/cargo.py b/lisa/tools/cargo.py index d87f918a94..3cd71600b1 100644 --- a/lisa/tools/cargo.py +++ b/lisa/tools/cargo.py @@ -105,7 +105,13 @@ def __install_dependencies(self) -> None: node_os: Posix = cast(Posix, self.node.os) # install prerequisites - node_os.install_packages(["build-essential", "cmake"]) + if isinstance(node_os, CBLMariner) and node_os.information.version >= "4.0.0": + # build-essential not available on Azure Linux 4.0 + node_os.install_packages( + ["kernel-headers", "binutils", "glibc-devel", "gcc", "make", "cmake"] + ) + else: + node_os.install_packages(["build-essential", "cmake"]) gcc = self.node.tools[Gcc] gcc_version_info = gcc.get_version() diff --git a/lisa/tools/docker.py b/lisa/tools/docker.py index f3311efb86..a8ecadea7f 100644 --- a/lisa/tools/docker.py +++ b/lisa/tools/docker.py @@ -223,7 +223,11 @@ def _install(self) -> bool: ["docker-ce", "docker-ce-cli", "containerd.io"] ) elif isinstance(self.node.os, CBLMariner): - self.node.os.install_packages(["moby-engine", "moby-cli"]) + if self.node.os.information.version >= "4.0.0": + # moby-cli not available on Azure Linux 4.0 + self.node.os.install_packages(["moby-engine"]) + else: + self.node.os.install_packages(["moby-engine", "moby-cli"]) elif isinstance(self.node.os, Suse) or isinstance(self.node.os, Fedora): self.node.os.install_packages(["docker"]) elif isinstance(self.node.os, BSD): diff --git a/lisa/tools/fio.py b/lisa/tools/fio.py index a184e6e918..ef7fbb4962 100644 --- a/lisa/tools/fio.py +++ b/lisa/tools/fio.py @@ -420,19 +420,22 @@ def _install_dep_packages(self) -> None: elif isinstance(self.node.os, CBLMariner): package_list = [ "wget", - "build-essential", - "sysstat", "blktrace", "libaio", "bc", + "sysstat", "libaio-devel", "gcc", "kernel-devel", "kernel-headers", "binutils", "glibc-devel", - "zlib-devel", ] + if self.node.os.information.version >= "4.0.0": + # zlib-devel replaced by zlib-ng-compat-devel on Azure Linux 4.0 + package_list.append("zlib-ng-compat-devel") + else: + package_list.extend(["build-essential", "zlib-devel"]) else: raise LisaException( f"tool {self.command} can't be installed in distro {self.node.os.name}." diff --git a/lisa/tools/fips.py b/lisa/tools/fips.py index a92d689c11..1a9eccf367 100644 --- a/lisa/tools/fips.py +++ b/lisa/tools/fips.py @@ -33,11 +33,11 @@ def create(cls, node: "Node", *args: Any, **kwargs: Any) -> Tool: if isinstance(node.os, CBLMariner): if node.os.information.release == "2.0": return AzlV2Fips(node, args, kwargs) - if node.os.information.release == "3.0": + if node.os.information.release in ("3.0", "4.0"): return AzlV3Fips(node, args, kwargs) raise UnsupportedDistroException( - os=node.os, message="FIPS tool only supported on CBLMariner 2.0 and 3.0." + os=node.os, message="FIPS tool only supported on CBLMariner 2.0, 3.0 and 4.0." ) def __init__(self, node: "Node", *args: Any, **kwargs: Any) -> None: diff --git a/lisa/tools/gpu_drivers.py b/lisa/tools/gpu_drivers.py index 6d8592fa66..ef7d3b5da4 100644 --- a/lisa/tools/gpu_drivers.py +++ b/lisa/tools/gpu_drivers.py @@ -379,7 +379,18 @@ def _install_dependencies(self) -> None: ] # CBL-Mariner dependencies elif isinstance(self.node.os, CBLMariner): - dependencies = ["build-essential", "binutils", "kernel-devel"] + if self.node.os.information.version >= "4.0.0": + # build-essential not available on Azure Linux 4.0 + dependencies = [ + "kernel-headers", + "binutils", + "glibc-devel", + "gcc", + "make", + "kernel-devel", + ] + else: + dependencies = ["build-essential", "binutils", "kernel-devel"] if not dependencies: return diff --git a/lisa/tools/grub_config.py b/lisa/tools/grub_config.py index f7c6c13364..a938c86318 100644 --- a/lisa/tools/grub_config.py +++ b/lisa/tools/grub_config.py @@ -22,7 +22,7 @@ def create(cls, node: "Node", *args: Any, **kwargs: Any) -> Tool: if isinstance(node.os, CBLMariner): if node.os.information.release == "2.0": return GrubConfigAzl2(node, args, kwargs) - if node.os.information.release == "3.0": + if node.os.information.release in ("3.0", "4.0"): return GrubConfigAzl3(node, args, kwargs) elif isinstance(node.os, Debian): return GrubConfigDebian(node, args, kwargs) @@ -31,7 +31,7 @@ def create(cls, node: "Node", *args: Any, **kwargs: Any) -> Tool: raise UnsupportedDistroException( os=node.os, - message="Grub tool only supported on CBLMariner 2.0/3.0, " + message="Grub tool only supported on CBLMariner 2.0, 3.0 and 4.0, " "Debian-based distributions, and RHEL-based distributions.", ) diff --git a/lisa/tools/ntttcp.py b/lisa/tools/ntttcp.py index 5eb091aea5..64ea84e155 100644 --- a/lisa/tools/ntttcp.py +++ b/lisa/tools/ntttcp.py @@ -762,14 +762,17 @@ def _initialize(self, *args: Any, **kwargs: Any) -> None: def _install(self) -> bool: if isinstance(self.node.os, CBLMariner): - self.node.os.install_packages( - [ - "kernel-headers", - "binutils", - "glibc-devel", - "zlib-devel", - ] - ) + packages = [ + "kernel-headers", + "binutils", + "glibc-devel", + ] + if self.node.os.information.version >= "4.0.0": + # zlib-devel not available on Azure Linux 4.0 + packages.append("zlib-ng-compat-devel") + else: + packages.append("zlib-devel") + self.node.os.install_packages(packages) elif ( isinstance(self.node.os, Ubuntu) and self.node.os.information.version >= "25.10.0" diff --git a/lisa/tools/perf.py b/lisa/tools/perf.py index 526c76e463..76e67ce541 100644 --- a/lisa/tools/perf.py +++ b/lisa/tools/perf.py @@ -32,7 +32,11 @@ def _install(self) -> bool: self.node.tools[Uname].get_linux_information().kernel_version_raw ) if isinstance(self.node.os, CBLMariner): - self.node.os.install_packages("kernel-tools") + if self.node.os.information.version >= "4.0.0": + # Azure Linux 4.0 has perf in a separate package + self.node.os.install_packages("perf") + else: + self.node.os.install_packages("kernel-tools") elif isinstance(self.node.os, (Redhat, Suse)): self.node.os.install_packages("perf") elif isinstance( diff --git a/lisa/tools/sockperf.py b/lisa/tools/sockperf.py index fd75a9ac24..5027df9583 100644 --- a/lisa/tools/sockperf.py +++ b/lisa/tools/sockperf.py @@ -114,7 +114,11 @@ def install(self) -> bool: # mariner needs headers and -dev packages if isinstance(posix_os, CBLMariner): - packages.append("build-essential") + if posix_os.information.version >= "4.0.0": + # build-essential not available on Azure Linux 4.0 + packages.extend(["kernel-headers", "binutils", "glibc-devel"]) + else: + packages.append("build-essential") # install and pick build dir posix_os.install_packages(packages) diff --git a/lisa/transformers/kernel_source_installer.py b/lisa/transformers/kernel_source_installer.py index 3c6cce7f8f..9c608ab32c 100644 --- a/lisa/transformers/kernel_source_installer.py +++ b/lisa/transformers/kernel_source_installer.py @@ -451,25 +451,28 @@ def _install_build_tools(self, node: Node) -> None: ] ) elif isinstance(os, CBLMariner): - os.install_packages( - [ - "build-essential", - "bison", - "flex", - "bc", - "ccache", - "elfutils-libelf", - "elfutils-libelf-devel", - "ncurses-libs", - "ncurses-compat", - "xz", - "xz-devel", - "xz-libs", - "openssl-libs", - "openssl-devel", - "xxhash-devel", - ] - ) + packages = [ + "bison", + "flex", + "bc", + "elfutils-libelf", + "elfutils-libelf-devel", + "ncurses-libs", + "xz", + "xz-devel", + "xz-libs", + "openssl-libs", + "openssl-devel", + "xxhash-devel", + ] + if os.information.version >= "4.0.0": + # build-essential, ccache, ncurses-compat not available on Azure Linux 4.0 + packages.extend( + ["kernel-headers", "binutils", "glibc-devel", "gcc", "make"] + ) + else: + packages.extend(["build-essential", "ccache", "ncurses-compat"]) + os.install_packages(packages) else: raise LisaException( f"os '{os.name}' doesn't support in {self.type_name()}. "