Interface testing method and device of management controller, equipment and storage medium

By obtaining the interactive data of the management controller from the production environment to generate preset test cases, automatically filtering the target test cases and performing dynamic verification, the problem of complexity and effectiveness of the BMC interface test generation process is solved, and efficient interface testing is achieved.

CN120276995APending Publication Date: 2025-07-08INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510495051.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

Existing BMC interface testing relies on manual writing of test scripts, which makes the generation process complex and the test effectiveness difficult to guarantee.

Method used

By obtaining the interactive data of the management controller from the production environment, generating preset test cases, filtering target test cases based on the automated matching mechanism, and dynamic verification of the scene parameters to be tested is achieved to realize interface testing.

Benefits of technology

It improves the efficiency and effectiveness of the generation of test scripts, ensures consistency and coverage between test cases and actual business scenarios, and avoids the subjectivity and cumbersomeness of manual scripting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120276995A_ABST
    Figure CN120276995A_ABST
Patent Text Reader

Abstract

The invention provides an interface testing method and device for a management controller, equipment and a storage medium, and can be applied to the technical field of computers. The method comprises: in response to a received test request for a to-be-tested management controller, based on a test demand included in the test request, determining a target test case matched with the test demand from a plurality of preset test cases, the preset test case being obtained according to interaction data of a preset management controller in a production environment; under the condition that it is determined that preset scene parameters in the target test case are consistent with to-be-tested scene parameters of the to-be-tested management controller, interface testing is conducted on the to-be-tested management controller through the target test case, a test result is obtained, and the to-be-tested scene parameters are determined according to a server where the to-be-tested management controller is located and the test requirement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an interface test method, device, equipment, medium and program product for a management controller. Background Art

[0002] The BMC (Baseboard Management Controller) is a dedicated controller integrated on a server. In related technologies, interface testing of the BMC is often performed to ensure that its interactions with an external management platform and internal hardware modules of the server are normal, so as to ensure reliability.

[0003] Currently, BMC interface testing mostly relies on test scripts pre-written by operation and maintenance personnel. However, for the BMC interface testing performed in the above manner, there are problems such as a complex test script generation process and difficult-to-guarantee test effectiveness. Summary of the Invention

[0004] In view of the above problems, this application provides an interface test method, device, equipment, medium and program product for a management controller.

[0005] According to one aspect of this application, an interface test method for a management controller is provided, including: in response to receiving a test request for a management controller to be tested, based on the test requirements included in the test request, determining a target test case that matches the test requirements from a plurality of preset test cases, where the preset test cases are obtained based on the interaction data of a preset management controller in a production environment; in the case where it is determined that the preset scenario parameters in the target test case are consistent with the to-be-tested scenario parameters of the management controller to be tested, using the target test case to perform an interface test on the management controller to be tested to obtain a test result, where the to-be-tested scenario parameters are determined according to the server where the management controller to be tested is located and the test requirements.

[0006] Another aspect of this application provides an interface test device for a management controller, including: a use case determination module, configured to, in response to receiving a test request for a management controller to be tested, based on the test requirements included in the test request, determine a target test case that matches the test requirements from a plurality of preset test cases, where the preset test cases are obtained based on the interaction data of a preset management controller in a production environment; an interface test module, configured to, in the case where it is determined that the preset scenario parameters in the target test case are consistent with the to-be-tested scenario parameters of the management controller to be tested, use the target test case to perform an interface test on the management controller to be tested to obtain a test result, where the to-be-tested scenario parameters are determined according to the server where the management controller to be tested is located and the test requirements.

[0007] Another aspect of the present application provides an electronic device, including: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0008] Another aspect of the present application further provides a computer-readable storage medium, on which computer programs or instructions are stored, and when the computer programs or instructions are executed by a processor, the steps of the above method are implemented.

[0009] Another aspect of the present application further provides a computer program product, including computer programs or instructions, and when the computer programs or instructions are executed by a processor, the steps of the above method are implemented.

[0010] According to the interface test method of the management controller of the present application, by determining a target test case that can meet the test requirements for the management controller to be tested from the preset test cases obtained from the interaction data of the preset management control in the production environment, and by comparing the preset scenario parameters with the scenario parameters to be tested of the management controller to be tested, the scenario verification of the target test case is realized, and it is determined whether the target test case can be used for the current test scenario. Since the preset test cases are generated based on the real interaction data of the preset management controller in the production environment, and the target test cases are screened through an automated matching mechanism and dynamically verified in combination with the scenario parameters to be tested, the subjectivity and complexity of manually writing scripts are avoided, and the consistency and coverage of the test cases with the actual business scenarios are ensured. Therefore, at least partially, the problems of complex test script generation process and difficult to guarantee test effectiveness are solved, and the technical effects of improving the generation efficiency of test scripts and test effectiveness are achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Through the following description of the embodiments of the present application with reference to the drawings, the above content and other objects, features and advantages of the present application will be more clearly understood. In the drawings:

[0012] Figure 1 Schematically shows an application scenario diagram of the interface test method, device, equipment, medium and program product of the management controller according to the embodiment of the present application;

[0013] Figure 2 Schematically shows a flowchart of the interface test method of the management controller according to the embodiment of the present application;

[0014] Figure 3 Schematically shows an implementation structure diagram of the interface test method of the management controller according to the embodiment of the present application;

[0015] Figure 4Schematically shows a flow structure diagram for obtaining and managing multiple preset test cases according to an embodiment of the present application;

[0016] Figure 5 Schematically shows a flow structure diagram for performing an interface test on a to-be-tested management controller according to an embodiment of the present application;

[0017] Figure 6 Schematically shows a structural block diagram of an interface test device for a management controller according to an embodiment of the present application; and

[0018] Figure 7 Schematically shows a block diagram of an electronic device suitable for implementing an interface test method for a management controller according to an embodiment of the present application. Detailed implementation manners

[0019] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present application. In the following detailed description, for the sake of explanation, many specific details are set forth in order to provide a comprehensive understanding of the embodiments of the present application. However, obviously, one or more embodiments can also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present application.

[0020] The terms used herein are only for describing specific embodiments and are not intended to limit the present application. The terms "including", "comprising", etc. used herein indicate the presence of the described features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0021] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0022] In the case of using expressions such as "at least one of A, B, and C", generally, it should be interpreted according to the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include, but not be limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).

[0023] In the research process, it is found that in the related technology, when conducting BMC interface tests, the interfaces are all tested by simulating requests with code. For example, the automated test of the Redfish interface. By using the designed test data as request parameters and comparing the return value of the obtained response with the expected result, the assertion of the test result is carried out. However, the above methods usually require sorting out the information of the interface to be tested, designing test data, and writing test scripts in advance, which have relatively high requirements for both test design ability and script development ability, and there are problems of large workload, easy detachment of test scenario design from the actual user application, and lack of focus.

[0024] In addition, the Redfish interface is the first recommended remote management method in the current BMC daily management and is also the main direction of the future development of BMC management. Therefore, the test of Redfish is also an extremely important part of the BMC test work. However, there are many difficulties in the test of Redfish, such as the handling of issues such as the extensiveness of its functions, the complexity of the test environment, the writing of automated test scripts, the importance of security, the requirement for performance stability, cross-platform compatibility, fault diagnosis and troubleshooting, and standard compliance. Overcoming these difficulties requires testers to have professional knowledge and rich experience, as well as the use of appropriate tools and technologies.

[0025] In view of this, the embodiments of the present application provide an interface test method for a management controller, including: in response to receiving a test request for a management controller to be tested, based on the test requirements included in the test request, determining a target test case that matches the test requirements from a plurality of preset test cases, where the preset test cases are obtained according to the interaction data of a preset management controller in a production environment; in the case where the preset scenario parameters in the target test case are determined to be consistent with the to-be-tested scenario parameters of the management controller to be tested, using the target test case to perform an interface test on the management controller to be tested to obtain a test result, where the to-be-tested scenario parameters are determined according to the server where the management controller to be tested is located and the test requirements.

[0026] BMC provides multiple management methods such as IPMI and Redfish for administrators to remotely monitor and control servers. Among them, Redfish is a device management standard maintained by the DMTF (Distributed Management Task Force) organization. It is based on the HTTPs service and uses RESTful interfaces to implement device management. The Redfish interface is a set of standards based on RESTful APIs, which provides a way to manage and monitor server hardware and related components.

[0027] Figure 1Schematically shows an application scenario diagram of a method, apparatus, device, medium, and program product for interface testing of a management controller according to an embodiment of the present application.

[0028] As Figure 1 shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, a server 105, a recording tool 106, a preset management controller 107, and a management controller to be tested 108. The network 104 is used to provide a medium for communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105, between the server 105 and the recording tool 106, and between the server 105 and the management controller to be tested 106. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0029] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0030] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, and desktop computers, etc.

[0031] The server 105 may be a server providing various services, such as a background management server that supports the websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (only for example). The background management server may analyze and process data such as received user requests, etc., and feedback the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0032] The recording tool 106 may be deployed inside the preset management controller 107 for collecting the interaction data of the preset management controller 107.

[0033] The preset management controller 107 may be a BMC in a production environment.

[0034] The management controller to be tested 109 may be a BMC in a test environment.

[0035] It should be noted that the interface testing method for the management controller provided by the embodiments of the present application can generally be executed by the server 105. Correspondingly, the interface testing device for the management controller provided by the embodiments of the present application can generally be set in the server 105. The interface testing method for the management controller provided by the embodiments of the present application can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, the recording tool 106, the management controller under test 108, and / or the server 105. Correspondingly, the interface testing device for the management controller provided by the embodiments of the present application can also be set in a server or a server cluster different from the server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, the recording tool 106, the management controller under test 108, and / or the server 105.

[0036] It should be understood that Figure 1 the numbers of terminal devices, networks, and servers in

[0037] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers. Figure 1 The following will be based on Figures 2 to 5 the described scenario, and will describe in detail the interface testing method for the management controller of the embodiments of the present application through

[0038] Figure 2 FIG. schematically shows a flowchart of the interface testing method for the management controller according to the embodiments of the present application.

[0039] As Figure 2 shown, the method includes operation S210 to operation S220.

[0040] In operation S210, in response to receiving a test request for the management controller under test, based on the test requirements included in the test request, a target test case matching the test requirements is determined from a plurality of preset test cases, where the preset test cases are obtained according to the interaction data of the preset management controller in the production environment.

[0041] In operation S220, when it is determined that the preset scenario parameters in the target test case are consistent with the scenario parameters under test of the management controller under test, the target test case is used to perform interface testing on the management controller under test to obtain a test result, where the scenario parameters under test are determined according to the server where the management controller under test is located and the test requirements.

[0042] The test request can be a request for testing the management controller under test.

[0043] Test requirements can be used to characterize the functional scope of testing the to-be-tested management controller or the target test requirements for a preset test case, etc. For example: In the case where the test requirements characterize the functional scope, the test requirements may include a description of the to-be-tested function, and the description of the to-be-tested function may be a functional description statement. In the case where the test requirements characterize the target test requirements for a preset test case, the test requirements may be to perform interface testing on the to-be-tested management controller in sequence according to the time attributes of multiple preset test cases to achieve comprehensive function verification; select multiple preset test cases to perform multiple threads or coroutine concurrency to perform interface testing for the concurrent pressure of the to-be-tested management controller, so as to detect the concurrent processing ability of the BMC; randomly adjust the order of multiple preset test cases to test the interface idempotency.

[0044] The production environment can be an environment that provides services in actual business. The preset management controller can be a BMC applied in actual business.

[0045] The interaction data can be data generated during the interaction of the preset management controller. For example: it may include the sample request received by the preset associated controller and the sample response for the sample request.

[0046] The preset scenario parameters can be parameters in the preset test case that match the environment to which the preset management controller belongs, and can include preset credential parameters, preset resource parameters, preset dynamic update parameters, etc. The preset credential parameters can characterize the authentication information recognized by the preset management controller; the resource parameters characterize the resource information included in the preset server where the preset management controller is located; the dynamic update parameters characterize the timeliness of the preset test case.

[0047] The target scenario parameters can be parameters that match the environment to which the to-be-tested management controller belongs, and can be determined according to the server where the to-be-tested management controller is located and the test requirements. It can include credential parameters, resource parameters, dynamic update parameters, etc.

[0048] For example: The preset credential parameter can be a token (Token). In a request, Token is a parameter used for authentication and authorization. The resource parameter can be hardware resource information, software resource information, data resource information, etc. in the server. The dynamic update parameter can be a parameter that changes dynamically and has timeliness, such as a timestamp, version number, etc.

[0049] The type of the interface in the interface test is not limited. For example: it can be a test for the Redfish interface, a test for the Intelligent Platform Management Interface (IPMI) interface.

[0050] In the case where the interface test is for testing the Redfish interface of the to-be-tested management controller, corresponding HyperText Transfer Protocol (HTTP) requests and expected responses can be generated using the target test cases.

[0051] According to the interface test method of the management controller of the present application, by determining, from the preset test cases obtained from the interaction data of the preset management control in the production environment, the target test cases that can meet the test requirements for the to-be-tested management controller, and by comparing the preset scenario parameters with the to-be-tested scenario parameters of the to-be-tested management controller, the scenario verification of the target test cases is realized to determine whether the target test cases can be used in the current test scenario. Since the preset test cases are generated based on the real interaction data of the preset management controller in the production environment, and the target test cases are screened through an automated matching mechanism and dynamically verified in combination with the to-be-tested scenario parameters, the subjectivity and complexity of manually writing scripts are avoided, and the consistency and coverage of the test cases with the actual business scenarios are ensured. Therefore, at least partially solves the problems that the process of generating test scripts is complex and the test effectiveness is difficult to guarantee, and realizes the technical effect of improving the generation efficiency and test effectiveness of test scripts.

[0052] According to an embodiment of the present application, a plurality of preset test cases are divided into at least one use case set; multiple preset test cases in the same use case set correspond to the same function tree; the function tree includes a plurality of nodes and at least one edge; the edge represents the association relationship between the plurality of nodes; the plurality of nodes includes a root node and at least one child node; the root node represents function domain information; the child node represents sub-function information of the function domain information.

[0053] According to an embodiment of the present application, determining the target test cases that match the test requirements from a plurality of preset test cases based on the test requirements included in the test request may include the following operations.

[0054] According to the to-be-tested function description included in the test requirements and the function domain information of the root node of at least one function tree, determine the target function tree from at least one function tree; calculate the similarity between the function domain information of the root node and the sub-function information of the child node in the target function tree and the to-be-tested function description respectively; use the preset test cases corresponding to the nodes with similarity greater than the preset threshold as the target test cases.

[0055] In some embodiments, based on different function dimensions, the same preset test case can be divided into different use case sets and correspond to different function trees, so as to realize selective testing of different function dimensions, and further improve the interface test efficiency for the to-be-tested management controller.

[0056] The functional area information can be the interface function information that the preset test case corresponding to the root node wants to test, which can be relatively macroscopic, general, and integral. The sub-functional information can be the interface function information that the preset test case corresponding to the sub-node wants to test, which can be more specific function information under the functional area information.

[0057] For example: when the functional area information is the function of the BMC to obtain metadata about the hard disk in the server, the sub-functional information can be the function of the BMC to obtain the specific usage information of a certain hard disk in the server.

[0058] The functional description to be tested can be matched with the functional area information of the root node of at least one functional tree by keyword matching or similarity calculation, so as to use the functional tree with the highest matching degree with the functional description to be tested as the target functional tree.

[0059] The way of similarity calculation is not limited, and it can be cosine similarity, Jaccard similarity, etc.

[0060] Since the preset test case corresponding to the root node and the preset test case corresponding to the sub-node can separately perform interface function testing on the target test case, the similarity can be compared with the preset threshold, and one or more preset test cases greater than the preset threshold can be used as the target test case.

[0061] According to the embodiments of the present application, a large language model (LLM) can be added, so that the functional description to be tested included in the test requirements can be first input into the large language model, and the large language model can be used to normalize the functional description to be tested and perform functional area division to obtain the target functional area that the functional description to be tested wants to test. The target functional area can be matched with the functional area information of the root node of the target functional tree, so as to verify the target functional tree, thereby improving the determination accuracy of the target test case and better meeting the test requirements.

[0062] According to the embodiments of the present application, the preset test cases are stored in the form of a use case set, and each use case set corresponds to a functional tree. By matching the functional description to be tested included in the test requirements with the functional area information of the root node of the functional tree, the rapid screening of the function set that meets the test requirements from a large number of preset test cases can be realized, and the target test case can be accurately determined by the similarity between the function information of the nodes in the function set and the functional description to be tested of the test requirements. The rapid determination of the target test case that meets the test requirements can be realized, and the determination efficiency of the test case can be effectively improved when testing the interface of the management controller to be tested.

[0063] According to the embodiments of the present application, the functional tree is determined in the following manner.

[0064] Based on the request feature information and response feature information included in each of multiple preset test cases, perform test function analysis on each of the multiple preset test cases to obtain the function information of each of the multiple preset test cases; based on the uniform resource locator in the request feature information included in each of the multiple preset test cases, perform dependency analysis on the multiple preset test cases to obtain an analysis result; based on the analysis result, determine multiple associated test cases with dependency relationships from the multiple preset test cases; based on the dependency relationships between the multiple associated test cases and the function information of the associated test cases, determine the function domain information of the root node and the sub-function information of the sub-nodes from the multiple function information; based on the dependency relationship, connect the root node and the sub-nodes to obtain a function tree.

[0065] It is possible to comprehensively analyze information such as the uniform resource locator (URL), request method, response code, and fields in the response header in the request feature information, so as to determine the function information for which each preset test case is used for testing.

[0066] For example: The URL usually reflects the system function module targeted by the request. Therefore, the function information can be analyzed by determining the URL; request methods such as GET, POST, PUT, etc. can further clarify the specific operations; different response codes can be the results corresponding to requests for different functions.

[0067] It is possible to determine whether there is a dependency relationship between preset test cases through the uniform resource locator included in the preset test cases. For example: If the URL of preset test case 1 is redfish / v1 / Systems and the URL of preset test case 2 is redfish / v1 / Systems / 1, it can be considered that there is a dependency relationship between preset test case 1 and preset test case 2.

[0068] The preset test cases with dependency relationships can be stored as a test case set. The dependency relationship is a type of association relationship.

[0069] Through the dependency relationships between multiple associated test cases, the function information of the multiple associated test cases can be arranged, and the arrangement order can be verified through the function information of the associated test cases, so as to determine the function domain information of the root node and the sub-function information of at least one sub-node from the multiple function information.

[0070] By connecting the root node and the sub-nodes, and the sub-nodes and sub-nodes according to the dependency relationship, a function tree can be obtained.

[0071] In some embodiments, the functional information fields of multiple preset test cases can also be divided by a preset clustering algorithm to obtain functional information belonging to the same field. Then, referring to the URLs of the preset test cases corresponding to the above functional information or the preset functional level division, the sorting order of the functional information belonging to the same field can be determined. Furthermore, the functional information at the starting position can be used as the functional field information of the root node, and the connection order between the sub-nodes can be determined based on this sorting order, thereby obtaining a functional tree.

[0072] In some embodiments, the dependency relationship can also be obtained by monitoring the target sample response of the target sample request for creating a resource. A more comprehensive dependency relationship can be obtained by combining the URL of the above sample request with the URL in the target sample response.

[0073] The URL of the target sample request for creating a resource can be: POST / redfish / v1 / Systems, and the response body of the target sample response can be {"@odata.id": " / redfish / v1 / Systems / 1"}.

[0074] In some embodiments, when the dependency relationship is obtained with reference to the URL of the target sample response of the target sample request for creating a resource, during interface testing, the target test case can include a preset test case for creating the functional information represented by a preset test case that matches the test requirement.

[0075] According to the embodiments of the present application, each preset test case is respectively subjected to test function analysis and dependency relationship analysis, so that through the dependency relationships between the associated test cases with dependency relationships, combined with the functional information of the preset test cases, the functional field information of the root node of the functional tree and the sub-functional information of the sub-nodes are determined, and the functional tree is determined by establishing connections between the nodes. Through in-depth analysis of the characteristic information of requests and responses, a three-dimensional analysis of the test functions is realized, and through explicit modeling of the dependency relationships, it is ensured that logically related use cases are reasonably grouped. The construction of the functional tree hierarchizes and visualizes the test logic, effectively improving the maintainability and execution efficiency of test cases, and improving the full-coverage test for complex hardware scenarios.

[0076] According to the embodiments of the present application, the interaction data includes multiple sample requests and sample responses of a preset management controller for the multiple sample requests; the multiple preset test cases are obtained through the following steps.

[0077] Obtain multiple sample requests and multiple sample responses collected by a recording tool for a preset management controller; extract request feature information from the multiple sample requests respectively; extract response feature information from the multiple sample responses respectively; based on the feature tags of the request feature information and the response feature information respectively, associate the request feature information and the response feature information respectively to obtain multiple preset test cases.

[0078] The recording tool can be implemented by a network interceptor deployed on the preset management controller side or by inserting a kernel function into the Web server of the preset management controller, so that requests and responses passing by can be captured without affecting the business processing of the preset management controller.

[0079] For example: A proxy server Proxy can be deployed on the preset management controller side, or a hook function can be inserted into the Web server of the preset management controller to intercept all HTTP requests and responses, so as to achieve no need to modify the kernel, and directly transfer network packet data, that is, interaction data, to the database at the kernel layer, avoiding memory copy overhead, and having the effect of low development cost.

[0080] Proxy is an independent process program, which achieves no code intrusion into the Web service process that responds to Redfish requests of the preset management controller.

[0081] Through the above recording tool, it is possible to avoid the problems in traditional data collection methods, such as relying on external proxies or network mirrors, which cannot collect the encrypted traffic and internal resource call chains after BMC internal processing, resulting in incomplete information, context loss, high invasiveness, increased latency, and inability to adapt to high-concurrency or low-resource scenarios. It is possible to capture the complete unencrypted requests or responses inside the BMC and avoid problems such as protocol parsing errors caused by proxy tools.

[0082] The request feature information may include request headers, request bodies, request methods, and the uniform resource locator in the request line, etc.

[0083] The response feature information may include response codes, response headers, and response bodies, etc.

[0084] The feature tags may be session identifiers, timestamps, etc. Associating the request feature information and the response feature information respectively through the session identifier can achieve session isolation for multiple preset test cases, and the session identifier can be used as the unique identifier of the preset test case.

[0085] In some embodiments, the acquisition time of each sample request can be recorded and used as the time attribute of a preset test case. Thus, in the case where the test requirement is to conduct a comprehensive functional test on the management controller under test, the management controller under test can be comprehensively functionally tested using multiple preset test cases in chronological order according to the time attributes of each preset test case.

[0086] In some embodiments, to ensure the confidentiality of the interaction data of the preset management controller, the automatically recognized sensitive fields of the acquired interaction data can be desensitized, thus ensuring the security of the interaction data of the preset management controller. Sensitive fields include, for example: Password, Authorization header, etc.

[0087] In some embodiments, during the process of collecting interaction data, a memory buffer with a fixed size can be used to reduce the storage pressure. During the storage process, the old data that has been stored in the target database in the memory buffer can be continuously overwritten to prevent storage overflow.

[0088] In some embodiments, during the process of collecting interaction data, irrelevant requests and their responses can be not collected, thus realizing data screening. Irrelevant requests include, for example: static file requests such as *.css. Or a collection policy can be set to collect some requests and their responses.

[0089] In some embodiments, during the storage process of multiple preset test cases, an access control policy can be set simultaneously. For example: the preset test case is only open to personnel holding the corresponding test vouchers.

[0090] In some embodiments, a compression algorithm can be adopted during the storage process of interaction data and preset test cases, thus reducing the memory pressure. For example: using the Lempel-Ziv 4 (LZ4) or Zstandard Compression Algorithm.

[0091] In some embodiments, the output operation of writing the interaction data to storage can be placed in a background thread, thus not blocking the main business logic of the preset management controller.

[0092] In some embodiments, the preset test cases can be stored in a target database, and a security interface can be set to obtain the preset test cases during the interface test process.

[0093] In some embodiments, the interface processing delay of the preset management controller when the recording tool is turned on or off can be recorded. If it is found that the difference between the interface processing delays of the two is greater than the preset duration threshold, an alarm can be issued to remind the operation and maintenance personnel to perform an anomaly check. The preset duration threshold can be 5%.

[0094] In some embodiments, it can be detected whether the preset test cases are desensitized and whether the access control takes effect.

[0095] According to the embodiments of the present application, by monitoring the interaction data of the preset management controller, comprehensive sample request and sample response information can be obtained. And by extracting the feature information in the sample request and sample response, filtering of useless information and saving of storage space can be achieved. In addition, through the feature tags of the two pieces of feature information, the association of the feature information can be realized, and the isolation management of different preset test cases can be achieved. For example, when the feature tag is a session identifier, session isolation of different preset test cases can be realized, thereby avoiding management chaos among multiple preset test cases.

[0096] According to the embodiments of the present application, the test request further includes a test voucher, and the test voucher is used for access control of the test request for the preset test cases; based on the test requirements included in the test request, determining a target test case that matches the test requirements from multiple preset test cases may include the following operations.

[0097] Based on the test voucher, determine multiple candidate test cases that match the test voucher from multiple preset test cases; based on the test requirements, determine the target test case from the multiple candidate test cases.

[0098] The test voucher can be a voucher included in the test request for characterizing the test request permission, such as: Token, account password, etc.

[0099] The range of preset test cases that the test voucher can access can be set in advance, so that only the test requests with permissions are allowed to access the preset test cases.

[0100] Through the test voucher, access control of the test request can be realized, so that only the candidate test cases with permissions are opened to the test request, and after determining multiple candidate test cases, the test requirements are used to select the target test case that matches the test requirements from the multiple candidate test cases.

[0101] According to the embodiments of the present application, by setting access control for the preset test cases, each preset test case is only open to the test requests that meet the permissions, thereby improving the security of the preset test cases.

[0102] According to the embodiments of the present application, the interface test method of the management controller further includes the following operations.

[0103] In the case where the preset scenario parameters in the target test case are inconsistent with the to-be-tested scenario parameters of the to-be-tested management controller, replace the preset scenario parameters in the target test case with the to-be-tested scenario parameters to obtain an updated target test case; use the updated target test case to perform an interface test on the to-be-tested management controller to obtain a test result; wherein, the to-be-tested scenario parameters include at least one of credential parameters, resource parameters, and dynamic update parameters; the credential parameters represent the authentication information recognized by the to-be-tested management controller; the resource parameters represent the resource information included in the server; the dynamic update parameters represent the timeliness of the target test case.

[0104] The preset scenario parameters can be obtained by extracting parameters from the target test case using a preset parameter extractor or by collecting the interaction data used to generate the target test case. For example, the parameter extractor can be implemented by preset extraction code.

[0105] The inconsistency between the preset scenario parameters and the to-be-tested scenario parameters can be a situation where the matching degree between the preset scenario parameters and the to-be-tested scenario parameters is lower than a preset threshold.

[0106] The credential parameters can be maintained regularly. In the case where it is determined that the credential parameters have expired, they can be updated or discarded accordingly.

[0107] Since the preset scenario parameters can exist in both the request feature information and the response feature information included in the target test case, when the preset scenario parameters are inconsistent with the to-be-tested scenario parameters, the preset scenario parameters included in the request feature information and the response feature information can be replaced with the to-be-tested scenario parameters by using the to-be-tested scenario parameters.

[0108] According to an embodiment of the present application, when it is determined that the scenario parameters in the target test case do not match the current scenario by comparing the preset scenario parameters and the to-be-tested scenario parameters, replace the preset scenario parameters with the to-be-tested scenario parameters, so that a target test case that conforms to the current scenario can be quickly obtained, improving the generation efficiency of the target test case. And the to-be-tested scenario parameters are limited in multiple dimensions, and are clearly divided into core categories such as credential sub-parameters, resource sub-parameters, and dynamic update parameters, realizing more refined modeling of the test scenario and improving the adaptability of the target test case to the current scenario.

[0109] According to an embodiment of the present application, using the target test case to perform an interface test on the to-be-tested management controller to obtain a test result may include the following operations.

[0110] Send the interface test request determined based on the request feature information in the target test case to the management controller under test; in response to receiving the interface test response for the interface test request, compare the interface test response with the expected response determined based on the response feature information in the target test case to obtain the test result.

[0111] The interface test request can be determined by splicing the feature information included in the request feature information. The expected response can be determined by splicing the feature information included in the response feature information.

[0112] In the case of receiving the interface test response for the interface test request sent by the management controller under test, the interface test response can be compared and asserted with the preset response to obtain the final test result.

[0113] For example: A multi-level assertion mechanism can be adopted. For example, an assertion can be made on the structural consistency between the interface test response and the expected response to determine whether the structures of the interface test response and the expected response are consistent. And a check on the existence of the response status code and response headers can be carried out. In the case where the response status code and response headers exist, it is determined whether the response codes and response headers of the interface test response and the preset response are consistent. And an assertion on key fields can be carried out to compare whether the key fields of the interface test response and the preset response are consistent. For example, it is determined whether the PowerState fields are consistent.

[0114] In some embodiments, due to the scenario differences between the management controller under test and the preset management controller, assertion ignores can be set to ignore special cases, so that the test result accuracy is higher. Special cases include, for example, function differences, hardware configurations, user permissions, etc.

[0115] In some embodiments, an assertion ignore rule for ignoring BMC self-signed certificate errors can be set.

[0116] In some embodiments, a test report can be generated based on the test result. The test report can contain content in two dimensions: overall and details. The overall part is mainly statistical information, including the total number of target test cases executed, the number of successes, the number of failures, the number of blocks, the number of exceptions, the overall test pass rate, etc. The details part contains the detailed logs of each target test case, the request URL, request parameters, request method, request execution time, response result, status code, data assertion conclusion, exception logs, etc.

[0117] The file format of the test report is not limited and can be a file in HyperText Markup Language (HTML) format.

[0118] In the test report, special markings can be made for key fields. For example, the fields considered as the reasons for anomalies in the report can be presented in a special font or color. The test report can typeset the details according to the anomaly types.

[0119] In some embodiments, a preset management tool can be used to manage target test cases based on the test report. For example, Jenkins can be used for the automated processes of continuous integration (CI) and continuous delivery / deployment (CD).

[0120] In some embodiments, according to the test report, communication tools such as emails can be used to inform designated personnel of the failed target test cases, and visual monitoring of the interface functions for metric reporting and error reporting can be performed.

[0121] According to the embodiments of the present application, an interface test request and an expected response for the to-be-tested management controller are generated through the target test case. The to-be-tested management controller is subjected to an interface test through the interface test request. Based on the comparison result between the interface test response and the preset response, the final test result is obtained, realizing the templatization and automation of the test process and improving the test efficiency.

[0122] Figure 3 Schematically shows the implementation structure diagram of the interface test method for the management controller according to the embodiments of the present application.

[0123] As Figure 3 shown, when implementing the interface test method for the management controller, a recording tool can be used to collect the sample requests sent by the user to the BMC in the production environment, i.e., the preset management controller, and collect the sample responses of the BMC Web process for the sample requests.

[0124] After the sample requests and sample responses can be determined from the recording tool, the collected interaction data, i.e., the sample requests and sample responses, can be stored in a database or a file and processed into preset test cases.

[0125] The test platform can obtain interaction data from a database or a file and process it into preset test cases. When receiving a test request, it can determine a target test case that matches the test requirements included in the test request. When it is determined that the preset scenario parameters in the target test case are consistent with the to-be-tested scenario parameters of the to-be-tested management controller, an interface test request is generated based on the target test case and sent to the BMC (i.e., the to-be-tested management controller) in the test environment. When the test platform receives the interface test response of the BMC Web process of the to-be-tested management controller for this interface test request, the interface test response is compared with the expected response determined based on the response feature information in the target test case to obtain a test result and generate a test report.

[0126] In addition, the preset scenario parameters and the to-be-tested scenario parameters can be determined in advance by the test platform and stored in the scenario parameter storage space.

[0127] According to an embodiment of the present application, the interface test method of the management controller can be executed by the test platform.

[0128] Figure 4 Schematically shows a flow structure diagram for obtaining and managing multiple preset test cases according to an embodiment of the present application.

[0129] As Figure 4 shown, interaction data such as capture sample requests and sample responses of sample requests of a preset management controller can be captured by a recording tool to obtain interaction data 410. During the storage process of the interaction data 410, data processing such as circular caching, encryption, desensitization, and feature association can be performed, and the processed interaction data 410 is stored in a database or a file. The processed interaction data 410 can be associated to obtain a preset feature use case 420. And the interaction data 410 can be used to extract scenario parameters to obtain preset scenario parameters 430 corresponding to the preset feature use case 420 of the interaction data.

[0130] An external access interface 440 for the preset scenario parameters 430 and the preset feature use case 420 can be provided, so that the test module can conveniently obtain the preset feature use case 420 and its preset scenario parameters 430.

[0131] Figure 5 Schematically shows a flow structure diagram for performing an interface test on a to-be-tested management controller according to an embodiment of the present application.

[0132] As Figure 5As shown, in response to receiving a test request 510 for a management controller under test, at least one target test case 520 that matches the test requirements can be determined from multiple preset test cases based on the test requirements included in the test request. The preset scenario parameters in each target test case can be compared with the scenario parameters to be tested of the management controller under test, so that when the preset scenario parameters are consistent with the scenario parameters to be tested, the target test case can be determined as a test case for interface testing the management controller under test. Among them, the target test case can be loaded based on the external access interface 440.

[0133] And request header fields such as signatures and necessary request header fields can be randomly generated, so that the request header fields are embedded into the request header included in the request feature information of the target test case, and the request header, request body, request line, etc. included in the request feature information are feature-stitched to obtain an interface test request 530.

[0134] Error injection can be to modify key fields in the request feature information of the target test case, such as: modifying ContentType: text / xm to image / png). It can also be to randomly introduce delays, loss of interface test requests, etc. through a preset network simulation tool. The preset network simulation tool can be tc netem or Mock.

[0135] During the generation process of the interface test request, request header repair can be performed, such as: randomly generating request header fields and adding them, such as: User-Agent: Replay-Engine. Signature calculation can also be performed, and for interface test requests that require signatures, such as AWS SigV4, the signature can be automatically regenerated.

[0136] And a test strategy 540 can be selected, such as: controlling concurrency, controlling order, and error injection, etc. According to the test strategy, at least one interface test request 530 is sent to the management controller under test for interface testing, so that when an interface test response from the management controller under test to the interface test request is received, the interface test response is compared with the preset response to obtain at least one test result 550. At least one test result 550 can be summarized, data processing can be performed, and a test report 560 can be generated.

[0137] In some embodiments, case detection can be performed on the target test case. When the detection result indicates that the target test case is abnormal, the target test case can be repaired. The abnormality can be, for example, that the request feature information in the target test case is extracted from an unfinished login request.

[0138] In some embodiments, connection pool reuse between the test platform and the management control under test, and between the test platform and the recording tool can be performed, so as to maintain long connections to improve performance.

[0139] According to an embodiment of the present application, through the interface test method of the management controller of the present application, since the recording tool is embedded in the HTTP service stack of the BMC in the environment: such as the rest-dbus layer of OpenBMC, the raw sample requests and sample responses that are not encrypted are directly intercepted. It is possible to directly capture the plaintext data processed inside the BMC in the environment without an external proxy. And full-life cycle tracing records the complete internal processing link from request parsing to response generation, such as: DBus calls, hardware status reading.

[0140] According to an embodiment of the present application, the URL is extracted and associated in real time from the sample request or sample response, realizing the maintenance of the resource creation and reference relationships. It is possible to automatically trace the resource path and realize the construction of the function tree.

[0141] According to an embodiment of the present application, the above interface test method of the management controller may further include providing a recording configuration interface, where the request URL filter, recording port, recording file storage path, recording information storage database connection information, etc. to be recorded can be configured.

[0142] A running configuration interface can be provided, where various runtime environment information configurations can be configured, such as BMC Web address, server hardware configuration information, in-band OS information configuration, etc. Information configurations can also be configured, such as program running parameter configurations like request timeout time configuration, concurrent thread configuration, etc.

[0143] According to an embodiment of the present application, due to the standardization and stability of the Redfish interface, the method of recording the interaction data of the BMC in the generated environment and generating test cases is more suitable for the test of the Redfish interface. First, the recorded interaction data comes from the online production scenario, and the scenario coverage and data are more real and in line with the actual business. Using it in the test environment can greatly improve the test efficiency, avoid designing invalid test data and test scenarios, and ensure the efficient use of limited test resources. Moreover, since the function updates of the BMC usually adopt the method of iteratively adding new functions with little change to the existing functions, through the above test method, a comprehensive smoke test of the existing functions can be quickly carried out with a high success rate, saving a large amount of analysis time for test results. In addition, the recorded test scripts can be repeatedly executed in different environments to ensure the consistency and reliability of the test results. Compared with manually writing test scripts, the method of recording and playback is easier to maintain because they are closer to the behavior of real users. Through multi-threading technology, it is also easy to convert automated tests into performance stress tests, and the scope of use of the scripts is also wider.

[0144] Based on the above interface testing method for the management controller, the present application also provides an interface testing device for the management controller. The following will combine Figure 6 to describe this device in detail.

[0145] Figure 6 The structural block diagram of the interface testing device for the management controller according to an embodiment of the present application is schematically shown.

[0146] As Figure 6 shown, the interface testing device 600 for the management controller in this embodiment includes a test case determination module 610 and an interface testing module 620.

[0147] The test case determination module 610 is configured to, in response to receiving a test request for the management controller to be tested, determine a target test case that matches the test requirements from multiple preset test cases based on the test requirements included in the test request, where the preset test cases are obtained according to the interaction data of a preset management controller in a production environment.

[0148] The interface testing module 620 is configured to, when it is determined that the preset scenario parameters in the target test case are consistent with the scenario parameters to be tested of the management controller to be tested, perform interface testing on the management controller to be tested using the target test case to obtain a test result, where the scenario parameters to be tested are determined according to the server where the management controller to be tested is located and the test requirements.

[0149] According to an embodiment of the present application, multiple preset test cases are divided into at least one test case set. Multiple preset test cases in the same test case set correspond to the same function tree. The function tree includes multiple nodes and at least one edge. The edge represents the association relationship between multiple nodes. The multiple nodes include a root node and at least one child node. The root node represents function domain information. The child node represents sub - function information of the function domain information. The test case determination module 610 includes: a first determination sub - module, a calculation sub - module, and a second determination sub - module.

[0150] The first determination sub - module is configured to determine a target function tree from at least one function tree according to the function domain information of the root node of the at least one function tree and the function description to be tested included in the test requirements.

[0151] The calculation sub - module is configured to calculate the similarity between the function domain information of the root node and the sub - function information of the child node in the target function tree and the function description to be tested respectively.

[0152] The second determination sub - module is configured to use the preset test cases corresponding to the nodes with a similarity greater than a preset threshold as the target test cases.

[0153] According to an embodiment of the present application, the interface test device 600 of the management controller further includes: an information determination module, an analysis module, an associated use case determination module, a node determination module, and a connection module.

[0154] The information determination module is configured to perform test function analysis on multiple preset test cases respectively based on the request feature information and response feature information included in each of the multiple preset test cases, and obtain the function information of each of the multiple preset test cases.

[0155] The analysis module is configured to perform dependency analysis on multiple preset test cases based on the uniform resource locator in the request feature information included in each of the multiple preset test cases, and obtain an analysis result.

[0156] The associated use case determination module is configured to determine multiple associated test cases with dependency relationships from multiple preset test cases based on the analysis result.

[0157] The node determination module is configured to determine the function domain information of the root node and the sub-function information of the child nodes from multiple function information based on the dependency relationships between multiple associated test cases and the function information of the associated test cases.

[0158] The connection module is configured to connect the root node and the child nodes based on the dependency relationships to obtain a function tree.

[0159] According to an embodiment of the present application, the interaction data includes multiple sample requests and sample responses of a preset management controller for the multiple sample requests. The interface test device of the management controller further includes: an acquisition module, a first feature extraction module, a second feature extraction module, and an association module.

[0160] The acquisition module is configured to acquire multiple sample requests and multiple sample responses collected by a recording tool for a preset management controller.

[0161] The first feature extraction module is configured to extract request feature information from multiple sample requests respectively.

[0162] The second feature extraction module is configured to extract response feature information from multiple sample responses respectively.

[0163] The association module is configured to associate the request feature information with the response feature information respectively based on the feature tags of the request feature information and the response feature information to obtain multiple preset test cases.

[0164] According to an embodiment of the present application, the test request further includes a test voucher, and the test voucher is used to perform access control on the test request for a preset test case. The use case determination module 610 further includes: a matching sub-module and a use case determination sub-module.

[0165] A matching sub-module, configured to determine a plurality of candidate test cases that match the test voucher from a plurality of preset test cases based on the test voucher.

[0166] A test case determination sub-module, configured to determine a target test case from a plurality of candidate test cases based on the test requirements.

[0167] According to an embodiment of the present application, the interface test device 600 of the management controller further includes: a replacement module and an update module.

[0168] The replacement module is configured to, when it is determined that the preset scenario parameters in the target test case are inconsistent with the to-be-tested scenario parameters of the to-be-tested management controller, replace the preset scenario parameters in the target test case with the to-be-tested scenario parameters to obtain an updated target test case.

[0169] The update module is configured to perform an interface test on the to-be-tested management controller using the updated target test case to obtain a test result. Wherein, the to-be-tested scenario parameters include at least one of voucher parameters, resource parameters, and dynamic update parameters. The voucher parameters represent the authentication information recognized by the to-be-tested management controller. The resource parameters represent the resource information included in the server. The dynamic update parameters represent the timeliness of the target test case.

[0170] According to an embodiment of the present application, the interface test module 620 includes: a sending sub-module and a comparison sub-module.

[0171] The sending sub-module is configured to send an interface test request determined based on the request feature information in the target test case to the to-be-tested management controller.

[0172] The comparison sub-module is configured to, in response to receiving a functional interface test response for the test request, compare the interface test response with the expected response determined based on the response feature information in the target test case to obtain a test result.

[0173] According to an embodiment of the present application, any number of the use case determination module 610 and the interface test module 620 can be combined and implemented in one module, or any one of them can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present application, at least one of the use case determination module 610 and the interface test module 620 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by any other reasonable means such as hardware or firmware for integrating or packaging circuits, or can be implemented in any one of the three implementation manners of software, hardware, and firmware, or in an appropriate combination of any several of them. Alternatively, at least one of the use case determination module 610 and the interface test module 620 can be at least partially implemented as a computer program module, and when the computer program module is run, corresponding functions can be executed.

[0174] Figure 7 FIG. schematically shows a block diagram of an electronic device suitable for implementing an interface test method of a management controller according to an embodiment of the present application.

[0175] As Figure 7 shown, the electronic device 700 according to an embodiment of the present application includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read only memory (ROM) 702 or a program loaded from a storage section 708 into a random access memory (RAM) 703. The processor 701 can include, for example, a general microprocessor (such as a CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (such as an application specific integrated circuit (ASIC)), etc. The processor 701 can also include on-board memory for caching purposes. The processor 701 can include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present application.

[0176] In the RAM 703, various programs and data required for the operation of the electronic device 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. The processor 701 performs various operations of the method flow according to an embodiment of the present application by executing the programs in the ROM 702 and / or the RAM 703. It should be noted that the program can also be stored in one or more memories other than the ROM 702 and the RAM 703. The processor 701 can also perform various operations of the method flow according to an embodiment of the present application by executing the programs stored in the one or more memories.

[0177] According to an embodiment of the present application, the electronic device 700 may further include an input / output (I / O) interface 705, and the input / output (I / O) interface 705 is also connected to the bus 704. The electronic device 700 may further include one or more of the following components connected to the input / output (I / O) interface 705: an input portion 706 including a keyboard, a mouse, etc.; an output portion 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage portion 708 including a hard disk, etc.; and a communication portion 709 including a network interface card such as a LAN card, a modem, etc. The communication portion 709 performs communication processing via a network such as the Internet. The drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read from it can be installed into the storage portion 708 as needed.

[0178] The present application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist separately without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiments of the present application is implemented.

[0179] According to an embodiment of the present application, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium may be any tangible medium that contains or stores a program, and this program can be used by or combined with an instruction execution system, device, or device. For example, according to an embodiment of the present application, the computer-readable storage medium may include the above-described ROM 702 and / or RAM 703 and / or one or more memories other than ROM 702 and RAM 703.

[0180] An embodiment of the present application further includes a computer program product, which includes a computer program, and the computer program includes program codes for executing the method shown in the flowchart. When the computer program product runs on a computer system, the program codes are used to cause the computer system to implement the method provided by the embodiments of the present application.

[0181] When the computer program is executed by the processor 701, the above functions defined in the system / apparatus of the embodiments of the present application are executed. According to the embodiments of the present application, the systems, apparatuses, modules, units, etc. described above can be implemented by computer program modules.

[0182] In one embodiment, the computer program can rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program can also be transmitted and distributed in the form of signals on a network medium, and be downloaded and installed through the communication part 709, and / or be installed from the removable medium 711. The program code included in the computer program can be transmitted by any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0183] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or be installed from the removable medium 711. When the computer program is executed by the processor 701, the above functions defined in the system of the embodiments of the present application are executed. According to the embodiments of the present application, the systems, devices, apparatuses, modules, units, etc. described above can be implemented by computer program modules.

[0184] According to the embodiments of the present application, the program code for executing the computer program provided by the embodiments of the present application can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedures and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include but are not limited to, such as Java, C++, python, the "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, by using an Internet service provider to connect through the Internet).

[0185] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur in a different order than that noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, as well as combinations of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0186] Those skilled in the art can understand that the features described in the various embodiments of the present application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the features described in the various embodiments of the present application can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present application.

[0187] The embodiments of the present application have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present application. Although the embodiments have been described separately above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Without departing from the scope of the present application, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present application.

Claims

1. An interface test method for a management controller, characterized in that The method includes: In response to receiving a test request for a management controller to be tested, based on the test requirements included in the test request, determining a target test case that matches the test requirements from a plurality of preset test cases, where the preset test cases are obtained according to the interaction data of a preset management controller in a production environment; When it is determined that the preset scenario parameters in the target test case are consistent with the scenario parameters to be tested of the management controller to be tested, using the target test case to perform an interface test on the management controller to be tested to obtain a test result, where the scenario parameters to be tested are determined according to the server where the management controller to be tested is located and the test requirements.

2. The method according to claim 1, wherein The plurality of preset test cases are divided into at least one use case set; the multiple preset test cases in the same use case set correspond to the same function tree; the function tree includes multiple nodes and at least one edge; the edge represents the association relationship between the multiple nodes; the multiple nodes include a root node and at least one child node; the root node represents function domain information; the child node represents sub-function information of the function domain information; Among them, the determining a target test case that matches the test requirements from a plurality of preset test cases based on the test requirements included in the test request includes: Determining a target function tree from at least one function tree according to the function domain information of the root node of the at least one function tree and the to-be-tested function description included in the test requirements; Calculating the similarity between the function domain information of the root node and the sub-function information of the child node in the target function tree and the to-be-tested function description respectively; Taking the preset test case corresponding to the node with the similarity greater than a preset threshold as the target test case.

3. The method according to claim 2, wherein The function tree is determined by the following method: Based on the request feature information and response feature information included in each of the plurality of preset test cases, performing test function analysis on each of the plurality of preset test cases to obtain the function information of each of the plurality of preset test cases; Based on the uniform resource locator in the request feature information included in each of the plurality of preset test cases, performing dependency analysis on the plurality of preset test cases to obtain an analysis result; Based on the analysis result, determining a plurality of associated test cases with a dependency relationship from the plurality of preset test cases; Based on the dependency relationship between the plurality of associated test cases and the function information of the associated test cases, determining the function domain information of the root node and the sub-function information of the child node from the plurality of function information; Based on the dependency relationship, connecting the root node and the child node to obtain the function tree.

4. The method according to claim 1, wherein The interaction data includes a plurality of sample requests and the sample responses of the preset management controller for the plurality of sample requests; the plurality of preset test cases are obtained through the following steps: Obtaining the plurality of sample requests and the plurality of sample responses collected by a recording tool for the preset management controller; Respectively extracting request feature information from the plurality of sample requests; Respectively extracting response feature information from the plurality of sample responses; Based on the feature tags of the request feature information and the response feature information respectively, associate the request feature information with the response feature information respectively to obtain a plurality of the preset test cases.

5. The method according to claim 1, wherein The test request further includes a test credential, and the test credential is used for access control of the test request for the preset test cases. Wherein, the determining, from a plurality of preset test cases, a target test case that matches the test requirement based on the test requirement included in the test request includes: Based on the test credential, determine a plurality of candidate test cases that match the test credential from the plurality of preset test cases. Based on the test requirement, determine the target test case from the plurality of candidate test cases.

6. The method according to claim 1, wherein The method further includes: In the case where it is determined that the preset scenario parameters in the target test case are inconsistent with the to-be-tested scenario parameters of the to-be-tested management controller, replace the preset scenario parameters in the target test case with the to-be-tested scenario parameters to obtain an updated target test case. Use the updated target test case to perform an interface test on the to-be-tested management controller to obtain the test result. Wherein, the to-be-tested scenario parameters include at least one of a credential parameter, a resource parameter, and a dynamic update parameter; the credential parameter represents the authentication information recognized by the to-be-tested management controller; the resource parameter represents the resource information included in the server; the dynamic update parameter represents the timeliness of the target test case.

7. The method according to claim 1, characterized in that, The using the target test case to perform an interface test on the to-be-tested management controller to obtain a test result includes: Send an interface test request determined based on the request feature information in the target test case to the to-be-tested management controller. In response to receiving a functional interface test response to the test request, compare the interface test response with the expected response determined based on the response feature information in the target test case to obtain the test result.

8. An interface test device for a management controller, characterized in that, The device includes: A use case determination module, configured to, in response to receiving a test request for a to-be-tested management controller, determine, from a plurality of preset test cases, a target test case that matches the test requirement based on the test requirement included in the test request, wherein the preset test cases are obtained according to the interaction data of a preset management controller in a production environment. An interface test module, configured to, in the case where it is determined that the preset scenario parameters in the target test case are consistent with the to-be-tested scenario parameters of the to-be-tested management controller, use the target test case to perform an interface test on the to-be-tested management controller to obtain the test result, wherein the to-be-tested scenario parameters are determined according to the server where the to-be-tested management controller is located and the test requirement.

9. An electronic device, including: One or more processors; A memory, configured to store one or more computer programs, Characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, The computer program or instruction, when executed by the processor, implements the steps of the method according to any one of claims 1 to 7.