From 415c0fcbcada9076f3f78316d342df18fd73f812 Mon Sep 17 00:00:00 2001 From: Miriam Deng Date: Tue, 24 Oct 2023 14:43:14 -0400 Subject: [PATCH] SLOF:Add package info of SLOF for ppc Signed-off-by: Miriam Deng --- virttest/env_process.py | 12 ++++++++++++ virttest/shared/cfg/base.cfg | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/virttest/env_process.py b/virttest/env_process.py index 64089f6ab6d..0d88e51f71c 100644 --- a/virttest/env_process.py +++ b/virttest/env_process.py @@ -1250,6 +1250,18 @@ def preprocess(test, params, env): test.cancel("Got host qemu version:%s, which is not in %s" % (host_qemu, required_qemu)) + # Get the SLOF version for power pc + slof_ver_cmd = params.get("slof_ver_cmd", "rpm -qa|grep SLOF") + if arch.ARCH in ('ppc64', 'ppc64le'): + if slof_ver_cmd: + try: + slof_version = a_process.run( + slof_ver_cmd, shell=True).stdout_text.strip() + LOG.debug("SLOF version: %s", slof_version) + version_info["firmware_version"] = str(slof_version) + except a_process.CmdError: + slof_version = "Unkown" + # Get the Libvirt version if vm_type == "libvirt": libvirt_ver_cmd = params.get("libvirt_ver_cmd", "libvirtd -V|awk -F' ' '{print $3}'") diff --git a/virttest/shared/cfg/base.cfg b/virttest/shared/cfg/base.cfg index 8ae26fcfae2..5a28c1673e0 100644 --- a/virttest/shared/cfg/base.cfg +++ b/virttest/shared/cfg/base.cfg @@ -752,7 +752,9 @@ netdev_peer_re = "\s{2,}(.*?): .*?\\\s(.*?):" # is a convenient example for RHEL and Fedora. #kvm_ver_cmd = "modinfo kvm | grep vermagic | awk '{print $2}'" #kvm_userspace_ver_cmd = "grep -q el5 /proc/version && rpm -q kvm || rpm -q qemu-kvm" - +# You can set command for checking SLOF on Power PC +# slof_ver_cmd = "rpm -qa|grep SLOF" +# image_clone_command = 'cp --reflink=auto %s %s' image_remove_command = 'rm -rf %s'