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

Virtual_disk: add new cases for disk driver discard_no_unref attribute #5649

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

meinaLi
Copy link
Contributor

@meinaLi meinaLi commented May 30, 2024

Automate cases of discard_no_unref attribute: VIRT-301646 VIRT-301647 VIRT-301651

@meinaLi
Copy link
Contributor Author

meinaLi commented May 30, 2024

# avocado run --vt-type libvirt --test-runner=runner --vt-machine-type q35 virtual_disks.discard_no_unref
JOB ID     : ffc96321ed99250872fab7885de42bdd1f04b7ba
JOB LOG    : /var/lib/avocado/job-results/job-2024-05-29T23.35-ffc9632/job.log
 (01/11) type_specific.io-github-autotest-libvirt.virtual_disks.discard_no_unref.start_vm.enable.with_discard_unmap.file_disk: PASS (73.90 s)
 (02/11) type_specific.io-github-autotest-libvirt.virtual_disks.discard_no_unref.start_vm.enable.with_discard_unmap.block_disk: PASS (103.49 s)
 (03/11) type_specific.io-github-autotest-libvirt.virtual_disks.discard_no_unref.start_vm.enable.with_discard_ignore.file_disk: PASS (78.05 s)
 (04/11) type_specific.io-github-autotest-libvirt.virtual_disks.discard_no_unref.start_vm.enable.with_discard_ignore.block_disk: PASS (103.58 s)
 (05/11) type_specific.io-github-autotest-libvirt.virtual_disks.discard_no_unref.start_vm.disable.with_discard_unmap.file_disk: PASS (81.20 s)
 (06/11) type_specific.io-github-autotest-libvirt.virtual_disks.discard_no_unref.start_vm.disable.with_discard_unmap.block_disk: PASS (103.38 s)
 (07/11) type_specific.io-github-autotest-libvirt.virtual_disks.discard_no_unref.start_vm.disable.with_discard_ignore.file_disk: PASS (81.56 s)
 (08/11) type_specific.io-github-autotest-libvirt.virtual_disks.discard_no_unref.start_vm.disable.with_discard_ignore.block_disk: PASS (101.71 s)
 (09/11) type_specific.io-github-autotest-libvirt.virtual_disks.discard_no_unref.define_invalid.raw_format.enable.with_discard_unmap.file_disk: PASS (20.38 s)
 (10/11) type_specific.io-github-autotest-libvirt.virtual_disks.discard_no_unref.define_invalid.readonly_mode.enable.with_discard_unmap.file_disk: PASS (20.81 s)
 (11/11) type_specific.io-github-autotest-libvirt.virtual_disks.discard_no_unref.hotplug_disk.enable.with_discard_unmap.file_disk: PASS (79.34 s)
RESULTS    : PASS 11 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /var/lib/avocado/job-results/job-2024-05-29T23.35-ffc9632/results.html
JOB TIME   : 849.34 s

@@ -0,0 +1,42 @@
- virtual_disks.discard_no_unref:
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are different attributes. Discard_no_unref is a driver attribute which is in "". But discard_granularity is a blockio attribute which is in "".

from provider.virtual_disk import disk_base


def result_check(vm, params, test):
Copy link
Contributor

Choose a reason for hiding this comment

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

python method naming convention: verb + noun. ,So maybe change to check_result

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@meinaLi meinaLi force-pushed the start_discard branch 2 times, most recently from 9e69a8a to 871576d Compare June 5, 2024 06:46
@meinaLi meinaLi requested a review from chunfuwen June 5, 2024 08:34
Copy link
Contributor

@chunfuwen chunfuwen left a comment

Choose a reason for hiding this comment

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

lgtm

libvirt.check_logfile(check_libvirtd_log, libvirtd_log_file)
test.log.info("Check read/write in guest.")
session = vm.wait_for_login()
session.cmd("mkfs.ext4 /dev/%s && mount /dev/%s /mnt" % (target_dev, target_dev))
Copy link
Contributor

Choose a reason for hiding this comment

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

This test for disk IO in VM already has an utility function. Could you have a look at check_virtual_disk_io() in virttest/utils_libvirt/libvirt_disk.py ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an useful function. I've updated to use it.

Automate cases of discard_no_unref attribute: VIRT-301646 VIRT-301647 VIRT-301651

Signed-off-by: Meina Li <meili@redhat.com>
@meinaLi meinaLi requested a review from dzhengfy July 11, 2024 05:47
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 106aca0 into autotest:master Jul 22, 2024
5 checks passed
@meinaLi meinaLi deleted the start_discard branch July 29, 2024 07:41
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