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

VM_bootloader:provide bootloader's version for each arch #3786

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

MiriamDeng
Copy link
Contributor

ID:1456

@MiriamDeng
Copy link
Contributor Author

MiriamDeng commented Oct 23, 2023

Test results
(2/2) Host_RHEL.m8.u9.product_rhel.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.8.9.0.ppc64le.io-github-autotest-qemu.boot: STARTED
(2/2) Host_RHEL.m8.u9.product_rhel.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.8.9.0.ppc64le.io-github-autotest-qemu.boot: PASS (107.16 s)

[stdlog] 2023-10-23 04:19:11,094 avocado.utils.process INFO | Command 'rpm -qa|grep SLOF' finished with 0 after 1.331755701s
[stdlog] 2023-10-23 04:19:11,095 avocado.virttest.env_process DEBUG| SLOF version: SLOF-20210217-1.module+el8.9.0+18724+20190c23.noarch

@MiriamDeng
Copy link
Contributor Author

@PaulYuuu @maxujun can you help to review this patch ? Thank you !

@@ -1227,6 +1227,17 @@ def preprocess(test, params, env):
LOG.debug("KVM userspace version(qemu): %s", kvm_userspace_version)
version_info["qemu_version"] = str(kvm_userspace_version)

#Get the SLOF version for power pc
Copy link
Contributor

Choose a reason for hiding this comment

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

For what I want is to let it be configurable, I have 2 ideas:

  1. Get the firmware version for each platform:
    • ovmf, aarch64: check edk2 version
    • PC machine: check seabios
    • PPC: check SLOF
    • s390x: I don't know which one
  2. Make all collection versions can be customizable, qemu/kvm/libvirt/swtpm/firmware...

Cc @luckyh @YongxueHong

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 all,
I listed the build info for all arches and feel free to let me know if there's any missing.
1.
aarch64: edk2
x86_64: both seabios and edk2
s390x: need to confirm with bfu
2.
swtpm for all arches.

try:
slof_version = a_process.run(
slof_ver_cmd, shell=True).stdout_text.strip()
LOG.debug("SLOF version: %s", slof_version)
Copy link
Contributor

Choose a reason for hiding this comment

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

Save to version_info["firmware_version"]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thanks.

@MiriamDeng MiriamDeng force-pushed the add_slof_info branch 5 times, most recently from 99244b5 to 415c0fc Compare October 24, 2023 07:44
@maxujun
Copy link
Contributor

maxujun commented Oct 31, 2023

LGTM for power side.

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is not a good way to classify them as firmware_version since the firmware concept is a bit general.
As we know, the firmware includes lots kinds of devices, like GPU, sound card, RAID controller card, and so on. It's hard to represent all the kinds of firmware with the firmware_version which looks general.
I would like to add the keyword slof, like firmware_slof_version or just slof_version .
Please let me know your opinions. @PaulYuuu @MiriamDeng
Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer firmware_version to be an entry. And introduce a parameter to choose which firmware needs to be checked. But as I mentioned above, if we support custom components, we don't need a common name, can use the component name directly.

components_ver_check = qemu libvirt
qemu_ver_cmd = 
libvirt_ver_cmd = 
ppc64le:
    components_ver_check += " slof"
    slof_ver_cmd = 
aarch64, q35:
    components_ver_check += " edk2"
    edk2_ver_cmd = 
for component in params.objects('components_ver_check'):
    cmd = params.get(f'{component}_ver_cmd')
    ver_info = process.getoutput(cmd)
    LOG.debug(f"{component} version: {ver_info}")
    version_info[f"{component}_version"] = ver_info

@PaulYuuu
Copy link
Contributor

PaulYuuu commented Dec 7, 2023

After a short offline discussion with @YongxueHong, we think can only collect the boot firmware for each platform on this PR. A possible name may be qemu_bios_version? As SLOF/edk2/seabios is used to boot up a VM.

In short, in py file, log and save qemu_bios_version, in cfg:

default_bios:
    x86, i386:
        qemu_bios_ver_cmd = 
	aarch64:
        qemu_bios_ver_cmd = 
	ppc64le, ppc64:
        qemu_bios_ver_cmd = 
	s390x, s390:
        qemu_bios_ver_cmd = 
ovmf:
	qemu_bios_ver_cmd = 

What do you think @luckyh @MiriamDeng ?

@MiriamDeng
Copy link
Contributor Author

Hi @PaulYuuu
Thanks for the the guideline , will update the patch very soon.
Thank you !

@MiriamDeng MiriamDeng changed the title SLOF:Add package info of SLOF for ppc VM_bootloader:provide bootloader's version for each arch Dec 8, 2023
@MiriamDeng
Copy link
Contributor Author

Test result (without internal cfg)
(1/1) Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.unattended_install.cdrom.extra_cdrom_ks.default_install.aio_threads.q35: STARTED
(1/1) Host_RHEL.m9.u4.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.4.0.x86_64.io-github-autotest-qemu.unattended_install.cdrom.extra_cdrom_ks.default_install.aio_threads.q35: PASS (810.21 s

#
#Notes: please make sure the corresponding firmware before you set this value!
#eg. for x86_64
#bootloader = "rpm -qa|grep ^sea"
Copy link
Contributor

Choose a reason for hiding this comment

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

vm_bootloader_ver_cmd = xxx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, updated.

LOG.debug("vm_bootloader_version: %s", vm_bootloader_ver)
version_info["vm_bootloader_ver"] = str(vm_bootloader_ver)
except a_process.CmdError:
vm_bootloader_ver = "Unkown"
Copy link
Contributor

Choose a reason for hiding this comment

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

Even if the version is "Unknown", it can also be saved in the version_info, like qemu/libvirt doing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, updated

@MiriamDeng
Copy link
Contributor Author

MiriamDeng commented Dec 8, 2023

Also created new patch for internal cfg( id:1241) in gitlab.

@@ -1241,6 +1241,17 @@ def preprocess(test, params, env):
test.cancel("Got host qemu version:%s, which is not in %s" %
(host_qemu, required_qemu))

# Get the version of bootloader
vm_bootloader_cmd = params.get("vm_bootloader", "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
vm_bootloader_cmd = params.get("vm_bootloader", "")
vm_bootloader_cmd = params.get("vm_bootloader_ver_cmd", "")

except a_process.CmdError:
vm_bootloader_ver = "Unkown"
version_info["vm_bootloader_ver"] = str(vm_bootloader_ver)
LOG.debug("vm_bootloader_version: %s", vm_bootloader_ver)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
LOG.debug("vm_bootloader_version: %s", vm_bootloader_ver)
LOG.debug("VM bootloader version: %s", vm_bootloader_ver)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated,thanks !

vm_bootloader_cmd, shell=True).stdout_text.strip()
except a_process.CmdError:
vm_bootloader_ver = "Unkown"
version_info["vm_bootloader_ver"] = str(vm_bootloader_ver)
Copy link
Contributor

Choose a reason for hiding this comment

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

vm_bootloader_version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thanks

@MiriamDeng
Copy link
Contributor Author

MiriamDeng commented Dec 14, 2023

Test results without internal cfg
(1/3) Host_RHEL.m8.u9.product_rhel.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.xxx.x86_64.io-github-autotest-qemu.unattended_install.cdrom.extra_cdrom_ks.default_install.aio_threads.q35: STARTED
(1/3) Host_RHEL.m8.u9.product_rhel.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.xxx.x86_64.io-github-autotest-qemu.unattended_install.cdrom.extra_cdrom_ks.default_install.aio_threads.q35: PASS (967.83 s)

@@ -1244,6 +1244,17 @@ def preprocess(test, params, env):
test.cancel("Got host qemu version:%s, which is not in %s" %
(host_qemu, required_qemu))

# Get the version of bootloader
vm_bootloader_cmd = params.get("vm_bootloader_ver_cmd", "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
vm_bootloader_cmd = params.get("vm_bootloader_ver_cmd", "")
vm_bootloader_ver_cmd = params.get("vm_bootloader_ver_cmd", "")

x86_64: seabios and edk2
ppc64, ppc64le: SLOF
aarch64: edk2

Signed-off-by: Miriam Deng <[email protected]>
@YongxueHong YongxueHong merged commit fca87a6 into avocado-framework:master Dec 19, 2023
49 checks passed
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