From e56cb4ba9e02aa225e36debf954ce54636510b8e Mon Sep 17 00:00:00 2001 From: wji Date: Wed, 3 Jul 2024 21:13:49 +0800 Subject: [PATCH] installer: remove by_msi sub-testcase The warning check #3867 is no longer needed. Removing sub-testcase. ID: 2544 Signed-off-by: wji --- ...win_virtio_driver_install_by_installer.cfg | 9 -- .../win_virtio_driver_installer_uninstall.py | 117 ++++++++---------- 2 files changed, 54 insertions(+), 72 deletions(-) diff --git a/qemu/tests/cfg/win_virtio_driver_install_by_installer.cfg b/qemu/tests/cfg/win_virtio_driver_install_by_installer.cfg index dcc05abac7..20bebc10a3 100644 --- a/qemu/tests/cfg/win_virtio_driver_install_by_installer.cfg +++ b/qemu/tests/cfg/win_virtio_driver_install_by_installer.cfg @@ -249,15 +249,6 @@ driver_test_names = '' type = win_virtio_driver_installer_uninstall installer_pkg_check_cmd = 'wmic product get name |findstr "Virtio-win-driver-installer"' - variants: - - by_installer: - - by_msi: - required_virtio_win = [1.9.35.0, ) - uninstall_method = msi - run_uninstall_cmd = 'WIN_UTILS:\AutoIt3_%PROCESSOR_ARCHITECTURE%.exe C:\${uninstall_msi_script}' - warning_text_path = "C:\uninstall_warning.txt" - check_warning_file = 'type ${warning_text_path}' - warning_message = 'Warning: all customized settings will be removed' - driver_update: only all_drivers type = win_virtio_driver_update_by_installer diff --git a/qemu/tests/win_virtio_driver_installer_uninstall.py b/qemu/tests/win_virtio_driver_installer_uninstall.py index af713c2a53..8030db7a4f 100644 --- a/qemu/tests/win_virtio_driver_installer_uninstall.py +++ b/qemu/tests/win_virtio_driver_installer_uninstall.py @@ -1,16 +1,17 @@ -import time import re +import time from virttest import error_context -from virttest import utils_misc -from provider.win_driver_installer_test import (install_gagent, - uninstall_gagent, - win_uninstall_all_drivers, - win_installer_test, - check_gagent_version, - driver_check, - run_installer_with_interaction) +from provider.win_driver_installer_test import ( + check_gagent_version, + driver_check, + install_gagent, + run_installer_with_interaction, + uninstall_gagent, + win_installer_test, + win_uninstall_all_drivers, +) @error_context.context_aware @@ -48,71 +49,61 @@ def run(test, params, env): vm = env.get_vm(params["main_vm"]) session = vm.wait_for_login() - expected_gagent_version = install_gagent(session, test, - qemu_ga_pkg, - gagent_install_cmd, - gagent_pkg_info_cmd) + expected_gagent_version = install_gagent( + session, test, qemu_ga_pkg, gagent_install_cmd, gagent_pkg_info_cmd + ) uninstall_gagent(session, test, gagent_uninstall_cmd) win_uninstall_all_drivers(session, test, params) session = vm.reboot(session) - session = run_installer_with_interaction(vm, session, test, params, - run_install_cmd, - copy_files_params=params) + session = run_installer_with_interaction( + vm, session, test, params, run_install_cmd, copy_files_params=params + ) win_installer_test(session, test, params) check_gagent_version(session, test, gagent_pkg_info_cmd, expected_gagent_version) driver_check(session, test, params) - 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') + error_context.context( + "Run virtio-win-guest-tools.exe uninstall test", test.log.info + ) + vm.send_key("meta_l-d") time.sleep(30) - - if uninstall_method == "msi": - run_uninstall_cmd = utils_misc.set_winutils_letter( - session, 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: - session = run_installer_with_interaction(vm, session, - test, params, - run_uninstall_cmd) - 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) - - error_context.context("Check if all drivers are uninstalled.", - test.log.info) - uninstalled_device = [] - device_name_list = ['VirtIO RNG Device', 'VirtIO Serial Driver', - 'VirtIO Balloon Driver', 'QEMU PVPanic Device', - 'VirtIO Input Driver', - 'Red Hat VirtIO Ethernet Adapter', - 'VirtIO FS Device', 'QEMU FwCfg Device'] - # viostor and vioscsi drivers can not uninstalled by installer - for device_name in device_name_list: - chk_cmd = params["vio_driver_chk_cmd"] % device_name[0:30] - output = session.cmd_output(chk_cmd).strip() - inf_name = re.findall(r"\.inf", output, re.I) - if inf_name: - uninstalled_device.append(device_name) - if uninstalled_device: - test.fail("%s uninstall failed" % uninstalled_device) - - error_context.context("Check qemu-ga service.", test.log.info) - gagent_status_cmd = 'sc query qemu-ga |findstr "RUNNING" ' - status = session.cmd_status(gagent_status_cmd) - if status == 0: - test.fail("qemu-ga service still running after uninstall") + session = run_installer_with_interaction( + vm, session, test, params, run_uninstall_cmd + ) + 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) + error_context.context("Check if all drivers are uninstalled.", test.log.info) + uninstalled_device = [] + device_name_list = [ + "VirtIO RNG Device", + "VirtIO Serial Driver", + "VirtIO Balloon Driver", + "QEMU PVPanic Device", + "VirtIO Input Driver", + "Red Hat VirtIO Ethernet Adapter", + "VirtIO FS Device", + "QEMU FwCfg Device", + ] + # viostor and vioscsi drivers can not be uninstalled by the installer + for device_name in device_name_list: + chk_cmd = params["vio_driver_chk_cmd"] % device_name[0:30] + output = session.cmd_output(chk_cmd).strip() + inf_name = re.findall(r"\.inf", output, re.I) + if inf_name: + uninstalled_device.append(device_name) + if uninstalled_device: + test.fail("%s uninstall failed" % uninstalled_device) + error_context.context("Check qemu-ga service.", test.log.info) + gagent_status_cmd = 'sc query qemu-ga |findstr "RUNNING" ' + status = session.cmd_status(gagent_status_cmd) + if status == 0: + test.fail("qemu-ga service still running after uninstall") session.close()