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

add case for file backed nvdimm memory lifecycle #5370

Merged

Conversation

nanli1
Copy link
Contributor

@nanli1 nanli1 commented Dec 29, 2023

VIRT-299192: Life cycle of file backed nvdimm memory device

Signed-off-by: nanli [email protected]

x86+rhel9

avocado run --vt-type libvirt --test-runner=runner --vt-machine-type q35 memory.devices.file_nvdimm.lifecycle
 (1/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_undefined.target_label.access_shared: PASS (258.50 s)
 (2/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_undefined.target_label.access_private_alignsize: PASS (176.22 s)
 (3/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_undefined.target_readonly.access_shared: PASS (299.23 s)
 (4/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_undefined.target_readonly.access_private_alignsize: PASS (147.19 s)
 (5/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_slot_base.target_label.access_shared: PASS (258.20 s)
 (6/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_slot_base.target_label.access_private_alignsize: PASS (181.61 s)
 (7/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_slot_base.target_readonly.access_shared: PASS (245.93 s)
 (8/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_slot_base.target_readonly.access_private_alignsize: PASS (144.63 s)

aarch+rhel9

avocado run --vt-type libvirt --test-runner=runner --vt-machine-type arm64-mmio memory.devices.file_nvdimm.lifecycle
 (1/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_undefined.target_label.access_shared: PASS (110.53 s)
 (2/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_undefined.target_label.access_private_alignsize: PASS (110.29 s)
 (3/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_undefined.target_readonly.access_shared: PASS (162.42 s)
 (4/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_undefined.target_readonly.access_private_alignsize: PASS (161.37 s)
 (5/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_slot_base.target_label.access_shared: PASS (192.21 s)
 (6/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_slot_base.target_label.access_private_alignsize: PASS (191.79 s)
 (7/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_slot_base.target_readonly.access_shared: PASS (164.62 s)
 (8/8) type_specific.io-github-autotest-libvirt.memory.devices.file_nvdimm.lifecycle.with_numa.addr_slot_base.target_readonly.access_private_alignsize: PASS (163.03 s)



@nanli1 nanli1 force-pushed the add_case_for_file_backed_nvdimm_lifecycle branch 2 times, most recently from 15f25da to 394a519 Compare December 29, 2023 02:40
Copy link
Contributor

@smitterl smitterl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Some minor things called my attention please have a look.


save_file = params.get("save_file")
if os.path.exists(save_file):
os.remove(save_file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should better assume that the file doesn't exist when the test starts but make sure to remove it during teardown.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Sebas , Thanks for your comment. If other cases have the same named file left, m which will influence my test

nvdimm_dict = {'mem_model':'nvdimm', 'mem_access':'${access}',${source_attrs},${target_attrs} }
variants:
- with_numa:
no s390-virtio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, you could define no s390-virtio on the top level because there's no NVDIMM on s390x.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Sebas, Done


def run_test():
"""
1.Define vm with nvdimm memory device and check nvdimm config.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the comments need some cleanup, I propose:

        1. Define a vm with a nvdimm memory device and check the nvdimm configuration.
        2. Hotplug an nvdimm memory device and check the nvdimm configuration.
        3. Check the alignment with the virsh qemu-monitor-command.
        4. Create a file system on two nvdimm devices in the guest.
        6. Lifecycle checks for a guest with an attached device.
        7. Hotplug an nvdimm device.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Sebas, Done

3.Check the alignment by virsh qemu-monitor-command.
4.Create file system on two nvdimm device in guest.
6.Liefycle for guest.
7.Hotplug a nvdimm.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a second device? Is 7. the same as 2.?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Sebas, Done

@nanli1 nanli1 marked this pull request as draft January 15, 2024 02:07
@nanli1 nanli1 force-pushed the add_case_for_file_backed_nvdimm_lifecycle branch 2 times, most recently from d9a8690 to 434780c Compare January 17, 2024 11:01
@nanli1 nanli1 requested a review from smitterl January 17, 2024 11:08
@nanli1 nanli1 marked this pull request as ready for review January 17, 2024 11:51
@nanli1 nanli1 force-pushed the add_case_for_file_backed_nvdimm_lifecycle branch 3 times, most recently from b266a4b to 3d988cc Compare January 22, 2024 13:08
    VIRT-299192: Life cycle of file backed nvdimm memory device
Signed-off-by: nanli <[email protected]>
@nanli1 nanli1 force-pushed the add_case_for_file_backed_nvdimm_lifecycle branch from 3d988cc to fa34e06 Compare January 22, 2024 13:36
Copy link
Contributor

@smitterl smitterl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thank you!

Copy link
Contributor

@dzhengfy dzhengfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dzhengfy dzhengfy merged commit 47d2451 into autotest:master Mar 6, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants