-
Notifications
You must be signed in to change notification settings - Fork 166
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 starting guest with multiple driver attributes #5621
base: master
Are you sure you want to change the base?
Conversation
|
@chunfuwen Hi, could you help to review this virtual disk PR? Thanks. |
from provider.virtual_disk import disk_base | ||
|
||
|
||
def prepare_guest(vm, vmxml, disk_obj, params): |
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.
prepare_guest mix adding second disk and update system disk together, it is hard for others to read. Better separate them into two method.
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.
I'm not sure how to split them. Because from the scenarios perspective I think it may be reasonable. Could you give me some detailed introduction if you find the better method. Thanks.
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.
Split the function to two functions to add new scenarios in the future easily.
test.log.info("STEP3: login the guest and read/write.") | ||
session = vm.wait_for_login() | ||
if disk_type == "file": | ||
session.cmd("mkfs.ext4 /dev/%s && mount /dev/%s /mnt" % (disk_dev, disk_dev)) |
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.
libvirt_disk.fill_null_in_vm() implements similar function
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.
In test case only file disk need to format the vdb disk but not for the block disk. If we use libvirt_disk.fill_null_in_vm(), both the file disk and block disk will format which is not our expected. So I think it's inappropriate to use this function.
|
||
finally: | ||
bkxml.sync() | ||
libvirt.setup_or_cleanup_iscsi(is_setup=False) |
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.
Not all scenarios call libvirt.setup_or_cleanup_iscsi(is_setup=True) before , I assume
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.
Yes, only block disk test uses this function. I've updated now.
…ttributes These two cases are to match the cnv scenarios: VIRT-300872 and VIRT-300727. Signed-off-by: Meina Li <meili@redhat.com>
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.
ignore_status=False, shell=True
has been used for 3 times, Suggest use virsh_dargs = {"ignore_status": False, "debug": True}
if you want, Approved
These two cases are to match the cnv scenarios: VIRT-300872 and VIRT-300727.