-
Notifications
You must be signed in to change notification settings - Fork 169
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 2 new datastore cases #6183
base: master
Are you sure you want to change the base?
Conversation
80fd297
to
76447c7
Compare
|
if with_hotplug: | ||
if not vm.is_alive(): | ||
vm.start() | ||
_, new_image_path = disk_obj.prepare_disk_obj(disk_type, disk_dict, new_image_path="", extra=data_file_option) |
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.
line 51 to line 55 ,please put them into one small method to make code clean
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.
Move to hotplug_disk().
if not vm.is_alive(): | ||
vm.start() | ||
vm_session = vm.wait_for_login() | ||
test.log.info("TEST_STEP: Check the disk dumpxml.") |
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.
line 61 to line 68 ,please put them into one method e.g. validate_attached_datastore()
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.
Move to check_result().
9995ab1
to
9ce8594
Compare
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.
lgtm
Start guest with datastore and hotplug disk with datastore. | ||
""" | ||
def prepare_vm(): | ||
""" |
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 think it would be more appropriate to say " prepare_disk" here
disk_xml = virsh.dumpxml(vm_name, "--xpath //disk", debug=True).stdout_text | ||
if "dataStore" not in disk_xml: | ||
test.fail("Can't get the datastore element automatically!") | ||
test.log.info("TEST_STEP: Do rear/write for disk.") |
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.
A typo here: s/rear/read
if with_hotplug: | ||
test.log.info("TEST_STEP: Hotplug disk with datastore.") | ||
new_image_path, disk_dev = hotplug_disk(data_file_option) | ||
else: |
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.
Better to also log the TEST_STEP here, right?
test.log.info("TEST_STEP: Check the disk dumpxml.") | ||
check_result() | ||
if with_hotplug: | ||
virsh.detach_device(vm_name, disk_dev.xml, debug=True, ignore_status=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.
Better to log the TEST_STEP here for hotunplug
finally: | ||
vmxml_backup.sync() | ||
disk_obj.cleanup_disk_preparation(disk_type) | ||
if with_block: |
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.
Isn't cleanup_disk_preparation enough to clean up the disk? Why do we need the following lines?
Automate two cases: VIRT-303298 [virtual disks][dataStore] Hotplug/unplug disks with data files VIRT-303297 [virtual_disks][dataStore] Start guest with disks that have data files Signed-off-by: Meina Li <[email protected]>
Automate two cases:
VIRT-303298 [virtual disks][dataStore] Hotplug/unplug disks with data files
VIRT-303297 [virtual_disks][dataStore] Start guest with disks that have data files