CN113722170A - 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
CN113722170A
CN113722170A CN202110964736.0A CN202110964736A CN113722170A CN 113722170 A CN113722170 A CN 113722170A CN 202110964736 A CN202110964736 A CN 202110964736A CN 113722170 A CN113722170 A CN 113722170A
Authority
CN
China
Prior art keywords
pfr
test
function
command
server
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.)
Granted
Application number
CN202110964736.0A
Other languages
Chinese (zh)
Other versions
CN113722170B (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

Images

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

Abstract

The application discloses a PFR function test method, a PFR function test device, PFR function test equipment and a readable storage medium. The PFR function test script is preset, the PFR function test script is deployed in the OS of the server, and the PFR function test script can be operated based on the OS after the server is started, so that at least one PFR test item in the server is automatically tested by the PFR function test script, a test log corresponding to the at least one PFR test item is recorded in real time, and the PFR test item needing to be tested in the server is automatically tested. The scheme is automatically completed based on the PFR function test script, and the test content is also specified in the PFR function test script, so that the test time is short, errors are not easy to occur, the requirement on testers is low, and the test efficiency and the convenience of the PFR function are improved. Correspondingly, the PFR function testing device, the PFR function testing equipment and the readable storage medium have the technical effects.

Description

PFR function test method, device, equipment and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a PFR function testing method, apparatus, device, and readable storage medium.
Background
Currently, for PFR (Platform Firmware Resilience) functions in a server, a technician is required to manually perform the test. However, the PFR has strong functional speciality and requires testers to know the technical specifications of the PFR, so the requirements on the testers are high; and the test content is relatively complicated, the manual test is too long in time consumption and is easy to make mistakes.
Therefore, how to improve the efficiency and convenience of testing the PFR function is a problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, an object of the present application is to provide a method, an apparatus, a device and a readable storage medium for testing PFR functions, so as to improve efficiency and convenience of testing PFR functions. The specific scheme is as follows:
in a first aspect, the present application provides a PFR function testing method, including:
acquiring a preset PFR function test script;
deploying the PFR functional test script to an OS of a server;
and if the server is started, running the PFR function test script based on the OS so as 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.
Preferably, if the PFR test item is a PFR firmware image, testing the PFR firmware image by using the PFR functional test script includes:
reading the PFR firmware image by utilizing 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 Staging area corresponding to the PFR firmware image;
if the Recovery area and the Staging area exist, and the image version number of the Active area is consistent with the image version number of the Recovery area, outputting a notification message that the PFR firmware image test passes, and recording the image information of the PFR firmware image.
Preferably, the method further comprises the following steps:
if the Recovery area and/or the Staging area do not exist, or the image version number of the Active area is not consistent with the image version number of the Recovery area, outputting a notification message that the PFR firmware image test fails, and recording image information of the PFR firmware image.
Preferably, the PFR firmware image is: a CPLD firmware image, a BIOS firmware image, and/or a BMC firmware image.
Preferably, if the PFR test item is an I2C bus command, testing the I2C bus command by using the PFR functional test script includes:
reading a configuration file by utilizing a PFR function test script, and analyzing the configuration file to obtain a command white list of an I2C bus; the command white list records an I2C bus command between the CPLD and the BIOS and an I2C bus command between the CPLD and the BMC;
and testing each command in the command white list one by one, and recording a test result.
Preferably, the method further comprises the following steps:
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.
Preferably, if the PFR test item is a RoT register, testing the RoT register by using the PFR functional test script includes:
and after the server is started, collecting the starting information recorded by the RoT register by utilizing a PFR function test script, and marking the explanation and the timestamp corresponding to the starting information.
In a second aspect, the present application provides a PFR function testing 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;
and the test module is used for running the PFR function test script based on the OS if the server is started, so as to test at least one PFR test item in the server by using the PFR function test script and record a test log corresponding to the at least one PFR test item in real time.
In a third aspect, the present application provides an electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the PFR functional test method disclosed in the foregoing.
In a fourth aspect, the present application provides a readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the PFR functional test method disclosed in the foregoing.
According to the scheme, the PFR function testing method comprises the following steps: acquiring a preset PFR function test script; deploying the PFR functional test script to an OS of a server; and if the server is started, running the PFR function test script based on the OS so as 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.
Therefore, the PFR function test script is preset, the PFR function test script is deployed in the OS of the server, and the PFR function test script can be operated based on the OS after the server is started, so that at least one PFR test item in the server is automatically tested by using the PFR function test script, a test log corresponding to the at least one PFR test item is recorded in real time, and the PFR test item to be tested in the server is automatically tested. The scheme is automatically completed based on the PFR function test script, and the test content is also specified in the PFR function test script, so that the test time is short, errors are not easy to occur, the requirement on testers is low, and the test efficiency and the convenience of the PFR function are improved.
Correspondingly, the PFR function testing device, the PFR function testing equipment and the readable storage medium have the technical effects.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a PFR functional test method disclosed herein;
FIG. 2 is a flow chart of a method of testing a PFR firmware image as disclosed herein;
FIG. 3 is a flow chart of a method of testing I2C bus commands as disclosed herein;
FIG. 4 is a flow chart of a method of testing registers as disclosed herein;
fig. 5 is a schematic diagram of a PFR function testing apparatus disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Currently, a technician is required to manually perform the test for the PFR function in the server. However, the PFR has strong functional speciality and requires testers to know the technical specifications of the PFR, so the requirements on the testers are high; and the test content is relatively complicated, the manual test is too long in time consumption and is easy to make mistakes. Therefore, the PFR function testing scheme is provided, and the efficiency and convenience of testing the PFR function can be improved.
In order to guarantee the safety and reliability of the server, the server has corresponding measurement and verification actions in each step from the beginning of power-on to the final entering of an operating system, namely the whole starting process is a complete trust chain. PFR is another powerful and new security technique in the above trust chain. Briefly, after the server is powered on, the BIOS (Basic Input Output System) and the BMC (Baseboard Management Controller) of the server are not directly controlled by the server motherboard, but are controlled by a Root of Trust (RoT). The CPLD (Complex Programmable Logic Device) measures and verifies the BIOS and the BMC, and the control right of the firmware is given to the server mainboard after the BIOS and the BMC pass, so that the safety of the mainboard firmware is greatly improved.
Referring to fig. 1, an embodiment of the present application discloses a PFR function testing method, including:
s101, obtaining a preset PFR function test script.
S102, deploying the PFR function test script in the OS of the server.
The os (operation system) of the server may be any type of operating system, such as: UNIX, Linux, Windows, etc.
S103, if the server is started, the PFR function test script is operated based on the OS so as to test at least one PFR test item in the server by using the PFR function test script, and a test log corresponding to the at least one PFR test item is recorded in real time.
In this embodiment, the PFR functional test script may test for at least one PFR test item. The PFR test items may be: PFR firmware image, I2C (Inter-Integrated Circuit) bus command, or RoT register. Specifically, the tester can select which test items to test based on the human-computer interaction interface. In the whole testing process, the testing content and the testing result of each testing step are recorded in the testing log for subsequent reference.
Wherein, 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 and the like) in the trust chain checking process, registers for recording execution flows and states and the like. When detecting that an error occurs or an event such as an upgrade operation is executed occurs, the hardware trust root closes the corresponding firmware, performs measurement and verification, further executes corresponding recovery or upgrade operation, and restarts the corresponding firmware after the operation is executed.
Wherein testing the PFR firmware image may include: and detecting the specific content of the PFR firmware image, upgrading or degrading the PFR firmware image and the like.
The PFR firmware image includes three areas, Active, Recovery and Staging. Wherein Active corresponds to the firmware image file. The Recovery is a compressed firmware image file, and also contains some signature data, and when the firmware image file corresponding to the Active cannot work normally, the Recovery image is restored to the Active area by the RoT. The Staging area is default to be empty, when a user carries out upgrading operation, an upgrading tool stores an image to be upgraded into the Staging area, and the upgraded image can be copied into the Active area only after the upgraded image is verified by the RoT. These three areas collectively constitute a PFR firmware image that supports PFR functionality. The PFR firmware image may be a CPLD firmware image, a BIOS firmware image, or a BMC firmware image, and may be burned into a corresponding CPLD chip, BIOS chip, or BMC chip.
The mirror images corresponding to the above three regions must conform to the format defined by Intel PFR, wherein the most important part is Platform Firmware Manifest (PFM). The platform firmware list contains the specific information of the image, including: version number, layout and address of the three regions, I2C monitor white list, etc.
Wherein, I2C monitors the white list, i.e. I2C bus command between CPLD and BIOS and I2C bus command between CPLD and BMC set by Intel PFR. When the server runs, the RoT monitors the corresponding I2C bus according to the white list, and the command in the white list can be executed, otherwise, the execution is refused, and corresponding actions such as warning or restarting the server are triggered. Of course, the white list also records the I2C bus address, so that the CPLD can determine the corresponding control interfaces of the BMC and the BIOS based on the I2C bus address.
It can be seen that, in this embodiment, a PFR function test script is preset, and the PFR function test script is deployed in an OS of a server, so that the PFR function test script can be run based on the OS after the server is started, thereby automatically testing at least one PFR test item in the server by using the PFR function test script, recording a test log corresponding to the at least one PFR test item in real time, and automatically testing the PFR test item to be tested in the server. The scheme is automatically completed based on the PFR function test script, and the test content is also specified in the PFR function test script, so that the test time is short, errors are not easy to occur, the requirement on testers is low, and the test efficiency and the convenience of the PFR function are improved.
Based on the above embodiments, it should be noted that, if the PFR test item is a PFR firmware image, the testing the PFR firmware image by using a PFR function test script includes: reading the PFR firmware image by utilizing a PFR functional test script, and searching a PFR label (a section of hexadecimal number of four bytes designed by Intel) of the PFR firmware image; if the PFR label is found, detecting an Active area, a Recovery area and a Staging area corresponding to the PFR firmware image; and if the Recovery area and the Staging area exist and the image version number of the Active area is consistent with the image version number of the Recovery area, outputting a notification message that the PFR firmware image test passes and recording the image information of the PFR firmware image. And if the Recovery area and/or the stabilizing area do not exist or the image version number of the Active area is not consistent with the image version number of the Recovery area, outputting a notification message that the PFR firmware image test fails, and recording the image information of the PFR firmware image.
When the notification message that the PFR firmware image test passes is output, the recorded image information includes: offset addresses corresponding to the Active area, the Recovery area and the stabilizing area respectively, the image version number of the Active area, the image version number of the Recovery area and the like. The image version number may specifically include: major version number, minor version number, security version number. When a notification message that the PFR firmware image test fails is output, the recorded image information includes: offset addresses corresponding to the Active area, the Recovery area and the stabilizing area respectively, the image version number of the Active area, the image version number of the Recovery area and the like. The image version number may specifically include: major version number, minor version number, security version number. These are all recorded in the test log one by one.
In one embodiment, the PFR firmware image is: a CPLD firmware image, a BIOS firmware image, and/or a BMC firmware image.
Referring to fig. 2, the process is used to detect the details of the PFR firmware image. If the PFR firmware image needs to be upgraded or downgraded, other detection procedures can be designed accordingly. The process shown in fig. 2 specifically includes: and traversing the CPLD firmware image, the BIOS firmware image or the BMC firmware image according to the address of the image so as to quickly search the PFR label. If finding the PFR label, checking the image version number of the Active area, and checking whether a Recovery area and a Staging area exist. When there are a Recovery region and a Staging region, the Recovery region is checked for a mirror version number. And if the image version number of the Active area is consistent with the image version number of the Recovery area, the current image test is considered to pass. If the PFR label is not found, the current mirror image does not support the PFR function. If the Recovery region and/or the Staging region do not exist, it is indicated that the current mirror supports the PFR function, but the PFR function is invalid, i.e. the test fails. If the image version number of the Active area is not consistent with the image version number of the Recovery area, the current image supports the PFR function, but the PFR function is invalid, namely the test is failed.
Based on the above embodiments, it should be noted that, if the PFR test item is the I2C bus command, the testing of the I2C bus command by using the PFR functional test script includes: reading a configuration file (such as a configuration file in an XML or JSON format) by utilizing a PFR function test script, and analyzing the configuration file to obtain a command white list of an I2C bus (namely an I2C monitoring white list); the command white list records an I2C bus command between the CPLD and the BIOS and an I2C bus command between the CPLD and the BMC; and testing each command in the command white list one by one, and recording the test result. The test results of any of the commands may include: the command name, the register accessed, the bus address, the return value, the check result for the return value, and the like are recorded in the test log one by one.
In order to enable the PFR functional test Script to parse a configuration file of XML (Extensible Markup Language) or JSON (Java Script Object notification, a lightweight data exchange format), a DOM API and a cJSON library of Java Language may be integrated in the PFR functional test Script. The configuration file may be specified by a user-entered parameter, such as using-x or-j plus a file path.
Referring to fig. 3, for the test of any command, it is required to be clear: what the command is, what the corresponding I2C bus address is, what registers need to be read, which interface returns a test value, etc.
If the I2C bus command between the CPLD and the BIOS, recorded in the test command white list, then the test may be performed with reference to the following example:
command functions: reading a RoT register to see whether a current server supports an Intel PFR function;
the BIOS accesses the I2C bus address of the CPLD: 0x 0E;
accessing the RoT register: 0x 0A;
and returning a value: 0x 30;
the checking mode comprises the following steps: ANDing the return value when the return value &0x 20! 0 and returns a value &0x 10! When 0, it means that the current server supports the Intel PFR function.
If the test command is a white list of recorded I2C bus commands between CPLD and BMC, the test can be performed with reference to the following example:
command functions: reading the RoT register to check the starting state of the current server;
the BIOS accesses the I2C bus address of the CPLD: 0x 20;
accessing the RoT register: 0x 03;
and returning a value: 0x 0D;
the checking mode comprises the following steps: and if the 0x0D is found according to the state Table of the 0x03 register, determining that the BIOS is started completely.
In a specific embodiment, the method further comprises the following steps: 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. Since commands not in the command white list are not allowed to be executed, if a command not in the command white list is triggered, a mechanism for protecting the command by the PFR function of the server is triggered. The command protection mechanism is: and when detecting that the command which is not in the command white list is triggered, the RoT closes the server, verifies each firmware image in the server, and restarts the server after the verification is passed.
Thus testing any command that is not in the command white list can detect whether the command protection mechanism can be triggered normally. After restarting the server accordingly, the register in the RoT is checked so that it can be determined that the server was restarted due to sending a command that is not in the white list, and the record passes.
Based on the foregoing embodiments, it should be noted that, if the PFR test item is a RoT register, the testing the RoT register by using the PFR function test script includes: after the server is started, the PFR function test script is used for collecting the starting information recorded by the RoT register, and explanation definitions and time stamps corresponding to the starting information are marked. These are all recorded in the test log one by one.
Wherein the start-up information includes: the system comprises related information of normal starting of a server, starting related information of execution of recovery operation of a CPLD after starting timeout of a BIOS or a BMC, restarting information after access of a non-white list command, starting information after upgrading of the BIOS or the BMC or the CPLD and the like.
The following embodiments provide a test script that can automate the testing of Intel PFR functions, which test script covers the functions of: logging, detecting PFR firmware image, detecting I2C bus monitoring white list, checking register function in RoT, and automatically upgrading PFR firmware image. The test script has no particular limitation on the test order of the test items.
1. The logging function is used for logging the whole test process, and can specifically record the parameters executed each time, the corresponding test results, the time stamps and other contents. The specific log information output is redirected to a log folder under other directories at the same level as the directory where the test script is located.
2. Referring to fig. 2, the specific steps of detecting the PFR firmware image include:
a. and reading the mirror image input to the test script and searching whether the mirror image contains the PFM label.
b. And checking a main version number, a minor version number and a safety version number corresponding to the Active area in the PFM.
c. It is checked whether there is a region containing Recovery region and Staging region.
d. And checking whether the main version number, the minor version number and the safety version number corresponding to the Recovery area are consistent with the Active area.
e. If the above checks are passed, the Supported PFR is returned, and the offset address, major version number, minor version number, and security version number of each region are printed in detail.
3. Referring to fig. 3, detecting the monitoring white list of the I2C bus to detect the monitoring and filtering functions of the I2C bus includes the following steps:
a. and receiving the configuration file of XML or JSON, and analyzing an I2C bus monitoring white list.
b. And applying for a control interface of the BMC or the host according to the I2C bus address defined by the white list.
c. And sending a certain command in the corresponding white list to the address defined in the white list, and checking the corresponding return state. If the data is successfully returned, the test is passed; if the command is tested out or the access is denied, the command fails to be tested. Each piece of test content and test results are recorded in a log.
d. And testing each command in the white list one by one, and if the white list test is passed, attempting to send a command which is not in the white list to trigger a command protection mechanism of the PFR, namely: and the RoT closes the server, verifies the firmware image, and restarts the server after the verification is passed.
e. After restarting the server, the register in the RoT is checked to determine that the server restart was due to sending a command that is not in the white list, and the record test passes.
4. Referring to fig. 4, the register function in RoT is examined: the test script can be resident in the server OS for execution, records the start information recorded by the register when the server is restarted, the text description of the corresponding information, the current timestamp and other contents, and stores the contents in the log.
If the server cannot be started successfully all the time, the register records the starting information in a repeated covering mode, and the same information is repeatedly covered at the moment, so that information cannot be lost. Of course, the information recorded by the register may be captured by other means.
5. Automatically upgrading a BIOS firmware image, a BMC firmware image and a CPLD firmware image which support PFR: and the upgrading and downgrading tests can be carried out for multiple times, and the test result is recorded.
Therefore, the test script provided by the embodiment can improve the efficiency of research and development and testing, and has the following advantages:
the PFR firmware image is automatically analyzed, detailed information of the image can be conveniently recorded and displayed, a user can conveniently know the currently used firmware information, and the situation that the PFR function is not supported by the firmware image after the firmware image is refreshed through misoperation can be prevented. The PFR firmware image is automatically upgraded.
The white list of the bus monitoring and filtering function of the automatic test I2C can solve the problem that a tester does not know how to test some commands, greatly save the test time and clearly show the test result of each command.
The state of the register after each restart is recorded, the execution condition of each PFR event can be kept to the maximum extent, the reason of error occurrence is recorded, and when the server is restarted for multiple times continuously, a complete event flow can be shown.
In the following, a PFR function testing apparatus provided in an embodiment of the present application is introduced, and a PFR function testing apparatus described below and a PFR function testing method described above may be referred to each other.
Referring to fig. 5, an embodiment of the present application discloses a PFR function testing apparatus, including:
an obtaining module 501, configured to obtain a preset PFR function test script;
a deployment module 502, configured to deploy the PFR functional test script to the OS of the server;
the testing module 503 is configured to run a PFR function testing script based on the OS if the server is booted, so as to test at least one PFR test item in the server by using the PFR function testing script, and record a testing log corresponding to the at least one PFR test item in real time.
In one embodiment, the test module is specifically configured to:
reading the PFR firmware image by using a 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 Staging area corresponding to the PFR firmware image;
and if the Recovery area and the Staging area exist and the image version number of the Active area is consistent with the image version number of the Recovery area, outputting a notification message that the PFR firmware image test passes and recording the image information of the PFR firmware image.
In one embodiment, the test module is further configured to:
and if the Recovery area and/or the stabilizing area do not exist or the image version number of the Active area is not consistent with the image version number of the Recovery area, outputting a notification message that the PFR firmware image test fails, and recording the image information of the PFR firmware image.
In one embodiment, the PFR firmware image is: a CPLD firmware image, a BIOS firmware image, and/or a BMC firmware image.
In one embodiment, the test module is specifically configured to:
reading the configuration file by utilizing a PFR function test script, and analyzing the configuration file to obtain a command white list of an I2C bus; the command white list records an I2C bus command between the CPLD and the BIOS and an I2C bus command between the CPLD and the BMC;
and testing each command in the command white list one by one, and recording the test result.
In one embodiment, the test module is further configured to:
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.
In one embodiment, the test module is specifically configured to:
after the server is started, the PFR function test script is used for collecting the starting information recorded by the RoT register, and explanation definitions and time stamps corresponding to the starting information are marked.
For more specific working processes of each module and unit in this embodiment, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not described here again.
Therefore, the embodiment provides a PFR function testing device, which is automatically completed based on a PFR function testing script, and the testing content is also specified in the PFR function testing script, so that the testing time is short, errors are not easy to occur, the requirement on testing personnel is low, and the efficiency and convenience of testing the PFR function are improved.
In the following, an electronic device provided by an embodiment of the present application is introduced, and an electronic device described below and a PFR function testing method and apparatus described above may be referred to each other.
The embodiment of the application discloses electronic equipment, includes:
a memory for storing a computer program;
a processor for executing the computer program to implement the method disclosed in any of the above embodiments.
In the following, a readable storage medium provided by an embodiment of the present application is introduced, and a readable storage medium described below and a PFR function testing method, apparatus, and device described above may be referred to each other.
A readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the PFR functional test method disclosed in the foregoing embodiments. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, which are not described herein again.
References in this application to "first," "second," "third," "fourth," etc., if any, are intended to distinguish between similar elements and not necessarily to describe a particular order or sequence. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, or apparatus.
It should be noted that the descriptions in this application referring to "first", "second", etc. are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of readable storage medium known in the art.
The principle and the implementation of the present application are explained herein by applying specific examples, and the above description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A PFR function test method is characterized by comprising the following steps:
acquiring a preset PFR function test script;
deploying the PFR functional test script to an OS of a server;
and if the server is started, running the PFR function test script based on the OS so as 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.
2. The PFR functional test method of claim 1, wherein if the PFR test item is a PFR firmware image, testing the PFR firmware image using the PFR functional test script comprises:
reading the PFR firmware image by utilizing 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 Staging area corresponding to the PFR firmware image;
if the Recovery area and the Staging area exist, and the image version number of the Active area is consistent with the image version number of the Recovery area, outputting a notification message that the PFR firmware image test passes, and recording the image information of the PFR firmware image.
3. The PFR functional test method of claim 2, further comprising:
if the Recovery area and/or the Staging area do not exist, or the image version number of the Active area is not consistent with the image version number of the Recovery area, outputting a notification message that the PFR firmware image test fails, and recording image information of the PFR firmware image.
4. The PFR functional test method of claim 2, wherein said PFR firmware image is: a CPLD firmware image, a BIOS firmware image, and/or a BMC firmware image.
5. The PFR functional test method of claim 1, wherein if the PFR test item is an I2C bus command, testing the I2C bus command using the PFR functional test script comprises:
reading a configuration file by utilizing a PFR function test script, and analyzing the configuration file to obtain a command white list of an I2C bus; the command white list records an I2C bus command between the CPLD and the BIOS and an I2C bus command between the CPLD and the BMC;
and testing each command in the command white list one by one, and recording a test result.
6. The PFR functional test method of claim 5, further comprising:
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.
7. The PFR functional test method of claim 1, wherein if the PFR test item is a RoT register, testing the RoT register using the PFR functional test script, comprises:
and after the server is started, collecting the starting information recorded by the RoT register by utilizing a PFR function test script, and marking the explanation and the timestamp corresponding to the starting information.
8. A PFR function 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;
and the test module is used for running the PFR function test script based on the OS if the server is started, so as to test at least one PFR test item in the server by using the PFR function test script and record a test log corresponding to the at least one PFR test item in real time.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the PFR functional test method of any of claims 1 to 7.
10. A readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the PFR functional test method of any of claims 1 to 7.
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 true CN113722170A (en) 2021-11-30
CN113722170B 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)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140245070A1 (en) * 2013-02-27 2014-08-28 International Business Machines Corporation Automated execution of functional test scripts on a remote system within a unit testing framework
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140245070A1 (en) * 2013-02-27 2014-08-28 International Business Machines Corporation Automated execution of functional test scripts on a remote system within a unit testing framework
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
CN113722170B (en) 2023-08-04

Similar Documents

Publication Publication Date Title
US6629267B1 (en) Method and system for reporting a program failure
US6189114B1 (en) Data processing system diagnostics
WO2017063505A1 (en) Method for detecting hardware fault of server, apparatus thereof, and server
TWI470420B (en) Dubugging method and computer system using the smae
EP1638000A2 (en) Program, method, and mechanism for performing panic memory dump
CN104254840A (en) Memory dump and analysis in a computer system
CN105468482B (en) Hard disk position identification and fault diagnosis method and server equipment thereof
US7404178B2 (en) ROM-embedded debugging of computer
CN110851351A (en) Deployment environment testing method and device, computer equipment and storage medium
CN108572895B (en) Stability test method for automatically checking software and hardware configuration under Linux
CN116775141A (en) Abnormality detection method, abnormality detection device, computer device, and storage medium
US6738778B1 (en) Method and apparatus for monitoring the execution of a program
WO2007086150A1 (en) Memory destruction detection method and device
CN113377586A (en) Automatic server detection method and device and storage medium
CN113722170B (en) PFR function test method, device, equipment and readable storage medium
US8464103B2 (en) Generating a functional coverage model from a trace
JP4558376B2 (en) controller
CN113064750B (en) Tracking method, device and medium for BIOS log information
JP5348120B2 (en) Program, method and mechanism for collecting panic dump
JP3171325B2 (en) Memory test apparatus and method and recording medium
CN114496053A (en) Data anomaly detection method, device and equipment and computer readable storage medium
CN107766251B (en) Detection method, system and device for loading image and readable storage medium
CN113297029A (en) QNX end operation information management system and method for dual-system intelligent cockpit
JP3309792B2 (en) Stack pointer trace device, stack pointer trace method, and recording medium
JP2001331344A (en) Fault information tracing device for integrated system

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