From a767a8f82b44e55c35c182636e2737a9b121b1a2 Mon Sep 17 00:00:00 2001 From: Umang Francis <164182179+umfranci@users.noreply.github.com> Date: Wed, 9 Oct 2024 07:50:12 +0530 Subject: [PATCH] Changes to steps involved for Tests verify_load_gpu_driver and verify_dhcp_client_timeout for Redhat (#3465) * Updating gpu package name for Cuda and steps for Redhat dhcp get_timeout() * using sudo for cat * Adding support for GPU A10-8Q * Formatting as per black recommendations --- lisa/features/gpu.py | 2 +- lisa/tools/dhclient.py | 10 +++++++--- lisa/tools/nvidiasmi.py | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lisa/features/gpu.py b/lisa/features/gpu.py index dfa4748fe..ec582c813 100644 --- a/lisa/features/gpu.py +++ b/lisa/features/gpu.py @@ -201,7 +201,7 @@ class Gpu(Feature): "http://developer.download.nvidia.com/compute/cuda/" f"repos/rhel{release}/x86_64/cuda-rhel{release}.repo" ) - install_packages = ["cuda-drivers"] + install_packages = ["nvidia-driver-cuda"] if release == "7": install_packages.append("nvidia-driver-latest-dkms") self._node.os.install_packages(install_packages, signed=False) diff --git a/lisa/tools/dhclient.py b/lisa/tools/dhclient.py index a98a3361b..d6c3baf83 100644 --- a/lisa/tools/dhclient.py +++ b/lisa/tools/dhclient.py @@ -5,7 +5,7 @@ from typing import Any, Optional, Type from lisa.base_tools import Cat from lisa.executable import Tool -from lisa.operating_system import Debian, Fedora, Suse +from lisa.operating_system import Debian, Fedora, Redhat, Suse from lisa.util import LisaException, UnsupportedDistroException, find_group_in_lines from .ls import Ls @@ -44,7 +44,11 @@ class Dhclient(Tool): def get_timeout(self) -> int: is_default_value: bool = True - if isinstance(self.node.os, Debian) or isinstance(self.node.os, Suse): + if ( + isinstance(self.node.os, Debian) + or isinstance(self.node.os, Suse) + or isinstance(self.node.os, Redhat) + ): paths_to_check = [ f"/etc/dhcp/{self._command}.conf", f"/etc/{self._command}.conf", @@ -61,7 +65,7 @@ class Dhclient(Tool): # the default value in debian is 300 value: int = 300 cat = self.node.tools[Cat] - output = cat.read(config_path) + output = cat.read(config_path, sudo=True) group = find_group_in_lines(output, self._debian_pattern) if group and not group["default"]: value = int(group["number"]) diff --git a/lisa/tools/nvidiasmi.py b/lisa/tools/nvidiasmi.py index f7c9561f7..52db48239 100644 --- a/lisa/tools/nvidiasmi.py +++ b/lisa/tools/nvidiasmi.py @@ -15,6 +15,7 @@ class NvidiaSmi(Tool): ("A100", "44450000", 6), ("H100", "44453233", 0), ("A10-4Q", "56475055", 0), + ("A10-8Q", "3e810200", 0), ) @property