-
Notifications
You must be signed in to change notification settings - Fork 175
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
NVMe and resource disc testcase fixes #3432
base: main
Are you sure you want to change the base?
Conversation
c7e4a17
to
bd7d0e2
Compare
f76263a
to
5855bb7
Compare
207c2b8
to
7bb2e16
Compare
NVMe and resource disc testcase fixes 1. Added new testcase "Nvme.verify_nvme_function_unpartitioned". 2. NVMe test case fixes for disc controller type NVMe. 3. Resource disc testcases fixes for VMs with Local NVMEs. 4. "Nvme.verify_nvme_fstrim" - use fstrim testfile size based on available space.
b402609
to
b29f14e
Compare
@@ -78,7 +93,17 @@ def get_namespaces(self) -> List[str]: | |||
return namespaces | |||
|
|||
def get_namespaces_from_cli(self) -> List[str]: | |||
return self._node.tools[Nvmecli].get_namespaces() | |||
namespaces_list = self._node.tools[Nvmecli].get_namespaces() | |||
node_disk = self._node.features[Disk] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic is repeated multiple times, it should be a new method like _remove_nvme_os_disk
.
raise LisaException("Resource disk not found") | ||
if "nvme" in resource_disks[0]: | ||
raise SkippedException( | ||
f"Resource disk type is NVMe and the VM has {len(resource_disks)} NVMe disks" # noqa: E501 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The skip message doesn't explain why nvme disk should be skipped.
@@ -71,6 +71,9 @@ def _initialize(self, *args: Any, **kwargs: Any) -> None: | |||
def get_resource_disk_mount_point(self) -> str: | |||
raise NotImplementedError | |||
|
|||
def get_resource_disks(self) -> List[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default implementation should return an empty list, because "resource disk" is a concept on cloud or Azure, not all platforms. All test cases, which used the resource disk, should handle the empty list.
) | ||
if resourcedisk: | ||
resource_disks = [resourcedisk.name] | ||
except AssertionError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way not check by the error? The error can be happened by other reasons, the eating code may hide other problems.
f"'WARNING: THIS IS A TEMPORARY DISK' should be present in {file_path}", | ||
).contains("WARNING: THIS IS A TEMPORARY DISK") | ||
node_disc = node.features[Disk] | ||
resource_disks = node_disc.get_resource_disks() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a method in Disk
feature, called like get_disk_controller_type
, and it accept mount point as a parameter. Please also reduce duplicate code with existing get_os_disk_controller_type
.
resource_disks = node_disc.get_resource_disks() | ||
if not resource_disks: | ||
raise LisaException("Resource disk not found") | ||
if "nvme" in resource_disks[0]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above comments, use the type enum, instead of checking by string.
raise LisaException("Resource disk not found") | ||
if "nvme" in resource_disks[0]: | ||
raise SkippedException( | ||
f"Resource disk type is NVMe and the VM has {len(resource_disks)} NVMe disks" # noqa: E501 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message is unclear, why the tests should be skipped, if the resource disk is nvme. Please check if it's valid to skip for nvme, if so, update the description.
# Verify lost+found folder exists | ||
# Skip this step for BSD as it does not have lost+found folder | ||
# since it uses UFS file system | ||
if not isinstance(node.os, BSD): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it miscopied from above lines/ They are looks the same as above parts.
resource_disks = node_disc.get_resource_disks() | ||
if not resource_disks: | ||
raise LisaException("Resource disk not found") | ||
if "nvme" in resource_disks[0]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap the repeat logic to reuse.
NVMe and resource disc testcase fixes