CN113722170B - PFR function test method, device, equipment and readable storage medium - Google Patents
PFR function test method, device, equipment and readable storage medium Download PDFInfo
- 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
- firmware
- 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
Links
- 238000010998 test method Methods 0.000 title claims abstract description 16
- 238000012360 testing method Methods 0.000 claims abstract description 260
- 238000000034 method Methods 0.000 claims abstract description 21
- 230000006870 function Effects 0.000 claims description 121
- 238000011084 recovery Methods 0.000 claims description 43
- 238000004590 computer program Methods 0.000 claims description 11
- 238000011990 functional testing Methods 0.000 claims description 10
- 230000007246 mechanism Effects 0.000 claims description 8
- 230000000694 effects Effects 0.000 abstract description 2
- 230000000875 corresponding effect Effects 0.000 description 35
- 238000012544 monitoring process Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 230000001960 triggered effect Effects 0.000 description 5
- 238000012795 verification Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000001914 filtration Methods 0.000 description 2
- 238000001454 recorded image Methods 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 238000013497 data interchange Methods 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 230000000593 degrading effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000012827 research and development Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/26—Functional testing
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy 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
The application discloses a PFR function test method, a device, equipment and a readable storage medium. According to the method and the device, the PFR function test script is preset, the PFR function test script is deployed in the OS of the server, and then 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 specified in the PFR function test script, so that the time consumption of the test is short, errors are not easy to occur, the requirement on testers is low, and the test efficiency and convenience of the PFR function are improved. Correspondingly, the PFR function testing device, the PFR function testing equipment and the readable storage medium also have the technical effects.
Description
Technical Field
The present disclosure 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, platform firmware resiliency) functions in servers, technicians are required to perform the tests manually. However, the PFR has strong functional expertise, and needs to be known about the technical specifications of the PFR by a tester, so that the requirement on the tester is high; and the test content is complex, the manual test is too long and is easy to make mistakes.
Therefore, how to improve the testing efficiency and convenience of PFR functions is a problem that needs to be solved by those skilled in the art.
Disclosure of Invention
In view of the foregoing, it is an object of the present application to provide a PFR function testing method, apparatus, device and readable storage medium, so as to improve the testing efficiency and convenience of PFR functions. The specific scheme is as follows:
in a first aspect, the present application provides a PFR function test method, including:
acquiring a preset PFR function test script;
deploying the PFR function test script to an OS of a server;
and 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.
Preferably, if the PFR test item is a PFR firmware image, testing the PFR firmware image 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.
Preferably, the method further comprises:
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.
Preferably, the PFR firmware image is: CPLD firmware image, BIOS firmware image and/or BMC firmware image.
Preferably, 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;
and testing all commands in the command white list one by one, and recording a test result.
Preferably, the method further comprises:
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.
Preferably, if the PFR test item is a RoT register, testing the RoT register with 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.
In a second aspect, the present application provides 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;
and the test module is used for running the PFR function test script based on the OS if the server is started, testing 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.
In a third aspect, the present application provides an electronic device, including:
a memory for storing a computer program;
a processor for executing the computer program to implement the PFR function test method disclosed previously.
In a fourth aspect, the present application provides a readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the PFR function test method disclosed previously.
According to the scheme, the application provides a PFR function testing method, which comprises the following steps: acquiring a preset PFR function test script; deploying the PFR function test script to an OS of a server; and 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.
Therefore, the PFR function test script is preset, and deployed on the OS of the server, so that after the server is started, the PFR function test script can be operated based on the OS, at least one PFR test item in the server is automatically tested by using the PFR function test script, the 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 specified in the PFR function test script, so that the time consumption of the test is short, errors are not easy to occur, the requirement on testers is low, and the test efficiency and convenience of the PFR function are improved.
Correspondingly, the PFR function testing device, the PFR function testing equipment and the readable storage medium also 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 that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings may be obtained according to the provided drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flow chart of a PFR function test method disclosed in the present application;
FIG. 2 is a flow chart of a method of testing a PFR firmware image disclosed herein;
FIG. 3 is a flow chart of a method of testing I2C bus commands disclosed herein;
FIG. 4 is a flow chart of a method of testing registers disclosed herein;
fig. 5 is a schematic diagram of a PFR functional test apparatus disclosed in the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Currently, for PFR functionality in a server, a technician is required to manually perform the test. However, the PFR has strong functional expertise, and needs to be known about the technical specifications of the PFR by a tester, so that the requirement on the tester is high; and the test content is complex, the manual test is too long and is easy to make mistakes. Therefore, the PFR function testing scheme can improve the testing efficiency and convenience of the PFR function.
In order to ensure the safety and reliability of the server, the server has corresponding measurement and verification actions in each step from the beginning of power-up to the final entering of the operating system, namely, the whole starting-up process is a complete trust chain. The PFR is another powerful brand new security technology in the trust chain. Briefly, this technology is 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 motherboard, but are controlled by a Root of Trust (RoT) first. Namely, the CPLD (Complex Programmable Logic Device ) measures and checks the BIOS and the BMC, and gives control right of the firmware to the server main board after passing, so that the safety of the main board firmware is greatly improved.
Referring to fig. 1, an embodiment of the present application discloses a PFR function test method, including:
s101, acquiring a preset PFR function test script.
S102, deploying the PFR function test script to the OS of the server.
The server OS (operation system) may be any type of operating system, such as: UNIX, linux, windows, etc.
And S103, if the server is started, running a 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.
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 mirror, I2C (Inter-Integrated Circuit, two-wire serial bus) bus commands, or RoT registers. The test items are specifically tested, and a tester can select based on a human-computer interaction interface. In the whole test process, the test contents and test results of each test step are recorded in a test log for subsequent reference.
Wherein the RoT register is: several registers in the hardware trust root for recording PFR related functions, including: registers for recording error information (such as error types, error times, etc.) in the trust chain verification process, registers for recording execution flow and state, etc. When detecting that an error occurs or an upgrade operation is executed, the hardware trust root closes the corresponding firmware, measures and checks the corresponding firmware, further executes the corresponding recovery or upgrade operation, and restarts the corresponding firmware after the operation is executed.
Wherein testing the PFR firmware image may include: 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 regions, active, recovery and Start. Wherein the Active corresponds to a firmware image file. The Recovery is a compressed firmware image file, and also contains some signature data, when the firmware image file corresponding to the Active cannot work normally, the Recovery image is recovered to the Active area by the RoT. When the upgrade operation is performed by the user, the upgrade tool stores the image to be upgraded in the upgrade area, and the upgrade image is copied to the Active area only after the upgrade image is checked by the RoT. These three regions together 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 images corresponding to the above three regions must conform to the format defined by the Intel PFR, the most important part of which is the platform firmware manifest (Platform Firmware Manifest, PFM). The platform firmware list contains specific information of the mirror image, including: version number, layout and address of three areas, I2C monitoring white list, etc.
The I2C monitors a white list, namely I2C bus commands between the CPLD and the BIOS and I2C bus commands between the CPLD and the BMC set by the Intel PFR. When the server runs, the RoT monitors the corresponding I2C bus according to the white list, the command in the white list can be executed, otherwise, the execution is refused, and the corresponding actions such as alarming or restarting the server are triggered. Of course, the white list also records the I2C bus address, so that the CPLD determines the corresponding control interfaces of the BMC and the BIOS based on the I2C bus address.
Therefore, in this embodiment, the PFR function test script is preset, and the PFR function test script is deployed in the OS of the server, so that after the server is started, the PFR function test script is operated based on the OS, so that at least one PFR test item in the server is automatically tested 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, so that 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 specified in the PFR function test script, so that the time consumption of the test is short, errors are not easy to occur, the requirement on testers is low, and the test efficiency and 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, testing the PFR firmware image by using the PFR function test script includes: reading the PFR firmware image by using a PFR function test script, and searching a PFR label (hexadecimal number of a section of four bytes of Intel design) 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 both 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. If the Recovery area and/or the starting area do not exist, or the image version number of the Active area is inconsistent 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 comprises: the offset addresses corresponding to the Active region, the Recovery region and the starting region respectively, the mirror version number of the Active region, the mirror version number of the Recovery region and the like. The mirror version number may specifically include: a major version number, a minor version number, a security version number. When outputting a notification message that the PFR firmware image test fails, the recorded image information includes: the offset addresses corresponding to the Active region, the Recovery region and the starting region respectively, the mirror version number of the Active region, the mirror version number of the Recovery region and the like. The mirror version number may specifically include: a major version number, a minor version number, a security version number. These are recorded one by one in the test log.
In one embodiment, the PFR firmware image is: CPLD firmware image, BIOS firmware image and/or 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 flows can be designed accordingly. The flow shown in fig. 2 specifically includes: aiming at the CPLD firmware image, the BIOS firmware image or the BMC firmware image, traversing the image according to the address of the image so as to quickly search the PFR label. If the PFR label is found, the mirror version number of the Active area is checked, and whether a Recovery area and a starting area exist or not is checked. When there are a Recovery area and a starting area, the mirror version number of the Recovery area is checked. 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 tag is not found, it indicates that the current image does not support the PFR function. If the Recovery area and/or the starting area do not exist, the current mirror image is indicated to support the PFR function, but the PFR function is invalid, namely the test is failed. If the image version number of the Active area is inconsistent with the image version number of the Recovery area, the current image is indicated to support the PFR function, but the PFR function is invalid, namely the test is failed.
Based on the above embodiment, it should be noted that, if the PFR test item is an I2C bus command, testing the I2C bus command by using the PFR function test script includes: reading a configuration file (such as an XML or JSON format configuration file) by using a PFR function test script, and analyzing the configuration file to obtain a command white list (i.e. an I2C monitoring white list) of the I2C bus; the command white list records I2C bus commands between the CPLD and the BIOS and I2C bus commands between the CPLD and the BMC; and testing all commands in the command white list one by one, and recording the test result. The test results for any one command may include: command names, accessed registers, bus addresses, return values, check results for return values, etc., are recorded one-to-one in the test log.
In order for the PFR functional test script to parse the configuration file of XML (Extensible Markup Language, extensible markup language format) or JSON (Java Script Object Notation, a lightweight data interchange format), the DOM API and the cJSON library of Java language may be integrated in the PFR functional test script. The configuration file may be specified by a parameter entered by the user, such as using-x or-j plus a file path.
Referring to fig. 3, for any one command test, it is required to explicitly: what the command is, what the corresponding I2C bus address is, which registers need to be read, which interface returns the test value, etc.
If the I2C bus command between the CPLD and BIOS, recorded in the test command white list, then the test may be performed with reference to the following example:
command function: reading the RoT register to see if the current server supports Intel PFR functions;
the BIOS accesses the I2C bus address of the CPLD: 0x0E;
access RoT register: 0x0A;
return value: 0x30;
the checking mode is as follows: and the return value, when the return value is &0x 20-! =0, and return value &0x 10-! When=0, it means that the current server supports Intel PFR function.
If the I2C bus commands between the CPLD and the BMC recorded in the command whitelist are tested, then the test may be performed with reference to the following example:
command function: reading the RoT register to check the starting state of the current server;
the BIOS accesses the I2C bus address of the CPLD: 0x20;
access RoT register: 0x03;
return value: 0x0D;
the checking mode is as follows: and according to the state Table of the 0x03 register, if the 0x0D is found, determining that the BIOS is started.
In one specific embodiment, the method further comprises: if all the commands in the command white list pass the test, the PFR function test script is utilized to test any command which is not in the command white list 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 commands not in the command whitelist are triggered, the PFR function of the server will be triggered for the protection mechanism of the commands. The command protection mechanism is as follows: when detecting that a command not in the command white list is triggered, the RoT can close the server, check each firmware image in the server, and restart the server after the verification is passed.
Thus testing any commands that are not in the command whitelist can detect if the command protection mechanism can be triggered normally. After restarting the server accordingly, the registers in the RoT are checked, so that it can be determined that the recording passed due to the restart of the server caused by the command not in the white list being sent.
Based on the above embodiment, it should be noted that, if the PFR test item is a RoT register, testing the RoT register by using the PFR function test script includes: after the server is started, the PFR function test script is utilized to collect the starting information recorded by the RoT register, and the explanation definition and the time stamp corresponding to the starting information are marked. These are recorded one by one in the test log.
Wherein, the starting information comprises: the method comprises the steps of relevant information of normal starting of a server, starting relevant information of restoration operation executed by a CPLD after BIOS or BMC starting overtime, restarting information after non-white list command access, starting information after BIOS or BMC or CPLD updating and the like.
The following embodiments provide a test script that can automatically test Intel PFR functions, where the test script covers functions that are: logging, detecting PFR firmware images, detecting I2C bus monitoring whitelists, checking register functions in RoT, and automatically upgrading PFR firmware images. The test script is not particularly limited in the test sequence of these test items.
1. The log recording function is used for recording log aiming at the whole test flow, and can specifically record the parameters, the corresponding test results, the time stamp and other contents of each execution. The specific log information output is redirected to a log folder under other directories that are at the same level as the directory where the test script is located.
2. Referring to fig. 2, the specific steps for 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 or not.
b. And checking the major version number, the minor version number and the security version number corresponding to the Active region in the PFM.
c. It is checked whether there is a region containing the Recovery region and the starting region.
d. And checking whether the major version number, the minor version number and the security version number corresponding to the Recovery region are consistent with the Active region.
e. If all the above checks pass, the Supported PFR is returned, and the offset address, the major version number, the minor version number, and the security version number of each area in detail are printed.
3. Referring to fig. 3, detecting an I2C bus monitoring white list to detect a monitoring and filtering function of an I2C bus includes the following specific steps:
a. and receiving the XML or JSON configuration file, 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 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; timeout or denial of access, this command fails the test. Each piece of test content and test results are recorded in a log.
d. 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: the RoT shuts down the server and verifies the firmware image, and after verification passes, the server is restarted.
e. After restarting the server, the registers in the RoT are checked, and it is determined that the server is restarted due to a command not in the white list being sent, and then the record test is passed.
4. Referring to fig. 4, check register function in RoT: the test script can be executed by a resident server OS, records the starting information recorded by a register when the server is restarted each time, the text description of the corresponding information, the current time stamp and other contents, and stores the contents in a log.
If the server cannot be started successfully, the register repeatedly records the starting information, and the same information is repeatedly covered at the moment, so that no information is lost. Of course, the information recorded by the register may be grasped by other means.
5. Automated upgrades to support BIOS firmware images, BMC firmware images, and CPLD firmware images of the PFR: multiple promotion and degradation tests can be performed, and test results are recorded.
Therefore, the test script provided in this embodiment can improve the efficiency of research and development and testing, and has the following advantages:
the PFR firmware mirror image is automatically analyzed, the detailed information of the mirror image can be conveniently recorded and displayed, a user can conveniently know the currently used firmware information, and the phenomenon that the firmware mirror image does not support the PFR function after the firmware mirror image is updated by misoperation can be prevented. The PFR firmware image is automatically upgraded.
The white list with the automatic I2C bus monitoring and filtering functions can solve the problem that a tester does not know how to test certain commands, can greatly save test time and clearly show the test result of each command.
The state of the register after each restarting is recorded, the executing state of each PFR event can be reserved to the greatest extent, the reason of error occurrence is recorded, and when the server continuously restarts for a plurality of times, the complete event flow can be shown.
The following describes a PFR function test apparatus provided in the embodiments of the present application, and the PFR function test apparatus described below and the PFR function test method described above may be referred to with reference to each other.
Referring to fig. 5, an embodiment of the present application discloses a PFR function test apparatus, including:
the acquiring module 501 is configured to acquire a preset PFR function test script;
a deployment module 502, configured to deploy the PFR functional test script to an OS of the server;
and the test module 503 is configured to run a PFR function test script based on the OS if the server is started, 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 one embodiment, 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 both 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:
if the Recovery area and/or the starting area do not exist, or the image version number of the Active area is inconsistent 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: CPLD firmware image, BIOS firmware image and/or BMC firmware image.
In one embodiment, the test module is specifically configured to:
reading the configuration file by using the PFR function test script, and analyzing the configuration file to obtain a command white list of the I2C bus; the command white list records I2C bus commands between the CPLD and the BIOS and I2C bus commands between the CPLD and the BMC;
and testing all commands 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, the PFR function test script is utilized to test any command which is not in the command white list so as to detect the 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 utilized to collect the starting information recorded by the RoT register, and the explanation definition and the time stamp corresponding to the starting information are marked.
The more specific working process of each module and unit in this embodiment may refer to the corresponding content disclosed in the foregoing embodiment, and will not be described herein.
Therefore, the device for testing the PFR function is provided, the device is automatically completed based on the PFR function test script, and the test content is specified in the PFR function test script, so that the time consumption of the test is short, the error is not easy to occur, the requirement on a tester is low, and the test efficiency and the convenience of the PFR function are improved.
An electronic device provided in the embodiments of the present application is described below, and an electronic device described below and a PFR function testing method and apparatus described above may be referred to with each other.
The embodiment of the application discloses electronic equipment, which comprises:
a memory for storing a computer program;
and a processor for executing the computer program to implement the method disclosed in any of the above embodiments.
The following describes a readable storage medium provided in the embodiments of the present application, and the readable storage medium described below and the PFR function testing method, apparatus and device described above may be referred to with each other.
A readable storage medium storing a computer program which when executed by a processor implements the PFR function test method disclosed in the foregoing embodiments. For specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and no further description is given here.
Reference to "first," "second," "third," "fourth," etc. (if present) herein is used to distinguish similar objects from each other and does not necessarily describe a particular order or sequence. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," 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 or inherent to such process, method, or apparatus.
It should be noted that the description herein of "first," "second," etc. is for descriptive purposes only and is not to be construed as indicating or implying a relative importance or implying an indication of the number of technical features being indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be regarded as not exist and not within the protection scope of the present application.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between 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. The software modules may be disposed 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 principles and embodiments of the present application are described herein with specific examples, the above examples being provided only to assist in understanding the methods of the present application and their core ideas; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.
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.
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) |
Citations (3)
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)
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 |
-
2021
- 2021-08-20 CN CN202110964736.0A patent/CN113722170B/en active Active
Patent Citations (3)
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 |
---|---|---|
US9471474B2 (en) | Cloud deployment infrastructure validation engine | |
CN102736978B (en) | A kind of method and device detecting the installment state of application program | |
KR100868762B1 (en) | Method of error detecting method for embedded sofeware | |
US6502208B1 (en) | Method and system for check stop error handling | |
KR101143679B1 (en) | Automated firmware recovery | |
US20080270840A1 (en) | Device and method for testing embedded software using emulator | |
CN104536875A (en) | IPMI-based method for carrying out automatic restart test on server | |
CN106547653B (en) | Computer system fault state detection method, device and system | |
CN105468482B (en) | Hard disk position identification and fault diagnosis method and server equipment thereof | |
CN103455397A (en) | System self-test method, equipment and system | |
CN110851351A (en) | Deployment environment testing method and device, computer equipment and storage medium | |
CN103678053A (en) | Computer self-check method and system | |
US20060069944A1 (en) | Program, method, and mechanism for taking panic dump | |
CN108572895B (en) | Stability test method for automatically checking software and hardware configuration under Linux | |
CN111274059A (en) | Software exception handling method and device for slave equipment | |
CN116775141A (en) | Abnormality detection method, abnormality detection device, computer device, and storage medium | |
CN113722170B (en) | PFR function test method, device, equipment and readable storage medium | |
CN116302738A (en) | Method, system, equipment and storage medium for testing chip | |
US20120102365A1 (en) | Generating a functional coverage model from a trace | |
CN115756935A (en) | Abnormal fault positioning method, device and equipment of embedded software system | |
CN115827298A (en) | Server startup fault positioning method and device, terminal and storage medium | |
US10216525B1 (en) | Virtual disk carousel | |
CN107766251B (en) | Detection method, system and device for loading image and readable storage medium | |
JP3459898B2 (en) | Fault information tracer for embedded systems | |
CN110096888A (en) | A kind of method and system for accelerating verifying and analysis SMM security risk |
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 |