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

hotplug_virtio_mem: implements virtio-mem hotunplug #3955

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

mcasquer
Copy link
Contributor

@mcasquer mcasquer commented Feb 6, 2024

Depends on avocado-framework/avocado-vt#3844

hotplug_virtio_mem: implements virtio-mem hotunplug

Implements virtio-mem hotunplug as the final step of
the test case. At first, it tries to unplug the virtio-mem
device with some memory plugged in; as expected the
exception is catched. Finally resizes the device to zero
and the hotunplug is successfully done.

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

@mcasquer mcasquer marked this pull request as ready for review February 6, 2024 11:46
@mcasquer
Copy link
Contributor Author

mcasquer commented Feb 6, 2024

@yanan-fu @zhenyzha @menli820 could you review this PR? Thanks !

@mcasquer
Copy link
Contributor Author

mcasquer commented Feb 6, 2024

 (1/1) Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.hotplug_virtio_mem.q35: STARTED
 (1/1) Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.hotplug_virtio_mem.q35: PASS (155.09 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

@@ -53,4 +54,13 @@ def run(test, params, env):
threshold, vm, test)
virtio_mem_utils.check_numa_plugged_mem(node_id, requested_size,
threshold, vm, test)
try:
hotplug_test.unplug_memory(vm, target_mem)
except QMPCmdError:
Copy link
Contributor

Choose a reason for hiding this comment

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

@mcasquer How about
except QMPCmdError as e:
test.fail(XX) --> Pass this parameter "e" to this fail message as what you want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@menli820 thanks for the suggestion, but if you check in our internal test case, the step is expected to fail, that's the reason of the info message 😀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps I can use the exception instance to look on it for the error message... what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps I can use the exception instance to look on it for the error message... what do you think?

@mcasquer Thanks reminder, after checking our internal test case, it is reasonable with the test.log.info
How about adding a if judgment behind 'except QMPCmdError:' to confirm whether the exception message is expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Code updated!

@mcasquer mcasquer force-pushed the 1939_add_hotunplug branch 3 times, most recently from 661f5e2 to 6a73bb4 Compare February 19, 2024 08:14
@mcasquer
Copy link
Contributor Author

 (1/1) Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.hotplug_virtio_mem.q35: STARTED
 (1/1) Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.hotplug_virtio_mem.q35: PASS (140.89 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

@mcasquer
Copy link
Contributor Author

@yanan-fu @zhenyzha @menli820 could you review this PR? Thanks !

@menli820
Copy link
Contributor

LGTM

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

@zhenyzha
Copy link
Contributor

(1/1) Host_RHEL.m9.u4.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.aarch64.page_64k.io-github-autotest-qemu.hotplug_virtio_mem.arm64-pci: PASS (149.81 s)

LGTM.Acked-by: Zhenyu Zhang [email protected]

@mcasquer mcasquer force-pushed the 1939_add_hotunplug branch 2 times, most recently from a1569a4 to 3ebb900 Compare February 19, 2024 11:26
@mcasquer
Copy link
Contributor Author

 (1/1) Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.hotplug_virtio_mem.q35: STARTED
 (1/1) Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.hotplug_virtio_mem.q35: PASS (139.07 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

Copy link
Contributor

@yanan-fu yanan-fu left a comment

Choose a reason for hiding this comment

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

Ack

Implements virtio-mem hotunplug as the final step of
the test case. At first, it tries to unplug the virtio-mem
device with some memory plugged in; as expected the
exception is catched. Finally resizes the device to zero
and the hotunplug is successfully done.

Signed-off-by: mcasquer <[email protected]>
@yanan-fu
Copy link
Contributor

Thanks all, let's merge this patch as the avocado-vt dependence was merged.

@yanan-fu yanan-fu merged commit 6ec52d3 into autotest:master Feb 21, 2024
6 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.

4 participants