diff --git a/qemu/tests/cfg/in_place_upgrade.cfg b/qemu/tests/cfg/in_place_upgrade.cfg index 0e51280517..ad5ffdb262 100644 --- a/qemu/tests/cfg/in_place_upgrade.cfg +++ b/qemu/tests/cfg/in_place_upgrade.cfg @@ -63,7 +63,12 @@ # com_ins_leapp = "yum install leapp-upgrade" - upstream_install: com_install = "no" + com_ins_leapp_9 = "dnf install leapp-upgrade-el9toel10 -y" variants: + - without_rhsm: + rhsm_type = "no_rhsm" + - with_rhsm: + rhsm_type = "rhsm" - without_rhsm_rhel8_to_rhel9: rhsm_type = "no_rhsm" pre_upgrade_no_rhsm = "leapp preupgrade --debug --no-rhsm" diff --git a/qemu/tests/in_place_upgrade.py b/qemu/tests/in_place_upgrade.py index df7271d8f2..8edcbffd3f 100644 --- a/qemu/tests/in_place_upgrade.py +++ b/qemu/tests/in_place_upgrade.py @@ -1,11 +1,14 @@ import logging -from avocado.utils import process -from virttest import data_dir, error_context, storage +from virttest import data_dir +from virttest import error_context +from virttest import storage +from avocado.utils import process from provider.in_place_upgrade_base import IpuTest -LOG_JOB = logging.getLogger("avocado.test") + +LOG_JOB = logging.getLogger('avocado.test') @error_context.context_aware @@ -44,7 +47,8 @@ def run(test, params, env): pre_release = params.get("pre_release") release_chk = params.get("release_check") if pre_release not in upgrade_test.run_guest_cmd(release_chk): - test.cancel("your image is not for rhel 8 product, please check") + test.cancel("your image is not for rhel %s, please check" + % pre_release) post_release = params.get("post_release") # create an assistant user upgrade_test.create_ipuser(test) @@ -62,7 +66,10 @@ def run(test, params, env): # this parameter should contain the repo files, # by which you can upgrade old system to the newer version # before you really do in place upgade - old_custom_repo = params.get("old_custom_internal_repo") + if pre_release == "release 9": + old_custom_repo = params.get("old_custom_internal_repo_9") + else: + old_custom_repo = params.get("old_custom_internal_repo") if params.get_boolean("com_install"): upgrade_test.run_guest_cmd(params.get("com_ins_leapp")) upgrade_test.run_guest_cmd(params.get("prepare_env")) @@ -93,9 +100,8 @@ def run(test, params, env): ipu_timeout = int(params.get("ipu_after_timeout")) usr = params.get("user_assistant") passwd = params.get("user_assistant_pw") - upgrade_test.session = vm.wait_for_login( - timeout=ipu_timeout, username=usr, password=passwd - ) + upgrade_test.session = vm.wait_for_login(timeout=ipu_timeout, + username=usr, password=passwd) # restore settings in the guest upgrade_test.post_upgrade_restore(test) # post checking @@ -103,12 +109,9 @@ def run(test, params, env): post_rhel_ver = upgrade_test.run_guest_cmd(check_rhel_ver) vm.verify_kernel_crash() if params.get("device_cio_free_check_cmd"): - cio_status = str( - upgrade_test.session.cmd_status_output( - params.get("device_cio_free_check_cmd") - ) - ) - if "inactive" in cio_status: + cio_status = str(upgrade_test.session.cmd_status_output( + params.get("device_cio_free_check_cmd"))) + if 'inactive' in cio_status: test.fail("device_cio_free is not enabled after upgrading") finally: vm.graceful_shutdown(timeout=300) @@ -118,6 +121,7 @@ def run(test, params, env): image_path = params.get("images_base_dir", data_dir.get_data_dir()) old_name = storage.get_image_filename(image_params, image_path) upgraded_name = old_name.replace(pre_rhel_ver, post_rhel_ver) - process.run(params.get("image_clone_command") % (old_name, upgraded_name)) + process.run(params.get("image_clone_command") % + (old_name, upgraded_name)) except Exception as error: - test.log.warning("Failed to rename upgraded image:%s", str(error)) + test.log.warning("Failed to rename upgraded image:%s" % str(error))