Method, apparatus and electronic device for testing hardware management software

By loading description files into the hardware management software to virtualize the static properties of hardware components, the problem of in-situ limitations of hardware components is solved, enabling flexible testing of the hardware management software and improving testing efficiency.

CN115712559BActive Publication Date: 2026-07-21XFUSION DIGITAL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XFUSION DIGITAL TECH CO LTD
Filing Date
2022-10-14
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In existing technologies, hardware management software testing can only be performed when the hardware components are in place, resulting in insufficient testing flexibility.

Method used

By virtualizing hardware components using mapping tables and description files when the hardware components are not in place, their static properties are loaded for testing.

Benefits of technology

It improves the testing flexibility of hardware management software, enabling management function testing even when hardware components are not available, reducing the cost of setting up the testing environment and improving testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115712559B_ABST
    Figure CN115712559B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a method, device and electronic equipment for testing hardware management software. In the method for testing hardware management software, a first test requirement is determined, which at least indicates a target management function to be tested and a first hardware component associated with the target management function. The first hardware component is not present. The first test requirement is executed, which includes querying a mapping table to determine a first description file corresponding to the first hardware component, loading the first description file into the hardware management software to virtually create a first virtual component corresponding to the first hardware component. The target management function of the hardware management software for the first virtual component is tested. Thus, the management function of the hardware management software for a certain hardware component can be tested without the hardware component being present, which improves the flexibility of testing the hardware management software.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of this application relate to the field of testing technology, and in particular to a method, apparatus and electronic device for testing hardware management software. Background Technology

[0002] Hardware management software provides various out-of-band management functions (or simply management functions) for each hardware component in a server. These hardware components can include, for example, the CPU, memory, hard drive, fan, chassis, network interface card (NIC), and NIC connectors. Management functions can include, for example, thermal management and alarm management.

[0003] To verify whether the hardware management software's management functions for each hardware component meet the specified requirements, the hardware management software itself needs to be tested. However, in traditional technologies, the software's management functions for a specific hardware component can typically only be tested when that component is present. Therefore, a more flexible solution for testing hardware management software is needed. Summary of the Invention

[0004] This application describes one or more embodiments of a method, apparatus, and electronic device for testing hardware management software, which can test the management functions of the hardware management software for a hardware component when that hardware component is not in place, thereby improving the flexibility of testing hardware management software.

[0005] Firstly, this application provides a method for testing hardware management software installed on a target server, which provides several management functions for various hardware components within the target server. The method includes: determining a first test requirement, which at least indicates a target management function to be tested and a first hardware component associated with the target management function, wherein the first hardware component is not present. Executing the first test requirement includes: querying a mapping table to determine a first description file corresponding to the first hardware component, the mapping table storing description files corresponding to each hardware component, each description file recording various static attributes of the corresponding hardware component. Loading the first description file into the hardware management software to virtualize a first virtual component corresponding to the first hardware component. Testing the target management function of the hardware management software for the first virtual component. Therefore, the management function of the hardware management software for a hardware component can be tested even when that hardware component is not present, improving the flexibility of testing the hardware management software.

[0006] In one possible implementation, before determining the first test requirement, the method further includes: obtaining the current hardware state, which at least indicates whether each hardware component is present or absent; determining the present target hardware component from among the hardware components based on the current hardware state; and executing the target test requirement for the hardware component involved. In other words, this solution can prioritize executing test requirements for hardware components where they are present, thereby enabling selective execution of test requirements and improving the flexibility of hardware management software testing.

[0007] In one possible implementation, after executing the first test requirement, the method further includes: determining a second test requirement, wherein the second hardware component involved in the second test requirement is associated with the first hardware component; and executing the second test requirement. This solution, after executing the first test requirement, selects and executes the second test requirement associated with the second hardware component and the first hardware component. In effect, it achieves the selection of test requirements based on hardware status, that is, it intelligently selects a specific management function for testing. Compared to traditional technologies that can only execute test requirements sequentially, this greatly improves the flexibility of hardware management software testing.

[0008] In one possible implementation, determining the first description file corresponding to the first hardware component includes: querying a mapping table based on the hardware identifier of the first hardware component to obtain the first description file corresponding to the first hardware component; or, determining a target identifier based on a combination of the hardware identifier and hardware type of the first hardware component. Based on the target identifier, querying the mapping table to obtain the first description file corresponding to the first hardware component. That is, this solution can improve the flexibility of mapping table lookups.

[0009] In one possible implementation, the hardware identifier is the board number (BoardId) of the first hardware component; or, the hardware identifier is a combination of the VID, DID, subVID, and subDID of the first hardware component. That is, this solution can set the hardware identifier of the first hardware component in multiple ways.

[0010] In one possible implementation, determining the target identifier includes: obtaining the hardware type code of the first hardware component; and sequentially concatenating the hardware type code of the first hardware component with the hardware identifier to obtain the target identifier.

[0011] In one possible implementation, the first hardware component is a network interface card (NIC), and the first virtual component is a virtual NIC. Testing the target management function of the hardware management software for the first virtual component includes: determining whether there are any available slots in the server; if there are available slots, establishing an association between the virtual NIC and the available slot to virtually insert the virtual NIC into the available slot; and testing the target management function of the hardware management software for the virtual NIC inserted into the available slot. This allows for testing the management function of NICs that are not currently in use.

[0012] In one possible implementation, determining whether there are available slots in the server includes: obtaining the current hardware status and, based on that, determining whether the network interface card (NIC) connector in the server is in place. If the NIC connector is in place, obtaining the slot status information of the NIC connector and, based on that, determining whether there are available slots in the server. If the NIC connector is not in place, determining that there are no available slots in the server.

[0013] In one possible implementation, the method further includes: if no free slots exist in the server, obtaining a second description file for the network interface card (NIC) connector and loading it into the hardware management software to virtualize a virtual connector corresponding to the NIC connector. A mapping between the virtual NIC and the virtual connector slots is established to virtually insert the virtual NIC into the virtual connector slot. The target management function of the hardware management software for the virtual NIC inserted into the virtual connector slot is then tested.

[0014] Secondly, this application provides an apparatus for testing hardware management software installed on a target server, which provides several management functions for various hardware components in the target server. The apparatus includes: a determining unit for determining a first test requirement, which at least indicates a target management function to be tested and a first hardware component associated with the target management function (the first hardware component is not currently present); and an execution unit for executing the first test requirement. The execution unit includes: a query submodule for querying a mapping table to determine a first description file corresponding to the first hardware component. The mapping table stores description files corresponding to each hardware component, where each description file records various static attributes of the corresponding hardware component; a loading submodule for loading the first description file into the hardware management software to virtualize a first virtual component corresponding to the first hardware component; and a testing submodule for testing the target management function of the hardware management software for the first virtual component.

[0015] In one possible implementation, the query submodule is specifically used to: query a mapping table based on the hardware identifier of the first hardware component to obtain the first description file corresponding to the first hardware component; or, determine a target identifier based on a combination of the hardware identifier and hardware type of the first hardware component. Based on the determined target identifier, the mapping table is queried to obtain the first description file corresponding to the first hardware component.

[0016] In one possible implementation, the hardware identifier is the board number (BoardId) of the first hardware component; or, the hardware identifier is a combination of the VID, DID, subVID, and subDID of the first hardware component.

[0017] In one possible implementation, the query submodule is further specifically used to: obtain the hardware type code of the first hardware component; and sequentially concatenate the hardware type code of the first hardware component with the hardware identifier to obtain the target identifier.

[0018] In one possible implementation, the apparatus may further include: an acquisition unit for acquiring a current hardware state, which at least indicates whether each hardware component is present or absent; and a determination unit for determining, based on the current hardware state, a target hardware component that is present from among the hardware components.

[0019] In one possible implementation, the determining unit is further configured to determine a second test requirement. The second hardware component involved in the second test requirement is associated with the first hardware component. The execution unit is further configured to execute the second test requirement.

[0020] In one possible implementation, the first hardware component is a network interface card (NIC), and the first virtual component is a virtual NIC. The testing submodule is specifically used to: determine if there are any free slots in the server; if free slots exist, establish an association between the virtual NIC and the free slot, so as to virtually insert the virtual NIC into the free slot; and test the target management functions of the hardware management software for the virtual NIC inserted into the free slot.

[0021] In one possible implementation, the test submodule is further configured to: obtain the current hardware status and determine, based on it, whether the network interface card (NIC) connector in the server is in place. If the NIC connector is in place, obtain the slot status information of the NIC connector and determine, based on it, whether there is an available slot in the server. If the NIC connector is not in place, determine that there is no available slot in the server.

[0022] In one possible implementation, the testing submodule is further configured to: if no free slots exist in the server, obtain the second description file of the network interface card (NIC) connector and load it into the hardware management software to virtualize a virtual connector corresponding to the NIC connector; establish a correspondence between the virtual NIC and the slots of the virtual connector to virtually insert the virtual NIC into the slot of the virtual connector; and test the target management functions of the hardware management software for the virtual NIC inserted into the slot of the virtual connector.

[0023] Thirdly, this application provides an electronic device comprising: at least one memory for storing a program; and at least one processor for executing the program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to perform the method described in the first aspect or any possible implementation thereof. Exemplarily, the electronic device may be, but is not limited to, a server.

[0024] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when run on a processor, causes the processor to perform the method described in the first aspect or any possible implementation thereof.

[0025] Fifthly, this application provides a computer program product that, when run on a processor, causes the processor to perform the method described in the first aspect or any possible implementation thereof.

[0026] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0027] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this application;

[0029] Figure 2 This diagram illustrates a hardware management software management method in one example.

[0030] Figure 3 A flowchart illustrating a method for testing hardware management software according to one embodiment is shown;

[0031] Figure 4The flowchart shows the loading methods for virtual and real components;

[0032] Figure 5 The flowchart illustrates a method for testing hardware management software in one example.

[0033] Figure 6 A diagram showing the static attributes of the network card is provided.

[0034] Figure 7 A schematic diagram of an apparatus for testing hardware management software according to one embodiment is shown. Detailed Implementation

[0035] The solution provided in this application will now be described with reference to the accompanying drawings.

[0036] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this application. Figure 1 In this context, hardware management software can be installed on the server. In one example, this hardware management software could be a BaseboardManager Controller (BMC). BMC is an intelligent management software that is compatible with industry-standard server management protocols such as Intelligent Platform Management Interface (IPMI), Simple Network Management Protocol (SNMP), and Redfish protocol. It supports keyboard, mouse, and video redirection, text console redirection, remote virtual media, and high-reliability hardware component management and monitoring.

[0037] The aforementioned hardware management software may include a component management module, which is primarily used to obtain the component attributes of hardware components. These component attributes include at least basic component information, which may include, but is not limited to, name, manufacturer, slot status information, type, component code, board ID, printed circuit board (PCB) information, and software version number. It is understood that after the component management module obtains the component attributes of a hardware component, it can perform out-of-band interface display and sensor monitoring based on these attributes.

[0038] Figure 2 This diagram illustrates a hardware management software management method in one example. Figure 2In this system, actual hardware components are installed on the server board. Hardware management software can obtain the component attributes of the hardware components by interacting with Complex Programming Logic Devices (CPLDs), Management Engines (ME), or Basic Input Output Systems (BIOS), thereby triggering the out-of-band management functions of the hardware management software.

[0039] Taking a hard drive as an example, the hardware management software can obtain the hard drive's BoardID (a type of hardware identifier) ​​using a CPLD. Then, based on the BoardID, the hardware management software can read the hard drive's component attributes, thereby displaying the hard drive in the user interface and enabling alarm management, heat dissipation management, and other functions for the hard drive.

[0040] Taking a network interface card (NIC) as an example, hardware management software can obtain the NIC's four-tuple information using the BIOS: Vendor Identifier (VID), Device Identifier (DID), subVID, and subDID. Based on this four-tuple information, the hardware management software can then read the NIC's component attributes, displaying the NIC in the user interface and enabling functions such as alarm management and thermal management.

[0041] In summary, hardware management software's management of hardware components can be divided into two parts: lower-level hardware delivery and upper-level out-of-band management. For upper-level out-of-band management, it is typically necessary to verify whether it meets specified requirements, i.e., out-of-band management needs to be tested. However, in traditional technologies, the hardware management software's management functions for a specific hardware component can usually only be tested when that component is in place. This affects the testing efficiency of the hardware management software.

[0042] Therefore, the inventors of this application propose to bypass the delivery of lower-level hardware and directly virtualize the hardware component by loading a description file (also known as a configuration file) that records the various static attributes of the hardware component when the hardware component is not in place, thereby enabling out-of-band management testing.

[0043] It should be understood that the above is called a static attribute because it is not a component attribute of a real, in-situ hardware component, but a component attribute simulated artificially.

[0044] The following is a detailed explanation of this plan.

[0045] Figure 3 A flowchart illustrating a method for testing hardware management software according to one embodiment is shown. This method can be executed by any system, device, platform, or device cluster with computing and processing capabilities. Figure 3 As shown, the method may include the following steps.

[0046] Step 302: Determine the first test requirement.

[0047] The aforementioned first test requirement, also known as the first test case, is manually pre-written before testing the hardware management software installed on the server. This first test requirement at least indicates the target management function to be tested, and the first hardware component associated with that function. Here, the first hardware component is any hardware component in the server that is not currently in use.

[0048] The aforementioned first hardware component can be, for example, a CPU, memory, hard drive, fan, chassis, network card, or network card connector, etc. The aforementioned target management functions can be, for example, thermal management functions, alarm management functions, etc.

[0049] The aforementioned first hardware component may have a corresponding hardware identifier. In one example, this hardware identifier may be the board number (BoardId) of the first hardware component. In another example, this hardware identifier may be a combination of VID, DID, subVID, and subDID.

[0050] In some embodiments, before determining the first test requirement, the following steps may be performed: Obtain the current hardware status, which at least indicates whether each hardware component in the server is present or absent. Based on the current hardware status, determine the present target hardware component from among the hardware components, and execute the target test requirement for the target hardware component.

[0051] In other words, this solution can prioritize the execution of test requirements for the hardware components involved, thereby enabling selective execution of test requirements and improving the flexibility of hardware management software testing.

[0052] It is understandable that the steps described above for determining the first test requirement may be performed after the test requirements for the hardware components involved are in place.

[0053] Step 304: Perform the first test requirement.

[0054] The execution of the first test requirement may include the following steps:

[0055] Step 3042: Query the mapping table to determine the first description file corresponding to the first hardware component.

[0056] The mapping table above stores the description files corresponding to each hardware component. Each description file is used to record the static attributes of the corresponding hardware component.

[0057] The static attributes of the aforementioned hardware components include at least: basic component information and hardware identifier.

[0058] Furthermore, the aforementioned description file can have a corresponding unique identifier. In one example, the unique identifier of the description file can be the hardware identifier of the corresponding hardware component. In another example, the unique identifier of the description file can be determined based on a combination of the hardware identifier of the corresponding hardware component and the hardware type.

[0059] The following example illustrates the method for determining the unique identifier of the description file in the other example above.

[0060] Specifically, the hardware type can be encoded first. For example, the network card connector can be encoded as "14140129", the network card as "14140130", and the hard drive backplane as "1406G002". Then, the hardware type encoding can be concatenated with the hardware identifier (such as BoardID or quadruple information) to obtain the unique identifier of the description file.

[0061] It is understandable that, when the unique identifier of the description file is the hardware identifier of the corresponding hardware component, the above-mentioned determination of the first description file corresponding to the first hardware component may include: based on the hardware identifier of the first hardware component, querying the mapping table to obtain the first description file corresponding to the first hardware component.

[0062] When the unique identifier of the description file is based on a combination of the hardware identifier and hardware type of the corresponding hardware component, the above-mentioned determination of the first description file corresponding to the first hardware component may include: determining a target identifier based on the combination of the hardware identifier and hardware type of the first hardware component; and querying a mapping table based on the target identifier to obtain the first description file corresponding to the first hardware component.

[0063] Specifically, the hardware type code and hardware identifier of the first hardware component are sequentially concatenated to obtain the aforementioned target identifier.

[0064] In one specific implementation of the mapping table, each description file can be recorded in the form of a Key_Value pair. The Key is a unique identifier for the description file, and the Value is the description file itself.

[0065] Finally, the above description file can be in XML format or JSON format; this specification does not limit this to either.

[0066] Step 3044: Load the first description file into the hardware management software to virtualize the first virtual component corresponding to the first hardware component.

[0067] This means loading the static attributes of the first hardware component into the hardware management software, thereby enabling the presentation of the first virtual component corresponding to the first hardware component in the hardware management software.

[0068] Step 3046: Test the target management function of the hardware management software for the first virtual component.

[0069] This involves testing whether the hardware management software's thermal management or alarm management functions for the first virtual component meet expectations.

[0070] For example, suppose the hardware management software manages the network card's heat dissipation as follows: when the network card's temperature exceeds 50 degrees Celsius, it starts the fan to run, thus achieving heat dissipation management. Then, if the temperature in the network card's description file is 50 degrees Celsius, we can test whether the hardware management software starts the fan. If it does, the heat dissipation management test for the network card passes; otherwise, the test fails.

[0071] At this point, the first test requirement has been completed. Next, the second test requirement can be determined, wherein the second hardware component involved in the second test requirement is associated with the first hardware component. The second test requirement is then executed.

[0072] The association between the second hardware component and the first hardware component can include: the second hardware component being identical to the first hardware component; or the second hardware component being a foundational component of the first hardware component, meaning that the first hardware component can only function if the second hardware component is present. For example, a network interface card (NIC) connector is a foundational component of a NIC.

[0073] After executing the first test requirement, this solution selects and executes the second test requirement associated with the first hardware component. In effect, it selects and executes test requirements based on the hardware status, which means it can intelligently select a management function for testing. Compared with traditional technology, which can only execute test requirements sequentially, this greatly improves the flexibility of hardware management software testing.

[0074] The method for testing hardware management software proposed in this application involves pre-analyzing each hardware component in the server to obtain a corresponding description file for each component. This process of analyzing hardware components to obtain description files is also called component modeling. Correspondingly, the obtained description files can be called model files. Furthermore, a mapping table can be established based on the hardware identifiers of each hardware component to record the aforementioned description files. Then, when executing a test requirement, the description file corresponding to the hardware component involved in the test requirement is first looked up from the mapping table based on the hardware identifier. This description file is then loaded into the hardware management software to virtualize the corresponding virtual component. Finally, the target management function (the management function indicated by the requirement) for this virtual component is tested. This allows for testing the management function of the hardware management software for a specific hardware component even when that component is not present, thereby improving the flexibility of testing the hardware management software.

[0075] In summary, the solution provided in this application can solve the following problems:

[0076] First, it can solve the problem of R&D testing activities being blocked when real hardware is not available. This solution analyzes and models hardware components, sorts out their static attributes and hardware identifiers, and virtualizes the components using XML files (or other file formats). By loading XML files (or other file formats), it can also experiment with the out-of-band management features of the hardware management software. This allows testing requirements to be freed from the limitations of the hardware environment.

[0077] Secondly, it addresses the issue of low testing efficiency. The complex and tedious component virtualization process is automated. Initially, requirement component analysis and modeling are performed to obtain component model information, such as XML files. Then, during testing, the hardware component can be loaded and virtualized using known component hardware identifiers (e.g., BoardId).

[0078] Third, based on the current hardware status, a specific hardware component can be selectively virtualized, thereby enabling the selective triggering of a particular management function test. In other words, this solution can determine whether to virtualize a component and which type of component to virtualize based on testing requirements, thus making testing more intelligent and diversified.

[0079] Corresponding to the problem solved, the solution provided by the embodiments of this application has the following beneficial effects:

[0080] First, it breaks free from hardware limitations, achieving the testing effect of real hardware through component modeling and virtualization simulation without the presence of actual hardware components.

[0081] Secondly, by automating the virtualization of a wide range of hardware components and the mapping and reading of model files, it breaks free from the limitations of testing single functions and single requirements. It can arbitrarily virtualize the hardware components involved according to testing needs, reducing the cost of setting up the test environment and greatly improving testing efficiency.

[0082] The following is a summary of the methods for loading virtual components and real components proposed in this solution.

[0083] Figure 4 The flowchart shows the loading methods for virtual and real components. Figure 4 In the method of loading real components, the hardware management software can obtain the component attributes of the hardware component by interacting with the CPLD, ME, or BIOS, thereby triggering out-of-band management of the hardware management software. In the method of loading virtual components, a description file replaces the real hardware. Specifically, based on the hardware identifier of the hardware component, the description file of the hardware component is found and virtually loaded, thereby achieving out-of-band management in place of the real component.

[0084] The following uses a network card as an example of a hardware component to illustrate the solution provided in the embodiments of this application.

[0085] Figure 5 This diagram illustrates a method for testing hardware management software in one example. The implementation scenario for this method can be as follows: The test requirement is to perform alarm management testing on a specific model of network interface card (NIC). After obtaining this test requirement, the current hardware status of the server is first obtained to determine if the NIC is present. If it is not present, then the NIC needs to be virtualized for alarm management testing.

[0086] like Figure 5 As shown, the method may include the following steps.

[0087] Step 502: Determine the first test requirement.

[0088] This first test requirement at least indicates the alarm management function to be tested, and the aforementioned network interface card (NIC). In one example, the NIC here could be a PCIe NIC.

[0089] Step 504: Perform the first test requirement.

[0090] The execution of the first test requirement may include the following steps.

[0091] Step 5042: Query the mapping table to determine the network card description file corresponding to the network card.

[0092] The network interface card (NIC) description file here is used to record various static attributes of the NIC.

[0093] For example, based on the network card's four-tuple information, a mapping table can be queried to determine the network card description file corresponding to the network card.

[0094] Figure 6 This diagram illustrates the static attributes of a network interface card (NIC). Figure 6 In a network interface card (NIC), the static attributes include: basic NIC information, unique identifier, supported features, and thermal management information. Basic NIC information includes several items such as: external name, chip model, manufacturer, and NIC type. The unique identifier can be a four-tuple. Supported features include several items such as: whether it supports Network Connectivity Status Indicator (NCSI), Management Component Transport Protocol (MCTP), and whether it supports out-of-band acquisition of optical module information. Thermal management information may include, for example, whether it has a temperature sensor.

[0095] Back Figure 5 middle, Figure 5 The method shown may also include the following steps:

[0096] Step 5044: Load the network card description file into the hardware management software to virtualize a virtual network card.

[0097] Step 5046: Determine if there are any free slots in the server; if there are free slots in the server, proceed to step 5048; if there are no free slots in the server, proceed to step 5052.

[0098] The above-mentioned determination of whether there are free slots in the server may include: obtaining the current hardware status and determining whether the network interface card (NIC) connector in the server is in place based on the current hardware status. If the NIC connector is in place, obtaining the slot status information of the NIC connector and determining whether there are free slots in the server based on the slot status information. If the NIC connector is not in place, determining that there are no free slots in the server.

[0099] It is understandable that the slot status information mentioned above can be one of the component attributes of the network card connector pre-obtained by the hardware management software. In one example, the network card connector here could be a Riser card.

[0100] Step 5048: Establish the association between the virtual network card and the available slot, so as to virtually insert the virtual network card into the available slot.

[0101] Step 5050: Test the alarm management function of the hardware management software for virtual network cards inserted into empty slots.

[0102] Step 5052: Obtain the connector description file of the network card connector and load the connector description file into the hardware management software to virtualize the virtual connector.

[0103] It should be understood that the connector description file here is used to record various static attributes of the network card connector.

[0104] Step 5054: Establish the correspondence between the virtual network card and the slot of the virtual connector, so as to virtually insert the virtual network card into the slot of the virtual connector.

[0105] Step 5056: Test the alarm management function of the hardware management software for the virtual network card inserted into the slot of the virtual connector.

[0106] It should be understood that after the first test requirement is completed, the associated test requirements involving the hardware components of the network card and / or the network card connector can be selected from the test requirements that have not yet been executed and executed. This allows for selective execution of test requirements, thereby improving test flexibility.

[0107] Corresponding to the method for testing hardware management software described above, this application also provides an apparatus for testing hardware management software. This hardware management software is installed on a target server and provides several management functions for each hardware component within the target server.

[0108] like Figure 7 As shown, the device may include:

[0109] The determining unit 702 is used to determine a first test requirement, which at least indicates the target management function to be tested and a first hardware component associated with the target management function, wherein the first hardware component is not in place.

[0110] Execution unit 704 is used to execute the first test requirement. Execution unit 704 includes:

[0111] The query submodule 7042 is used to query the mapping table to determine the first description file corresponding to the first hardware component. The mapping table stores the description files corresponding to each hardware component, and each description file is used to record the static attributes of the corresponding hardware component.

[0112] The loading submodule 7044 is used to load the first description file into the hardware management software to virtualize the first virtual component corresponding to the first hardware component.

[0113] Test submodule 7046 is used to test the target management function of the hardware management software for the first virtual component.

[0114] Specifically, the query submodule 7042 is used for:

[0115] Based on the hardware identifier of the first hardware component, a mapping table is consulted to obtain the first description file corresponding to the first hardware component; or,

[0116] Based on the combination of the hardware identifier and hardware type of the first hardware component, a target identifier is determined. Based on the determined target identifier, a mapping table is queried to obtain the first description file corresponding to the first hardware component.

[0117] Wherein, the aforementioned hardware identifier is the board number BoardId of the first hardware component; or, the aforementioned hardware identifier is a combination of the VID, DID, subVID and subDID of the first hardware component.

[0118] In some embodiments, the query submodule 7042 is further configured to: obtain the hardware type code of the first hardware component; and sequentially concatenate the hardware type code of the first hardware component with the hardware identifier to obtain the target identifier.

[0119] In some embodiments, the device may further include:

[0120] The acquisition unit 706 is used to acquire the current hardware status, which at least indicates whether each hardware component is in place or not.

[0121] The determining unit 702 is also used to determine the target hardware component in place from among the various hardware components based on the current hardware state.

[0122] In some embodiments, the determining unit 702 is further configured to determine a second test requirement. The second hardware component involved in the second test requirement is associated with the first hardware component.

[0123] Execution unit 704 is also used to execute the second test requirement.

[0124] In some embodiments, the first hardware component is a network interface card (NIC), and the first virtual component is a virtual NIC.

[0125] Test submodule 7046 is specifically used for:

[0126] Determine if there are any free slots in the server;

[0127] If there are available slots in the server, establish an association between the virtual network interface card (NIC) and the available slot to virtually insert the virtual NIC into the available slot.

[0128] The hardware management software was tested for its target management function for virtual network cards inserted into empty slots.

[0129] Test submodule 7046 is also specifically used for:

[0130] Obtain the current hardware status and determine whether the network card connector in the server is in place based on it;

[0131] If the network interface card (NIC) connector is in place, obtain the slot status information of the NIC connector and determine whether there is a free slot in the server based on it;

[0132] If the network card connector is not in place, confirm that there are no free slots in the server.

[0133] Test submodule 7046 is also specifically used for:

[0134] If there are no free slots in the server, the second description file of the network card connector is obtained and loaded into the hardware management software to virtualize the virtual connector corresponding to the network card connector.

[0135] Establish a mapping between virtual network interface cards (NICs) and virtual connector slots to virtually insert virtual NICs into the virtual connector slots;

[0136] The hardware management software was tested for its target management function for virtual network cards inserted into the slots of the virtual connector.

[0137] The functions of each functional module of the apparatus in the above embodiments of this specification can be implemented through the steps of the above method embodiments. Therefore, the specific working process of the apparatus provided in one embodiment of this specification will not be repeated here.

[0138] The apparatus for testing hardware management software provided in one embodiment of this specification can test the management function of the hardware management software for a hardware component when that hardware component is not in place, thereby improving the flexibility of testing the hardware management software.

[0139] Based on the methods in the above embodiments, this application provides an electronic device. The electronic device may include: at least one memory for storing a program; and at least one processor for executing the program stored in the memory, wherein when the program stored in the memory is executed, the processor performs the methods in the above embodiments. Exemplarily, the electronic device may be, but is not limited to, a server.

[0140] Based on the methods in the above embodiments, this application provides a computer-readable storage medium storing a computer program that, when run on a processor, causes the processor to execute the methods of the above embodiments.

[0141] Based on the methods in the above embodiments, this application provides a computer program product that, when run on a processor, causes the processor to execute the methods in the above embodiments.

[0142] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, the embodiments for electronic devices, readable storage media, and computer program products are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0143] The steps of the methods or algorithms described in conjunction with the disclosure in this specification can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in RAM, flash memory, ROM, EPROM, EEPROM, registers, hard disk, external hard disk, CD-ROM, or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and storage medium can reside in an ASIC. Alternatively, the ASIC can reside in a server. Of course, the processor and storage medium can also exist as discrete components in the server.

[0144] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium accessible to a general-purpose or special-purpose computer.

[0145] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0146] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this specification. It should be understood that the above description is only a specific embodiment of this specification and is not intended to limit the scope of protection of this specification. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of this specification should be included within the scope of protection of this specification.

Claims

1. A method for testing hardware management software, wherein the hardware management software is installed on a target server and provides several management functions for each hardware component in the target server; the method includes: Determine the first test requirements; The first test requirement at least indicates the target management function to be tested, and the first hardware component associated with the target management function; Performing the first test requirement includes: The mapping table is queried to determine the first description file corresponding to the first hardware component; the mapping table stores the description files corresponding to each hardware component, and each description file is used to record the static attributes of the corresponding hardware component. The first description file is loaded into the hardware management software to virtualize the first virtual component corresponding to the first hardware component; The hardware management software is tested for the target management function of the first virtual component; The first hardware component is a network interface card (NIC), and the first virtual component is a virtual NIC; The network interface card (NIC) description file is loaded into the hardware management software to virtualize a virtual NIC. The testing of the hardware management software for the target management function of the first virtual component includes: Determine if there are any free slots in the server; If there are available slots in the server, an association is established between the virtual network card and the available slot, so that the virtual network card can be inserted into the available slot in a virtualized manner; The hardware management software is tested for the target management function of the virtual network card inserted into the free slot; Prior to determining the first test requirement, the following is also included: Obtain the current hardware status; the current hardware status at least indicates whether each hardware component is in place or not. Based on the current hardware status, determine the in-situ target hardware component from among the various hardware components; The hardware components involved in the execution are the target test requirements for the target hardware components.

2. The method according to claim 1, further comprising, after executing the first test requirement: Determine the second test requirement; wherein the second hardware component involved in the second test requirement is associated with the first hardware component; Perform the second test requirement.

3. The method according to claim 1, wherein, The step of determining the first description file corresponding to the first hardware component includes: Based on the hardware identifier of the first hardware component, the mapping table is queried to obtain the first description file corresponding to the first hardware component; or, Based on the combination of the hardware identifier and hardware type of the first hardware component, a target identifier is determined; based on the target identifier, the mapping table is queried to obtain the first description file corresponding to the first hardware component.

4. The method according to claim 3, wherein, The hardware identifier is the board number (BoardId) of the first hardware component; or... The hardware identifier is a combination of the VID, DID, subVID, and subDID of the first hardware component.

5. The method according to claim 3, wherein, The determination of the target identifier includes: Obtain the encoding of the hardware type of the first hardware component; The target identifier is obtained by sequentially concatenating the hardware type code of the first hardware component with the hardware identifier.

6. The method according to claim 1, wherein, The step of determining whether there are any free slots in the server includes: Obtain the current hardware status and determine whether the network card connector in the server is in place based on it; When the network interface card (NIC) connector is in place, obtain the slot status information of the NIC connector and determine whether there is a free slot in the server based on it; If the network card connector is not in place, it is determined that there is no free slot in the server.

7. The method according to claim 1, further comprising: If there are no free slots in the server, the second description file of the network card connector is obtained and loaded into the hardware management software to virtualize the virtual connector corresponding to the network card connector. Establish a correspondence between the virtual network card and the slot of the virtual connector, so as to virtually insert the virtual network card into the slot of the virtual connector; The hardware management software is tested for the target management function of the virtual network card inserted into the slot of the virtual connector.

8. An electronic device, comprising: At least one memory for storing programs; At least one processor is configured to execute a program stored in memory, wherein when the program stored in memory is executed, the processor is configured to perform the method as described in any one of claims 1-7.