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

installer: check warning message when uninstall driver by msi #3867

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

leidwang
Copy link
Contributor

@leidwang leidwang commented Nov 6, 2023

ID: 1387

Signed-off-by: Leidong Wang [email protected]

@vivianQizhu
Copy link
Contributor

@leidwang Please consider to abstract common part to utils_windows. Thanks.

@leidwang
Copy link
Contributor Author

(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
(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: PASS (473.32 s)

@leidwang
Copy link
Contributor Author

@leidwang Please consider to abstract common part to utils_windows. Thanks.

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!

@leidwang
Copy link
Contributor Author

Hi @heywji Could you please help review this patch?Thanks!

@heywji
Copy link
Contributor

heywji commented Nov 15, 2023

LGTM

1-repeat1.Host_RHEL.m9.u4.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 Finshed 2023-11-15 00:33:53 2023-11-15 00:44:05 PASS 612.843096
2-repeat2.Host_RHEL.m9.u4.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 Finshed 2023-11-15 00:44:06 2023-11-15 00:54:17 PASS 611.369202
3-repeat3.Host_RHEL.m9.u4.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 Finshed 2023-11-15 00:54:18 2023-11-15 01:04:21 PASS 602.795255
Summary:
Finshed=3, PASS=3

@leidwang
Copy link
Contributor Author

Hi @vivianQizhu Could you please help to review it when you are free?Thanks.

@leidwang
Copy link
Contributor Author

leidwang commented Dec 4, 2023

Depends on this patch: avocado-framework/avocado-vt#3808

@leidwang
Copy link
Contributor Author

avocado-vt 3808 still under review

@leidwang
Copy link
Contributor Author

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.
JOB LOG : /root/avocado/job-results/job-2024-01-23T18.31-c73ece2/job.log
(1/2) Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.unattended_install.cdrom.extra_cdrom_ks.default_install.aio_threads.q35: STARTED
(1/2) Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.unattended_install.cdrom.extra_cdrom_ks.default_install.aio_threads.q35: PASS (991.80 s)
(2/2) Host_RHEL.m9.u4.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
(2/2) Host_RHEL.m9.u4.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: PASS (467.37 s)

2.Run the case not in specific virtio-win range, the test case can cancel.
JOB LOG : /root/avocado/job-results/job-2024-01-23T19.07-06f6fec/job.log
(1/1) Host_RHEL.m9.u4.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
(1/1) Host_RHEL.m9.u4.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: CANCEL: Got virtio-win version:1.9.34.0, which is not in [1.9.35.0, ) (3.93 s)

3.Run the case with wrong virtio-win limitation, the test case report an error.
JOB LOG : /root/avocado/job-results/job-2024-01-23T19.35-56f313f/job.log
(1/1) Host_RHEL.m9.u4.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
(1/1) Host_RHEL.m9.u4.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: ERROR: The limitation for virtio-win is not suitable for the cdrom_virtio (3.30 s)

Hi @vivianQizhu Would you please review this PR and avocado-vt PR again?Thanks!

Comment on lines 65 to 84
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)
Copy link
Contributor

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:

Suggested change
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)

Copy link
Contributor

Choose a reason for hiding this comment

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

Another question to the test step itself: so we totally ignore whether the uninstall is successful or not via MSI? @xiagao @heywji ?

Copy link
Contributor Author

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!

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

@heywji I understand you don't need to check it in your test with netkvm, but let's confirm with @xiagao If we really want to ignore it.

Copy link
Contributor

@xiagao xiagao Jan 24, 2024

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.'

@leidwang leidwang force-pushed the issue1387 branch 3 times, most recently from 134295b to ba1b74d Compare January 24, 2024 03:31
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"])
Copy link
Contributor

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.

Copy link
Contributor Author

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 = ''
Copy link
Contributor

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?

Copy link
Contributor Author

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

@vivianQizhu vivianQizhu merged commit a2ab180 into autotest:master Feb 6, 2024
6 checks passed
heywji added a commit to heywji/tp-qemu that referenced this pull request Jun 26, 2024
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]>
heywji added a commit to heywji/tp-qemu that referenced this pull request Jun 26, 2024
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]>
heywji added a commit to heywji/tp-qemu that referenced this pull request Jul 3, 2024
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]>
heywji added a commit to heywji/tp-qemu that referenced this pull request Jul 3, 2024
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]>
heywji added a commit to heywji/tp-qemu that referenced this pull request Jul 4, 2024
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]>
heywji added a commit to heywji/tp-qemu that referenced this pull request Jul 4, 2024
The warning check autotest#3867 is no longer needed. Removing sub-testcase.

ID: 2544
Signed-off-by: wji <[email protected]>
heywji added a commit to heywji/tp-qemu that referenced this pull request Jul 4, 2024
The warning check autotest#3867 is no longer needed. Removing sub-testcase.

ID: 2544
Signed-off-by: wji <[email protected]>
heywji added a commit to heywji/tp-qemu that referenced this pull request Jul 5, 2024
The warning check autotest#3867 is no longer needed. Removing sub-testcase.

ID: 2544
Signed-off-by: wji <[email protected]>
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