Command test method and device, electronic equipment, storage medium and program product
By building a test program and a preset command set on a single computer platform to automatically test BMC commands on different servers, the problem of high testing costs and low efficiency in the existing technology is solved, and efficient and low-cost BMC command testing is achieved.
Patent Information
- Application Number
- CN202411017880.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-10-18
AI Technical Summary
In the existing technology, testing server BMC commands is costly and inefficient. Equipment manufacturers need to purchase multiple servers and install hardware devices one by one for testing, resulting in a waste of resources and long time.
Build a test program on a single computer platform, automatically obtain the commands to be tested through a preset command set and send them to the device under test, covering BMC commands on different servers, and use the system management bus interface for testing, reducing costs and improving efficiency.
It achieves comprehensive coverage and efficient testing of different server-side BMC commands, reduces testing costs, simplifies the process, significantly improves testing efficiency, and avoids the need to purchase multiple servers and install hardware devices one by one.
Smart Images

Figure CN118796703A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of equipment testing, and in particular to a command testing method, device, electronic equipment, storage medium and program product. Background Art
[0002] In current server systems, BMC (Baseboard Management Controller) is an important component for server hardware management. It obtains various information from the device through standard interfaces such as SMBus (System Management Bus) to manage the device.
[0003] However, due to the differences in BMC commands between different server vendors, the hardware devices developed by equipment vendors, such as GPUs (Graphics Processing Units), need to be compatible with the BMC commands of various server vendors in order to be smoothly integrated and effectively managed by the BMCs of various server vendors. Therefore, equipment vendors not only need to invest a lot of resources to purchase servers from various vendors, but also need to install the hardware devices to be tested on the servers of various vendors one by one in order to test the BMC commands of the corresponding servers, which not only leads to high testing costs, but also cumbersome testing processes and low testing efficiency. Summary of the invention
[0004] The present invention provides a command testing method, device, electronic device, storage medium and program product, which are used to solve the defects of high testing cost and low testing efficiency in the BMC command testing of each server in the related art.
[0005] The present invention provides a command testing method, which is applied to a computer platform and comprises: Based on the test program, a command to be tested is obtained from a preset command set, and the command to be tested is sent to the device under test for testing, wherein the test program is pre-built on the computer platform, and the preset command set is pre-built based on the test commands of each server end; A response result returned by the device under test is received, and based on the response result, a test result corresponding to the command to be tested is determined.
[0006] According to a command testing method provided by the present invention, the step of constructing the preset command set includes: Obtaining relevant information of the test commands of each server end, wherein the relevant information includes at least one of command document information and command tracking information; Parsing the relevant information of the test commands of each server end to obtain the command format and parameter information of each test command; The preset command set is constructed based on the command format and parameter information of each test command.
[0007] According to a command testing method provided by the present invention, based on a test program, a command to be tested is obtained from a preset command set, and the command to be tested is sent to a device under test for testing, including: Based on the test program, the preset command set is traversed, and the traversed preset commands are used as the commands to be tested; Based on the system management bus interface, the command to be tested is sent to the device under test for testing.
[0008] According to a command testing method provided by the present invention, determining a test result corresponding to the command to be tested based on the response result includes: Compare the response result with the expected result to obtain a comparison result; If the comparison result is relatively consistent, then the test result corresponding to the command to be tested is determined to be a test success; otherwise, the test result corresponding to the command to be tested is determined to be a test failure.
[0009] According to a command testing method provided by the present invention, the step of determining a test result corresponding to the command to be tested further includes: Based on the preset command set, obtaining a server-side identifier corresponding to the command to be tested; The server-side identifier is associated with the test result corresponding to the command to be tested, and based on the association result, the test results of the test commands of each server-side are classified and displayed.
[0010] According to a command testing method provided by the present invention, the preset command set includes at least one of a temperature acquisition command, a power acquisition command, an HBM status acquisition command, a PCIE status acquisition command, and a FRU information acquisition command.
[0011] According to a command testing method provided by the present invention, the command types of the test commands of each server are all BMC commands.
[0012] The present invention also provides a command testing device, which is applied to a computer platform and comprises: A sending unit, configured to obtain a command to be tested from a preset command set based on a test program, and send the command to be tested to the device under test for testing, wherein the test program is pre-constructed on the computer platform, and the preset command set is pre-constructed based on the test commands of each server end; The determination unit is used to receive a response result returned by the device under test, and determine a test result corresponding to the command to be tested based on the response result.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the command testing methods described above is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the command testing method described in any one of the above is implemented.
[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the command testing method described above is implemented.
[0016] The command testing method, device, electronic device, storage medium and program product provided by the present invention can automatically obtain the commands to be tested from the preset command set through the test program pre-constructed on the computer platform, and send these commands directly to the device under test for testing. Since the preset command set is constructed based on the test commands of each server side, it is possible to achieve comprehensive coverage and efficient testing of different server-side test commands on a single computer platform, thereby eliminating the need to purchase servers from different manufacturers and installing the devices under test one by one on the server for testing. This not only greatly reduces the testing cost, but also simplifies the testing process and significantly improves the testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are 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.
[0018] Figure 1 It is a schematic diagram of the architecture of performing BMC command testing on the server side provided by the present invention; Figure 2 It is a schematic diagram of the architecture of performing BMC command testing on a PC platform provided by the present invention; Figure 3 It is a flowchart of the command testing method provided by the present invention; Figure 4 It is a schematic diagram of a flow chart of the construction of the preset command set provided by the present invention; Figure 5is a structural schematic diagram of a command testing device provided by the present invention; Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings 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.
[0020] BMC (Baseboard Management Controller) is a special microcontroller integrated into hardware systems such as servers, computers, and network devices, and is used to remotely manage and monitor hardware devices. In the server management ecosystem, BMC, as an important component of server hardware management, communicates with various components inside the server through standard interfaces such as SMBus to obtain various information on the device side, thereby realizing functions such as device management, server health status monitoring, and fault diagnosis.
[0021] However, because different server vendors use their own unique command sets and protocols when designing and implementing BMC functions, equipment vendors face significant compatibility issues during development and management. In order to ensure that their hardware devices (such as GPUs, etc.) can be smoothly integrated and effectively managed by the BMCs of various server vendors, equipment vendors have to conduct extensive and complex compatibility testing. This requires equipment vendors to not only have a deep understanding of and master the BMC command specifications of various mainstream server vendors, but also invest a lot of resources to purchase servers from various vendors and build a test environment.
[0022] Figure 1 FIG. 1 is a schematic diagram of an architecture for performing a BMC command test on a server side provided by the present invention, such as Figure 1 As shown, the equipment manufacturer needs to test the equipment (such as Figure 1 Devices shown in the figure) are installed one by one on the servers of each manufacturer (such as Figure 1The server shown in the figure is used to verify and debug the compatibility and effectiveness of the BMC command through actual operation. Here, the BMC command refers to the instruction or command to interact with the server BMC, which is sent by the BMC on the server to the device under test and receives the response result returned by the device under test. In addition, to ensure the long-term stable operation of the system, the equipment manufacturer needs to set up a dedicated test server for daily guard testing to monitor and respond to possible compatibility issues. This testing method not only greatly increases the R&D and testing costs of the equipment manufacturer by purchasing and maintaining servers from different manufacturers for testing, but also takes a long time and has low testing efficiency because the test needs to be performed one by one on the servers of each manufacturer.
[0023] In this regard, the present invention provides a command testing method, which achieves comprehensive coverage and efficient testing of BMC commands from different server manufacturers by building a test program on a unified computer platform, which can not only reduce procurement and maintenance costs, but also improve testing efficiency, thereby overcoming the above-mentioned defects.
[0024] It should be noted that the command testing method provided by the present invention can be applied to a computer platform, which is different from a server. A server refers to a computer specially designed to provide services, store and process data, while a computer platform refers to an environment in which hardware and software jointly run application programs. Here, the computer platform can be a PC (Personal Computer) platform, such as a desktop computer, a laptop computer, a tablet computer, etc., and the embodiments of the present invention do not specifically limit this.
[0025] Figure 2 FIG. 1 is a schematic diagram of an architecture for performing a BMC command test on a PC platform provided by the present invention. Figure 2 As shown in the figure, a test program is built on the PC platform in advance and executed through the CPU (Central Processing Unit). Relying on the SMBus interface of the PC platform, the CPU can send the BMC commands of each server manufacturer to the device under test (i.e. Figure 2 It should be understood that the PC platform is equipped with a chipset, which is a group of integrated circuit chips that work together. The chipset is the core component of the PC platform and is responsible for connecting the main components of the computer, including the CPU, memory, expansion slots, etc., to ensure smooth communication between them. Therefore, through the SMBus interface of the chipset, the CPU can access and test various devices.
[0026] Specifically, when performing a server BMC command test on a PC platform, the device under test (such as a GPU) can be inserted into a PCIE (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) slot in the PC platform. The CPU acts as the master node on the system management bus (SMBus), and the GPU acts as a slave node on the system management bus. The CPU can send commands to the GPU and receive responses through the SMBus interface, thereby implementing command testing.
[0027] Figure 3 It is a flowchart of the command testing method provided by the present invention, such as Figure 3 As shown, the method is applied to a computer platform, and the method includes: Step 310, based on the test program, obtaining the command to be tested from the preset command set, and sending the command to be tested to the device under test for testing, wherein the test program is pre-built on the computer platform, and the preset command set is pre-built based on the test commands of each server end; It should be noted that in order to test the test commands of each server side on a computer platform (i.e., PC platform), a test program and a preset command set can be created in advance on the PC platform. Here, the test program refers to a software application specially designed for automated testing, which contains the logic, algorithms and instructions required to perform the test, and can simulate the test commands of each server side to interact with the device under test to verify whether the status and performance of various aspects of the device under test meet expectations. The test program can send test commands to the device under test, and receive and analyze the responses returned by the device to evaluate the success of the test. The preset command set refers to a set of all possible commands that can be used to test the device under test, which are pre-defined based on the test commands of each server side.
[0028] Specifically, after the test program is constructed, the test program can select one or more commands to be tested from a preset command set according to a predetermined strategy or rule, and send these commands to the device under test for testing. For example, commands can be taken out from the set in sequence according to a preset command order for testing; commands can also be randomly selected from the set using a random number generator for testing to increase the randomness and coverage of the test; commands related to the current test scenario (such as testing a certain manufacturer's server BMC command) can also be selected from the set for testing. It should be understood that the above-mentioned commands to be tested refer to specific commands selected from a preset command set in the current test round and prepared to be sent to the device under test for testing. The above-mentioned device under test refers to a device that needs to be tested, which can be a GPU, GPGPU (General-purpose computing on graphics processing units, general-purpose graphics processor), etc. During the test process, the device under test can receive commands sent by the test program, perform corresponding operations according to the commands, and return corresponding responses.
[0029] After receiving the command to be tested, the device under test will parse the command and identify the command type, parameters and other information; based on the parsed command information, the device under test will perform the corresponding operation or query the corresponding status, and return the execution result or query status to the test program in the form of a response. For example, the device under test may be a GPU, and the command to be tested may be a command to obtain GPU temperature, obtain GPU power, etc. After receiving these commands, the GPU will parse them and query the current temperature or power based on the parsed information. Subsequently, the GPU will return the queried current temperature or current power to the test program to verify whether the test has passed.
[0030] It is understandable that before executing step 310, a preset command set can be constructed in advance on the PC platform based on the test commands of each server side. Here, the test commands of each server side refer to the test commands corresponding to servers of different types or different manufacturers. For example, the command type of the test commands of each server side can be the BMC command of each server manufacturer, which refers to the instruction set used to manage and control the server hardware, and these instructions are executed by the BMC chip on the server motherboard. It should be understood that different server manufacturers will customize or expand the functions and interfaces of the BMC according to the design and requirements of their own servers, so the BMC command sets of different server manufacturers will also be different. The preset command set is pre-built based on the BMC commands of each server manufacturer, which means that the set contains BMC commands provided by multiple server manufacturers, so that the test program on the PC platform can simulate the BMC commands of each server manufacturer to interact with the device under test (such as GPU), thereby realizing the testing of the BMC commands of all server manufacturers on the PC platform.
[0031] Specifically, building a preset command set based on the test commands of each server can be achieved through the following steps: First, collect server BMC commands of different types or different manufacturers. These commands can come from official documents, technical manuals, etc. provided by server manufacturers; then, conduct in-depth analysis of the collected documents to understand the specific format, command ID (Identity Document, identity identification number), parameter list, return value and other information of the BMC commands of each manufacturer's server; on the PC platform, based on the BMC command format and parameter information obtained by analysis, build a set of BMC commands to be tested from different server manufacturers, thereby obtaining a preset command set. The set can be a database, configuration file, code library or any other form suitable for storing and organizing this data. In addition, as time goes by and server manufacturers release new BMC commands or update existing commands, the preset command set also needs to be regularly updated and maintained to ensure that it always contains the latest and most comprehensive server BMC commands.
[0032] Before executing step 310, a test program can also be pre-built on the PC platform. Specifically, it can be built through the following steps: first, analyze the test requirements, clarify the test objectives, scope, etc., and design the test process according to the test requirements; then, you can use a programming language (such as C, C++, Python, etc.) to write the code of the test program according to the test process and a pre-built preset command set, and debug it to ensure that the program can run normally and achieve the expected results; after debugging is completed, the test program can be deployed to the PC platform and prepared for testing.
[0033] Step 320: Receive a response result returned by the device under test, and determine a test result corresponding to the command to be tested based on the response result.
[0034] Specifically, the response result refers to the data or information returned to the test program after the device under test receives the test command sent by the test program and performs the corresponding operation or queries the status. These data or information include the results of the operation, status information, error codes, etc., which are used by the test program to evaluate whether the behavior of the device under test meets expectations. When the device under test returns the response result, the test program can receive the data or information returned by the device under test by continuously monitoring the communication channel established with the device under test (such as the SMBus interface).
[0035] After receiving the response result returned by the device under test, the test program can parse it to extract useful information, and determine the test result of the command to be tested based on the parsed result. Specifically, the test program can predefine the expected result of each command to be tested, including the success status of the operation, the returned data content, the error code, etc.; then, the response result actually received is compared with the expected result, so that the test result of the command to be tested can be evaluated based on the comparison result. Here, the test result refers to the judgment conclusion drawn by the test program after executing a series of test steps, based on the comparison result of the response result of the device under test and the expected result, on whether the function, performance, reliability, etc. of the device under test meet the expectations. The test result can be expressed in the form of success, failure, warning, etc., and contains detailed test data and comparison results.
[0036] The method provided by the embodiment of the present invention can automatically obtain the commands to be tested from the preset command set and send these commands directly to the device under test for testing through the test program pre-constructed on the computer platform. Since the preset command set is constructed based on the test commands of each server, it is possible to achieve comprehensive coverage and efficient testing of different server-side test commands on a single computer platform, thereby eliminating the need to purchase servers from different manufacturers and eliminating the need to install the devices under test one by one on the server for testing. This not only greatly reduces the testing cost, but also simplifies the testing process and significantly improves the testing efficiency.
[0037] Based on any of the above embodiments, Figure 4 is a flow chart of the preset command set provided by the present invention, such as Figure 4 As shown, the steps of constructing the preset command set include: Step 410, obtaining relevant information of the test commands of each server, wherein the relevant information includes at least one of command document information and command tracking information; Specifically, in order to construct a preset command set, relevant information of the test commands of each server side can be collected and obtained first. Here, the relevant information of the test command refers to data or information related to the BMC commands of each server manufacturer, which can help understand and build a preset command set. For example, the relevant information of the test command may include command document information, command tracking information, or command document information and command tracking information at the same time, wherein the command document information refers to official documents, technical manuals, etc. that record the command instructions, syntax, parameters, examples, etc. in detail. Command tracking information refers to the data of the BMC command on the system bus captured using a protocol analyzer.
[0038] It is understandable that in order to obtain relevant information about the test commands of each server, it is possible to collect and obtain information from the official website, technical manuals, support forums and other channels of each server manufacturer, or to use tools such as protocol analyzers to capture the interaction process of BMC commands in a real server environment, thereby obtaining the tracking information of the server BMC commands. Here, a protocol analyzer refers to a special test tool used to monitor the data flow in a data communication system and verify whether the data exchange is correctly carried out in accordance with the protocol. It can capture the BMC command trace (i.e., command tracking information) of servers from different manufacturers.
[0039] Step 420, parsing the relevant information of the test commands of each server end to obtain the command format and parameter information of each test command; Specifically, after obtaining the relevant information of the test commands of each server, the information can be parsed to extract the command format and parameter information of each test command. Here, the command format refers to the basic structure and writing method of the command, including the command name, parameter list, options, etc.; parameter information refers to the required or optional parameters and their detailed descriptions when the command is executed, including the parameter name, data type, whether it is required, default value, description, etc.
[0040] It can be understood that in order to extract the command format and parameter information of each test command, the collected command document information can first be deeply analyzed to understand the specific format, command ID, parameter list, return value and other information of each server manufacturer's BMC command; then, the BMC command format analyzed from the document can be compared and verified with the actual captured BMC command trace to ensure the accuracy and consistency of the information, thereby obtaining accurate BMC command format and parameter information.
[0041] Step 430: construct the preset command set based on the command format and parameter information of each test command.
[0042] Specifically, after parsing the command format and parameter information of each test command, a data structure suitable for storing command information, such as a list, a dictionary, a database table, etc., can be designed, and the format of each element in the set and the information fields contained therein, such as command ID, command name, command format, parameter list, return value description, etc. can be determined; then the command format and parameter information of each test command obtained by parsing are filled into the preset command set, thereby constructing a preset command set.
[0043] It can be understood that the preset command set is constructed based on the BMC commands of various server manufacturers, which includes BMC commands specific to different server manufacturers and common BMC commands. Therefore, when the equipment manufacturer tests the compatibility between the tested device and servers from different manufacturers, no matter which manufacturer's server's BMC commands, the test program can find the corresponding commands from the preset command set for testing, thereby enhancing the comprehensiveness of the test.
[0044] Based on any of the above embodiments, step 310 specifically includes: Step 311, based on the test program, traverse the preset command set, and use the traversed preset commands as the commands to be tested; Step 312: Based on the system management bus interface, send the command to be tested to the device under test for testing.
[0045] Specifically, after the test program is built on the PC platform, the BMC commands of each server manufacturer can be simulated through the test program to interact with the device under test. First, the preset command set can be traversed through the test program to ensure that the test program can execute all commands in the set in sequence for comprehensive testing. Here, when traversing the preset command set, the loop structure in the programming language (such as for loop, while loop, etc.) can be used to access each element in the set in sequence. These elements are preset commands in this scenario.
[0046] Specifically, a set containing all preset commands can be defined in the test program, and a loop structure can be used to traverse the set, taking out a command from the set in each loop; in the loop body, the test logic is executed on the taken command, that is, the taken command is sent to the device under test for testing and waits for a response. It should be understood that the preset command traversed above refers to a command in the set taken out by the current loop iteration during the traversal process, which is a specific element in the set, and the test program will execute the corresponding test logic for this command.
[0047] During the loop traversal process, after taking a preset command from the preset command set, the current preset command can be used as the command to be tested, and the command to be tested can be sent to the device under test through the system management bus interface for testing. Here, the system management bus interface refers to an interface for communication through the SMBus protocol, which allows the master node (such as the CPU on the PC platform) to communicate with the slave node (such as the GPU of the device under test).
[0048] Based on any of the above embodiments, in step 320, determining the test result corresponding to the command to be tested based on the response result includes: Step 321, comparing the response result with the expected result to obtain a comparison result; Step 322: If the comparison result is relatively consistent, then determine that the test result corresponding to the command to be tested is a test success; otherwise, determine that the test result corresponding to the command to be tested is a test failure.
[0049] Specifically, after receiving the response result returned by the device under test, the test program can parse it to convert it into a format that is convenient for comparison (such as a string, number, etc.). Then, the parsed response result can be compared with the expected result using an appropriate comparison operator or comparison function to obtain a comparison result. Here, the expected result is a pre-defined or expected response result based on the specification, documentation, or known device behavior of the test command before the test. It is a benchmark for evaluating whether the actual response result meets the expected standard. If the expected result is not directly given in a comparable format, it also needs to be parsed and converted.
[0050] The above comparison result refers to the result obtained after comparing the response result with the expected result, which can be a Boolean value (true or false), an error code, or a descriptive string, indicating whether the response result is consistent with the expected result. If the comparison result is relatively consistent (or called matching, equal), it means that the response of the device under test to the test command is consistent with the expected result, that is, the device under test executes the test command in the expected manner or the corresponding state of the device under test is consistent with expectations. In this case, it can be determined that the test result corresponding to the command to be tested is a test success. If the comparison result is inconsistent (or called mismatch, unequal), it means that the response of the device under test to the test command is inconsistent with the expected result, that is, the device under test does not execute the test command in the expected manner or the corresponding state of the device under test is inconsistent with expectations, which may be caused by a variety of reasons, such as device failure, software error, configuration error or problem with the test command itself. In this case, it can be determined that the test result corresponding to the command to be tested is a test failure, and the cause can be further analyzed.
[0051] For example, if the device under test is a GPU, after receiving the test command to obtain the GPU temperature, the GPU will query the current temperature value of its temperature sensor and return the queried current temperature to the test program. After receiving the current temperature returned by the GPU, the test program will compare it with the expected result, that is, determine whether the current temperature of the GPU is within the normal temperature range corresponding to the GPU idle state. If it is within the range, it indicates that the test has passed.
[0052] Based on any of the above embodiments, after step 320, the method further includes: Based on the preset command set, obtaining a server-side identifier corresponding to the command to be tested; The server-side identifier is associated with the test result corresponding to the command to be tested, and based on the association result, the test results of the test commands of each server-side are classified and displayed.
[0053] It should be noted that, considering that the preset command set includes BMC commands of various server manufacturers, when performing unified testing through the PC platform, in order to be able to identify which server manufacturer's BMC command the currently executed command to be tested belongs to, and at the same time identify the test results of BMC commands of different server manufacturers, when constructing the preset command set, a specific identifier can be added to each test command from a different server manufacturer for identification and distinction. For example, the command name or part of the command parameters can be used to identify the manufacturer, or a metadata field can be maintained for each command, which is used to record the manufacturer source of the command.
[0054] Specifically, in the test program, when a preset command is traversed, the server-side identifier of the command can be read to determine which server manufacturer it belongs to, and then the identifier is recorded or processed as part of the test process. Here, the server-side identifier refers to a specific identifier added to each command in order to distinguish BMC commands from different server manufacturers. It can be a string, a numeric code, or a more complex structure, which is used to uniquely identify which server manufacturer the command comes from during the test process.
[0055] When receiving the response result returned by the device under test, the test program can associate the test result with the corresponding server-side identifier according to the previously determined server-side identifier (i.e., command manufacturer information) after determining the test result of the command based on the response result. Here, through association, the test result of the command can be associated with the corresponding manufacturer, thereby ensuring the accuracy and traceability of the test result. During the test process, since the BMC commands of different server manufacturers are different, even if the same operation is performed, the test results may vary from manufacturer to manufacturer. By associating the server-side identifier of the command with the test result, the system can clearly know which test result corresponds to which server manufacturer's command, thereby avoiding confusion and misjudgment. In addition, this association also facilitates subsequent test result analysis and problem location, helping developers or testers to quickly identify and solve possible problems.
[0056] After associating the server-side identifier corresponding to the command to be tested with the test result, the association result can be obtained. Here, the association result refers to the logical connection established between the server-side identifier of the command to be tested and the corresponding test result. According to the association result, the test results of the test commands of each server side can be classified and displayed. Here, the test results of the test commands of each server side are the test results of the BMC commands of each server manufacturer, which can be obtained through the test results of each command to be tested.
[0057] Specifically, during the test process, all executed commands and their corresponding test results and server-side identifiers can be collected; the test results can be classified and sorted according to the server-side identifier, and the test results belonging to the same server manufacturer can be grouped together; a visual display interface for the test results can be designed to clearly display the test results of different server manufacturers, for example, by using different colors, labels, groups or tables. Finally, in the display interface, the test results are classified and displayed according to the server-side identifier for easy viewing by users.
[0058] Based on any of the above embodiments, the preset command set includes at least one of a temperature acquisition command, a power acquisition command, an HMB status acquisition command, a PCIE status acquisition command, an SPC status acquisition command, and a FRU information acquisition command.
[0059] Specifically, the preset command set is constructed based on the BMC commands of each server manufacturer. The BMC provides remote monitoring, management and fault diagnosis functions for hardware devices. Therefore, each preset command in the preset command set is a command related to the device under test.
[0060] Exemplarily, the device under test takes a GPU as an example, and the temperature acquisition command refers to a command used to query and obtain the current temperature of the GPU; the power acquisition command refers to a command used to obtain the current power consumption information of the GPU; the HBM (High Bandwidth Memory) status acquisition command refers to a command used to query the status of the HBM module on the GPU, including bandwidth utilization, data transmission speed, etc. The PCIE (Peripheral Component Interconnect Express) status acquisition command refers to a command used to query the power status and link status of the PCIE interface. The SPC (Service Processor Controller) status acquisition command refers to a command used to query the current status of the GPU service processor component, storage controller, etc. The FRU (Field Replaceable Unit) information acquisition command refers to a command used to obtain the FRU information of the GPU, including the serial number, model, manufacturer, etc. In addition, the preset commands in the preset command set may also include a command to set the maximum power of the GPU, which allows the administrator to set the maximum power limit for the GPU. By limiting the maximum power consumption of the GPU, unnecessary power consumption can be avoided while ensuring the stable operation of the system. The above commands together constitute detailed monitoring and management capabilities for the GPU. Testing these commands helps ensure that the GPU runs efficiently and stably on the server.
[0061] Based on any of the above embodiments, the command types of the test commands of each server are all BMC commands.
[0062] Specifically, when constructing a preset command set based on the test commands of each server side, the test commands of each server side are the BMC commands of each server manufacturer. Although these test commands come from different server manufacturers, their command types are all BMC commands, which shows that during the test process, the main focus is on the management and monitoring functions of the BMC of each manufacturer's server on the device under test.
[0063] Based on any of the above embodiments, an embodiment of the present invention provides a method for testing a server BMC command based on a PC platform, the method comprising: Step S1, obtaining BMC command information provided by different server manufacturers or using a protocol analyzer to capture the BMC command trace of each server platform; Step S2, parsing the acquired BMC command information or BMC command trace to obtain the command format and parameter information of each server BMC command; Step S3, constructing a preset command set based on the command format and parameter information of each server BMC command; Step S4, writing a test program on the PC platform, traversing the preset command set through the test program, and using the traversed preset commands as commands to be tested; Step S5, based on the SMBus interface of the PC platform, sending the command to be tested to the GPU for testing; Step S6, receiving the response result returned by the GPU, and comparing the response result with the expected result to determine the test result corresponding to the command to be tested.
[0064] Based on any of the above embodiments, Figure 5 is a schematic diagram of the structure of the command test device provided by the present invention, such as Figure 5 As shown, the device is applied to a computer platform, and the device includes: The sending unit 510 is used to obtain the command to be tested from the preset command set based on the test program, and send the command to be tested to the device under test for testing, wherein the test program is pre-built on the computer platform, and the preset command set is pre-built based on the test commands of each server end; The determination unit 520 is configured to receive a response result returned by the device under test, and determine a test result corresponding to the command to be tested based on the response result.
[0065] The device provided by the embodiment of the present invention can automatically obtain the commands to be tested from the preset command set through the test program pre-constructed on the computer platform, and send these commands directly to the device under test for testing. Since the preset command set is constructed based on the test commands of each server side, it is possible to achieve comprehensive coverage and efficient testing of different server-side test commands on a single computer platform, thereby eliminating the need to purchase servers from different manufacturers and installing the devices under test one by one on the server for testing. This not only greatly reduces the testing cost, but also simplifies the testing process and significantly improves the testing efficiency.
[0066] Based on any of the above embodiments, the device further includes a construction unit, and the construction unit is used to: Obtaining relevant information of the test commands of each server end, wherein the relevant information includes at least one of command document information and command tracking information; Parsing the relevant information of the test commands of each server end to obtain the command format and parameter information of each test command; The preset command set is constructed based on the command format and parameter information of each test command.
[0067] Based on any of the foregoing embodiments, the sending unit 510 is specifically configured to: Based on the test program, the preset command set is traversed, and the traversed preset commands are used as the commands to be tested; Based on the system management bus interface, the command to be tested is sent to the device under test for testing.
[0068] Based on any of the foregoing embodiments, the determining unit 520 is specifically configured to: Compare the response result with the expected result to obtain a comparison result; If the comparison result is relatively consistent, then the test result corresponding to the command to be tested is determined to be a test success; otherwise, the test result corresponding to the command to be tested is determined to be a test failure.
[0069] Based on any of the above embodiments, the device further includes a display unit, and the display unit is used to: Based on the preset command set, obtaining a server-side identifier corresponding to the command to be tested; The server-side identifier is associated with the test result corresponding to the command to be tested, and based on the association result, the test results of the test commands of each server-side are classified and displayed.
[0070] Based on any of the above embodiments, the preset command set includes at least one of a temperature acquisition command, a power acquisition command, a high-bandwidth memory status acquisition command, a high-speed interface status acquisition command, a service processor controller status acquisition command, and a replaceable component acquisition command.
[0071] Based on any of the above embodiments, the command types of the test commands of each server are all baseboard management controller commands.
[0072] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the command testing method, which includes: based on the test program, obtaining the command to be tested from the preset command set, and sending the command to be tested to the device under test for testing, wherein the test program is pre-built on the computer platform, and the preset command set is pre-built based on the test commands of each server end; receiving the response result returned by the device under test, and determining the test result corresponding to the command to be tested based on the response result.
[0073] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0074] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the command testing method provided by the above methods, the method including: based on the test program, obtaining the command to be tested from a preset command set, and sending the command to be tested to the device under test for testing, the test program is pre-constructed on the computer platform, and the preset command set is pre-constructed based on the test commands of each server end; receiving the response result returned by the device under test, and determining the test result corresponding to the command to be tested based on the response result.
[0075] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the command testing method provided by the above-mentioned methods, the method comprising: based on the test program, obtaining a command to be tested from a preset command set, and sending the command to be tested to the device under test for testing, the test program is pre-constructed on the computer platform, and the preset command set is pre-constructed based on the test commands of each server end; receiving a response result returned by the device under test, and determining the test result corresponding to the command to be tested based on the response result.
[0076] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected for implementation according to actual needs. Those of ordinary skill in the art may understand and implement them without creative effort.
[0077] Through the description of the above implementation methods, those skilled in the art can clearly understand each implementation method and can implement it by means of software plus a necessary general hardware platform. Based on such an understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A command testing method, It is characterized in that The method is applied to a computer platform, and comprises: Based on the test program, a command to be tested is obtained from a preset command set, and the command to be tested is sent to the device under test for testing, wherein the test program is pre-built on the computer platform, and the preset command set is pre-built based on the test commands of each server end; A response result returned by the device under test is received, and based on the response result, a test result corresponding to the command to be tested is determined.
2. The command testing method according to claim 1, It is characterized in that The steps of constructing the preset command set include: Obtaining relevant information of the test commands of each server end, wherein the relevant information includes at least one of command document information and command tracking information; Parsing the relevant information of the test commands of each server end to obtain the command format and parameter information of each test command; The preset command set is constructed based on the command format and parameter information of each test command.
3. The command testing method according to claim 1, It is characterized in that The method of obtaining a command to be tested from a preset command set based on the test program and sending the command to be tested to the device under test for testing includes: Based on the test program, the preset command set is traversed, and the traversed preset commands are used as the commands to be tested; Based on the system management bus interface, the command to be tested is sent to the device under test for testing.
4. The command testing method according to claim 1, It is characterized in that The determining, based on the response result, a test result corresponding to the command to be tested includes: Compare the response result with the expected result to obtain a comparison result; If the comparison result is relatively consistent, then the test result corresponding to the command to be tested is determined to be a test success; otherwise, the test result corresponding to the command to be tested is determined to be a test failure.
5. The command testing method according to claim 1, It is characterized in that The step of determining the test result corresponding to the command to be tested further includes: Based on the preset command set, obtaining a server identifier corresponding to the command to be tested; The server identifier is associated with the test result corresponding to the command to be tested, and based on the association result, the test results of the test commands of each server are classified and displayed.
6. The command testing method according to any one of claims 1 to 5, It is characterized in that The preset command set includes at least one of a temperature acquisition command, a power acquisition command, an HBM status acquisition command, a PCIE status acquisition command, and a FRU information acquisition command.
7. The command testing method according to any one of claims 1 to 5, It is characterized in that The command types of the test commands of each server are all BMC commands.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the command testing method according to any one of claims 1 to 7 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the command testing method according to any one of claims 1 to 7 is implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the command testing method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Server test method, electronic equipment and storage medium
CN120386675A
Script test verification method and electronic equipment
CN122220199A
