Automatic testing method and device for platform firmware protection and recovery function
By automatically configuring the test environment and performing firmware refresh operations, the problems of cumbersome testing steps and large labor investment in the existing technology are solved, and the platform's firmware protection recovery function is achieved quickly and accurately.
Patent Information
- Application Number
- CN202211357156.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-01
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2042-11-01
AI Technical Summary
In the prior art, testing of the platform firmware protection recovery function requires manual configuration of the test environment and execution of test steps, resulting in cumbersome testing steps, long time consumption, and large labor investment.
Through the automated test process, we obtain the test parameter document information automatically generated by the test system, configure the test environment, receive the firmware files to be refreshed, perform the firmware refresh operation and restart the server, and determine the protection and recovery function of the platform firmware based on the restart situation.
Automatic testing of the platform's firmware protection recovery function is realized, reducing the workload of staff and improving the testing speed and accuracy.
Smart Images

Figure CN115757099B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for automatically testing a platform firmware protection and recovery function. Background Art
[0002] The server's PFR (Platform Firmware Resilience) function is an important guarantee for the stable operation of the server. It can protect the server firmware when an abnormal situation occurs in the server firmware. Whether the platform firmware protection and recovery function can play a role in a timely and effective manner is an important factor in ensuring the safe operation of the server. In addition, as we all know, CPLD (Complex Programmable Logic Device) is a control component of the server motherboard and management board. If it is maliciously refreshed to an incorrect version or there is an abnormality during the refresh process that causes a refresh error, it will directly affect the safe operation of the server. Therefore, during the server testing phase, it is necessary to test the implementation of the platform firmware protection and recovery function, working stability, and abnormal situation handling.
[0003] In the traditional implementation method, testers can confirm the environment, tools, test methods, and test data requirements required for the test by querying the platform firmware protection and recovery technical documents, and configure the test environment according to the technical document requirements. Manually install the corresponding test software, driver and other software, and configure the operating system environment. Then manually refresh the wrong version of the CPLD according to the test requirements, observe the recovery function of the platform firmware protection and recovery system, and collect the corresponding test data for analysis.
[0004] However, although the above method can realize partial automation of information collection and software organization in the platform firmware protection recovery test, simplify the test process to a certain extent and improve the test efficiency. However, the tester needs to manually configure the test environment, manually test according to the design case, manually upload the damaged version of the CPLD firmware and refresh it to analyze the data results. However, since the platform firmware protection recovery and refresh of the damaged version of the CPLD test is highly professional, the tester needs to deeply understand the test document requirements and use the corresponding tools for testing. The test steps are cumbersome, time-consuming, and require a large amount of manpower investment. Summary of the invention
[0005] Based on this, the present application provides a method, device, equipment and storage medium for automatically testing the platform firmware protection and recovery function, which realizes the testing of the platform firmware protection and recovery function through an automated testing process, thereby reducing the workload of staff and improving the speed and accuracy of the test.
[0006] In a first aspect, a method for automatically testing a platform firmware protection and recovery function is provided, the method comprising:
[0007] Obtain the test parameter document information automatically generated by the test system;
[0008] Configure the current test environment based on the test parameter document information, and receive the firmware file to be updated sent by the test system;
[0009] Perform a firmware refresh operation on the firmware file to be refreshed based on the current test environment, and restart the server to be tested;
[0010] According to the restart situation of the server to be tested, the protection and recovery function of the platform firmware is determined and the test results are obtained.
[0011] According to an achievable method in an embodiment of the present application, when the firmware file to be refreshed is a damaged firmware file to be refreshed; based on the current test environment, a firmware refresh operation is performed on the firmware file to be refreshed, and the server to be tested is restarted, including:
[0012] Perform a firmware refresh regression operation on the damaged firmware file to be refreshed based on the current test environment;
[0013] The damaged firmware file to be refreshed is refreshed back to the original firmware file and the corresponding original version information is generated, and the server to be tested is restarted.
[0014] According to an achievable method in an embodiment of the present application, the test parameter document information includes preset initial version information; according to the restart situation of the server to be tested, the protection recovery function of the platform firmware is determined and the test result is obtained, including:
[0015] If the server to be tested fails to restart, it is determined that the protection and recovery function of the platform firmware is invalid and this test fails;
[0016] If the server to be tested is restarted successfully, the preset initial version information and the original version information are verified;
[0017] Based on the verification results, the protection and recovery function of the platform firmware is determined and the test results are obtained.
[0018] According to an achievable method in an embodiment of the present application, when the firmware file to be refreshed is a normal firmware file to be refreshed; based on the current test environment, a firmware refresh operation is performed on the firmware file to be refreshed, and the server to be tested is restarted, including:
[0019] Perform firmware refresh and upgrade operations on normal firmware files to be refreshed based on the current test environment;
[0020] Update and upgrade the normal firmware file to be updated to the target version firmware file and generate the corresponding current target version information, and restart the server to be tested.
[0021] According to an achievable method in an embodiment of the present application, the test parameter document information also includes preset target version information; according to the restart situation of the server to be tested, the protection recovery function of the platform firmware is determined and the test result is obtained, including:
[0022] If the server to be tested fails to restart, it is determined that the protection and recovery function of the platform firmware is invalid and this test fails;
[0023] If the server to be tested is restarted successfully, the preset target version information and the current target version information are verified;
[0024] Based on the verification results, the protection and recovery function of the platform firmware is determined and the test results are obtained.
[0025] According to an achievable method in an embodiment of the present application, based on the verification situation, the protection recovery function of the platform firmware is determined and the test result is obtained, including:
[0026] If the verification passes, it is determined that the protection and recovery function of the platform firmware is effective and this test is successful;
[0027] If the verification fails, it is determined that the protection recovery function of the platform firmware is partially invalid and the test fails, and / or,
[0028] Generate test abnormality information and display it on the human-computer interaction interface through an image pop-up window to give an alarm.
[0029] According to an achievable method in an embodiment of the present application, the test parameter document information further includes a preset number of test cycles and a preset number of allowed failures; the method further includes:
[0030] Perform cyclic testing based on the calibration results and the preset number of test cycles;
[0031] If the number of test failures is greater than the preset allowable number of failures, it is determined that the protection recovery function of the platform firmware is invalid;
[0032] If the number of test failures is less than or equal to the preset allowed number of failures, it is determined that the protection recovery function of the platform firmware is effective.
[0033] In a second aspect, a platform firmware protection recovery function automatic testing device is provided, the device comprising:
[0034] An acquisition module is used to obtain the test parameter document information automatically generated by the test system;
[0035] A configuration module, used to configure the current test environment based on the test parameter document information, and receive the firmware file to be refreshed sent by the test system;
[0036] A refresh module is used to perform a firmware refresh operation on the firmware file to be refreshed based on the current test environment and restart the server to be tested;
[0037] The function determination module is used to determine the protection and recovery function of the platform firmware and obtain the test result according to the restart situation of the server to be tested.
[0038] In a third aspect, a computer device is provided, comprising:
[0039] at least one processor; and
[0040] a memory communicatively connected to at least one processor; wherein,
[0041] The memory stores computer instructions that can be executed by at least one processor, and the computer instructions are executed by at least one processor to enable the at least one processor to execute the method involved in the first aspect above.
[0042] In a fourth aspect, a computer-readable storage medium is provided, on which computer instructions are stored, characterized in that the computer instructions are used to enable a computer to execute the method involved in the first aspect above.
[0043] According to the technical content provided by the embodiment of the present application, the embodiment of the present application obtains the test parameter document information automatically generated by the test system; configures the current test environment based on the test parameter document information, and receives the firmware file to be refreshed sent by the test system; performs a firmware refresh operation on the firmware file to be refreshed based on the current test environment, and restarts the server to be tested; according to the restart situation of the server to be tested, determines the protection and recovery function of the platform firmware and obtains the test results. The above operations, by automatically configuring the test environment, automatically generating the test parameter document information, and automatically performing the firmware refresh operation on the firmware file to be refreshed, realize the automated testing of the protection and recovery function of the platform firmware, while saving labor costs and achieving the effect of improving the speed and accuracy of the test. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 An application environment diagram of a platform firmware protection and recovery function automatic testing method in one embodiment;
[0045] Figure 2 A schematic diagram of a flow chart of a method for automatically testing a platform firmware protection and recovery function in one embodiment;
[0046] Figure 3 It is a schematic diagram of a preferred flow chart in a method for automatically testing a platform firmware protection and recovery function in an embodiment when the firmware file to be refreshed is a damaged firmware file to be refreshed;
[0047] Figure 4It is a schematic diagram of a preferred flow chart in a method for automatically testing a platform firmware protection and recovery function in an embodiment when the firmware file to be refreshed is a normal firmware file to be refreshed;
[0048] Figure 5 It is a structural block diagram of a platform firmware protection recovery function automatic testing device in one embodiment;
[0049] Figure 6 FIG. 4 is a schematic structural diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0050] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] The present application provides a platform firmware protection recovery function automatic testing method, which can be applied to Figure 1 In the application environment shown. Among them, the access device 102 is connected to the server to be tested 104 through external means such as serial port and network to communicate. Specifically, the server to be tested 104 obtains the test parameter document information automatically generated by the test system of the access device 102; configures the current test environment based on the test parameter document information, and receives the firmware file to be refreshed sent by the test system of the access device 102; performs the firmware refresh operation on the firmware file to be refreshed based on the current test environment, and restarts the server to be tested; according to the restart situation of the server to be tested, the protection and recovery function of the platform firmware is determined and the test results are obtained. Here, the access device 102 can be but not limited to various personal computers, laptops and tablet computers; or the access device 102 can be a U disk, and the connection with the server to be tested 104 is realized by plugging the U disk into the server to be tested. The server to be tested 104 can be implemented with an independent server or a server cluster composed of multiple servers. And the platform firmware protection and recovery function is set in the server to be tested, which is the core system of the server to be tested, and undertakes functions such as information flow and test situation management.
[0052] It should be noted here that when the server 104 to be tested receives the control signal sent by the access device 102, it needs to use the data decoding module set inside it to implement the data transcoding operation. For the data uplink process, it can provide temporary data storage space for the firmware file to be refreshed when uploading, and convert the received control signal into the control format required by the corresponding component to facilitate the stable sending of control instructions. For the data downlink process, the data decoding module can provide temporary storage space for the collected test data, and classify and temporarily store the test results of the platform firmware protection and recovery function and the execution of control instructions.
[0053] Figure 2A flowchart of a platform firmware protection recovery function automatic testing method provided in an embodiment of the present application, the method can be performed as follows Figure 1 The server under test is executed in the application environment shown. Figure 2 As shown, the method may include the following steps:
[0054] Step 201: Acquire test parameter document information automatically generated by the test system.
[0055] The test parameter document information includes, but is not limited to, preset initial version information, preset target version information, storage path of the firmware to be refreshed, preset number of test cycles, and preset number of allowed failures.
[0056] Here, the server to be tested obtains the test parameter document information automatically generated by the test system. Since the access device includes a USB flash drive and a test computer, the test system can be imported into the server to be tested by plugging the USB flash drive into the server to be tested, thereby obtaining the test parameter document information; or the test computer and the server to be tested can be connected through external means such as a serial port or network communication, and since the test system is set on the test computer, the test parameter document information can also be obtained.
[0057] Step 203: configure the current test environment based on the test parameter document information, and receive the firmware file to be updated sent by the test system.
[0058] The firmware file to be refreshed may be a CPLD (Complex Programmable Logic Device), which is a control component of a server mainboard and a management board.
[0059] Here, taking the access device as a test computer as an example, before preparing for the test, the staff will upload the firmware file to be refreshed to the test computer, and click to run the test system on the test computer. The test system will automatically generate test parameter document information and send the test parameter document information to the server to be tested. After receiving the test parameter document information, the server to be tested will configure the current test environment. After the configuration is completed, a signal of successful configuration will be sent to the test computer. After confirming that the server to be tested has been configured successfully, the test computer will send the firmware file to be refreshed to the server to be tested, and the server to be tested will receive the firmware file to be refreshed sent by the test computer.
[0060] Step 205: Perform a firmware refresh operation on the firmware file to be refreshed based on the current test environment, and restart the server to be tested.
[0061] Here, the firmware refresh operation is performed on the firmware file to be refreshed based on the current test environment. Since the server to be tested is provided with a PFR (Platform Firmware Resilience, platform firmware protection and recovery function) system, the PFR system performs a refresh operation on the firmware file to be refreshed based on the test parameter document information after receiving the firmware file to be refreshed. After the refresh is completed, the server to be tested will automatically restart.
[0062] Step 207: According to the restart status of the server to be tested, the protection and recovery function of the platform firmware is determined and the test result is obtained.
[0063] Here, due to abnormal refresh or damage to the firmware file to be refreshed, the server to be tested will not be able to work. Therefore, after performing the firmware refresh operation on the firmware file to be refreshed, the server to be tested needs to be restarted, and then based on the restart situation of the server to be tested, the protection and recovery function of the platform firmware is determined to obtain the test result.
[0064] It can be seen that the embodiment of the present application obtains the test parameter document information automatically generated by the test system; configures the current test environment based on the test parameter document information, and receives the firmware file to be refreshed sent by the test system; performs a firmware refresh operation on the firmware file to be refreshed based on the current test environment, and restarts the server to be tested; according to the restart situation of the server to be tested, determines the protection and recovery function of the platform firmware and obtains the test results. The above operations, by automatically configuring the test environment, automatically generating the test parameter document information, and automatically performing the firmware refresh operation on the firmware file to be refreshed, realize the automated testing of the protection and recovery function of the platform firmware, saving labor costs while achieving the effect of improving the speed and accuracy of the test.
[0065] In one achievable manner, when the firmware file to be refreshed is a damaged firmware file to be refreshed, the above step 205, namely "performing a firmware refresh operation on the firmware file to be refreshed based on the current test environment and restarting the server to be tested", is described in detail in combination with the above embodiment.
[0066] Based on the current test environment, a firmware refresh regression operation is performed on the damaged firmware file to be refreshed; the damaged firmware file to be refreshed is refreshed and regressed to the original firmware file and the corresponding original version information is generated, and the server to be tested is restarted.
[0067] Here, when the firmware file to be refreshed is a damaged firmware file to be refreshed, if the protection and recovery function of the platform firmware is normal, it will be found that the firmware file to be refreshed is a damaged firmware file, and thus, the operation of firmware refresh regression will be performed on the damaged firmware file to be refreshed based on the current test environment, that is, the damaged firmware file to be refreshed will be refreshed and returned to the original firmware file and the corresponding original version information will be generated, and the server to be tested will be restarted. It should be noted here that the original firmware file here refers to the original version of the firmware file, that is, the firmware file before the damaged firmware file to be refreshed is damaged.
[0068] Through the above operations, when the firmware file to be refreshed is a damaged firmware file to be refreshed, the firmware refresh regression operation is performed on the damaged firmware file to be refreshed based on the current test environment, thereby realizing automatic testing of the protection and recovery function of the platform firmware, so as to achieve the effect of improving the speed and accuracy of the test.
[0069] In combination with the above embodiment, the above step 207, ie, "determining the protection and recovery function of the platform firmware and obtaining the test result according to the restart situation of the server to be tested" is described in detail.
[0070] If the server to be tested fails to restart, it is determined that the protection and recovery function of the platform firmware is invalid and this test fails; if the server to be tested restarts successfully, the preset initial version information and the original version information are verified; based on the verification results, the protection and recovery function of the platform firmware is determined and the test results are obtained.
[0071] Here, if the server to be tested fails to restart, it means that the damaged firmware file to be refreshed is still in a damaged state and has not been restored by the platform firmware, which means that the protection and recovery function of the platform firmware is invalid, and this test naturally fails.
[0072] If the server to be tested restarts successfully, it does not prove that the protection and recovery function of the platform firmware is intact, because the test parameter document information includes the preset initial version information. Therefore, the preset initial version information and the original version information can be verified, that is, to confirm whether the damaged firmware file restored by the platform firmware is really restored to its original state. Then, based on the verification situation, the protection and recovery function of the platform firmware is determined and the test results are obtained.
[0073] Through the above operations, after the server to be tested is successfully restarted, it is necessary to perform an operation of verifying the preset initial version information and the original version information to further ensure the protection and recovery function of the platform firmware and the accuracy of the test.
[0074] In another achievable manner, when the firmware file to be refreshed is a normal firmware file to be refreshed, the above step 205, namely "performing a firmware refresh operation on the firmware file to be refreshed based on the current test environment and restarting the server to be tested" is described in detail in combination with the above embodiment.
[0075] Based on the current test environment, a firmware refresh and upgrade operation is performed on the normal firmware file to be refreshed; the normal firmware file to be refreshed is refreshed and upgraded to the target version firmware file and the corresponding current target version information is generated, and the server to be tested is restarted.
[0076] Here, when the firmware file to be refreshed is a normal firmware file to be refreshed, if the protection and recovery function of the platform firmware is normal, it will be found that the firmware file to be refreshed is a normal firmware file, so that the firmware refresh and upgrade operation is performed on the normal firmware file to be refreshed based on the current test environment, that is, the normal firmware file to be refreshed is refreshed and upgraded to the target version firmware file and the corresponding current target version information is generated, and the server to be tested is restarted. It should be noted that the target version firmware file here refers to other more advanced versions of the normal firmware file to be refreshed, and the function of this version is more powerful than the version function of the current normal firmware file.
[0077] Through the above operations, when the firmware file to be refreshed is a normal firmware file to be refreshed, the firmware refresh upgrade operation is performed on the normal firmware file to be refreshed based on the current test environment, thereby realizing automatic testing of the protection and recovery function of the platform firmware, so as to achieve the effect of improving the test speed and accuracy.
[0078] In combination with the above embodiment, the above step 207, ie, "determining the protection and recovery function of the platform firmware and obtaining the test result according to the restart situation of the server to be tested" is described in detail.
[0079] If the server to be tested fails to restart, it is determined that the protection and recovery function of the platform firmware is invalid and this test fails; if the server to be tested restarts successfully, the preset target version information and the current target version information are verified; based on the verification results, the protection and recovery function of the platform firmware is determined and the test results are obtained.
[0080] Here, since the firmware file to be refreshed is the normal firmware file to be refreshed, and there is a refresh error after the refresh, the new version of the firmware file after the refresh is not the target version firmware file, resulting in a conflict with the original normal firmware file to be refreshed, causing the server to fail to restart, that is, it is determined that the protection and recovery function of the platform firmware is invalid, and this test fails.
[0081] If the server to be tested restarts successfully, it is still not certain that the protection and recovery function of the platform firmware is completely effective, because the test parameter document information includes the preset target version information. Therefore, the preset target version information and the current target version information can be verified; based on the verification situation, the protection and recovery function of the platform firmware is determined and the test results are obtained.
[0082] Through the above operations, after the server to be tested is successfully restarted, it is necessary to verify the preset target version information and the current target version information to further ensure the protection and recovery function of the platform firmware and the accuracy of the test.
[0083] In one embodiment, based on the verification situation, the protection and recovery function of the platform firmware is determined and the test results are obtained, including: if the verification passes, it is determined that the protection and recovery function of the platform firmware is valid and the test is successful; if the verification fails, it is determined that the protection and recovery function of the platform firmware is partially invalid and the test fails, and / or, test exception information is generated and displayed on the human-computer interaction interface through an image pop-up window to give an alarm.
[0084] Here, no matter the firmware file to be refreshed is a normal firmware file to be refreshed or a damaged firmware file to be refreshed, as long as the server to be tested can be restarted successfully, the verification operation needs to be performed. If the verification passes, it is determined that the protection and recovery function of the platform firmware is effective regardless of the firmware refresh regression operation or the firmware refresh upgrade operation, that is, this test is successful.
[0085] In one achievable method, if the firmware file to be refreshed is a damaged firmware file to be refreshed, when the verification fails, it means that an error occurred in the platform firmware when performing the refresh and regression operation on the damaged firmware file to be refreshed. Although the firmware refresh and regression operation is performed, it will not be refreshed and returned to the original firmware file. Therefore, even if it can restart the standby computer, it can only be determined that the platform firmware protection and recovery function is not completely invalid, that is, partially effective. This test still fails, and the test abnormality information is generated and displayed on the human-computer interaction interface through an image pop-up window to give an alarm.
[0086] In another feasible way, if the firmware file to be refreshed is a normal firmware file to be refreshed, when the verification fails, it means that an error occurred in the platform firmware when refreshing and upgrading the normal firmware file to be refreshed, and after the error occurred, it performed a firmware refresh regression operation to restore the normal firmware file to be refreshed. Although the refresh and upgrade operation is not implemented, the restore operation after the refresh error still exists, so the standby computer can be restarted, but it is not refreshed and upgraded to the target version of the firmware file, indicating that the protection and recovery function of the platform firmware is partially invalid, and this test still fails. At the same time, the test abnormality information is generated and displayed on the human-computer interaction interface through an image pop-up window to give an alarm.
[0087] By comprehensively analyzing the above verification results, the effectiveness of the platform firmware protection recovery function and the test results can be further determined.
[0088] In one embodiment, the method also includes: performing cyclic testing based on the verification situation and a preset number of test cycles; if the number of test failures is greater than the preset allowable number of failures, determining that the protection recovery function of the platform firmware is invalid; if the number of test failures is less than or equal to the preset allowable number of failures, determining that the protection recovery function of the platform firmware is valid.
[0089] Here, since the test parameter document information includes the preset number of test cycles and the preset number of allowed failures, a cyclic test is performed based on the verification situation and the preset number of test cycles. If the number of test failures is greater than the preset number of allowed failures, it is determined that the protection and recovery function of the platform firmware is invalid, which means that the protection and recovery function of the platform firmware is unstable and cannot meet the user's needs even if there are successful times.
[0090] If the number of test failures is less than or equal to the preset allowed number of failures, it is determined that the protection and recovery function of the platform firmware is valid. This situation is generally a situation where the user's requirements are relatively low, that is, when the number of test failures is less than or equal to the preset allowed number of failures, it is determined that the platform firmware can still be used, that is, it is determined that the protection and recovery function of the platform firmware is valid.
[0091] Here, it should also be noted that if a single round of testing fails, the analysis system of the server under test will record the data that failed the verification, generate test exception information, and display it on the human-computer interaction interface through an image pop-up window to give an alarm. However, if a single round of test data cannot be obtained, the analysis system of the server under test will still record this situation and perform a cyclic test. If a single round of testing is successful, that is, the verification passes, the analysis system of the server under test will classify and package the corresponding data. After all rounds of cyclic testing are completed, all test data are sorted out and a test report is automatically generated to analyze the stability of the platform firmware protection and recovery function.
[0092] Through the above-mentioned cyclic testing, the stability of the platform firmware protection and recovery function can be analyzed, further ensuring the accuracy and precision of the automatic testing.
[0093] In combination with the implementation method in the above embodiment, Figure 3 In the automatic testing method for platform firmware protection and recovery function provided in the embodiment of the present application, a preferred flow chart is described by way of example when the firmware file to be refreshed is a damaged firmware file to be refreshed. Figure 3 As shown, the method may include the following steps:
[0094] Step 301: Acquire test parameter document information automatically generated by the test system.
[0095] Step 302: configure the current test environment based on the test parameter document information, and receive the firmware file to be updated sent by the test system.
[0096] Step 303: Perform a firmware refresh regression operation on the damaged firmware file to be refreshed based on the current test environment.
[0097] Step 304, refresh the damaged firmware file to be refreshed back to the original firmware file and generate the corresponding original version information, and restart the server to be tested; if the server to be tested fails to restart, execute step 305; if the server to be tested restarts successfully, execute step 306;
[0098] Step 305 , it is determined that the protection recovery function of the platform firmware is invalid and this test fails.
[0099] In step 306, the preset initial version information and the original version information are verified; if the verification passes, step 307 is executed; if the verification fails, step 308 is executed.
[0100] Step 307 , it is determined that the protection and recovery function of the platform firmware is effective, and this test is successful.
[0101] Step 308 : It is determined that the protection and recovery function of the platform firmware is partially invalid, and the test fails; and / or a test abnormality message is generated and displayed on the human-computer interaction interface in the form of an image pop-up window to give an alarm.
[0102] In combination with the implementation method in the above embodiment, Figure 4 In the automatic testing method for platform firmware protection and recovery function provided in the embodiment of the present application, a preferred flow chart when the firmware file to be refreshed is a normal firmware file to be refreshed is described by way of example. Figure 4 As shown, the method may include the following steps:
[0103] Step 401, obtaining test parameter document information automatically generated by the test system.
[0104] Step 402: configure the current test environment based on the test parameter document information, and receive the firmware file to be updated sent by the test system.
[0105] Step 403: Perform a firmware refresh and upgrade operation on the normal firmware file to be refreshed based on the current test environment.
[0106] Step 404, update and upgrade the normal firmware file to be updated to the target version firmware file and generate the corresponding current target version information, and restart the server to be tested; if the restart of the server to be tested fails, execute step 405; if the restart of the server to be tested succeeds, execute step 406;
[0107] Step 405 , it is determined that the protection recovery function of the platform firmware is invalid and this test fails.
[0108] In step 406, the preset target version information and the current target version information are verified; if the verification passes, step 407 is executed; if the verification fails, step 408 is executed.
[0109] Step 407 , it is determined that the protection and recovery function of the platform firmware is effective, and this test is successful.
[0110] Step 408 , it is determined that the protection and recovery function of the platform firmware is partially invalid, the test fails, and / or a test abnormality message is generated and displayed on the human-computer interaction interface in the form of an image pop-up window to give an alarm.
[0111] It should be understood that although Figure 2-Figure 4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in the application, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-Figure 4 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0112] The above method embodiment can be applied to a variety of application scenarios, for example, including but not limited to application scenarios in which the CPLD of the server to be tested is upgraded and damaged through the platform firmware protection and recovery function.
[0113] Figure 5 A schematic diagram of a platform firmware protection recovery function automatic test device provided in an embodiment of the present application, which can be set at Figure 1 The server under test in the system shown is used to execute the following Figure 2-Figure 4 The method flow shown in Figure 5 As shown, the device may include: an acquisition module 501 , a configuration module 503 , a refresh module 505 and a function determination module 507 .
[0114] An acquisition module 501 is used to acquire test parameter document information automatically generated by a test system;
[0115] Configuration module 503, configured to configure the current test environment based on the test parameter document information, and receive the firmware file to be updated sent by the test system;
[0116] A refresh module 505 is used to perform a firmware refresh operation on the firmware file to be refreshed based on the current test environment and restart the server to be tested;
[0117] The function determination module 507 is used to determine the protection and recovery function of the platform firmware and obtain the test result according to the restart status of the server to be tested.
[0118] In one embodiment, when the firmware file to be refreshed is a damaged firmware file to be refreshed, the refresh module 505 is further used to:
[0119] Perform a firmware refresh regression operation on the damaged firmware file to be refreshed based on the current test environment;
[0120] The damaged firmware file to be refreshed is refreshed back to the original firmware file and the corresponding original version information is generated, and the server to be tested is restarted.
[0121] In one embodiment, the test parameter document information includes preset initial version information, and the function determination module 507 is further used to:
[0122] If the server to be tested fails to restart, it is determined that the protection and recovery function of the platform firmware is invalid and this test fails;
[0123] If the server to be tested is restarted successfully, the preset initial version information and the original version information are verified;
[0124] Based on the verification results, the protection and recovery function of the platform firmware is determined and the test results are obtained.
[0125] In one embodiment, when the firmware file to be refreshed is a normal firmware file to be refreshed, the refresh module 505 is further used to:
[0126] Perform firmware refresh and upgrade operations on normal firmware files to be refreshed based on the current test environment;
[0127] Update and upgrade the normal firmware file to be updated to the target version firmware file and generate the corresponding current target version information, and restart the server to be tested.
[0128] In one embodiment, the test parameter document information also includes preset target version information. The function determination module 507 is further used to:
[0129] If the server to be tested fails to restart, it is determined that the protection and recovery function of the platform firmware is invalid and this test fails;
[0130] If the server to be tested is restarted successfully, the preset target version information and the current target version information are verified;
[0131] Based on the verification results, the protection and recovery function of the platform firmware is determined and the test results are obtained.
[0132] In one embodiment, the device is also used to:
[0133] If the verification passes, it is determined that the protection and recovery function of the platform firmware is effective and this test is successful;
[0134] If the verification fails, it is determined that the protection recovery function of the platform firmware is partially invalid and the test fails, and / or,
[0135] Generate test abnormality information and display it on the human-computer interaction interface through an image pop-up window to give an alarm.
[0136] In one embodiment, the test parameter document information also includes a preset number of test cycles and a preset number of allowed failures, and the device is further used to:
[0137] Perform cyclic testing based on the calibration results and the preset number of test cycles;
[0138] If the number of test failures is greater than the preset allowable number of failures, it is determined that the protection recovery function of the platform firmware is invalid;
[0139] If the number of test failures is less than or equal to the preset allowed number of failures, it is determined that the protection recovery function of the platform firmware is effective.
[0140] The same or similar parts between the above embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0141] It should be noted that the embodiments of the present application may involve the use of user data. In actual applications, user-specific personal data can be used in the scheme described in this article within the scope permitted by applicable laws and regulations, provided that the applicable laws and regulations of the country are met (for example, the user's explicit consent, effective notification to the user, and the user's explicit authorization, etc.).
[0142] According to an embodiment of the present application, the present application also provides a computer device and a computer-readable storage medium.
[0143] like Figure 6, is a block diagram of a computer device according to an embodiment of the present application. The computer device is intended to represent various forms of digital computers or mobile devices. The digital computer may include a desktop computer, a portable computer, a workbench, a personal digital assistant, a server, a mainframe computer, and other suitable computers. The mobile device may include a tablet computer, a smart phone, a wearable device, etc.
[0144] like Figure 6 As shown, the device 600 includes a computing unit 601, a ROM 602, a RAM 603, a bus 604, and an input / output (I / O) interface 605, and the computing unit 601, ROM 602 and RAM 603 are connected to each other through the bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.
[0145] The computing unit 601 can perform various processes in the method embodiment of the present application according to the computer instructions stored in the read-only memory (ROM) 602 or the computer instructions loaded from the storage unit 608 to the random access memory (RAM) 603. The computing unit 601 can be various general and / or special processing components with processing and computing capabilities. The computing unit 601 may include, but is not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. In some embodiments, the method provided in the embodiment of the present application can be implemented as a computer software program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 608.
[0146] RAM 603 may also store various programs and data required for the operation of device 600. Part or all of a computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609.
[0147] The input unit 606, output unit 607, storage unit 608 and communication unit 609 in the device 600 can be connected to the I / O interface 605. The input unit 606 can be, for example, a keyboard, a mouse, a touch screen, a microphone, etc. The output unit 607 can be, for example, a display, a speaker, an indicator light, etc. The device 600 can exchange information, data, etc. with other devices through the communication unit 609.
[0148] It should be noted that the device may also include other components necessary for normal operation, or may only include components necessary for implementing the solution of the present application, rather than all the components shown in the figure.
[0149] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof.
[0150] The computer instructions for implementing the method of the present application can be written in any combination of one or more programming languages. These computer instructions can be provided to the computing unit 601, so that when the computer instructions are executed by the computing unit 601 such as a processor, the steps involved in the method embodiment of the present application are executed.
[0151] The computer-readable storage medium provided in the present application may be a tangible medium that may contain or store computer instructions for executing the steps involved in the method embodiments of the present application. The computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, and other forms of storage media.
[0152] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A method for automatically testing the protection and recovery function of platform firmware, It is characterized in that The method comprises: Obtain the test parameter document information automatically generated by the test system; Configuring the current test environment based on the test parameter document information, and receiving the firmware file to be updated sent by the test system; Based on the current test environment, a firmware refresh operation is performed on the firmware file to be refreshed, and the server to be tested is restarted; According to the restart situation of the server to be tested, determine the protection and recovery function of the platform firmware and obtain the test result; When the firmware file to be refreshed is a damaged firmware file to be refreshed; the firmware refresh operation is performed on the firmware file to be refreshed based on the current test environment, and the server to be tested is restarted, including: performing a firmware refresh regression operation on the damaged firmware file to be refreshed based on the current test environment, refreshing and returning the damaged firmware file to be refreshed to the original firmware file and generating corresponding original version information, and restarting the server to be tested; or, when the firmware file to be refreshed is a normal firmware file to be refreshed; the firmware refresh operation is performed on the firmware file to be refreshed based on the current test environment, and the server to be tested is restarted, including: performing a firmware refresh upgrade operation on the normal firmware file to be refreshed based on the current test environment, refreshing and upgrading the normal firmware file to be refreshed to the target version firmware file and generating corresponding current target version information, and restarting the server to be tested; and / or, The test parameter document information includes preset initial version information; the protection recovery function of the platform firmware is determined according to the restart situation of the server to be tested and the test result is obtained, including: If the server to be tested fails to restart, it is determined that the protection and recovery function of the platform firmware is invalid and this test fails; If the server to be tested is restarted successfully, the preset initial version information and the original version information are verified; Based on the verification situation, the protection and recovery function of the platform firmware is determined and a test result is obtained.
2. The method according to claim 1, It is characterized in that The test parameter document information also includes preset target version information; the protection recovery function of the platform firmware is determined according to the restart status of the server to be tested and the test result is obtained, including: If the server to be tested fails to restart, it is determined that the protection and recovery function of the platform firmware is invalid and this test fails; If the server to be tested is restarted successfully, the preset target version information and the current target version information are verified; Based on the verification situation, the protection and recovery function of the platform firmware is determined and a test result is obtained.
3. The method according to any one of claims 1 or 2, It is characterized in that The step of determining the protection recovery function of the platform firmware based on the verification situation and obtaining the test result includes: If the verification passes, it is determined that the protection and recovery function of the platform firmware is effective and this test is successful; If the verification fails, it is determined that the protection recovery function of the platform firmware is partially invalid and the test fails, and / or, Generate test abnormality information and display it on the human-computer interaction interface through an image pop-up window to give an alarm.
4. The method according to any one of claims 1 or 2, It is characterized in that The test parameter document information also includes a preset number of test cycles and a preset number of allowed failures; the method also includes: Performing a cyclic test based on the verification condition and a preset number of test cycles; If the number of test failures is greater than the preset allowable number of failures, it is determined that the protection recovery function of the platform firmware is invalid; If the number of test failures is less than or equal to the preset allowed number of failures, it is determined that the protection recovery function of the platform firmware is valid.
5. A platform firmware protection recovery function automatic testing device that implements the platform firmware protection recovery function automatic testing method according to any one of claims 1 to 4, It is characterized in that The device comprises: An acquisition module is used to obtain the test parameter document information automatically generated by the test system; A configuration module, configured to configure the current test environment based on the test parameter document information, and receive the firmware file to be updated sent by the test system; A refresh module, used to perform a firmware refresh operation on the firmware file to be refreshed based on the current test environment, and restart the server to be tested; The function determination module is used to determine the protection and recovery function of the platform firmware and obtain the test result according to the restart status of the server to be tested.
6. A computer device, include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores computer instructions that can be executed by the at least one processor, and the computer instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.
7. A computer-readable storage medium having computer instructions stored thereon, It is characterized in that The computer instructions are used to make a computer execute the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Stability test method, device and apparatus for in-band firmware refreshing process
CN111104271A
PFR-based firmware upgrading method, system and equipment and storage medium
CN114579982A