-
Notifications
You must be signed in to change notification settings - Fork 174
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
installer: check warning message when uninstall driver by msi #3867
Conversation
@leidwang Please consider to abstract common part to utils_windows. Thanks. |
(1/1) Host_RHEL.m9.u3.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.win_virtio_driver_install_by_installer.driver_uninstall.by_msi.q35: STARTED |
Hi @vivianQizhu In fact, the uninstall driver common part is that they(uninstall via exe/msi) all need to execute a command (this command will call the autoit script), and the others are different. So I think we might no need to define a function for it. Not sure if I got your point, we can discuss it offline if needed.Thanks! |
Hi @heywji Could you please help review this patch?Thanks! |
LGTM
|
Hi @vivianQizhu Could you please help to review it when you are free?Thanks. |
Depends on this patch: avocado-framework/avocado-vt#3808 |
avocado-vt 3808 still under review |
Tested this patch with avocado-vt 3808, test will run as expected. 1.Run the case in specific virtio-win range, the test case can pass. 2.Run the case not in specific virtio-win range, the test case can cancel. 3.Run the case with wrong virtio-win limitation, the test case report an error. Hi @vivianQizhu Would you please review this PR and avocado-vt PR again?Thanks! |
if params.get_boolean("uninstall_by_msi", False): | ||
error_context.context("Check the warning when use msi to uninstall driver", | ||
test.log.info) | ||
vm.send_key('meta_l-d') | ||
time.sleep(30) | ||
run_uninstall_cmd = utils_misc.set_winutils_letter( | ||
session, params["run_uninstall_cmd"]) | ||
session.cmd(run_uninstall_cmd) | ||
time.sleep(30) | ||
check_warning_file = params["check_warning_file"] | ||
output = session.cmd_output(check_warning_file) | ||
if params["warning_message"] not in output: | ||
test.fail("Not found expected warning message, the output is %s" % output) | ||
else: | ||
error_context.context("Run virtio-win-guest-tools.exe uninstall test", | ||
test.log.info) | ||
vm.send_key('meta_l-d') | ||
time.sleep(30) | ||
run_uninstall_cmd = utils_misc.set_winutils_letter( | ||
session, params["run_uninstall_cmd"]) | ||
session.cmd(run_uninstall_cmd) | ||
time.sleep(30) | ||
s_check, o_check = session.cmd_status_output(installer_pkg_check_cmd) | ||
if s_check == 0: | ||
test.fail("Could not uninstall Virtio-win-guest-tools package " | ||
"in guest', detail: '%s'" % o_check) | ||
session = vm.reboot(session) |
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.
Let's introduce a params uninstall_method
:
if params.get_boolean("uninstall_by_msi", False): | |
error_context.context("Check the warning when use msi to uninstall driver", | |
test.log.info) | |
vm.send_key('meta_l-d') | |
time.sleep(30) | |
run_uninstall_cmd = utils_misc.set_winutils_letter( | |
session, params["run_uninstall_cmd"]) | |
session.cmd(run_uninstall_cmd) | |
time.sleep(30) | |
check_warning_file = params["check_warning_file"] | |
output = session.cmd_output(check_warning_file) | |
if params["warning_message"] not in output: | |
test.fail("Not found expected warning message, the output is %s" % output) | |
else: | |
error_context.context("Run virtio-win-guest-tools.exe uninstall test", | |
test.log.info) | |
vm.send_key('meta_l-d') | |
time.sleep(30) | |
run_uninstall_cmd = utils_misc.set_winutils_letter( | |
session, params["run_uninstall_cmd"]) | |
session.cmd(run_uninstall_cmd) | |
time.sleep(30) | |
s_check, o_check = session.cmd_status_output(installer_pkg_check_cmd) | |
if s_check == 0: | |
test.fail("Could not uninstall Virtio-win-guest-tools package " | |
"in guest', detail: '%s'" % o_check) | |
session = vm.reboot(session) | |
uninstall_method = params.get('uninstall_method', 'installer') | |
error_context.context("Run uninstall test via %s" % uninstall_method, | |
test.log.info) | |
vm.send_key('meta_l-d') | |
time.sleep(30) | |
run_uninstall_cmd = utils_misc.set_winutils_letter( | |
session, params["run_uninstall_cmd"]) | |
session.cmd(run_uninstall_cmd) | |
time.sleep(30) | |
if uninstall_method == "MSI": | |
check_warning_file = params["check_warning_file"] | |
output = session.cmd_output(check_warning_file) | |
if params["warning_message"] not in output: | |
test.fail("Not found expected warning message, the output is %s" % output) | |
else: | |
s_check, o_check = session.cmd_status_output(installer_pkg_check_cmd) | |
if s_check == 0: | |
test.fail("Could not uninstall Virtio-win-guest-tools package " | |
"in guest', detail: '%s'" % o_check) | |
session = vm.reboot(session) |
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.
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.
Let's introduce a params
uninstall_method
:
Updated,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.
Hi @vivianQizhu, Let me explain our test steps. The development has completely fixed the problem with missing DNS and IP addresses, but there are still unknown issues with some other parts of the virtio-win module. The developer still keeps this warning message, so our test step is to check that msi has this warning message when uninstalling. We do not ensure msi uninstalled is successful or not.
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.
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 my opinion, 'Checking warning info' is just a step in win_virtio_driver_install_by_installer/uninstall test case, no need to check the uninstall result from the test steps, 'tips exist and you can close the window if you can see it.'
134295b
to
ba1b74d
Compare
test.log.info) | ||
vm.send_key('meta_l-d') | ||
time.sleep(30) | ||
run_uninstall_cmd = utils_misc.set_winutils_letter( | ||
session, params["run_uninstall_cmd"]) | ||
run_uninstall_cmd = utils_misc.set_winutils_letter(session, params["run_uninstall_cmd"]) |
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.
Please limit each line within 79 characters.
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.
Okay.
run_uninstall_cmd = 'WIN_UTILS:\AutoIt3_%PROCESSOR_ARCHITECTURE%.exe WIN_UTILS:\uninstall_via_msi.au3' | ||
warning_text_path = "C:\uninstall_warning.txt" | ||
check_warning_file = 'type ${warning_text_path}' | ||
warning_message = '' |
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.
Should we set a default value for it?
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.
Hi @vivianQizhu
Sure, I also prefer to set a expected warning message.
like that:3685f30
Signed-off-by: Leidong Wang <[email protected]>
The previous warning check autotest#3867 is no longer needed, according to Vadim in RHEL-36742. This patch removes the warning messages. ID: 2544 Signed-off-by: wji <[email protected]>
The previous warning check autotest#3867 is no longer needed, according to Vadim in RHEL-36742. This patch removes the warning messages. ID: 2544 Signed-off-by: wji <[email protected]>
The previous warning check autotest#3867 is no longer needed, according to Vadim in RHEL-36742. This patch removes the warning messages. ID: 2544 Signed-off-by: wji <[email protected]>
The previous warning check autotest#3867 is no longer needed, according to Vadim in RHEL-36742. This patch removes the warning messages. ID: 2544 Signed-off-by: wji <[email protected]>
The previous warning check autotest#3867 is no longer needed, according to Vadim in RHEL-36742. This patch removes the warning messages. ID: 2544 Signed-off-by: wji <[email protected]>
The warning check autotest#3867 is no longer needed. Removing sub-testcase. ID: 2544 Signed-off-by: wji <[email protected]>
The warning check autotest#3867 is no longer needed. Removing sub-testcase. ID: 2544 Signed-off-by: wji <[email protected]>
The warning check autotest#3867 is no longer needed. Removing sub-testcase. ID: 2544 Signed-off-by: wji <[email protected]>
ID: 1387
Signed-off-by: Leidong Wang [email protected]