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

Fix test issues on mariner 3.0 #3427

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lisa/sut_orchestrator/azure/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -1649,10 +1649,12 @@ def _get_scsi_data_disks(self) -> List[str]:
if len(files) == 0 and self._node.capability.disk.data_disk_count != 0:
os = self._node.os
# https://docs.microsoft.com/en-us/troubleshoot/azure/virtual-machines/troubleshoot-device-names-problems#get-the-latest-azure-storage-rules # noqa: E501
# there are known issues on ubuntu 16.04 and rhel 9.0
# there are known issues on ubuntu 16.04, rhel 9.0 and mariner 3.0
# try to workaround it
if (isinstance(os, Ubuntu) and os.information.release <= "16.04") or (
isinstance(os, Redhat) and os.information.release >= "9.0"
if (
(isinstance(os, Ubuntu) and os.information.release <= "16.04")
or (isinstance(os, Redhat) and os.information.release >= "9.0")
or isinstance(os, CBLMariner)
):
self._log.debug(
"download udev rules to construct a set of "
Expand Down
18 changes: 15 additions & 3 deletions lisa/tools/dhclient.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

import re
from typing import Optional, Type
from typing import Any, Optional, Type

from lisa.base_tools import Cat
from lisa.executable import Tool
Expand All @@ -18,7 +17,20 @@ class Dhclient(Tool):

@property
def command(self) -> str:
return "dhclient"
return self._command

def _initialize(self, *args: Any, **kwargs: Any) -> None:
self._command = "dhclient"

def _check_exists(self) -> bool:
original_command = self._command
commands_to_check = ["dhclient", "dhcpcd"]
for command in commands_to_check:
self._command = command
if super()._check_exists():
return True
self._command = original_command
return False

@classmethod
def _freebsd_tool(cls) -> Optional[Type[Tool]]:
Expand Down
Loading