From 34bbeae6dc198b452b7ce02521e41dfd425e4b87 Mon Sep 17 00:00:00 2001 From: Miriam Deng Date: Sun, 29 Sep 2024 14:33:54 +0800 Subject: [PATCH] IPU: Checking virtiofsd's version Signed-off-by: Miriam Deng --- provider/in_place_upgrade_base.py | 19 +++++++++++++++++++ qemu/tests/cfg/in_place_upgrade.cfg | 1 + qemu/tests/in_place_upgrade.py | 2 ++ 3 files changed, 22 insertions(+) diff --git a/provider/in_place_upgrade_base.py b/provider/in_place_upgrade_base.py index 1f6fc0ccac..5775f994a0 100644 --- a/provider/in_place_upgrade_base.py +++ b/provider/in_place_upgrade_base.py @@ -176,3 +176,22 @@ def post_upgrade_restore(self, test): test.fail("Failed to restart sshd: %s" % o) except Exception as error: test.fail("Failed to restore permit: %s" % str(error)) + + def check_version_virtiofsd(self, test): + """ + Check virtiofsd's version + """ + try: + virtiofsd = self.params.get("chk_virtiofsd") + status, actual_fsd = self.session.cmd_status_output(virtiofsd) + post_release = self.params.get("post_release") + if post_release == "release 10": + expected_fsd = "el10" + if post_release == "release 9": + expected_fsd = "el9" + if not re.search(expected_fsd, actual_fsd): + test.fail("Actual result: %s, expected result: %s" + % (actual_fsd, expected_fsd)) + except Exception as error: + test.fail("virtiofsd's version is not expected : %s" + % str(error)) diff --git a/qemu/tests/cfg/in_place_upgrade.cfg b/qemu/tests/cfg/in_place_upgrade.cfg index ae6c9b4304..931a188f82 100644 --- a/qemu/tests/cfg/in_place_upgrade.cfg +++ b/qemu/tests/cfg/in_place_upgrade.cfg @@ -31,6 +31,7 @@ stop_yum_update = "rm -rf /var/run/yum.pid" check_repo_list = "yum repolist enabled" check_rhel_ver = "cut -f1-2 -d. /etc/redhat-release | sed 's/[^0-9]//g'" + chk_virtiofsd = "rpm -qa | grep virtiofsd" s390,s390x: # no need to check in host, and we don't support RHEL.7.9 as the # host on s390x diff --git a/qemu/tests/in_place_upgrade.py b/qemu/tests/in_place_upgrade.py index e61dc19f12..f041f650a0 100644 --- a/qemu/tests/in_place_upgrade.py +++ b/qemu/tests/in_place_upgrade.py @@ -103,6 +103,8 @@ def run(test, params, env): upgrade_test.post_upgrade_restore(test) # post checking upgrade_test.post_upgrade_check(test, post_release) + # check virtiofsd's version + upgrade_test.check_version_virtiofsd(test) post_rhel_ver = upgrade_test.run_guest_cmd(check_rhel_ver) vm.verify_kernel_crash() if params.get("device_cio_free_check_cmd"):