-
Notifications
You must be signed in to change notification settings - Fork 168
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
Test the "--managed-save" option #6131
base: master
Are you sure you want to change the base?
Conversation
test results: |
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.
Except 2 typos, rest looks good to me!
|
||
def vm_undefine_check(vm_name): | ||
""" | ||
Check if vm can be undefined with manage-save 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.
it should be managed-save in the above line. Can be ignored as it is in commented 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.
Thank you! updated.
ignore_status=True) | ||
LOG.debug("%s", ret1) | ||
if ret1.exit_status: | ||
test.fail("Guest can't be undefine with " |
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.
undefined suits better than undefine
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.
Thank you! updated.
29f76f0
to
1772117
Compare
test.fail("Can't find managed save image") | ||
LOG.info("Step2: Undefine the VM without --managed-save option:") | ||
ret = virsh.undefine(vm_name, options='--nvram', ignore_status=True) | ||
LOG.debug("%s", ret) |
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.
What about using 'debug=True' in virsh.undefine() instead of logging out it by 'LOG.debug("%s", ret)'? What do you think?
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.
updated, Thank you!
if not ret.exit_status: | ||
test.fail("Guest shouldn't be undefined" | ||
"while domain managed save image exists!") |
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.
Would you like to try the result checking wrapper function - libvirt.check_exit_status?
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.
Update, Thank you!
ret1 = virsh.undefine(vm_name, options="--managed-save --nvram", | ||
ignore_status=True) | ||
LOG.debug("%s", ret1) | ||
if ret1.exit_status: | ||
test.fail("Guest can't be undefined with " | ||
"managed-save 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.
Same as above.
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.
see above
test.fail("Guest shouldn't be undefined" | ||
"while domain managed save image exists!") | ||
LOG.info("Step3: Undefine the VM with --managed-save option:") | ||
ret1 = virsh.undefine(vm_name, options="--managed-save --nvram", |
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.
May I ask if '--nvram' option is required? Same question to the first virsh undefine attempt(the failed one) as well.
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.
For uefi guest, the guest can not be undefined successfully with "--nvram" or "--keep-nvram" option.
The option has no impact for guest with seabios. So I added the "--nvram" to make sure the undefine operation is not blocked by the nvram file.
When the VM have a managedsave file, it can not be undefined without the "--managed-save" option. This option can remove the managedsave file and then undefine the VM. Signed-off-by: Yalan Zhang <[email protected]>
1772117
to
40d7b9b
Compare
When the VM have a managedsave file, it can not be undefined without the "--managed-save" option. This option can remove the managedsave file and then undefine the VM. (automate VIRT-297771)