CN113722170B - PFR function test method, device, equipment and readable storage medium - Google Patents

PFR function test method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN113722170B
CN113722170B CN202110964736.0A CN202110964736A CN113722170B CN 113722170 B CN113722170 B CN 113722170B CN 202110964736 A CN202110964736 A CN 202110964736A CN 113722170 B CN113722170 B CN 113722170B
Authority
CN
China
Prior art keywords
pfr
test
function
mirror
command
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110964736.0A
Other languages
Chinese (zh)
Other versions
CN113722170A (en
Inventor
翟占平
王兵
刘朝辉
高玉亚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202110964736.0A priority Critical patent/CN113722170B/en
Publication of CN113722170A publication Critical patent/CN113722170A/en
Application granted granted Critical
Publication of CN113722170B publication Critical patent/CN113722170B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请公开了一种PFR功能测试方法、装置、设备及可读存储介质。本申请预设了PFR功能测试脚本,将该PFR功能测试脚本部署于服务器的OS,就可以在服务器开机启动后,基于OS运行PFR功能测试脚本,从而利用PFR功能测试脚本自动测试服务器中的至少一个PFR测试项,并实时记录至少一个PFR测试项对应的测试日志,自动对服务器中需要测试的PFR测试项进行测试。该方案基于PFR功能测试脚本自动完成,且测试内容也在PFR功能测试脚本中有指定,因此测试耗时较短且不易出错,对测试人员的要求也较低,提高了PFR功能的测试效率和便捷性。相应地,本申请提供的一种PFR功能测试装置、设备及可读存储介质,也同样具有上述技术效果。

The application discloses a PFR function testing method, device, equipment and a readable storage medium. This application presets the PFR function test script, deploys the PFR function test script to the OS of the server, and after the server starts up, the PFR function test script can be run based on the OS, thereby using the PFR function test script to automatically test at least A PFR test item, and record the test log corresponding to at least one PFR test item in real time, and automatically test the PFR test items that need to be tested in the server. This solution is automatically completed based on the PFR functional test script, and the test content is also specified in the PFR functional test script, so the test takes less time and is less prone to errors, and has lower requirements for testers, which improves the test efficiency and performance of the PFR function. Convenience. Correspondingly, the PFR functional testing device, equipment and readable storage medium provided by the present application also have the above-mentioned technical effects.

Description

一种PFR功能测试方法、装置、设备及可读存储介质A PFR function test method, device, equipment and readable storage medium

技术领域technical field

本申请涉及计算机技术领域,特别涉及一种PFR功能测试方法、装置、设备及可读存储介质。The present application relates to the field of computer technology, in particular to a PFR function testing method, device, equipment and readable storage medium.

背景技术Background technique

目前,针对服务器中的PFR(Platform Firmware Resilience,平台固件弹性)功能,需要技术人员手动进行测试。但是,PFR功能专业性较强,需要测试人员了解PFR的技术规范,因此对测试人员的要求较高;且测试内容比较繁琐,手动测试耗时太长且容易出错。At present, for the PFR (Platform Firmware Resilience, Platform Firmware Resilience) function in the server, technical personnel need to manually test. However, the PFR function is highly specialized and requires testers to understand the technical specifications of PFR, so the requirements for testers are relatively high; and the test content is relatively cumbersome, and manual testing takes too long and is prone to errors.

因此,如何提高PFR功能的测试效率和便捷性,是本领域技术人员需要解决的问题。Therefore, how to improve the test efficiency and convenience of the PFR function is a problem to be solved by those skilled in the art.

发明内容Contents of the invention

有鉴于此,本申请的目的在于提供一种PFR功能测试方法、装置、设备及可读存储介质,以提高PFR功能的测试效率和便捷性。其具体方案如下:In view of this, the purpose of this application is to provide a PFR function testing method, device, equipment and readable storage medium, so as to improve the testing efficiency and convenience of PFR function. The specific plan is as follows:

第一方面,本申请提供了一种PFR功能测试方法,包括:In the first aspect, the application provides a PFR functional testing method, including:

获取预设的PFR功能测试脚本;Obtain the preset PFR functional test script;

将所述PFR功能测试脚本部署于服务器的OS;Deploying the PFR function test script on the OS of the server;

若所述服务器开机启动,则基于所述OS运行所述PFR功能测试脚本,以利用所述PFR功能测试脚本测试所述服务器中的至少一个PFR测试项,并实时记录所述至少一个PFR测试项对应的测试日志。If the server is powered on, then run the PFR function test script based on the OS to test at least one PFR test item in the server by using the PFR function test script, and record the at least one PFR test item in real time Corresponding test log.

优选地,若所述PFR测试项为PFR固件镜像,则利用所述PFR功能测试脚本测试所述PFR固件镜像,包括:Preferably, if the PFR test item is a PFR firmware image, then utilize the PFR function test script to test the PFR firmware image, including:

利用所述PFR功能测试脚本读取所述PFR固件镜像,并查找所述PFR固件镜像的PFR标签;Utilize the PFR function test script to read the PFR firmware image, and find the PFR label of the PFR firmware image;

若查找到所述PFR标签,则检测所述PFR固件镜像对应的Active区域、Recovery区域和Staging区域;If the PFR label is found, then detect the Active area, Recovery area and Staging area corresponding to the PFR firmware image;

若所述Recovery区域和所述Staging区域均存在,且所述Active区域的镜像版本号与所述Recovery区域的镜像版本号一致,则输出所述PFR固件镜像测试通过的通知消息,并记录所述PFR固件镜像的镜像信息。If the Recovery area and the Staging area all exist, and the image version number of the Active area is consistent with the image version number of the Recovery area, then output the notification message that the PFR firmware image test passes, and record the Image information for the PFR firmware image.

优选地,还包括:Preferably, it also includes:

若所述Recovery区域和/或所述Staging区域不存在,或所述Active区域的镜像版本号与所述Recovery区域的镜像版本号不一致,则输出所述PFR固件镜像测试未通过的通知消息,并记录所述PFR固件镜像的镜像信息。If the Recovery area and/or the Staging area does not exist, or the image version number of the Active area is inconsistent with the image version number of the Recovery area, then output the notification message that the PFR firmware image test fails, and Record the image information of the PFR firmware image.

优选地,所述PFR固件镜像为:CPLD固件镜像、BIOS固件镜像和/或BMC固件镜像。Preferably, the PFR firmware image is: CPLD firmware image, BIOS firmware image and/or BMC firmware image.

优选地,若所述PFR测试项为I2C总线命令,则利用所述PFR功能测试脚本测试所述I2C总线命令,包括:Preferably, if the PFR test item is an I2C bus command, then utilize the PFR function test script to test the I2C bus command, including:

利用PFR功能测试脚本读取配置文件,解析所述配置文件得到I2C总线的命令白名单;所述命令白名单中记录有CPLD与BIOS之间的I2C总线命令、CPLD与BMC之间的I2C总线命令;Utilize the PFR function test script to read the configuration file, analyze the configuration file to obtain the command whitelist of the I2C bus; the I2C bus command between the CPLD and the BIOS, and the I2C bus command between the CPLD and the BMC are recorded in the command whitelist ;

逐一测试所述命令白名单中的各个命令,并记录测试结果。Each command in the command whitelist is tested one by one, and the test result is recorded.

优选地,还包括:Preferably, it also includes:

若所述命令白名单中的各个命令均测试通过,则利用PFR功能测试脚本测试任一个不在所述命令白名单中的命令,以检测PFR功能的命令保护机制。If each command in the command whitelist passes the test, then use the PFR function test script to test any command not in the command whitelist to detect the command protection mechanism of the PFR function.

优选地,若所述PFR测试项为RoT寄存器,则利用所述PFR功能测试脚本测试所述RoT寄存器,包括:Preferably, if the PFR test item is a RoT register, then use the PFR function test script to test the RoT register, including:

在所述服务器开机启动后,利用PFR功能测试脚本收集所述RoT寄存器记录的启动信息,并标注所述启动信息对应的说明释义和时间戳。After the server is powered on, use the PFR function test script to collect the startup information recorded in the RoT register, and mark the explanation and time stamp corresponding to the startup information.

第二方面,本申请提供了一种PFR功能测试装置,包括:In a second aspect, the application provides a PFR functional testing device, comprising:

获取模块,用于获取预设的PFR功能测试脚本;Obtaining a module for obtaining a preset PFR functional test script;

部署模块,用于将所述PFR功能测试脚本部署于服务器的OS;A deployment module, configured to deploy the PFR function test script on the OS of the server;

测试模块,用于若所述服务器开机启动,则基于所述OS运行所述PFR功能测试脚本,以利用所述PFR功能测试脚本测试所述服务器中的至少一个PFR测试项,并实时记录所述至少一个PFR测试项对应的测试日志。A test module, configured to run the PFR function test script based on the OS if the server is powered on, to use the PFR function test script to test at least one PFR test item in the server, and record the Test log corresponding to at least one PFR test item.

第三方面,本申请提供了一种电子设备,包括:In a third aspect, the present application provides an electronic device, including:

存储器,用于存储计算机程序;memory for storing computer programs;

处理器,用于执行所述计算机程序,以实现前述公开的PFR功能测试方法。A processor, configured to execute the computer program, so as to realize the PFR function testing method disclosed above.

第四方面,本申请提供了一种可读存储介质,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现前述公开的PFR功能测试方法。In a fourth aspect, the present application provides a readable storage medium for storing a computer program, wherein when the computer program is executed by a processor, the aforementioned disclosed PFR function testing method is implemented.

通过以上方案可知,本申请提供了一种PFR功能测试方法,包括:获取预设的PFR功能测试脚本;将所述PFR功能测试脚本部署于服务器的OS;若所述服务器开机启动,则基于所述OS运行所述PFR功能测试脚本,以利用所述PFR功能测试脚本测试所述服务器中的至少一个PFR测试项,并实时记录所述至少一个PFR测试项对应的测试日志。It can be seen from the above scheme that the present application provides a PFR function test method, including: obtaining a preset PFR function test script; deploying the PFR function test script on the OS of the server; The OS runs the PFR function test script to use the PFR function test script to test at least one PFR test item in the server, and record the test log corresponding to the at least one PFR test item in real time.

可见,本申请预设了PFR功能测试脚本,将该PFR功能测试脚本部署于服务器的OS,就可以在服务器开机启动后,基于OS运行PFR功能测试脚本,从而利用PFR功能测试脚本自动测试服务器中的至少一个PFR测试项,并实时记录至少一个PFR测试项对应的测试日志,自动对服务器中需要测试的PFR测试项进行测试。该方案基于PFR功能测试脚本自动完成,且测试内容也在PFR功能测试脚本中有指定,因此测试耗时较短且不易出错,对测试人员的要求也较低,提高了PFR功能的测试效率和便捷性。It can be seen that the application presets the PFR function test script, deploys the PFR function test script to the OS of the server, and after the server is started, the PFR function test script can be run based on the OS, thereby using the PFR function test script to automatically test the server. At least one PFR test item, and record the test log corresponding to at least one PFR test item in real time, and automatically test the PFR test item that needs to be tested in the server. This solution is automatically completed based on the PFR functional test script, and the test content is also specified in the PFR functional test script, so the test takes less time and is less prone to errors, and has lower requirements for testers, which improves the test efficiency and performance of the PFR function. Convenience.

相应地,本申请提供的一种PFR功能测试装置、设备及可读存储介质,也同样具有上述技术效果。Correspondingly, the PFR functional testing device, equipment and readable storage medium provided by the present application also have the above-mentioned technical effects.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present application, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.

图1为本申请公开的一种PFR功能测试方法流程图;Fig. 1 is a kind of flow chart of PFR function testing method disclosed in the present application;

图2为本申请公开的一种测试PFR固件镜像的方法流程图;Fig. 2 is a kind of method flowchart of testing PFR firmware image disclosed by the application;

图3为本申请公开的一种测试I2C总线命令的方法流程图;Fig. 3 is a kind of flow chart of the method for testing I2C bus order disclosed by the present application;

图4为本申请公开的一种测试寄存器的方法流程图;FIG. 4 is a flow chart of a method for testing registers disclosed in the present application;

图5为本申请公开的一种PFR功能测试装置示意图。FIG. 5 is a schematic diagram of a PFR function testing device disclosed in the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the application with reference to the drawings in the embodiments of the application. Apparently, the described embodiments are only some of the embodiments of the application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

目前,针对服务器中的PFR功能,需要技术人员手动进行测试。但是,PFR功能专业性较强,需要测试人员了解PFR的技术规范,因此对测试人员的要求较高;且测试内容比较繁琐,手动测试耗时太长且容易出错。为此,本申请提供了一种PFR功能测试方案,能够提高PFR功能的测试效率和便捷性。Currently, technical personnel need to manually test the PFR function in the server. However, the PFR function is highly specialized and requires testers to understand the technical specifications of PFR, so the requirements for testers are relatively high; and the test content is relatively cumbersome, and manual testing takes too long and is prone to errors. For this reason, the present application provides a PFR function test solution, which can improve the test efficiency and convenience of the PFR function.

为了保障服务器自身的安全性和可靠性,服务器从开始上电到最终进入操作系统,每一步都有相应的测量和校验动作,即整个开机过程是一个完整的信任链。其中,PFR即是上述信任链中又一个强力的全新的安全技术。此技术简要地来说,就是在服务器上电后,服务器BIOS(Basic Input Output System,基本输入输出系统)和BMC(BaseboardManagement Controller,基板控制管理器)不直接交由服务器主板控制,而是先由硬件信任根(Root of Trust,RoT)控制。即CPLD(Complex Programmable Logic Device,复杂可编程逻辑器件)对BIOS和BMC进行测量和校验,通过之后才将固件的控制权交给服务器主板,因此大大增加了主板固件的安全性。In order to ensure the security and reliability of the server itself, from the beginning of power-on to the final access to the operating system, each step of the server has corresponding measurement and verification actions, that is, the entire boot process is a complete chain of trust. Among them, PFR is another powerful new security technology in the above trust chain. Briefly speaking, this technology means that after the server is powered on, the server BIOS (Basic Input Output System) and BMC (Baseboard Management Controller, Baseboard Control Manager) are not directly controlled by the server mainboard, but are first controlled by the server motherboard. Hardware Root of Trust (RoT) control. That is, CPLD (Complex Programmable Logic Device, Complex Programmable Logic Device) measures and verifies the BIOS and BMC, and then passes the control of the firmware to the server motherboard, thus greatly increasing the security of the motherboard firmware.

参见图1所示,本申请实施例公开了一种PFR功能测试方法,包括:Referring to Fig. 1, the embodiment of the present application discloses a PFR function test method, including:

S101、获取预设的PFR功能测试脚本。S101. Obtain a preset PFR function test script.

S102、将PFR功能测试脚本部署于服务器的OS。S102. Deploy the PFR function test script to the OS of the server.

其中,服务器的OS(operation system)可以是任意类型的操作系统,如:UNIX、Linux、Windows等。Wherein, the OS (operation system) of the server may be any type of operating system, such as: UNIX, Linux, Windows and so on.

S103、若服务器开机启动,则基于OS运行PFR功能测试脚本,以利用PFR功能测试脚本测试服务器中的至少一个PFR测试项,并实时记录至少一个PFR测试项对应的测试日志。S103. If the server is powered on, run the PFR function test script based on the OS to test at least one PFR test item in the server by using the PFR function test script, and record the test log corresponding to at least one PFR test item in real time.

在本实施例中,PFR功能测试脚本可以针对至少一个PFR测试项进行测试。PFR测试项可以是:PFR固件镜像、I2C(Inter-Integrated Circuit,两线式串行总线)总线命令或RoT寄存器。其中,具体针对哪些测试项进行测试,测试人员可以基于人机交互界面进行选择。在整个测试过程中,各个测试步骤的测试内容和测试结果都会记载在测试日志中,以便后续查阅。In this embodiment, the PFR function test script can test at least one PFR test item. The PFR test item can be: PFR firmware image, I2C (Inter-Integrated Circuit, two-wire serial bus) bus command or RoT register. Among them, for which test items to test, the tester can choose based on the human-computer interaction interface. Throughout the test process, the test content and test results of each test step will be recorded in the test log for subsequent reference.

其中,RoT寄存器即:硬件信任根中的用于记录PFR相关功能的若干寄存器,包括:记录信任链校验过程中的错误信息(如错误种类、错误次数等)的寄存器、记录执行流程及状态的寄存器等。当检测到有错误发生或执行升级操作等事件出现,硬件信任根会将对应的固件关闭,并进行测量和校验,进而执行对应的恢复或升级操作,操作执行完毕后,重新启动对应的固件。Among them, the RoT register is: a number of registers in the hardware root of trust for recording PFR-related functions, including: registers for recording error information (such as error types, error times, etc.) during the verification process of the chain of trust, recording the execution process and status registers, etc. When an error is detected or an upgrade operation is performed, the hardware root of trust will shut down the corresponding firmware, perform measurement and verification, and then perform the corresponding recovery or upgrade operation. After the operation is completed, restart the corresponding firmware .

其中,测试PFR固件镜像可以包括:检测PFR固件镜像的具体内容,对PFR固件镜像进行升级或降级等。Wherein, testing the PFR firmware image may include: detecting specific content of the PFR firmware image, upgrading or downgrading the PFR firmware image, and the like.

PFR固件镜像包括Active,Recovery和Staging三个区域。其中Active对应固件镜像文件。Recovery是压缩后的固件镜像文件,同时还包含了一些签名数据,当Active对应的固件镜像文件无法正常工作时,由RoT将Recovery镜像恢复到Active区域。Staging区域默认为空,当用户进行升级操作时,升级工具将要升级的镜像存放到Staging区域,升级镜像只有在被RoT校验通过之后,才会被复制到Active区域。这三个区域共同组成了一个支持PFR功能的PFR固件镜像。PFR固件镜像可以是CPLD固件镜像、BIOS固件镜像或BMC固件镜像,可以烧录到对应的CPLD芯片、BIOS芯片或BMC芯片中。The PFR firmware image includes Active, Recovery and Staging areas. Among them, Active corresponds to the firmware image file. Recovery is a compressed firmware image file, which also contains some signature data. When the firmware image file corresponding to Active fails to work normally, the RoT restores the Recovery image to the Active area. The Staging area is empty by default. When the user performs an upgrade operation, the upgrade tool stores the image to be upgraded in the Staging area. The upgraded image will only be copied to the Active area after being verified by the RoT. These three areas together form a PFR firmware image that supports PFR functionality. The PFR firmware image can be CPLD firmware image, BIOS firmware image or BMC firmware image, and can be burned into the corresponding CPLD chip, BIOS chip or BMC chip.

以上三个区域对应的镜像都必须要符合Intel PFR定义的格式,其中最重要的部分为平台固件清单(Platform Firmware Manifest,PFM)。平台固件清单中包含了镜像的具体信息,包括:版本号、三个区域的布局及地址、I2C监控白名单等。The images corresponding to the above three areas must conform to the format defined by Intel PFR, the most important part of which is the Platform Firmware Manifest (PFM). The platform firmware list contains the specific information of the image, including: version number, layout and address of the three areas, I2C monitoring white list, etc.

其中,I2C监控白名单即Intel PFR设定的CPLD与BIOS之间的I2C总线命令、CPLD与BMC之间的I2C总线命令。在服务器运行时,RoT将根据白名单监控相应的I2C总线,在白名单中的命令可以执行,否则拒绝执行,并触发相应的告警或重启服务器等动作。当然,白名单还记录有I2C总线地址,以便使CPLD基于I2C总线地址确定BMC和BIOS的相应控制接口。Among them, the I2C monitoring white list is the I2C bus command between the CPLD and the BIOS, and the I2C bus command between the CPLD and the BMC set by Intel PFR. When the server is running, RoT will monitor the corresponding I2C bus according to the white list. The commands in the white list can be executed, otherwise they will refuse to execute, and trigger corresponding alarms or restart the server. Of course, the white list also records the I2C bus address, so that the CPLD can determine the corresponding control interface of the BMC and BIOS based on the I2C bus address.

可见,本实施例预设了PFR功能测试脚本,将该PFR功能测试脚本部署于服务器的OS,就可以在服务器开机启动后,基于OS运行PFR功能测试脚本,从而利用PFR功能测试脚本自动测试服务器中的至少一个PFR测试项,并实时记录至少一个PFR测试项对应的测试日志,自动对服务器中需要测试的PFR测试项进行测试。该方案基于PFR功能测试脚本自动完成,且测试内容也在PFR功能测试脚本中有指定,因此测试耗时较短且不易出错,对测试人员的要求也较低,提高了PFR功能的测试效率和便捷性。It can be seen that the PFR function test script is preset in this embodiment, and the PFR function test script is deployed on the OS of the server. After the server is started, the PFR function test script can be run based on the OS, thereby using the PFR function test script to automatically test the server. At least one PFR test item in the database, and record the test log corresponding to at least one PFR test item in real time, and automatically test the PFR test items that need to be tested in the server. This solution is automatically completed based on the PFR functional test script, and the test content is also specified in the PFR functional test script, so the test takes less time and is less prone to errors, and has lower requirements for testers, which improves the test efficiency and performance of the PFR function. Convenience.

基于上述实施例,需要说明的是,若PFR测试项为PFR固件镜像,则利用PFR功能测试脚本测试PFR固件镜像,包括:利用PFR功能测试脚本读取PFR固件镜像,并查找PFR固件镜像的PFR标签(Intel设计的一段四字节的十六进制数);若查找到PFR标签,则检测PFR固件镜像对应的Active区域、Recovery区域和Staging区域;若Recovery区域和Staging区域均存在,且Active区域的镜像版本号与Recovery区域的镜像版本号一致,则输出PFR固件镜像测试通过的通知消息,并记录PFR固件镜像的镜像信息。若Recovery区域和/或Staging区域不存在,或Active区域的镜像版本号与Recovery区域的镜像版本号不一致,则输出PFR固件镜像测试未通过的通知消息,并记录PFR固件镜像的镜像信息。Based on the foregoing embodiments, it should be noted that if the PFR test item is a PFR firmware image, then utilize the PFR function test script to test the PFR firmware image, including: use the PFR function test script to read the PFR firmware image, and find the PFR of the PFR firmware image Label (a four-byte hexadecimal number designed by Intel); if the PFR label is found, detect the Active area, Recovery area, and Staging area corresponding to the PFR firmware image; if both the Recovery area and the Staging area exist, and the Active If the image version number of the area is the same as the image version number of the Recovery area, the notification message of passing the PFR firmware image test is output, and the image information of the PFR firmware image is recorded. If the Recovery area and/or the Staging area do not exist, or the image version number in the Active area is inconsistent with that in the Recovery area, output a notification message that the PFR firmware image test fails and record the image information of the PFR firmware image.

其中,输出PFR固件镜像测试通过的通知消息时,记录的镜像信息包括:Active区域、Recovery区域和Staging区域分别对应的偏移地址、Active区域的镜像版本号、Recovery区域的镜像版本号等。镜像版本号可以具体包括:主版本号、次版本号、安全版本号。输出PFR固件镜像测试未通过的通知消息时,记录的镜像信息包括:Active区域、Recovery区域和Staging区域分别对应的偏移地址、Active区域的镜像版本号、Recovery区域的镜像版本号等。镜像版本号可以具体包括:主版本号、次版本号、安全版本号。这些都会一一记录在测试日志中。Wherein, when outputting the notification message that the PFR firmware image test passes, the recorded image information includes: the offset addresses corresponding to the Active area, the Recovery area, and the Staging area, the image version number of the Active area, and the image version number of the Recovery area. The image version number may specifically include: a major version number, a minor version number, and a security version number. When the notification message that the PFR firmware image test fails is output, the image information recorded includes: the offset addresses corresponding to the Active area, the Recovery area, and the Staging area, the image version number of the Active area, and the image version number of the Recovery area. The image version number may specifically include: a major version number, a minor version number, and a security version number. These will be recorded one by one in the test log.

在一种具体实施方式中,PFR固件镜像为:CPLD固件镜像、BIOS固件镜像和/或BMC固件镜像。In a specific implementation manner, the PFR firmware image is: CPLD firmware image, BIOS firmware image and/or BMC firmware image.

请参见图2,该过程用于检测PFR固件镜像的具体内容。若需要对PFR固件镜像进行升级或降级,可据此设计其他检测流程。图2所示的流程具体包括:针对CPLD固件镜像、BIOS固件镜像或BMC固件镜像,根据该镜像的地址遍历该镜像,以快速查找PFR标签。若找到PFR标签,则检查Active区域的镜像版本号,检查是否有Recovery区域和Staging区域。在有Recovery区域和Staging区域时,检查Recovery区域的镜像版本号。若Active区域的镜像版本号与Recovery区域的镜像版本号一致,则认为当前镜像测试通过。若没有找到PFR标签,则表明当前镜像不支持PFR功能。若不存在Recovery区域和/或Staging区域,则表明当前镜像支持PFR功能,但PFR功能无效,即测试未通过。若Active区域的镜像版本号与Recovery区域的镜像版本号不一致,则表明当前镜像支持PFR功能,但PFR功能无效,即测试未通过。Please refer to Figure 2, this process is used to detect the specific content of the PFR firmware image. If it is necessary to upgrade or downgrade the PFR firmware image, other detection processes can be designed accordingly. The process shown in FIG. 2 specifically includes: for the CPLD firmware image, BIOS firmware image or BMC firmware image, traverse the image according to the address of the image to quickly find the PFR label. If the PFR label is found, check the image version number in the Active area, and check whether there is a Recovery area and a Staging area. When there is a recovery area and a staging area, check the image version number in the recovery area. If the image version number in the Active area is the same as that in the Recovery area, the current image test is considered to pass. If no PFR label is found, it indicates that the current image does not support the PFR function. If there is no Recovery area and/or Staging area, it indicates that the current image supports the PFR function, but the PFR function is invalid, that is, the test fails. If the version number of the image in the Active area is inconsistent with that in the Recovery area, it indicates that the current image supports the PFR function, but the PFR function is invalid, that is, the test fails.

基于上述实施例,需要说明的是,若PFR测试项为I2C总线命令,则利用PFR功能测试脚本测试I2C总线命令,包括:利用PFR功能测试脚本读取配置文件(如:XML或JSON格式的配置文件),解析配置文件得到I2C总线的命令白名单(即I2C监控白名单);命令白名单中记录有CPLD与BIOS之间的I2C总线命令、CPLD与BMC之间的I2C总线命令;逐一测试命令白名单中的各个命令,并记录测试结果。任一个命令的测试结果都可以包括:命令名称、所访问的寄存器、总线地址、返回值、对返回值的检查结果等,这些都会一一记录在测试日志中。Based on the foregoing embodiments, it should be noted that if the PFR test item is an I2C bus command, then utilizing the PFR function test script to test the I2C bus command includes: utilizing the PFR function test script to read configuration files (such as: configuration in XML or JSON format file), analyze the configuration file to obtain the command whitelist of the I2C bus (i.e. the I2C monitoring whitelist); the command whitelist records the I2C bus command between the CPLD and the BIOS, and the I2C bus command between the CPLD and the BMC; test the commands one by one Each command in the whitelist, and record the test results. The test result of any command can include: command name, accessed register, bus address, return value, check result of the return value, etc., which will be recorded in the test log one by one.

为使PFR功能测试脚本可以对XML(Extensible Markup Language,可扩展标记语言格式)或JSON(Java Script Object Notation,一种轻量级的数据交换格式)的配置文件进行解析,可以在PFR功能测试脚本中集成Java语言的DOM API和cJSON库。配置文件可通过用户输入的参数指定,如使用-x或-j加上文件路径来指定。In order to enable the PFR functional test script to parse XML (Extensible Markup Language, Extensible Markup Language format) or JSON (Java Script Object Notation, a lightweight data exchange format) configuration file, you can Integrate the DOM API and cJSON library of the Java language. The configuration file can be specified by parameters entered by the user, such as using -x or -j plus the file path to specify.

请参见图3,针对任一个命令的测试,都需要明确:命令是什么、对应的I2C总线地址是什么、需要读取哪些寄存器、哪个接口返回测试值等内容。Please refer to Figure 3. For the test of any command, it is necessary to clarify: what is the command, what is the corresponding I2C bus address, which registers need to be read, which interface returns the test value, etc.

若测试命令白名单中记录的、CPLD与BIOS之间的I2C总线命令,那么可参照如下示例进行测试:If you test the I2C bus command between CPLD and BIOS recorded in the command white list, you can refer to the following example for testing:

命令功能:读取RoT寄存器,以查看当前服务器是否支持Intel PFR功能;Command function: read the RoT register to check whether the current server supports Intel PFR function;

BIOS访问CPLD的I2C总线地址:0x0E;BIOS accesses the I2C bus address of CPLD: 0x0E;

访问RoT寄存器:0x0A;Access RoT register: 0x0A;

返回值:0x30;Return value: 0x30;

检查方式:对返回值进行与运算,当返回值&0x20!=0,且返回值&0x10!=0时,表示当前服务器支持Intel PFR功能。Checking method: perform AND operation on the return value, when the return value &0x20! =0, and return value &0x10! =0, it means that the current server supports the Intel PFR function.

若测试命令白名单中记录的、CPLD与BMC之间的I2C总线命令,那么可参照如下示例进行测试:If you want to test the I2C bus command between CPLD and BMC recorded in the command whitelist, you can refer to the following example for testing:

命令功能:读取RoT寄存器,以查看当前服务器的启动状态;Command function: read the RoT register to view the current server startup status;

BIOS访问CPLD的I2C总线地址:0x20;BIOS accesses the I2C bus address of CPLD: 0x20;

访问RoT寄存器:0x03;Access RoT register: 0x03;

返回值:0x0D;Return value: 0x0D;

检查方式:根据0x03寄存器的状态Table,若查找到0x0D,则确定BIOS启动完成。Checking method: According to the state table of the 0x03 register, if 0x0D is found, it is determined that the BIOS startup is complete.

在一种具体实施方式中,还包括:若命令白名单中的各个命令均测试通过,则利用PFR功能测试脚本测试任一个不在命令白名单中的命令,以检测PFR功能的命令保护机制。由于不在命令白名单中的命令不允许被执行,因此若不在命令白名单中的命令被触发,则服务器的PFR功能对于命令的保护机制会被触发。命令保护机制即:检测到不在命令白名单中的命令被触发,RoT会关闭服务器,并校验服务器中的各个固件镜像,校验通过后再重启服务器。In a specific implementation manner, it further includes: if all the commands in the command whitelist pass the test, then using the PFR function test script to test any command not in the command whitelist, so as to detect the command protection mechanism of the PFR function. Since commands not in the command whitelist are not allowed to be executed, if a command not in the command whitelist is triggered, the protection mechanism of the server's PFR function for the command will be triggered. The command protection mechanism is: when a command that is not in the command whitelist is detected to be triggered, RoT will shut down the server, and verify each firmware image in the server, and restart the server after the verification is passed.

因此测试任一个不在命令白名单中的命令,可以检测命令保护机制是否可以被正常触发。据此重启服务器后,检查RoT中的寄存器,从而可确定是由于发送了不在白名单中的命令导致的服务器重启,那么记录通过。Therefore, testing any command that is not in the command whitelist can detect whether the command protection mechanism can be triggered normally. According to this, after restarting the server, check the register in the RoT, so that it can be determined that the server restarted due to sending a command that is not in the whitelist, and the record passes.

基于上述实施例,需要说明的是,若PFR测试项为RoT寄存器,则利用PFR功能测试脚本测试RoT寄存器,包括:在服务器开机启动后,利用PFR功能测试脚本收集RoT寄存器记录的启动信息,并标注启动信息对应的说明释义和时间戳。这些都会一一记录在测试日志中。Based on the foregoing embodiments, it should be noted that if the PFR test item is the RoT register, then utilizing the PFR function test script to test the RoT register includes: after the server is started, using the PFR function test script to collect the startup information recorded by the RoT register, and Label the explanation and timestamp corresponding to the startup information. These will be recorded one by one in the test log.

其中,启动信息包括:服务器正常启动的相关信息、BIOS或BMC启动超时后CPLD执行恢复操作的启动相关信息、非白名单命令访问后的重启信息、升级BIOS或BMC或CPLD后的启动信息等。Among them, the startup information includes: information about the normal startup of the server, information about the startup of the CPLD after the BIOS or BMC startup timeout, restart information after non-whitelist command access, startup information after upgrading the BIOS or BMC or CPLD, etc.

下述实施例提供了一个可以自动化测试Intel PFR功能的测试脚本,该测试脚本涵盖的功能有:日志记录、检测PFR固件镜像、检测I2C总线监控白名单、检查RoT中的寄存器功能、自动化升级PFR固件镜像。该测试脚本对这些测试项的测试顺序没有具体限制。The following embodiments provide a test script that can automatically test the Intel PFR function. The functions covered by the test script include: logging, detecting PFR firmware images, detecting I2C bus monitoring whitelists, checking register functions in RoT, and automatically upgrading PFR Firmware image. The test script has no specific restrictions on the order in which these test items are tested.

1、日志记录功能用于针对整个测试流程进行日志记录,可以具体记录每次执行的参数、对应的测试结果、时间戳等内容。具体的日志信息输出重定向到与该测试脚本所在目录同级的其他目录下的log文件夹。1. The log recording function is used to record the entire test process, and can specifically record the parameters of each execution, the corresponding test results, time stamps and other content. The specific log information output is redirected to the log folder in another directory at the same level as the directory where the test script is located.

2、请参见图2,检测PFR固件镜像的具体步骤包括:2. Please refer to Figure 2. The specific steps to detect the PFR firmware image include:

a.读取输入给测试脚本的镜像,查找镜像是否有包含PFM标签。a. Read the image input to the test script to find out whether the image contains the PFM tag.

b.检查PFM中的Active区域对应的主版本号、次版本号、安全版本号。b. Check the major version number, minor version number, and security version number corresponding to the Active area in the PFM.

c.检查是否有包含Recovery区域和Staging区域。c. Check whether there is a Recovery area and a Staging area.

d.检查Recovery区域对应的主版本号、次版本号、安全版本编号是否和Active区域一致。d. Check whether the major version number, minor version number, and security version number corresponding to the Recovery area are consistent with those in the Active area.

e.以上检查都通过,则返回Supported PFR,并打印详细的各个区域的偏移地址、主版本号、次版本号、安全版本号。e. If all the above checks pass, the Supported PFR will be returned, and the detailed offset address, major version number, minor version number, and security version number of each area will be printed.

3、请参见图3,检测I2C总线监控白名单,以检测I2C总线的监控和过滤功能,具体步骤包括:3. Please refer to Figure 3 to detect the I2C bus monitoring whitelist to detect the monitoring and filtering functions of the I2C bus. The specific steps include:

a.接收XML或JSON的配置文件,解析出I2C总线监控白名单。a. Receive the XML or JSON configuration file and parse out the I2C bus monitoring whitelist.

b.根据白名单定义的I2C总线地址,申请BMC或主机的控制接口。b. According to the I2C bus address defined in the white list, apply for the control interface of BMC or host.

c.向白名单中定义的地址发送相应的白名单中的某一命令,检查相应的返回状态。若成功返回数据,则表明测试通过;超时或拒绝访问,则表示此条命令测试失败。每一条测试内容和测试结果都会记录到日志中。c. Send a certain command in the corresponding white list to the address defined in the white list, and check the corresponding return status. If the data is successfully returned, it means that the test is passed; if the timeout or access is denied, it means that the test of this command fails. Every test content and test result will be recorded in the log.

d.逐一测试白名单中的各个命令,如果白名单测试通过,则尝试发送一条不在白名单的命令,以触发PFR的命令保护机制,即:RoT关闭服务器,并校验固件镜像,校验通过后再重启服务器。d. Test each command in the white list one by one. If the white list test passes, try to send a command that is not in the white list to trigger the PFR command protection mechanism, that is: RoT shuts down the server, and verifies the firmware image, and the verification passes Then restart the server.

e.重启服务器后,检查RoT中的寄存器,确定是由于发送了不在白名单中的命令导致的服务器重启,那么记录测试通过。e. After restarting the server, check the register in the RoT to confirm that the server restarted due to sending a command that is not in the whitelist, then the record test is passed.

4、请参见图4,检查RoT中的寄存器功能:测试脚本可以常驻服务器OS执行,记录每次服务器重新启动时寄存器记录的启动信息、相应信息的文字说明、当前时间戳等内容,保存到日志中。4. Please refer to Figure 4 to check the function of the register in the RoT: the test script can be executed on the resident server OS, and record the startup information recorded by the register each time the server restarts, the text description of the corresponding information, the current time stamp, etc., and save it to in the log.

若服务器一直无法成功启动,那么寄存器会重复覆盖式记录启动信息,此时是同一信息的重复覆盖,因此不会有信息丢失。当然,可以通过其他手段抓取寄存器记录的信息。If the server has been unable to start successfully, the register will repeatedly overwrite and record the startup information. At this time, the same information is overwritten repeatedly, so no information will be lost. Of course, the information recorded in the register can be captured by other means.

5、自动化升级支持PFR的BIOS固件镜像、BMC固件镜像和CPLD固件镜像:可以进行多次升降级测试,并记录测试结果。5. Automatic upgrade supports PFR's BIOS firmware image, BMC firmware image and CPLD firmware image: multiple upgrade and upgrade tests can be performed, and the test results can be recorded.

可见,本实施例提供的测试脚本能够提高研发和测试的效率,具有如下优点:It can be seen that the test script provided in this embodiment can improve the efficiency of research and development and testing, and has the following advantages:

自动化解析PFR固件镜像,可以很方便记录并展示镜像的详细信息,方便用户了解当前所使用的固件信息,也可以防止误操作刷新固件镜像后导致固件镜像不支持PFR功能。自动升级PFR固件镜像。Automatic analysis of the PFR firmware image can easily record and display the detailed information of the image, which is convenient for users to understand the current firmware information, and can also prevent the firmware image from not supporting the PFR function after refreshing the firmware image by mistake. Automatically upgrade the PFR firmware image.

自动化测试I2C总线监控和过滤功能的白名单,可以解决测试人员不知道如何测试某些命令,也可以极大的节省测试时间,清晰的展示出每条命令的测试结果。Automated testing the whitelist of I2C bus monitoring and filtering functions can solve the problem that testers do not know how to test certain commands, and can also greatly save test time and clearly display the test results of each command.

记录每次重启后寄存器的状态,可以最大程度上保留每次PFR事件执行的状况,记录错误发生的原因,当服务器连续发生多次重启时,可以展现出完整的事件流程。Recording the state of the register after each restart can preserve the execution status of each PFR event to the greatest extent, record the cause of the error, and show a complete event flow when the server restarts multiple times in a row.

下面对本申请实施例提供的一种PFR功能测试装置进行介绍,下文描述的一种PFR功能测试装置与上文描述的一种PFR功能测试方法可以相互参照。A PFR functional testing device provided in the embodiment of the present application is introduced below, and a PFR functional testing device described below and a PFR functional testing method described above may be referred to each other.

参见图5所示,本申请实施例公开了一种PFR功能测试装置,包括:Referring to Figure 5, the embodiment of the present application discloses a PFR functional testing device, including:

获取模块501,用于获取预设的PFR功能测试脚本;An acquisition module 501, configured to acquire a preset PFR function test script;

部署模块502,用于将PFR功能测试脚本部署于服务器的OS;Deployment module 502, for deploying the PFR functional test script to the OS of the server;

测试模块503,用于若服务器开机启动,则基于OS运行PFR功能测试脚本,以利用PFR功能测试脚本测试服务器中的至少一个PFR测试项,并实时记录至少一个PFR测试项对应的测试日志。The test module 503 is configured to run the PFR function test script based on the OS if the server is powered on, so as to use the PFR function test script to test at least one PFR test item in the server, and record the test log corresponding to at least one PFR test item in real time.

在一种具体实施方式中,测试模块具体用于:In a specific implementation manner, the test module is specifically used for:

利用PFR功能测试脚本读取PFR固件镜像,并查找PFR固件镜像的PFR标签;Use the PFR function test script to read the PFR firmware image and find the PFR label of the PFR firmware image;

若查找到PFR标签,则检测PFR固件镜像对应的Active区域、Recovery区域和Staging区域;If the PFR label is found, detect the Active area, Recovery area, and Staging area corresponding to the PFR firmware image;

若Recovery区域和Staging区域均存在,且Active区域的镜像版本号与Recovery区域的镜像版本号一致,则输出PFR固件镜像测试通过的通知消息,并记录PFR固件镜像的镜像信息。If both the Recovery area and the Staging area exist, and the image version number in the Active area is the same as that in the Recovery area, output a notification message that the PFR firmware image test passed and record the image information of the PFR firmware image.

在一种具体实施方式中,测试模块还用于:In a specific embodiment, the test module is also used for:

若Recovery区域和/或Staging区域不存在,或Active区域的镜像版本号与Recovery区域的镜像版本号不一致,则输出PFR固件镜像测试未通过的通知消息,并记录PFR固件镜像的镜像信息。If the Recovery area and/or the Staging area do not exist, or the image version number in the Active area is inconsistent with that in the Recovery area, output a notification message that the PFR firmware image test fails and record the image information of the PFR firmware image.

在一种具体实施方式中,PFR固件镜像为:CPLD固件镜像、BIOS固件镜像和/或BMC固件镜像。In a specific implementation manner, the PFR firmware image is: CPLD firmware image, BIOS firmware image and/or BMC firmware image.

在一种具体实施方式中,测试模块具体用于:In a specific implementation manner, the test module is specifically used for:

利用PFR功能测试脚本读取配置文件,解析配置文件得到I2C总线的命令白名单;命令白名单中记录有CPLD与BIOS之间的I2C总线命令、CPLD与BMC之间的I2C总线命令;Use the PFR function test script to read the configuration file, analyze the configuration file to obtain the command whitelist of the I2C bus; the command whitelist records the I2C bus commands between CPLD and BIOS, and the I2C bus commands between CPLD and BMC;

逐一测试命令白名单中的各个命令,并记录测试结果。Test each command in the command whitelist one by one, and record the test results.

在一种具体实施方式中,测试模块还用于:In a specific embodiment, the test module is also used for:

若命令白名单中的各个命令均测试通过,则利用PFR功能测试脚本测试任一个不在命令白名单中的命令,以检测PFR功能的命令保护机制。If all the commands in the command whitelist pass the test, use the PFR function test script to test any command not in the command whitelist to detect the command protection mechanism of the PFR function.

在一种具体实施方式中,测试模块具体用于:In a specific implementation manner, the test module is specifically used for:

在服务器开机启动后,利用PFR功能测试脚本收集RoT寄存器记录的启动信息,并标注启动信息对应的说明释义和时间戳。After the server is started, use the PFR function test script to collect the startup information recorded by the RoT register, and mark the explanation and time stamp corresponding to the startup information.

其中,关于本实施例中各个模块、单元更加具体的工作过程可以参考前述实施例中公开的相应内容,在此不再进行赘述。For the more specific working process of each module and unit in this embodiment, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details are not repeated here.

可见,本实施例提供了一种PFR功能测试装置,该装置基于PFR功能测试脚本自动完成,且测试内容也在PFR功能测试脚本中有指定,因此测试耗时较短且不易出错,对测试人员的要求也较低,提高了PFR功能的测试效率和便捷性。Visible, present embodiment provides a kind of PFR function test device, and this device is based on PFR function test script to complete automatically, and test content also has designation in PFR function test script, so test time-consuming is shorter and error-prone, to the tester The requirements are also lower, which improves the test efficiency and convenience of the PFR function.

下面对本申请实施例提供的一种电子设备进行介绍,下文描述的一种电子设备与上文描述的一种PFR功能测试方法及装置可以相互参照。An electronic device provided by an embodiment of the present application is introduced below, and the electronic device described below and the PFR function testing method and device described above may refer to each other.

本申请实施例公开了一种电子设备,包括:The embodiment of this application discloses an electronic device, including:

存储器,用于保存计算机程序;memory for storing computer programs;

处理器,用于执行所述计算机程序,以实现上述任意实施例公开的方法。A processor, configured to execute the computer program, so as to implement the method disclosed in any of the above embodiments.

下面对本申请实施例提供的一种可读存储介质进行介绍,下文描述的一种可读存储介质与上文描述的一种PFR功能测试方法、装置及设备可以相互参照。A readable storage medium provided by the embodiment of the present application is introduced below. The readable storage medium described below and the PFR function test method, device, and equipment described above can be referred to each other.

一种可读存储介质,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现前述实施例公开的PFR功能测试方法。关于该方法的具体步骤可以参考前述实施例中公开的相应内容,在此不再进行赘述。A readable storage medium for storing a computer program, wherein the computer program implements the PFR function testing method disclosed in the foregoing embodiments when executed by a processor. Regarding the specific steps of the method, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details are not repeated here.

本申请涉及的“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法或设备固有的其它步骤或单元。"First", "second", "third", "fourth" and the like referred to in the present application, if any, are used to distinguish similar objects and not necessarily to describe a specific order or sequence. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, e.g. a process, method or apparatus comprising a series of steps or elements is not necessarily limited to those steps or elements explicitly listed , but may include other steps or elements not explicitly listed or inherent to the process, method or apparatus.

需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。It should be noted that the descriptions in this application involving "first", "second" and so on are for descriptive purposes only, and should not be understood as indicating or implying their relative importance or implicitly indicating the number of indicated technical features . Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of these features. In addition, the technical solutions of the various embodiments can be combined with each other, but it must be based on the realization of those skilled in the art. When the combination of technical solutions is contradictory or cannot be realized, it should be considered that the combination of technical solutions does not exist , nor within the scope of protection required by the present application.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same or similar parts of each embodiment can be referred to each other.

结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的可读存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known readable storage medium.

本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。In this paper, specific examples are used to illustrate the principles and implementation methods of the application. The descriptions of the above embodiments are only used to help understand the method and core idea of the application; meanwhile, for those of ordinary skill in the art, according to the application There will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be construed as limiting the application.

Claims (7)

1. A method of testing the function of a PFR, comprising:
acquiring a preset PFR function test script;
deploying the PFR function test script to an OS of a server;
if the server is started, running the PFR function test script based on the OS to test at least one PFR test item in the server by using the PFR function test script, and recording a test log corresponding to the at least one PFR test item in real time; the PFR test items are: PFR firmware mirror, I2C bus commands, or RoT registers;
if the PFR test item is a PFR firmware image, testing the PFR firmware image by using the PFR function test script includes:
reading the PFR firmware image by using the PFR function test script, and searching a PFR label of the PFR firmware image;
if the PFR label is found, detecting an Active area, a Recovery area and a starting area corresponding to the PFR firmware image;
if the Recovery area and the starting area exist and the mirror version number of the Active area is consistent with the mirror version number of the Recovery area, outputting a notification message that the PFR firmware mirror test passes and recording the mirror information of the PFR firmware mirror; the mirror information includes: the Active area, the Recovery area and the starting area are respectively corresponding to offset addresses, the mirror version number of the Active area and the mirror version number of the Recovery area;
if the PFR test item is an I2C bus command, testing the I2C bus command using the PFR function test script includes:
reading a configuration file by using a PFR function test script, and analyzing the configuration file to obtain a command white list of an I2C bus; the command white list is recorded with I2C bus commands between the CPLD and the BIOS and I2C bus commands between the CPLD and the BMC;
testing all commands in the command white list one by one, and recording test results;
if the PFR test item is a RoT register, testing the RoT register by using the PFR function test script includes:
and after the server is started, collecting the starting information recorded by the RoT register by using a PFR function test script, and marking explanation definitions and time stamps corresponding to the starting information.
2. The PFR functional test method of claim 1, further comprising:
if the Recovery area and/or the starting area do not exist or the mirror version number of the Active area is inconsistent with the mirror version number of the Recovery area, outputting a notification message that the PFR firmware mirror test fails, and recording the mirror information of the PFR firmware mirror.
3. The PFR functional test method of claim 1, wherein said PFR firmware image is: CPLD firmware image, BIOS firmware image and/or BMC firmware image.
4. The PFR functional test method of claim 1, further comprising:
and if all the commands in the command white list pass the test, testing any command which is not in the command white list by using a PFR function test script so as to detect a command protection mechanism of the PFR function.
5. A PFR functional test apparatus, comprising:
the acquisition module is used for acquiring a preset PFR function test script;
the deployment module is used for deploying the PFR function test script to the OS of the server;
the testing module is used for running the PFR function testing script based on the OS if the server is started, testing at least one PFR testing item in the server by using the PFR function testing script, and recording a testing log corresponding to the at least one PFR testing item in real time; the PFR test items are: PFR firmware mirror, I2C bus commands, or RoT registers;
if the PFR test item is a PFR firmware image, the test module is specifically configured to:
reading the PFR firmware image by using the PFR function test script, and searching a PFR label of the PFR firmware image;
if the PFR label is found, detecting an Active area, a Recovery area and a starting area corresponding to the PFR firmware image;
if the Recovery area and the starting area exist and the mirror version number of the Active area is consistent with the mirror version number of the Recovery area, outputting a notification message that the PFR firmware mirror test passes and recording the mirror information of the PFR firmware mirror; the mirror information includes: the Active area, the Recovery area and the starting area are respectively corresponding to offset addresses, the mirror version number of the Active area and the mirror version number of the Recovery area;
if the PFR test item is an I2C bus command, the test module is specifically configured to:
reading a configuration file by using a PFR function test script, and analyzing the configuration file to obtain a command white list of an I2C bus; the command white list is recorded with I2C bus commands between the CPLD and the BIOS and I2C bus commands between the CPLD and the BMC;
testing all commands in the command white list one by one, and recording test results;
if the PFR test item is a RoT register, the test module is specifically configured to:
and after the server is started, collecting the starting information recorded by the RoT register by using a PFR function test script, and marking explanation definitions and time stamps corresponding to the starting information.
6. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the PFR function test method of any one of claims 1 to 4.
7. A readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the PFR function test method of any one of claims 1 to 4.
CN202110964736.0A 2021-08-20 2021-08-20 PFR function test method, device, equipment and readable storage medium Active CN113722170B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110964736.0A CN113722170B (en) 2021-08-20 2021-08-20 PFR function test method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110964736.0A CN113722170B (en) 2021-08-20 2021-08-20 PFR function test method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN113722170A CN113722170A (en) 2021-11-30
CN113722170B true CN113722170B (en) 2023-08-04

Family

ID=78677243

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110964736.0A Active CN113722170B (en) 2021-08-20 2021-08-20 PFR function test method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113722170B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115357507B (en) * 2022-08-31 2025-06-06 苏州浪潮智能科技有限公司 PFR-based firmware recovery result determination method, device, equipment and medium
CN115757099B (en) * 2022-11-01 2025-06-06 苏州浪潮智能科技有限公司 Automatic testing method and device for platform firmware protection and recovery function

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112256505A (en) * 2020-10-16 2021-01-22 浪潮电子信息产业股份有限公司 Server stability testing method and device and related components
CN112948190A (en) * 2021-02-26 2021-06-11 浪潮电子信息产业股份有限公司 Hardware testing method, system and related device of server
CN113127883A (en) * 2021-04-26 2021-07-16 山东英信计算机技术有限公司 Locking method, device, equipment and medium for platform firmware protection recovery

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9135150B2 (en) * 2013-02-27 2015-09-15 International Business Machines Corporation Automated execution of functional test scripts on a remote system within a unit testing framework

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112256505A (en) * 2020-10-16 2021-01-22 浪潮电子信息产业股份有限公司 Server stability testing method and device and related components
CN112948190A (en) * 2021-02-26 2021-06-11 浪潮电子信息产业股份有限公司 Hardware testing method, system and related device of server
CN113127883A (en) * 2021-04-26 2021-07-16 山东英信计算机技术有限公司 Locking method, device, equipment and medium for platform firmware protection recovery

Also Published As

Publication number Publication date
CN113722170A (en) 2021-11-30

Similar Documents

Publication Publication Date Title
US6681323B1 (en) Method and system for automatically installing an initial software configuration including an operating system module from a library containing at least two operating system modules based on retrieved computer identification data
CN102736978B (en) A kind of method and device detecting the installment state of application program
US6189114B1 (en) Data processing system diagnostics
US20150052402A1 (en) Cloud Deployment Infrastructure Validation Engine
CN113722170B (en) PFR function test method, device, equipment and readable storage medium
CN110727597B (en) A method for troubleshooting invalid code completion use cases based on logs
CN105468482B (en) Hard disk position identification and fault diagnosis method and server equipment thereof
CN102521105A (en) Output method of power on self test information, virtual machine manager and processor
US9542304B1 (en) Automated operating system installation
CN108572895B (en) A Stability Test Method for Automatically Checking Software and Hardware Configuration under Linux
CN113377586A (en) Automatic server detection method and device and storage medium
CN113900693A (en) Firmware upgrading method, device and system, electronic equipment and storage medium
JP2009140155A (en) Test program for application program
CN116775141A (en) Abnormality detection method, abnormality detection device, computer device, and storage medium
CN106802846A (en) A kind of remote test method, apparatus and system
CN113064750A (en) Tracking method, device and medium for BIOS log information
CN115913913B (en) Method and device for locating fault of network card pre-start execution environment function
JP3735484B2 (en) Memory leak detection system, memory leak detection method, and recording medium
CN110096888B (en) A method and system for speeding up verification and analysis of SMM security risks
JP3171325B2 (en) Memory test apparatus and method and recording medium
CN112069009B (en) A method, device and terminal device for performing stress testing in recovery mode
CN109101383A (en) A kind of test method and system of memory detection
US10216525B1 (en) Virtual disk carousel
CN113297029A (en) QNX end operation information management system and method for dual-system intelligent cockpit
CN107506271A (en) A kind of method of testing and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant