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

block_hotplug_with_max_map_count: creates new test case #4225

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mcasquer
Copy link
Contributor

@mcasquer mcasquer commented Dec 2, 2024

block_hotplug_with_max_map_count: creates new test case

Creates new test case that boots up a VM with a small max_map_count,
then hotplugs 15 disks and checks the VM status.

Signed-off-by: mcasquer [email protected]
ID: 3130

@mcasquer
Copy link
Contributor Author

mcasquer commented Dec 2, 2024

 (1/1) Host_RHEL.m9.u6.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.RHEL.9.6.0.x86_64.io-github-autotest-qemu.block_hotplug_with_max_map_count.q35: STARTED
 (1/1) Host_RHEL.m9.u6.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.RHEL.9.6.0.x86_64.io-github-autotest-qemu.block_hotplug_with_max_map_count.q35: PASS (61.24 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

@mcasquer mcasquer marked this pull request as ready for review December 2, 2024 14:03
@mcasquer
Copy link
Contributor Author

mcasquer commented Dec 2, 2024

@qingwangrh please could you review this PR? Thanks!

@mcasquer
Copy link
Contributor Author

This is a kindly reminder, @qingwangrh please could you review this PR? Thanks !

maxmem_mem = 80G
mem = 4096
pcie_extra_root_port = 30
images += " stg1 stg2 stg3 stg4 stg5 stg6 stg7 stg8 stg9 stg10 stg11 stg12 stg13 stg14 stg15 stg16 stg17"
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest using extra_image_number to define the additional images, you already support dynamic create images. it is more flexible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Included !

:param env: Dictionary with test environment
"""

process.system("sysctl vm.max_map_count=3072", shell=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

could you please add reading value and store, then write it back after testing in final block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done !

timeout = params.get_numeric("login_timeout", 240)
img_list = params.get("images").split()[3:]

for img in img_list:
Copy link
Contributor

Choose a reason for hiding this comment

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

for idx in range(extra_image_number):
img="img"+idx
....
you may define the var name you feel good.

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 !

@mcasquer mcasquer force-pushed the 3130_max_map_count_disk_hotplug branch from b95de9d to 82351a8 Compare December 11, 2024 09:06
@mcasquer
Copy link
Contributor Author

 (1/1) Host_RHEL.m9.u6.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.RHEL.9.6.0.x86_64.io-github-autotest-qemu.block_hotplug_with_max_map_count.q35: STARTED
 (1/1) Host_RHEL.m9.u6.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.RHEL.9.6.0.x86_64.io-github-autotest-qemu.block_hotplug_with_max_map_count.q35: PASS (56.46 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

@mcasquer
Copy link
Contributor Author

@qingwangrh please could you review again this PR? Thanks !

@mcasquer
Copy link
Contributor Author

@zhencliu @YongxueHong could you also review this PR? Thanks

@mcasquer
Copy link
Contributor Author

mcasquer commented Jan 7, 2025

Hello @qingwangrh @zhencliu @YongxueHong this is a kindly reminder, could you review this PR? Thanks !


def run(test, params, env):
"""
Block hotplug wit vm.max_map_count test
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Block hotplug wit vm.max_map_count test
Block hotplug with vm.max_map_count test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, updated !

Comment on lines 52 to 53
test.log.info("Restoring max_map_count original value")
process.system(f"sysctl vm.max_map_count={orig_value}", shell=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

This part should be executed within a finally block, otherwise, the routine can not reach it in any case if it raises an error.

Suggested change
test.log.info("Restoring max_map_count original value")
process.system(f"sysctl vm.max_map_count={orig_value}", shell=True)
finally:
test.log.info("Restoring max_map_count original value")
process.system(f"sysctl vm.max_map_count={orig_value}", shell=True)

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 !

@mcasquer mcasquer force-pushed the 3130_max_map_count_disk_hotplug branch from 82351a8 to 99b965a Compare January 8, 2025 11:43
@mcasquer
Copy link
Contributor Author

mcasquer commented Jan 8, 2025

 (1/1) Host_RHEL.m9.u6.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.RHEL.9.6.0.x86_64.io-github-autotest-qemu.block_hotplug_with_max_map_count.q35: STARTED
 (1/1) Host_RHEL.m9.u6.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.RHEL.9.6.0.x86_64.io-github-autotest-qemu.block_hotplug_with_max_map_count.q35: PASS (120.18 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

@mcasquer
Copy link
Contributor Author

mcasquer commented Jan 8, 2025

@YongxueHong @qingwangrh @zhencliu could you review again this PR? Thanks !

YongxueHong
YongxueHong previously approved these changes Jan 9, 2025
Copy link
Contributor

@YongxueHong YongxueHong left a comment

Choose a reason for hiding this comment

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

LGTM.

@mcasquer
Copy link
Contributor Author

@zhencliu one extra thing, I am not sure if the sysctl command is working since I see invalid argument and the stderr what do you think?

[stdlog] 2025-01-10 02:04:28,831 avocado.utils.process process          L0658 INFO | Running 'sysctl vm.max_map_count=b'3072''
[stdlog] 2025-01-10 02:04:28,836 avocado.utils.process process          L0472 DEBUG| [stderr] sysctl: setting key "vm.max_map_count"
[stdlog] 2025-01-10 02:04:28,836 avocado.utils.process process          L0472 DEBUG| [stderr] : Invalid argument
[stdlog] 2025-01-10 02:04:28,837 avocado.utils.process process          L0715 INFO | Command 'sysctl vm.max_map_count=b'3072'' finished with 0 after 0.001439125s

@mcasquer
Copy link
Contributor Author

 (1/1) Host_RHEL.m9.u6.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.RHEL.9.6.0.x86_64.io-github-autotest-qemu.block_hotplug_with_max_map_count.q35: STARTED
 (1/1) Host_RHEL.m9.u6.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.RHEL.9.6.0.x86_64.io-github-autotest-qemu.block_hotplug_with_max_map_count.q35: PASS (57.93 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

@zhencliu
Copy link
Contributor

zhencliu commented Jan 10, 2025

@zhencliu one extra thing, I am not sure if the sysctl command is working since I see invalid argument and the stderr what do you think?

[stdlog] 2025-01-10 02:04:28,831 avocado.utils.process process          L0658 INFO | Running 'sysctl vm.max_map_count=b'3072''
[stdlog] 2025-01-10 02:04:28,836 avocado.utils.process process          L0472 DEBUG| [stderr] sysctl: setting key "vm.max_map_count"
[stdlog] 2025-01-10 02:04:28,836 avocado.utils.process process          L0472 DEBUG| [stderr] : Invalid argument
[stdlog] 2025-01-10 02:04:28,837 avocado.utils.process process          L0715 INFO | Command 'sysctl vm.max_map_count=b'3072'' finished with 0 after 0.001439125s

What about trying
count = 3072
system(f"sysctl vm.max_map_count={count}")

@mcasquer
Copy link
Contributor Author

What about trying
count = 3072
system(f"sysctl vm.max_map_count={count}")

Yeah, that works fine :)

Creates new test case that boots up a VM with a small max_map_count,
then hotplugs 15 disks and checks the VM status.

Signed-off-by: mcasquer <[email protected]>
@mcasquer mcasquer force-pushed the 3130_max_map_count_disk_hotplug branch from 88effa6 to cfb8824 Compare January 10, 2025 09:19
@mcasquer
Copy link
Contributor Author

@zhencliu code updated ! could you review again the PR? Thanks !

@mcasquer
Copy link
Contributor Author

 (1/1) Host_RHEL.m9.u6.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.RHEL.9.6.0.x86_64.io-github-autotest-qemu.block_hotplug_with_max_map_count.q35: STARTED
 (1/1) Host_RHEL.m9.u6.ovmf.qcow2.virtio_blk.up.virtio_net.Guest.RHEL.9.6.0.x86_64.io-github-autotest-qemu.block_hotplug_with_max_map_count.q35: PASS (57.26 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

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.

4 participants