Computer testing system and method and readable storage medium
By using simulated hardware environment and grabbing analysis components in computer testing systems, independent testing of BIOS and BMC firmware is achieved, solving the problems of high cost and poor flexibility in traditional testing methods, and improving the efficiency and accuracy of the test.
Patent Information
- Application Number
- CN202411358637.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-03
AI Technical Summary
Traditional computer hardware testing methods rely on real hardware, resulting in high testing costs, poor flexibility and scalability, making it difficult to test the firmware of BIOS and BMC separately.
Design a computer testing system, including control components, simulation components and grab analysis components, run the firmware of the functional module to be tested by simulating the hardware environment, receive test instructions and respond, grab and analyze interactive data with the physical hardware environment, and realize Independent testing of firmware.
It reduces testing costs, improves testing flexibility and scalability, enhances real-time and accuracy of testing, and enables testing of BIOS and BMC firmware alone.
Smart Images

Figure CN119248596A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer systems, and in particular to a computer testing system, method, and readable storage medium. Background Art
[0002] In the field of computer hardware development and testing, BIOS (Basic Input / Output System) and BMC (Baseboard Management Controller) are key components. Among them, BIOS is the first software to run when the computer starts up. It is responsible for initializing hardware devices and loading the operating system. BMC is an independent microcontroller used to manage the hardware health status of the server, including temperature, voltage, fan speed, etc., and provides remote management functions. During the hardware development and testing process, it is crucial to ensure that the functions and performance of BIOS and BMC meet the standards. However, traditional testing methods often rely on real hardware environments, which not only increases the testing cost, but also limits the flexibility and scalability of the test.
[0003] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present. Summary of the invention
[0004] The purpose of the present invention is to provide a computer testing system, method, and readable storage medium, which relate to the field of computer systems, can cut the binding relationship between firmware and physical hardware environment, can test firmware separately, reduce costs, and improve the flexibility and scalability of testing.
[0005] In order to solve the above technical problems, the present invention provides a computer testing system, comprising:
[0006] A control component, used for generating a test instruction corresponding to the current function to be tested of the functional module to be tested;
[0007] A simulation component connected to the physical hardware environment, the simulation component is used to build and start a simulation hardware environment corresponding to the functional module to be tested, when the current firmware of the functional module to be tested is run through the simulation hardware environment, respond to the received test instruction to obtain a response result, and transmit the response result to the physical hardware environment;
[0008] The capture and analysis component is used to capture the interaction data between the simulation component and the physical hardware environment, and analyze the test results of the current function to be tested of the function module to be tested based on the interaction data.
[0009] Wherein, the simulation component includes a first storage unit and a processing unit, and the processing unit includes a memory;
[0010] The first storage unit is used to store multiple versions of firmware of the functional module to be tested;
[0011] The processing unit is configured to perform a self-check on the simulation component after starting the simulation hardware environment, and after the self-check passes, load the current firmware corresponding to the version selection instruction among all the firmware stored in the first storage unit into the memory, and run the current firmware;
[0012] The control component is further configured to output the version selection instruction.
[0013] The process of performing self-check on the simulation component after starting the simulation hardware environment includes:
[0014] After starting the simulated hardware environment, performing integrity detection on multiple versions of firmware stored in the first storage unit;
[0015] When the integrity check of any version of the firmware fails, determining that the self-check fails;
[0016] When the integrity detection of all versions of the firmware passes, outputting a prediction instruction to the physical hardware environment;
[0017] Determining whether response information returned by the physical hardware environment in response to the prediction instruction is received within a preset time period;
[0018] If so, it is determined that the self-test has passed;
[0019] If not, it is determined that the self-test has failed.
[0020] Wherein, the first storage unit includes a plurality of storage areas, and the plurality of storage areas are divided based on the file size, type and access frequency of the firmware;
[0021] The processing unit is also used for:
[0022] When a new version of the firmware is received, obtaining the file size, type, and predicted access frequency of the new version of the firmware;
[0023] Determining a target storage area corresponding to the new version of the firmware from among the plurality of storage areas according to the file size, type and predicted access frequency of the new version of the firmware;
[0024] Based on whether the current storage capacity of the target storage area is less than the target storage capacity corresponding to the target storage area;
[0025] If it is smaller than the target storage capacity, writing the new version of the firmware into the target storage area;
[0026] If it is not less than the target storage capacity, determining whether there is firmware to be cleared that meets the invalidation condition in the target storage area;
[0027] If yes, clearing the firmware to be cleared from the target storage area;
[0028] If not, a target storage area corresponding to the new version of the firmware is re-determined from among the plurality of storage areas according to at most two items of the file size, type and predicted access frequency of the new version of the firmware.
[0029] Wherein, the capture and analysis component includes a capture unit for capturing the interaction data between the simulation component and the physical hardware environment;
[0030] The first storage unit is also used to store the interaction data;
[0031] The processing unit is also used to upload the interactive data stored in the first storage unit to a remote server when an upload condition is met; the upload condition includes that the current storage capacity of the first storage unit is greater than a preset storage threshold, and / or, a trigger signal corresponding to the upload cycle is received.
[0032] Wherein, the capture and analysis component also includes a data buffer;
[0033] The capture unit is also used to capture the interactive data between the simulation component and the physical hardware environment, and write the interactive data into the data buffer after converting the interactive data into a preset format;
[0034] The processing unit is further configured to write the data in the data buffer into the first storage unit.
[0035] Wherein, the simulation component includes a plurality of access interfaces;
[0036] The processing unit is further used to set a current working mode of each of the access interfaces, wherein the current working mode includes a first working mode corresponding to allowing reading, and a second working mode corresponding to allowing reading and allowing writing.
[0037] Among them, the capture and analysis component includes an analysis unit, which is used to compare and analyze the acquired interaction data with standard data, identify abnormal data in the interaction data, and generate prompt information based on the abnormal data, so that the tester can perform corresponding processing operations according to the prompt information.
[0038] To solve the above technical problems, the present invention also provides a computer testing method, comprising:
[0039] Generate a test instruction corresponding to the current function to be tested of the function module to be tested by the control component;
[0040] Building and starting a simulated hardware environment corresponding to the functional module to be tested through a simulation component connected to the physical hardware environment, and when the current firmware of the functional module to be tested is run through the simulated hardware environment, a response result is obtained in response to the received test instruction, and the response result is transmitted to the physical hardware environment;
[0041] The interaction data between the simulation component and the physical hardware environment is captured by a capture and analysis component, and the test result of the current function to be tested of the function module to be tested is analyzed based on the interaction data.
[0042] To solve the above technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the computer testing method described above are implemented.
[0043] The present invention provides a computer testing system. A simulation module is used to build and run a simulation hardware environment corresponding to a function module to be tested. The simulation hardware environment is used to run the current firmware of the function module to be tested, so that after receiving a test instruction sent by a control component, the simulation module simulates the function of the function module to be tested to respond to the test instruction and writes it into a physical hardware environment connected to itself. There is no need to rely on the real hardware connection of the function module to be tested. The binding relationship between the firmware and the physical hardware environment is cut off, and the firmware can be tested separately, which reduces the cost and improves the flexibility and scalability of the test. The interactive data between the simulation component and the physical hardware environment is captured by a capture and analysis component, and the data is immediately analyzed to improve the real-time and accuracy of the test.
[0044] The present invention also provides a computer testing method and a computer readable storage medium, which have the same beneficial effects as the above-mentioned computer testing system. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A schematic diagram of the structure of a first computer testing system provided by the present invention;
[0047] Figure 2 A schematic diagram of the structure of a second computer testing system provided by the present invention;
[0048] Figure 3A schematic diagram of the structure of a third computer testing system provided by the present invention;
[0049] Figure 4 A flowchart of the steps of a computer testing method provided by the present invention;
[0050] Figure 5 This is a schematic diagram of the structure of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0051] The core of the present invention is to provide a computer testing system, method, and readable storage medium, which relate to the field of computer systems. The system can cut the binding relationship between firmware and physical hardware environment, and can test the firmware separately, thereby reducing costs and improving the flexibility and scalability of testing.
[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] First, please refer to Figure 1 The present invention provides a computer testing system, comprising:
[0054] Control component 1, used to generate a test instruction corresponding to the current function to be tested of the functional module to be tested;
[0055] A simulation component 2 connected to the physical hardware environment, the simulation component 2 is used to build and start a simulation hardware environment corresponding to the functional module to be tested, when the current firmware of the functional module to be tested is run through the simulation hardware environment, a response result is obtained in response to the received test instruction, and the response result is transmitted to the physical hardware environment;
[0056] The capture and analysis component 3 is used to capture the interaction data between the simulation component 2 and the physical hardware environment, and analyze the test results of the current function to be tested of the function module to be tested based on the interaction data.
[0057] It can be understood that the simulation component 2 includes an interface for receiving test instructions and an interactive interface for interacting with the physical hardware environment. After the simulation component 2 and the physical hardware environment are connected through the corresponding interactive interface, the capture and analysis component 3 is connected to the interactive interface between the simulation component 2 and the physical hardware environment to capture the interactive data between the simulation component 2 and the physical hardware environment. The control component 1 may include a human-computer interaction device for receiving a test item selection instruction input by a user, and a test instruction corresponding to the current function to be tested of the functional module to be tested based on the test item selection instruction. The test instruction may also come from the system configuration or an external device, etc.
[0058] In this embodiment, the simulation component 2 is used to receive the test instruction, simulate the response of the functional module to be tested, and feedback the corresponding information. Specifically, the simulation component 2 is used to build a simulated hardware environment, and the simulation component 2 includes but is not limited to the CPU (Central Processing Unit), memory 221, hard disk and other related components, and also includes the interfaces and connection lines of key components such as the main board and cables. The simulation component 2 builds the simulated hardware environment corresponding to the functional module to be tested. The simulated hardware environment is a hardware environment that can run the firmware of the functional module to be tested. After the simulated hardware environment is built and started, the current firmware is loaded and driven to run, so that the simulation component 2 can simulate the function of the functional module to be tested. When the current firmware of the functional module to be tested runs in the simulated hardware environment, if a test instruction is received, the internal routine or function of the current firmware will be called at this time, and the corresponding hardware operation or software logic will be executed to respond to the test instruction to obtain a response result, and the response result will be output to the physical hardware environment, and the response of the physical hardware environment will be waited for, thereby completing the test of the current function to be tested of the current module to be tested. During the test process, the capture and analysis component 3 captures the interactive data transmitted by the interactive interface between the simulation component 2 and the physical hardware environment in real time, and analyzes it to obtain the test results. The present invention can capture the data generated during the simulation test in real time and analyze it immediately, thereby improving the real-time and accuracy of the test.
[0059] It can be understood that BIOS (Basic Input / Output System) and BMC (Baseboard Management Controller) are key components in a computer system. The functional modules to be tested in this embodiment include but are not limited to BIOS or BMC. The simulation component 2 can be configured separately for different functional modules to be tested, or a simulation component 2 can be set and the configuration of the simulation component 2 can be adjusted to adapt it to different functional modules to be tested. The simulation component 2 is used to provide a simulated hardware environment. The firmware file of the BIOS or BMC can be written into the simulated hardware environment provided by the simulation component 2. After being driven, data can be directly interacted with the physical hardware environment built in the early stage.
[0060] To facilitate the description of the test process of different functional modules to be tested, this embodiment configures simulation components 2 separately for different functional modules to be tested, illustratively, including but not limited to BIOS simulation component 2 and BMC simulation component 2, and the BIOS simulation component 2 and BMC simulation component 2 are described with reference to the functions of BIOS and BMC. The working principle of BIOS simulation component 2 is to load and execute BIOS firmware in the simulated hardware environment it builds and starts. After the BIOS firmware is executed, it will perform self-checking, initialize hardware devices, load the operating system and other tasks to ensure that the machine can start and run normally. The working principle of BMC simulation component 2 is to communicate with the sensor on the mainboard through the SPI protocol to monitor the physical state of the system, and to realize remote configuration, monitoring and recovery of the system by supporting the IPMI protocol. BMC simulation component 2 can test and verify BMC in the simulated hardware environment it builds and starts to ensure its stability and reliability in practical applications.
[0061] As an optional embodiment, the simulation component 2 can be implemented by an embedded tool. After the BIOS / BMC module processes the instructions, the embedded tool needs to transmit these instructions or processing results to the server and communicate with the connected server interface through the SPI (Serial Peripheral Interface) protocol.
[0062] It can be seen that in this embodiment, a simulated hardware environment corresponding to the functional module to be tested is built and run through the simulation module. The simulated hardware environment is used to run the current firmware of the functional module to be tested, so that after receiving the test instruction sent by the control component 1, the simulation module simulates the function of the functional module to be tested to respond to the test instruction, and writes it into the physical hardware environment connected to itself. There is no need to rely on the real hardware connection of the functional module to be tested. The binding relationship between the firmware and the physical hardware environment is cut off, and the firmware can be tested separately, which reduces the cost and improves the flexibility and scalability of the test. The interaction data between the simulation component 2 and the physical hardware environment is captured by the capture and analysis component 3, and analyzed immediately, thereby improving the real-time and accuracy of the test.
[0063] Based on the above embodiments:
[0064] In an exemplary embodiment, referring to Figure 2 , the simulation component 2 includes a first storage unit 21 and a processing unit 22, and the processing unit 22 includes a memory 221;
[0065] The first storage unit 21 is used to store multiple versions of firmware of the functional module to be tested;
[0066] The processing unit 22 is used to perform a self-check on the simulation component 2 after starting the simulation hardware environment. After the self-check passes, the current firmware corresponding to the version selection instruction among all the firmware stored in the first storage unit 21 is loaded into the memory 221, and the current firmware is run;
[0067] The control component 1 is further used to output a version selection instruction.
[0068] In this embodiment, the simulation component 2 includes a first storage unit 21, which includes but is not limited to a hard disk, and also includes a processing unit 22, which includes but is not limited to a CPU, and the CPU also includes a memory 221. In this embodiment, the first storage unit 21 stores multiple versions of firmware of the functional module to be tested. On the one hand, the compatibility of different versions of firmware with hardware can be tested to ensure that each version of the functional module to be tested can work normally. On the other hand, it can also verify whether different versions of the functional module to be tested have correctly implemented all its expected functions. On the other hand, when the version is updated, the simulation component 2 can also run the old version and the new version for comparative testing to ensure that the new version does not introduce new errors, thereby achieving a comprehensive test of the function and performance of the functional module to be tested.
[0069] It can be understood that the current firmware currently loaded in the simulated hardware environment is selected by the user, and the version of the current firmware selected by the user is loaded into the memory 221 of the CPU. On the one hand, it improves the speed at which the CPU accesses and executes the firmware code. On the other hand, since the memory 221 is directly connected to the CPU, the data transmission rate is high, which reduces the time the CPU waits for data and improves data processing efficiency, thereby improving the test efficiency of the function to be tested of the functional module to be tested.
[0070] In an exemplary embodiment, the process of performing a self-check on the simulation component 2 after starting the simulation hardware environment includes:
[0071] After starting the simulated hardware environment, integrity detection is performed on multiple versions of firmware stored in the first storage unit 21;
[0072] When the integrity test of any version of the firmware fails, the self-test is determined to have failed;
[0073] When the integrity check of all versions of the firmware passes, the predicted instructions are output to the physical hardware environment;
[0074] Determining whether a response message returned by the physical hardware environment response prediction instruction is received within a preset time period;
[0075] If yes, the self-test is judged to have passed;
[0076] If not, the self-test is determined to have failed.
[0077] It can be understood that before loading the current firmware, each version of the firmware is firstly checked for integrity. The integrity check can ensure that the stored firmware version is not damaged or tampered with, thereby ensuring the reliability and security of the firmware. When all stored firmware versions pass the integrity check, the simulation component 2 will proceed to the next step, thereby preventing the system from running in an unreliable state. By outputting prediction instructions to the physical hardware environment and receiving responses, it is verified whether the communication link between the simulation component 2 and the physical hardware environment is normal, ensuring that the simulation component 2 can correctly control the physical hardware, and further improving the test efficiency.
[0078] In an exemplary embodiment, the first storage unit 21 includes a plurality of storage areas, and the plurality of storage areas are divided based on the file size, type, and access frequency of the firmware;
[0079] The processing unit 22 is further configured to:
[0080] When a new version of the firmware is received, the file size, type, and predicted access frequency of the new version of the firmware are obtained;
[0081] Determine a target storage area corresponding to the new version of the firmware from among multiple storage areas according to the file size, type, and predicted access frequency of the new version of the firmware;
[0082] Based on whether the current storage capacity of the target storage area is less than the target storage capacity corresponding to the target storage area;
[0083] If it is smaller than the target storage capacity, the new version of the firmware is written into the target storage area;
[0084] If it is not less than the target storage capacity, determining whether there is firmware to be cleared that meets the invalidation condition in the target storage area;
[0085] If yes, clear the firmware to be cleared from the target storage area;
[0086] If not, a target storage area corresponding to the new version of the firmware is re-determined from among the multiple storage areas according to at most two items of the file size, type and predicted access frequency of the new version of the firmware.
[0087] Specifically, this embodiment divides the first storage unit 21 into multiple storage areas based on the file size, type and access frequency of the firmware, which can more effectively utilize the storage space and optimize data storage and management. It can be understood that storing the firmware in different storage areas according to the access frequency can speed up the access speed of commonly used firmware and improve the impact speed of the overall system. When storing a new version of the firmware, first determine the target storage area that matches it according to the file size, type and predicted access frequency of the new version of the firmware, and then obtain the current storage capacity of the target storage area. When ensuring that the target storage area has enough storage space, write the new version of the firmware to the target storage area. If the storage space is insufficient, this embodiment gives priority to clearing invalid old firmware and providing storage space for the new firmware. By clearing invalid or old firmware versions, the validity and latestness of the firmware version in the storage area can be maintained, which is convenient for testing and maintenance, ensuring the effective use of storage space, avoiding waste, and realizing dynamic management of storage space. If there is no old firmware that meets the invalid condition in the storage space, by considering up to two attributes to redetermine the target storage area, storage resources can be more reasonably allocated when the storage space is limited to avoid space waste. It can be understood that reasonable storage allocation can reduce unnecessary data migration and cleanup operations, thereby improving the performance of the entire system.
[0088] As an optional embodiment, storage based on the actual usage characteristics of the firmware (such as size and access frequency) can optimize the data access path and improve storage efficiency. Specifically, the access frequency can be given priority to determine the new target storage space, and the firmware with high access frequency can be stored in a storage area with a faster access speed, which can speed up the loading and execution speed of the firmware, thereby further improving the test efficiency. In order to further improve the test efficiency, the processing unit 22 provided in this embodiment also establishes an index system for firmware files, including key information such as file name, size, type, storage location, etc., which can speed up the retrieval and call process of firmware files to facilitate users to find and access firmware files.
[0089] In an exemplary embodiment, the capture and analysis component 3 includes a capture unit 31 for capturing interaction data between the simulation component 2 and the physical hardware environment;
[0090] The first storage unit 21 is also used to store interaction data;
[0091] The processing unit 22 is also used to upload the interaction data stored in the first storage unit 21 to the remote server when the upload conditions are met; the upload conditions include that the current storage capacity of the first storage unit 21 is greater than a preset storage threshold, and / or, a trigger signal corresponding to the upload cycle is received.
[0092] In this embodiment, the capture and analysis component 3 includes a capture unit 31. The communication interface between the capture unit 31 and the simulation component 2 adopts the SPI protocol. The capture unit 31 can capture data at the interactive interface, and the interaction between the firmware and the hardware can be analyzed through the interactive data. The communication parameters between the capture unit 31 and the simulation component 2, such as baud rate, data bit, stop bit, etc., are set to ensure that both parties can communicate normally. The serial port program is used to realize the reading and modification of the simulation module data, and the captured raw data is converted into a format that is convenient for subsequent processing, for example, binary data is converted into decimal or hexadecimal representation.
[0093] The interaction data is first stored in the first storage unit 21, which is convenient for subsequent analysis and processing, and also provides convenience for long-term preservation and traceability of data. When the processing unit 22 determines that the upload conditions are met, such as the current storage capacity of the first storage unit 21 is greater than the preset storage threshold or enters a new upload cycle, the interaction data is automatically uploaded to the remote server, releasing the storage space of the first storage unit 21, realizing effective management of storage resources, and preventing test interruptions caused by insufficient storage space. It can be understood that the uploaded interaction data can be processed in real time by the analysis tools on the remote server, quickly providing test results and feedback, and accelerating problem diagnosis and resolution.
[0094] In an exemplary embodiment, the capture and analysis component 3 further includes a data buffer;
[0095] The capture unit 31 is also used to capture the interactive data between the simulation component 2 and the physical hardware environment, and write the interactive data into the data buffer after converting the interactive data into a preset format;
[0096] The processing unit 22 is further configured to write the data in the data buffer into the first storage unit 21 .
[0097] In this embodiment, the capture and analysis component 3 includes a data buffer, which can smooth the data flow so that continuous interactive data has a temporary storage place before being written into the first storage unit 21, thereby avoiding data loss or errors caused by mismatch in processing speed. When writing data, the data buffer can be quickly collected first, and then written into the first storage unit 21 in batches in a more efficient manner, thereby reducing frequent access to the first storage unit 21 and improving overall efficiency. In addition, the data buffer allows the capture unit 31 and the processing unit 22 to work asynchronously, that is, the capture unit 31 can continue to capture data without considering the processing speed of the processing unit 22.
[0098] In an exemplary embodiment, the simulation component 2 includes a plurality of access interfaces;
[0099] The processing unit 22 is further used to set the current working mode of each access interface, and the current working mode includes a first working mode corresponding to allowing reading, and a second working mode corresponding to allowing reading and allowing writing.
[0100] In this embodiment, the simulation component 2 includes multiple access interfaces that allow different users to remotely access the simulation component 2 from different locations, thereby improving the convenience and collaboration of the test. The processing unit 22 configures the current working mode of each access interface. Specifically, the first access interface that receives the test instruction can be configured as the second working mode (read / write), and the other access interfaces can be configured as the first working mode (read-only). By locking other access interfaces, the stability of the test is ensured, and data conflicts caused by multiple people writing at the same time are avoided. Moreover, limiting write permissions can prevent unauthorized modifications and protect the security of test data and firmware. In addition, this design allows the test system to easily add or modify the working mode of the access interface as needed to adapt to different test scenarios and requirements. That is, the simulation component 2 not only provides the convenience of remote access by multiple people, but also ensures the orderliness of the test and the security of the data through effective access control.
[0101] In an exemplary embodiment, the capture and analysis component 3 includes an analysis unit 32 for comparing and analyzing the acquired interaction data with standard data, identifying abnormal data in the interaction data, and generating prompt information based on the abnormal data so that the tester can perform corresponding processing operations according to the prompt information.
[0102] In this embodiment, the capture and analysis component 3 also includes an analysis unit 32. The analysis unit 32 captures each interaction data and can compare and analyze the captured data with standard data. The analysis unit 32 can identify anomalies and errors in the data and generate corresponding suggestions to facilitate testers to quickly locate problems and optimize.
[0103] In summary, the present invention provides a fixture with an integrated simulation module, which realizes the simulation test of BIOS and BMC without using real hardware, greatly reduces the test cost and improves the convenience of the test. Reduce costs: Use the fixture to simulate the hardware environment, no need to purchase real hardware, reduce the test cost, and easy to operate: The simulation module is built into the fixture, and the tester only needs to send instructions through the test software to complete the test, which is easy and fast to operate. In the relevant test process, data capture and analysis are often separated, which may cause data loss or delay, affecting the accuracy and efficiency of the test. The present invention introduces a real-time data capture unit 31 and an analysis unit 32, which can capture the data generated during the simulation test in real time and analyze it immediately, thereby improving the real-time and accuracy of the test. Considering that the functions of BIOS and BMC are complex and diverse, different hardware environments and application scenarios may require different simulation methods. The simulation component 2 provided by the present invention is highly customizable, and the simulation parameters can be flexibly configured according to the test requirements to simulate the BIOS and BMC behaviors in various complex scenarios, thereby improving the comprehensiveness and effectiveness of the test.
[0104] Second, please refer to Figure 4 The present invention also provides a computer testing method, comprising:
[0105] S101: Generate a test instruction corresponding to the current function to be tested of the function module to be tested by a control component;
[0106] S102: Building and starting a simulated hardware environment corresponding to the functional module to be tested through a simulation component connected to the physical hardware environment, and when the current firmware of the functional module to be tested is run through the simulated hardware environment, a response result is obtained in response to the received test instruction, and the response result is transmitted to the physical hardware environment;
[0107] S103: capturing the interaction data between the simulation component and the physical hardware environment through the capture and analysis component, and analyzing the test result of the current function to be tested of the function module to be tested based on the interaction data.
[0108] In an exemplary embodiment, the simulation component includes a first storage unit, a processing unit, and the processing unit includes a memory;
[0109] Computer testing methods also include:
[0110] Storing multiple versions of firmware of the functional module to be tested by a first storage unit;
[0111] After starting the simulated hardware environment, the processing unit performs a self-check on the simulated component. After the self-check passes, the current firmware corresponding to the version selection instruction among all the firmware stored in the first storage unit is loaded into the memory, and the current firmware is run;
[0112] The version selection instructions are output by the control component.
[0113] In an exemplary embodiment, the process of self-checking the simulation component after starting the simulation hardware environment includes:
[0114] After starting the simulated hardware environment, performing integrity detection on multiple versions of firmware stored in the first storage unit;
[0115] When the integrity test of any version of the firmware fails, the self-test is determined to have failed;
[0116] When the integrity check of all versions of the firmware passes, the predicted instructions are output to the physical hardware environment;
[0117] Determining whether a response message returned by the physical hardware environment response prediction instruction is received within a preset time period;
[0118] If yes, the self-test is judged to have passed;
[0119] If not, the self-test is determined to have failed.
[0120] In an exemplary embodiment, the first storage unit includes a plurality of storage areas, and the plurality of storage areas are divided based on file size, type, and access frequency of the firmware;
[0121] Computer testing methods also include:
[0122] The processing unit performs the following operations:
[0123] When a new version of the firmware is received, the file size, type, and predicted access frequency of the new version of the firmware are obtained;
[0124] Determine a target storage area corresponding to the new version of the firmware from among multiple storage areas according to the file size, type, and predicted access frequency of the new version of the firmware;
[0125] Based on whether the current storage capacity of the target storage area is less than the target storage capacity corresponding to the target storage area;
[0126] If it is smaller than the target storage capacity, the new version of the firmware is written into the target storage area;
[0127] If it is not less than the target storage capacity, determining whether there is firmware to be cleared that meets the invalidation condition in the target storage area;
[0128] If yes, clear the firmware to be cleared from the target storage area;
[0129] If not, a target storage area corresponding to the new version of the firmware is re-determined from among the multiple storage areas according to at most two items of the file size, type and predicted access frequency of the new version of the firmware.
[0130] In an exemplary embodiment, the capture and analysis component includes a capture unit, and the process of capturing the interaction data between the simulation component and the physical hardware environment includes:
[0131] Capture the interaction data between the simulation component and the physical hardware environment through the capture unit;
[0132] Computer testing methods also include:
[0133] storing the interaction data by a first storage unit;
[0134] When the upload conditions are met, the processing unit uploads the interactive data stored in the first storage unit to the remote server; the upload conditions include that the current storage capacity of the first storage unit is greater than a preset storage threshold, and / or that a trigger signal corresponding to the upload cycle is received.
[0135] In an exemplary embodiment, the crawl analysis component further includes a data buffer;
[0136] Computer testing methods also include:
[0137] The interactive data between the simulation component and the physical hardware environment is captured by the capture unit, and the interactive data is converted into a preset format and then written into the data buffer;
[0138] The data in the data buffer is also written into the first storage unit through the processing unit.
[0139] In an exemplary embodiment, the simulation component includes a plurality of access interfaces;
[0140] Computer testing methods also include:
[0141] The current working mode of each access interface is set by the processing unit, and the current working mode includes a first working mode corresponding to allowing reading, and also includes a second working mode corresponding to allowing reading and allowing writing.
[0142] In an exemplary embodiment, the crawl analysis component includes an analysis unit;
[0143] The process of analyzing the test results of the current function to be tested of the function module to be tested based on the interactive data includes:
[0144] The acquired interaction data is compared and analyzed with the standard data through the analysis unit, abnormal data in the interaction data is identified, and prompt information is generated based on the abnormal data so that the tester can perform corresponding processing operations according to the prompt information.
[0145] Third, please refer to Figure 5 The present invention further provides a computer-readable storage medium 30 on which a computer program 31 is stored. When the computer program 31 is executed by a processor, the steps of the computer testing method described in any of the above embodiments are implemented.
[0146] For an introduction to a computer-readable storage medium provided by the present invention, please refer to the above embodiments, and the present invention will not be described in detail here.
[0147] A computer-readable storage medium provided by the present invention has the same beneficial effects as the above-mentioned computer testing method.
[0148] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0149] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A computer testing system, characterized in that: include: A control component, used for generating a test instruction corresponding to the current function to be tested of the functional module to be tested; A simulation component connected to the physical hardware environment, the simulation component is used to build and start a simulation hardware environment corresponding to the functional module to be tested, when the current firmware of the functional module to be tested is run through the simulation hardware environment, respond to the received test instruction to obtain a response result, and transmit the response result to the physical hardware environment; The capture and analysis component is used to capture the interaction data between the simulation component and the physical hardware environment, and analyze the test results of the current function to be tested of the function module to be tested based on the interaction data.
2. The computer testing system according to claim 1, characterized in that: The simulation component includes a first storage unit and a processing unit, and the processing unit includes a memory; The first storage unit is used to store multiple versions of firmware of the functional module to be tested; The processing unit is configured to perform a self-check on the simulation component after starting the simulation hardware environment, and after the self-check passes, load the current firmware corresponding to the version selection instruction among all the firmware stored in the first storage unit into the memory, and run the current firmware; The control component is further configured to output the version selection instruction.
3. The computer testing system according to claim 2, characterized in that: The process of performing self-check on the simulation component after starting the simulation hardware environment includes: After starting the simulated hardware environment, performing integrity detection on multiple versions of firmware stored in the first storage unit; When the integrity check of any version of the firmware fails, determining that the self-check fails; When the integrity detection of all versions of the firmware passes, outputting a prediction instruction to the physical hardware environment; Determining whether response information returned by the physical hardware environment in response to the prediction instruction is received within a preset time period; If so, it is determined that the self-test has passed; If not, it is determined that the self-test has failed.
4. The computer testing system according to claim 2, characterized in that: The first storage unit includes a plurality of storage areas, and the plurality of storage areas are divided based on the file size, type and access frequency of the firmware; The processing unit is also used for: When a new version of the firmware is received, obtaining the file size, type, and predicted access frequency of the new version of the firmware; Determining a target storage area corresponding to the new version of the firmware from among the plurality of storage areas according to the file size, type and predicted access frequency of the new version of the firmware; Based on whether the current storage capacity of the target storage area is less than the target storage capacity corresponding to the target storage area; If it is smaller than the target storage capacity, writing the new version of the firmware into the target storage area; If it is not less than the target storage capacity, determining whether there is firmware to be cleared that meets the invalidation condition in the target storage area; If yes, clearing the firmware to be cleared from the target storage area; If not, a target storage area corresponding to the new version of the firmware is re-determined from among the plurality of storage areas according to at most two items of the file size, type and predicted access frequency of the new version of the firmware.
5. The computer testing system according to claim 2, characterized in that: The capture and analysis component includes a capture unit for capturing interaction data between the simulation component and the physical hardware environment; The first storage unit is also used to store the interaction data; The processing unit is also used to upload the interactive data stored in the first storage unit to a remote server when an upload condition is met; the upload condition includes that the current storage capacity of the first storage unit is greater than a preset storage threshold, and / or, a trigger signal corresponding to the upload cycle is received.
6. The computer testing system according to claim 5, characterized in that: The capture and analysis component also includes a data buffer; The capture unit is also used to capture the interactive data between the simulation component and the physical hardware environment, and write the interactive data into the data buffer after converting the interactive data into a preset format; The processing unit is further configured to write the data in the data buffer into the first storage unit.
7. The computer testing system according to claim 2, characterized in that: The simulation component includes a plurality of access interfaces; The processing unit is further used to set a current working mode of each of the access interfaces, wherein the current working mode includes a first working mode corresponding to allowing reading, and a second working mode corresponding to allowing reading and allowing writing.
8. The computer testing system according to any one of claims 1 to 7, characterized in that: The capture and analysis component includes an analysis unit for comparing and analyzing the acquired interaction data with standard data, identifying abnormal data in the interaction data, and generating prompt information based on the abnormal data so that the tester can perform corresponding processing operations according to the prompt information.
9. A computer testing method, characterized in that: include: Generate a test instruction corresponding to the current function to be tested of the function module to be tested by the control component; Building and starting a simulated hardware environment corresponding to the functional module to be tested through a simulation component connected to the physical hardware environment, and when the current firmware of the functional module to be tested is run through the simulated hardware environment, a response result is obtained in response to the received test instruction, and the response result is transmitted to the physical hardware environment; The interaction data between the simulation component and the physical hardware environment is captured by a capture and analysis component, and the test result of the current function to be tested of the function module to be tested is analyzed based on the interaction data.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the computer testing method according to claim 9 are implemented.
