Test method, platform and equipment for data processor DPU and storage medium

Through fully automated DPU testing methods and systems, the problems of low testing efficiency and poor accuracy in the existing technology are solved, and the full-chain automation from environmental configuration to test result analysis is realized, which improves the efficiency and accuracy of DPU testing.

CN120295919APending Publication Date: 2025-07-11YUSUR TECH CO LTD

Patent Information

Application Number
CN202510394500.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

现有的DPU测试方法缺乏端到端自动化,依赖人工操作,导致测试效率低且结果不准确,难以全面覆盖DPU在存储、计算和安全等方面的多种特性。

Method used

Provide a fully automated DPU testing method and system, which realizes the full-chain automation from environmental configuration to test result analysis by obtaining environmental information, grouping test cases, sending test commands and analyzing results, and reduces manual intervention.

Benefits of technology

Improves testing efficiency and accuracy, reduces the risk of human error, and ensures comprehensiveness and consistency of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120295919A_ABST
    Figure CN120295919A_ABST
Patent Text Reader

Abstract

The invention provides a test method and device for a DPU, equipment and a storage medium, and the method comprises the steps: obtaining environment information of a to-be-tested resource, the environment information comprising path information of a test case of the to-be-tested DPU; obtaining the test case from a preset case library based on the path information of the test case; grouping the test cases to obtain a plurality of test case sets; adding test tasks corresponding to the test cases in the plurality of test case sets into a message queue; a test command corresponding to the test task in the message queue is sent to the to-be-tested resource, a test result of the at least one test item is received, and the test result is obtained after the to-be-tested resource executes the test command; and analyzing the test result of the at least one test item to obtain a test report of the to-be-tested DPU. Full-chain automation from environment configuration, test execution to result analysis is realized, and the test efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of Data Processing Unit (DPU) testing, and particularly to a testing method, platform, device, and storage medium for DPU. Background Art

[0002] With the development of data centers and the popularization of cloud computing, network performance and computing efficiency have become particularly important. When traditional Central Processing Unit (CPU) and Graphics Processing Unit (GPU) handle data packets and network traffic, they often consume a large amount of computing resources, affecting the overall performance of the system. To address this challenge, DPU has emerged. DPU is not only a network interface card but also a high-performance processor integrating multiple functions such as network, storage, computing, security, and management. It can effectively offload, accelerate, and manage the infrastructure virtualization services of data centers, thus solving the computing bottleneck problem and releasing more general computing resources to support customer services.

[0003] With the rapid development of DPU chips, the testing requirements for DPU chips have also increased day by day. As a key link in ensuring the performance and quality of integrated circuits, DPU chip testing technology is of great importance in the integrated circuit industry. In currently commonly used DPU testing methods, testers need to manually edit test scripts according to test requirements, manually configure the test environment, and manually analyze the test results.

[0004] In the above related technologies, due to the intervention of humans, true end-to-end automated testing cannot be achieved, and the above testing methods often only test specific network functions and are difficult to comprehensively cover the multiple features provided by DPU intelligent network cards in aspects such as storage, computing, and security. The above methods not only have low testing efficiency but are also easily affected by human factors, resulting in inaccurate test results. Summary of the Invention

[0005] To solve the above technical problems, this application provides a testing method, platform, device, and storage medium for DPU, realizing full-chain automation from environment configuration, test execution to result analysis. Through the fully automated test process, manual operations are reduced, the risk of human errors is lowered, and the testing efficiency and accuracy are improved.

[0006] In a first aspect, the present application provides a test method for a DPU. This test method is applied to a DPU test system, which is connected to a resource under test. The resource under test includes the DPU under test, and it includes: obtaining the environmental information of the resource under test, where the environmental information of the resource under test at least includes: the path information of multiple test cases for the DPU under test and the test items of the DPU under test; obtaining multiple test cases from a preset use case library based on the path information of the multiple test cases; grouping the multiple test cases to obtain multiple test case sets, where a test case set includes test cases belonging to the same test item; adding the test tasks corresponding to the test cases in the multiple test case sets to a message queue; sending a test command corresponding to the test task in the message queue to the resource under test and receiving the test result of the test task, where the test result is obtained after the resource under test executes the test command; analyzing the test result of the test task to obtain a test report of the DPU under test.

[0007] In a second aspect, the present application provides a test device for a DPU. The test device is configured in a DPU test system, which is connected to a resource under test. The resource under test includes the DPU under test, and it includes: an environmental information acquisition module for obtaining the environmental information of the resource under test, where the environmental information of the resource under test at least includes: the path information of multiple test cases for the DPU under test and the test items of the DPU under test; a test case acquisition module for obtaining multiple test cases from a preset use case library based on the path information of the multiple test cases; a test case set determination module for grouping the multiple test cases to obtain multiple test case sets, where a test case set includes test cases belonging to the same test item; a test task addition module for adding the test tasks corresponding to the test cases in the test case sets to a message queue; a test result reception module for sending a test command corresponding to the test task in the message queue to the resource under test and receiving the test result of the test task, where the test result is obtained after the resource under test executes the test command; a test result analysis module for analyzing the test result of the test task to obtain a test report of the DPU under test.

[0008] In a third aspect, the present application provides an electronic device, which can be a test device for a DPU. The electronic device includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the test method for a DPU as described in the first aspect above.

[0009] In a fourth aspect, the present application provides a storage medium, which can be a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the test method for a DPU as described in the first aspect above.

[0010] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the testing method for DPU described in any one of the above first aspects is implemented.

[0011] The technical solutions provided by the embodiments of the present application have the following advantages compared with the prior art:

[0012] An embodiment of the present application provides a testing method, device, equipment, and storage medium for a DPU. The method includes: obtaining the environmental information of the resource to be tested, where the environmental information of the resource to be tested at least includes: the path information of multiple test cases of the DPU to be tested and the test items of the DPU to be tested; obtaining multiple test cases from a preset use case library based on the path information of the multiple test cases; grouping the multiple test cases to obtain multiple test case sets, where each test case set includes test cases belonging to the same test item; for each test case set, adding the test tasks corresponding to the test cases in the test case set to a message queue; sending a test command corresponding to the test task in the message queue to the resource to be tested, and receiving the test results of the test task, where the test results are obtained after the resource to be tested executes the test command, and analyzing the test results of the test task to obtain a test report of the DPU to be tested. It realizes full-chain automation from environment configuration, test execution to result analysis. Through the fully automated test process, manual operations are reduced, the risk of human errors is lowered, and the test efficiency and accuracy are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.

[0014] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for describing the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0015] Figure 1 It is a schematic flowchart of the testing method for DPU provided by an embodiment of the present application;

[0016] Figure 2 It is a system architecture diagram of the DPU testing system provided by an embodiment of the present application;

[0017] Figure 3a It is a schematic diagram of the distributed structure of a DPU testing platform provided by an embodiment of the present application;

[0018] Figure 3b It is a schematic diagram of the distributed structure of another DPU test platform provided by an embodiment of the present application;

[0019] Figure 4 It is a schematic diagram of a visualization interface provided by an embodiment of the present application;

[0020] Figure 5 It is a flowchart for generating test commands based on test tasks provided by an embodiment of the present application;

[0021] Figure 6 It is a schematic flowchart of another test method for DPU provided by an embodiment of the present application;

[0022] Figure 7 It is a schematic diagram of the structure of a test device for DPU provided by an embodiment of the present application;

[0023] Figure 8 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0024] In order to be able to more clearly understand the above objects, features, and advantages of the present application, the solutions of the present application will be further described below. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments can be combined with each other.

[0025] Many specific details are set forth in the following description in order to fully understand the present application, but the present application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only a part of the embodiments of the present application, rather than all the embodiments.

[0026] The term "including" and its variants used herein are open-ended, that is, "including but not limited to". The term "based on" is "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0027] It should be noted that the concepts such as "first" and "second" mentioned in the present application are only used to distinguish different devices, modules, or units, and are not used to limit the order or mutual dependence relationship of the functions performed by these devices, modules, or units.

[0028] It should be noted that the modifications of "one" and "multiple" mentioned in the present application are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".

[0029] The following will combine the accompanying drawings and specific embodiments to provide a detailed description of the test method for DPU provided by the present application.

[0030] Figure 1 The figure is a flowchart of a test method for DPU in an embodiment of the present application. This embodiment is applicable to the situation of testing the performance of DPU. This method can be executed by a test device for DPU. The test device for DPU can be implemented in software and / or hardware, and the test device for DPU can be configured in an electronic device.

[0031] In the implementation of the present application, the DPU is first introduced.

[0032] The DPU is a dedicated processor constructed with data as the center. Different from the traditional Central Processing Unit (CPU) and Graphics Processing Unit (GPU), the DPU is mainly optimized for tasks at the infrastructure levels such as network, storage, and security. The DPU adopts a software-defined technical route to support the virtualization of infrastructure layer resources and supports infrastructure layer services such as storage, security, and service quality management. The DPU can help reduce the workload of the server CPU and improve the performance and efficiency of the overall system.

[0033] The main features of the DPU include: (1) Computing power offloading. Unload things such as the encapsulation and decapsulation of storage protocols and security protocols, which are not suitable for the CPU, to the DPU, saving more CPU computing power to support more application services. (2) Virtual network control plane isolation. The DPU sets up an independent network control plane, which is completely isolated from the host and can serve the combination and scaling of various resource pool capabilities. (3) Extension of host-side bus communication. In a distributed computing architecture, the way to connect different resource pools will change from the original system bus to the way of bus - network - bus. The DPU can not only provide the ability of PCIe Endpoint, but also provide the ability of PCIe Root Complex. (4) Lossless network transmission on the network side. The network side provides a congestion control mechanism and enhanced load balancing ability for the Incast traffic model and the impact of "elephant" flows, reducing the long-tail delay and providing a more reliable and efficient transmission network. (5) Fine-grained measurement and fault detection capabilities. Fine-grained traffic measurement supports fine-grained fault detection capabilities, making traffic data more transparent.

[0034] The test method for DPU provided by the embodiments of this application is mainly used to test the performance of the DPU. For example, it tests various characteristics such as supporting the high-performance network offloading and acceleration capabilities of OVS, supporting the security offloading capabilities, supporting the P4 custom protocol capabilities, and supporting the SR-IOV hardware virtualization capabilities.

[0035] The test method for DPU provided by the embodiments of this application is applied to a DPU test system, and the DPU test system is connected to the resource to be tested. The system architecture diagram of the DPU test system is as Figure 2 shown. The overall architecture of the DPU test system includes a user layer 21, a gateway layer 22, a service layer 23, and a persistence layer 24. A communication interface is deployed in the user layer 21. The communication interface may include an Application Programming Interface (API) and a HyperText Markup Language (HTML) interface. The above communication interfaces are mainly used to interact with the resource to be tested and testers. A gateway device is deployed in the gateway layer 22. The gateway device may include a Web Server Gateway Interface (WSGI) and a proxy server (Nginx) interface. Five modules, namely system configuration, environment management, use case management, task management, and report management, are deployed in the service layer 23. For specific details, reference may be made to the description in the following embodiments.

[0036] A middleware is deployed in the persistence layer. The middleware includes a relational database management system and a Message Queue (MQ). The relational database management system may be a MySQL database. The MySQL database can be used to store test scripts, test results, and configuration information according to the characteristics of test data, providing efficient data storage and retrieval capabilities, and supporting the management of a large amount of test data. In addition, the table structure and index design of the database are optimized to ensure performance in large-scale data storage and query. Expired test data can also be automatically archived through customized stored procedures and triggers, saving storage space and improving query efficiency. The message queue can customize message routing. As a message broker, MQ coordinates the communication between Django, Celery, and Ansible. According to different types of test tasks, customized message routing rules enable messages to be transmitted more efficiently between components. Through fine-grained management of the message queue, it is ensured that the system can still run stably under high concurrency. Moreover, the message queue can implement message persistence and an automatic retry mechanism to ensure that key test task information will not be lost in case of network or service failures, guaranteeing the continuity of task testing and further improving the reliability of the system.

[0037] In the DPU test system, a user interface is built through a web framework, allowing users to easily configure test case sets, test tasks, and view test results. A task queue system is used in conjunction with MQ to implement asynchronous task execution, and an automated operation and maintenance tool is responsible for automated deployment of the test environment and visual result statistical analysis.

[0038] Exemplarily, using Django as the web framework, a visualization tool for managing test scripts and test results is designed. Users can easily submit test tasks, view test results, and manage test scripts to support specific test task configurations, graphical display of test results, and complex user permission management. A centralized and user-friendly platform is provided to manage the entire test process. The above web framework can also use Flask or Spring Boot.

[0039] To meet specific test requirements, a plugin is developed to integrate platform environment monitoring into the test report, which can assist in analyzing information such as CPU and memory; test report management such as Aullre and robothtml is integrated. These reports include detailed test logs, result statistics, and chart analysis, making the test results more intuitive.

[0040] Such as Figure 1 shown, the test method for DPU provided by the embodiment of the present application mainly includes steps S101 - S106.

[0041] S101. Obtain the environmental information of the resource to be tested. The environmental information of the resource to be tested includes at least: the path information of multiple test cases of the DPU to be tested and the test items of the DPU to be tested.

[0042] Among them, the DPU to be tested can be understood as the DPU whose performance needs to be tested, and the resource to be tested can be understood as various resources related to the DPU to be tested, such as: hardware resources, software resources, document resources, etc.

[0043] The environmental information of the resource to be tested can refer to various environmental parameters in the actual environment that need to be obtained to ensure that the test can be carried out under the correct conditions. The environmental information usually includes the following aspects: hardware information, software information, network environment, physical environment, etc. Among them, the hardware information includes: the number of DPUs included in the resource to be tested, the server parameters of each DPU, such as: CPU, memory, hard disk space, etc., the network configuration parameters of each DPU, such as: bandwidth, latency, network topology structure, etc. The software information includes: the operating system used by the DPU, the version numbers and installation paths of each deployed application program, etc. The network environment includes the adopted network architecture and the networking method between each DPU, etc. The physical environment includes: the temperature, humidity, and power supply stability of the environment where the DPU to be tested is located, etc.

[0044] Further, the above environmental information further includes the test items that need to be executed for the DPU to be tested this time, and the test cases required for executing each test item, where the test cases can be represented in the form of scripts.

[0045] In a possible implementation, the resource to be tested further includes at least one auxiliary DPU for testing, and the auxiliary DPU for testing communicates with the DPU to be tested through a layer 2 protocol and / or a layer 3 protocol. The DPU to be tested can also be referred to as the main DPU for testing.

[0046] As Figure 3a shown, the test system can also be regarded as a management node 31, and the resource to be tested can be regarded as a controlled node 32. The management node 31 and the controlled node 32 together form a test platform. The management node 31 operates the controlled node 32 to perform tests, and the controlled node 32 responds to the operations of the management node 31 to perform tests. Among them, the controlled node 32 includes the DPU to be tested and the auxiliary DPU for testing.

[0047] The management node 31 is responsible for controlling the DPU to be tested and the auxiliary DPU for testing, and an interface for communicating with the auxiliary DPU for testing is provided in the management node 31 to realize the interaction between the management node and the auxiliary DPU for testing.

[0048] The auxiliary DPU for testing consists of one or several DPUs, and message passing, data exchange, etc. operations are performed between each DPU through a communication interface. The DPU to be tested communicates with the auxiliary DPU for testing through a layer 2 protocol and / or a layer 3 protocol, and the above communication data consists of one or more instructions. Each group of instructions is responsible for a specific test task.

[0049] Further, as Figure 3b shown, further, as Figure 4 shown, the DPU 321 to be tested includes a management network interface and a DPU network card, and the DPU network card includes multiple mac interfaces. For example, the DPU network card includes a mac1 interface and a mac2 interface. The auxiliary DPU 322 for testing includes a management network interface and a DPU commercial card, and the DPU commercial card includes multiple mac interfaces. For example, the DPU network card includes a mac1 interface and a mac2 interface.

[0050] The DPU test system is connected to the management network interface of the DPU to be tested. At the same time, the DPU test system is connected to the management network interface of the auxiliary DPU for testing. The DPU test system tests the DPU by performing network settings on the DPU through the management network interface and performing receive and transmit packet tests. The mac1 interface in the DPU network card is connected to the mac1 interface in the DPU commercial card. The mac2 interface in the DPU network card is connected to the mac12 interface in the DPU commercial card.

[0051] In a possible implementation, the DPU test system constructs a distributed test architecture with the DPU under test and the auxiliary DPU under test through interfaces.

[0052] Since the DPU test platform adopts a distributed architecture, there is no strict dependence relationship between the management node and the controlled node. During the test, it only needs to modify the communication parameters between the management node and the controlled node to complete. In addition, the test system supports multiple functions such as software online update, software upgrade, and virtual devices. Information can also be transmitted between the DPU under test and the auxiliary DPU under test through interfaces, ensuring the stable and reliable operation of the test platform.

[0053] In the embodiments of the present application, a distributed architecture is adopted, which supports dynamic resource configuration and system expansion and can adapt to different-scale test requirements.

[0054] In a possible implementation, obtaining the environmental information of the resource under test includes: maintaining the initial components using an automated maintenance tool; in response to a parameter configuration operation for the initial components, obtaining the device information of each device in the resource under test, where the device includes the DPU under test; in response to a selection operation for the test items in the resource under test, obtaining multiple test items for the DPU under test; in response to a selection operation for test cases, obtaining the path information of multiple test cases; in response to a setting operation for the network topology between each device in the resource under test, obtaining the network topology between each device in the resource under test; and generating a yaml file based on the network topology between each device in the resource under test and a pre-selected YAML template of another markup language, where the yaml file includes the environmental information of the resource under test.

[0055] In the embodiments of the present application, the automated maintenance tool is taken as an example of the Ansible automated operation and maintenance tool for illustration.

[0056] Modules and plugins can be customized in the Ansible automated operation and maintenance tool. Specifically, in order to support the characteristics of the DPU, customized Ansible modules and components are developed. This module is mainly used to deploy and manage the test environment, can configure special hardware parameters, execute complex network configurations, and dynamically adjust the test environment in different test scenarios to ensure the consistency and repeatability of the environment and avoid errors caused by manual configuration.

[0057] Furthermore, by extending Ansible, a module for dynamically managing the test environment is developed. This module can automatically detect the environment configuration before the test starts, monitor environmental information such as the CPU, memory, and network of the resource under test, and ensure that the environment is always in a monitored state.

[0058] In the application embodiment, the Ansible automation tool is integrated to automatically maintain the server information of the DPU and support dynamic addition and deletion. Specifically, the Ansible automation tool is deployed in the DPU test system, and the software, hardware, and network environments are initialized on the device under test through the Ansible automation tool. For example, initializing the hardware includes installing the software and hardware drivers of the DPU network card; initializing the software includes installing necessary packet sending and receiving tools, traffic capture tools, etc.; initializing the network environment includes performing basic networking, etc.

[0059] Exemplarily, testers need to configure the DPU under test based on the initial components. Then, the testers can read the device information of the DPU and select an initial component from multiple initial components. Display the configurable information in the initial component in the visualization interface, and input the read device information of the DPU under test to the specified position in the visualization interface. The DPU test system responds to the parameter configuration operation on the initial component, obtains the configured parameters, and configures the initial component with the configured parameters to configure the device information of the DPU under test in the resource under test. In other words, for each configurable parameter in the initial component, an input box for each configuration parameter is displayed in the visualization interface, and the tester can input parameters in the input box to implement the configuration of the DPU under test. For other devices in the resource under test, the above method can also be used for configuration.

[0060] The DPU test system also provides a test case combination function. The test cases are displayed in a tree-like test case structure according to the product feature modules. It supports users to freely combine test cases through the visualization interface to form a test case set to meet the requirements of different test scenarios. As Figure 4 shown, multiple test case names are displayed in the Figure 4 shown visualization interface. Each test case name has the path information storing the test case. Users can select the test case names they need to use on this visualization page, or search for the test case names they want to select in this visualization interface.

[0061] In the embodiment of the present application, a visualization interface can be provided, and users can design a test network topology through operations such as clicking and automatically generate a corresponding logical networking YAML file.

[0062] S102. Obtain multiple test cases from a preset use case library based on the path information of multiple test cases.

[0063] The above preset use case library can be a Robot use case library and / or a Python use case library.

[0064] In the DPU test system, the use case management module is deployed. The Robot use case library and the Pytest use case library are deployed in similar git repositories. The use case management module obtains the test case path information in step S101, and based on this test case path information, obtains the test cases at the storage location corresponding to the path information from the git repository.

[0065] The test cases in the embodiments of this application can use Robot scripts or Pytest scripts. Among them, Robot Framework is mainly used to write automated test scripts. Robot Framework supports keyword-driven testing and is easy to write and understand. For the automated testing of DPU smart network cards, test cases can be quickly written and executed through Robot Framework to achieve end-to-end automation. In addition, Robot Framework can also develop custom keyword libraries to support specific test requirements or be closely integrated with the characteristics of DPU network cards to ensure that the test scripts can cover all necessary test scenarios. As a Python test framework, Pytest is used to write more complex or test scripts that require programming logic. Pytest provides flexible test functions, supports writing highly customized test cases, and can meet the needs of complex test scenarios, especially those that require complex logical judgments or dynamic test generation. Developing specific plugins or extensions to support the advanced test requirements of DPU smart network cards can support parallel test execution, dynamic test case generation, and adjustment of test parameters at runtime. Through these plugins, the flexibility and scalability of test scripts have been significantly improved, and they can handle complex test scenarios.

[0066] Furthermore, PyTest can be used to execute unit tests, while RobotFramework can be used to implement functional tests at the UI level.

[0067] The DPU test system can support two test frameworks, Robot Framework and Pytest, which can meet different complexity and type of test requirements and provide a flexible test project.

[0068] S103. Group multiple test cases to obtain multiple test case sets, where each test case set includes test cases belonging to the same test project.

[0069] After obtaining the test cases from the git repository, the test cases belonging to the same test project are divided into a group to form a test case set. The test cases in this test case set are used to execute the same test project.

[0070] In the embodiments of the present application, test cases can also be stored in a MySql database, so that when the test cases are used for execution next time, the test cases can be directly read from the MySql database to improve the script reading speed.

[0071] Furthermore, test case sets can also be stored in a MySql database, so that when the same test project is executed next time, the same test case set can be used to avoid test errors caused by using different test cases for the same test project, thereby improving the accuracy of test results.

[0072] S104. Add the test tasks corresponding to the test cases in multiple test case sets to the message queue.

[0073] Deploy a task management module in the DPU test system for task queue management of the task management module. By customizing the task scheduling strategy of Celery, a resource-based queue system is designed. Test tasks can be dynamically allocated to different queues according to the resources required by the tasks to ensure that critical queues are processed first, optimizing the utilization of system resources. The task management module also designs a task failure retry mechanism. For tasks that fail due to environmental problems or transient errors, the system will automatically retry according to specific rules, reducing the need for manual intervention and increasing the completion rate of test tasks. To ensure seamless integration with Django, custom development is carried out for asynchronous execution of test tasks, optimizing the efficiency of task allocation and execution, improving test efficiency, being able to schedule and manage a large number of test tasks, and ensuring that the test tasks will not cause system performance degradation or resource conflicts due to synchronous execution.

[0074] In a possible implementation, deploy middleware in the DPU test system, where the middleware includes multiple message queues; adding the test tasks corresponding to the test cases in multiple test case sets to the message queue includes: calculating the required resources for all test tasks in each test case set; matching a message queue for the test case set based on the required resources; and putting all the test tasks included in the test case set into the matching message queue through the interface of the middleware.

[0075] For each test case set, calculate the specific resource requirements for all test tasks in this test case set. The above resource requirements may include: the CPU occupancy time required to run the test, the RAM size occupied during the execution of the test, the space required to store test data and results, etc. If the test involves a large amount of data transmission or remote service calls, the above resource requirements also include: the required network bandwidth.

[0076] According to the determined required resources, select a suitable message queue to meet different resource requirements. Matching a message queue for a test case set based on the required resources is mainly to select the most suitable message queue for the test case set. Specifically, select a message queue whose capacity and load can handle the expected workload without causing delays. For tests with higher criticality, allocate them to queues with higher priority processing capabilities. Use queues dedicated to different types of resource requirements, such as setting up a dedicated queue for tasks with high memory consumption, to avoid competing for resources with other types of tasks.

[0077] Add the test tasks to the selected message queue through the API provided by the middleware or other means. Specifically, encapsulate the test tasks, create a test task ID and configuration items for the test tasks, and package them according to the format specified by the middleware. Call the client library or REST API provided by the middleware to send a data packet containing the above information to the corresponding message queue, check whether it is successfully submitted to the queue, and record relevant logs for tracing.

[0078] In this embodiment, automatically selecting suitable test resources according to task requirements improves resource utilization and reduces resource waste.

[0079] S105. Send a test command corresponding to the test task in the message queue to the resource under test, and receive the test result of the test task.

[0080] Obtain the test tasks in the message queue in sequence, generate a corresponding test command for each test task, and send the test command to the DPU under test in the resource under test. The DPU under test executes the test command and obtains a test result. The DPU under test feeds back the test result to the DPU test system.

[0081] Figure 5It is a flowchart of generating test commands based on test tasks provided by an embodiment of the present application. Specifically, step 1, use Celery's task management tool to obtain the test task from MQ as the task to be tested. Step 2, obtain the test case and variable information required for the task to be tested from the case management module, and obtain the configuration information of the task to be tested from the environment management module. The case to be tested is obtained based on the test case, variable information and configuration information. Step 3, obtain the yaml file of the task to be tested from the environment management module. Step 4, based on the case to be tested and the yaml file, generate a test command, and execute the test command. Step 5, after the DPU test system sends the test command to the DPU to be tested, the DPU to be tested is tested based on the received test command, and the output result information is transmitted back to the DPU test system. Step 6, the DPU test system analyzes the test results, obtains a test report, and sends it to the gateway. Step 7, the test log can also be sent to the gateway. Step 8, update the status of the test task in the MyAQL database.

[0082] In this embodiment, Celery and RabbitMQ are used to perform asynchronous processing of tasks, which can process multiple test tasks at the same time, further improving the test efficiency.

[0083] In one possible implementation, a test command corresponding to a test task in a message queue is sent to a resource under test, and a test result of the test task is received, including: a test command corresponding to the test task in a message queue is sent to a DPU under test, and a first test result of at least one test item fed back by the DPU under test, and a second test result of at least one test item fed back by an auxiliary test DPU; the first test result is obtained after the DPU under test executes the test command and transmits data through a layer 2 protocol and / or a layer 3 protocol; the second test result is obtained after the auxiliary test DPU receives data transmitted by the DPU under test through a layer 2 protocol and / or a layer 3 protocol.

[0084] The DPU to be tested performs the test after receiving the test command from the DPU test system, and transmits the result information output by the DPU to the DPU test system.

[0085] The auxiliary test DPU is composed of one or several devices, and the devices of the auxiliary test DPU perform message transmission, data exchange and other operations through the communication interface. During the test process, the main task of the auxiliary test DPU is to assist the main test device in the transmission and communication of network data, and return data information to the DPU test system.

[0086] In the embodiment of the present application, the layer 2 and layer 3 networks of the DPU to be tested are tested, which involves testing the performance at the network level, making the test more comprehensive.

[0087] S106. Analyze the test results of the test task to obtain a test report of the DPU under test.

[0088] Deploy a report management module in the DPU test system, which is mainly used for report preprocessing and classification as well as log management. Specifically, perform intelligent analysis on the test report, extract error information and classify it to facilitate quick problem location. Log management refers to detailed recording of the logs during the test execution process, providing log query and analysis functions to facilitate debugging and review.

[0089] Furthermore, integrate third - party components in the DPU test system to meet specific test requirements. Develop a plugin to integrate platform environment monitoring into the test report, which can assist in analyzing information such as CPU and memory; integrate test report management such as Aullre and robothtml. These reports include detailed test logs, result statistics, and chart analysis, making the test results more intuitive.

[0090] The intelligent analysis and error classification functions of the test report help quickly locate problems and improve the accuracy of problem troubleshooting.

[0091] Based on the above - mentioned embodiments, after obtaining the environmental information of the resource under test, the above - mentioned test method for DPU further includes: initializing and configuring the board of the DPU under test by calling the embedded operating system; initializing and configuring the network interface of the DPU under test by calling the communication library function, and initializing and configuring the storage configuration of the DPU under test by calling the driver.

[0092] The DPU test system further includes: a DPU initialization module, which is mainly responsible for configuring the DPU under test as a complete DPU network card, including network interface configuration, storage configuration, and security configuration, etc., to ensure a consistent test environment. This DPU initialization module can be linked with other modules in the DPU test system for specific configuration according to the specific requirements of the test platform, and can also be extended according to other requirements of the test platform.

[0093] Specifically, the DPU initialization module includes a DPU initialization program and a DPU initialization control program. Among them, the DPU initialization program mainly completes the initialization of the DPU under test, including initializing the board, setting the main controller, setting the firmware upgrade interface and firmware upgrade options, etc.; monitoring and analyzing the DPU chip initialization control process and test results.

[0094] This module initializes the DPU by invoking the interrupt mechanism of the embedded operating system, initializes the network interface configuration by invoking communication library functions, and initializes the storage configuration by invoking the driver. In addition, this module can be extended according to other requirements of the test platform, including extensible communication interfaces, extensible storage configurations, and extensible security configurations, etc.

[0095] Figure 6 The complete process from test task configuration to test result analysis is described in detail. The DPU test system mainly includes five modules: system configuration, environment management, test case management, task management, and report management, as well as a dynamic adaptation layer and a hardware abstraction interface.

[0096] The system configuration module is mainly used for the configuration of the common YML template and the management of the path information of test cases. The configuration of the common YML template mainly includes: designing a unified YAML template for quickly defining the basic configuration of the test environment, including the test framework version, dependent libraries, etc. The management of the test case code path can implement the function of automatically identifying and loading the test case code path, support the automatic synchronization of the Git repository, and ensure the latestness of the test script.

[0097] The environment management module is mainly used for the management of the device resource list and the configuration of the networking YML. The management of the device resource list is based on the integrated Ansible automation tool to automatically maintain the device resource list and support dynamic addition and deletion. The networking YML configuration is based on the provided visual interface. Users can design the test network topology through operations such as clicking and automatically generate the corresponding logical networking YAML file.

[0098] The test case management module mainly implements the test case combination function. Specifically, the test case combination function: provides the user with a tree-like test case structure according to the product feature modules, supports the user to freely combine test cases through the interface to form a test case set to meet the requirements of different test scenarios.

[0099] The task management module is mainly used for queue management and dynamic allocation of resources. Queue management realizes the asynchronous processing of tasks through RabbitMQ to improve the task concurrency processing ability. Dynamic resource allocation and test execution refer to automatically selecting appropriate test resources according to task requirements and executing test scripts.

[0100] The report management module is mainly used for report preprocessing, classification, and log management. Among them, report preprocessing and classification refer to the intelligent analysis of test reports, extracting error information and classifying it to facilitate quick problem positioning. Log management refers to detailed recording of the logs during the test execution process, providing log query and analysis functions to facilitate debugging and review.

[0101] Such as Figure 6As shown in the figure, the process from test task configuration to test result analysis mainly includes four processes: Step 1, environmental networking; Step 2, creating a test case set; Step 3, task execution; and Step 4, report analysis.

[0102] Among them, Step 1, environmental networking, includes: Step 1.1 obtaining the resource information of the DPU to be tested; Step 1.2 obtaining the test project information; and Step 1.3 storing the storage networking environment yml and setting settings in the mysql database. Among them, Step 1.2 obtaining the test project information includes 1.2.1 obtaining the yaml template of the team.

[0103] Among them, Step 2, creating a test case set, includes: Step 2.1 obtaining the path information of the test cases from the project management module; Step 2.2 the test case set management module is used to obtain the test case information from the use case management module; and Step 2.3 synchronizing the test cases to the mysQL database. Among them, it also includes: Step 2.2.1 synchronizing the test cases to the git repository, and Step S2.2.2 synchronizing the path information of the test cases in the git repository to the mysQL database.

[0104] Among them, Step 3, task execution, includes: Step 3.1 obtaining device information, project information, and configuration information; 3.2 obtaining test cases; 3.3 putting the test tasks corresponding to the test cases into the message queue; 3.4 starting the consumer; 3.5 controlling the consumption of the resources to be tested; 3.6 generating a static report; and 3.7 generating logs.

[0105] The embodiment of this application constructs a fully automated DPU test system, which realizes the automation of the whole process from environment configuration, test execution to result analysis, improving the test efficiency and accuracy. The DPU test system consists of multiple modules, including system configuration, environment management, use case management, task management, and report management. Each module has specific functions and interfaces, enabling each functional module to be independently upgraded and maintained, enhancing the flexibility and scalability of the system. Multiple technology stacks are integrated in the DPU test system. Specifically, multiple technology stacks and tools such as Django, Celery, Ansible, MySQL, and RabbitMQ are integrated to support asynchronous task processing, automated deployment, and data storage. Two test frameworks, Robot Framework and Pytest, are used in the DPU test system to meet different complexity test requirements. The DPU test platform adopts a distributed test architecture, and the independence between the DPU test system and the DPU to be tested improves the stability and scalability of the system.

[0106] Figure 7FIG. 0 is a schematic structural diagram of a test device for a DPU in an embodiment of the present application. The test device is configured in a DPU test system, and the DPU test system is connected to a resource under test. The resource under test includes a DPU under test, such as Figure 7 As shown, the test device 70 for a DPU provided in the embodiment of the present application mainly includes: an environmental information acquisition module 71, a test case acquisition module 72, a test case set determination module 73, a test task addition module 74, a test result reception module 75, and a test result analysis module 76.

[0107] Among them, the environmental information acquisition module 71 is used to acquire the environmental information of the resource under test. The environmental information of the resource under test at least includes: the path information of multiple test cases of the DPU under test; the test case acquisition module 72 is used to acquire multiple test cases from a preset use case library based on the path information of the multiple test cases; the test case set determination module 73 is used to group the multiple test cases to obtain multiple test case sets, where the test case set includes test cases belonging to the same test project; the test task addition module 74 is used to add the test tasks corresponding to the test cases in the test case set to the message queue; the test result reception module 75 is used to send a test command corresponding to the test task in the message queue to the resource under test and receive the test result of the test task. The test result is obtained after the resource under test executes the test command; the test result analysis module 76 is used to analyze the test result of the test task to obtain a test report of the DPU under test.

[0108] In a possible implementation manner, the resource under test further includes an auxiliary DPU for testing. The auxiliary DPU for testing communicates with the DPU under test through a layer 2 protocol and / or a layer 3 protocol; the test result reception module 75 is specifically used to send a test command corresponding to the test task in the message queue to the DPU under test and receive a first test result of the test task fed back by the DPU under test, and a second test result of the test task fed back by the auxiliary DPU for testing; the first test result is obtained after the DPU under test executes the test command and transmits data through a layer 2 protocol and / or a layer 3 protocol; the second test result is obtained after the auxiliary DPU for testing receives the data transmitted by the DPU under test through a layer 2 protocol and / or a layer 3 protocol.

[0109] In a possible implementation manner, the DPU test system constructs a distributed test architecture with the DPU under test and the auxiliary DPU for testing through an interface.

[0110] In a possible implementation, the environment information acquisition module 71 is specifically configured to maintain the initial components by using an automated maintenance tool; in response to a parameter configuration operation for the initial components, obtain the device information of each device in the resource under test, where the devices include the DPU under test; in response to a selection operation for a test project, obtain the test project for the DPU under test; in response to a selection operation for a test case, obtain the path information of the test case; in response to a setting operation for the network topology between the devices in the resource under test, obtain the network topology between the devices in the resource under test; and generate a YAML file based on the network topology between the devices in the resource under test and a pre-selected YAML template of another markup language, where the YAML file includes the environment information of the resource under test.

[0111] In a possible implementation, a middleware is deployed in the DPU test system, and the middleware includes multiple message queues; the test task addition module 74 is specifically configured to calculate the resource requirements of all test tasks in each test case set; match a message queue for the test case set based on the required resource requirements; and put the test tasks in the test case set into the message queue matched with it through the interface of the middleware.

[0112] In a possible implementation, the test cases are written using Robot scripts and / or Pytest scripts.

[0113] In a possible implementation, it further includes: an initialization module, configured to, after obtaining the environment information of the resource under test, perform initialization configuration on the board of the DPU under test by calling the embedded operating system; perform initialization configuration on the network interface of the DPU under test by calling the communication library function, and perform initialization configuration on the storage space of the DPU under test by calling the driver.

[0114] The test device for DPU provided by the embodiments of the present application can execute the test method for DPU provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.

[0115] Figure 8 It is a schematic structural diagram of an electronic device provided in this embodiment. The electronic device may include a test device for DPU, such as Figure 8 As shown, the electronic device 800 includes a processor 810, a memory 820, an input device 830, and an output device 840; the number of processors 810 in the electronic device may be one or more, Figure 8 Taking one processor 810 as an example; the processor 810, the memory 820, the input device 830, and the output device 840 in the electronic device may be connected through a bus or other means, Figure 8 Taking the connection through the bus as an example.

[0116] The memory 820, being a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the test method for the DPU in the embodiments of the present invention. The processor 810 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 820, that is, implements the test method for the DPU provided by the embodiments of the present invention.

[0117] The memory 820 may mainly include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the terminal, etc. In addition, the memory 820 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some instances, the memory 820 may further include a memory remotely set relative to the processor 810, and these remote memories can be connected to the electronic device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0118] The input device 830 can be used to receive input digital or character information, and generate key signal inputs related to the user settings and function control of the electronic device, and can include a keyboard, a mouse, etc. The output device 840 may include a display device such as a display screen.

[0119] This embodiment also provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to implement the test method for the DPU provided by the embodiments of the present invention when executed by a computer processor.

[0120] Certainly, for a storage medium containing computer-executable instructions provided by the embodiments of the present invention, the computer-executable instructions are not limited to the method operations as described above, and can also execute related operations in the test method for the DPU provided by any embodiment of the present invention.

[0121] From the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software and necessary general-purpose hardware. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a floppy disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (FLASH), a hard disk, or an optical disc of a computer, etc., and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0122] It should be noted that in the above embodiments of the test device for DPU, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the present invention.

[0123] It should be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

[0124] The above are only the specific embodiments of the present application, enabling those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments described herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.

Claims

1. A test method for a data processor DPU, characterized in that, The described test method is applied to a DPU test system, which is connected to a resource under test. The resource under test includes a DPU under test, and it includes: Obtain the environmental information of the resource under test, where the environmental information of the resource under test at least includes: the path information of multiple test cases of the DPU under test and the test items of the DPU under test; Obtain multiple test cases from a preset use case library based on the path information of the multiple test cases; Group the multiple test cases to obtain multiple test case sets, where each test case set includes test cases belonging to the same test item; For each test case set, add the test tasks corresponding to the test cases in the test case set to a message queue; Send a test command corresponding to the test task in the message queue to the resource under test and receive the test result of the test task, where the test result is obtained after the resource under test executes the test command; Analyze the test result of the test task to obtain a test report of the DPU under test.

2. The method according to claim 1, characterized in that, The resource under test further includes an auxiliary DPU, and the auxiliary DPU communicates with the DPU under test through a layer 2 protocol and / or a layer 3 protocol; Sending a test command corresponding to the test task in the message queue to the resource under test and receiving the test result of the test task includes: Send a test command corresponding to the test task in the message queue to the DPU under test and receive the first test result of the test task fed back by the DPU under test and the second test result of the test task fed back by the auxiliary DPU; The first test result is obtained after the DPU under test executes the test command and transmits data through the layer 2 protocol and / or the layer 3 protocol; the second test result is obtained after the auxiliary DPU receives the data transmitted by the DPU under test through the layer 2 protocol and / or the layer 3 protocol.

3. The method according to claim 2, characterized in that, The DPU test system constructs a distributed test architecture with the DPU under test and the auxiliary DPU through an interface.

4. The method according to claim 1, characterized in that, Obtaining the environmental information of the resource under test includes: Use an automated maintenance tool to maintain the initial components; In response to a parameter configuration operation for the initial components, obtain the device information of each device in the resource under test, where the device includes the DPU under test; In response to a selection operation for the test item, obtain the test item for the DPU under test; In response to a selection operation for the test case, obtain the path information of the test case; In response to a setting operation for the network topology between each device in the resource under test, obtain the network topology between each device in the resource under test; Generate a yaml file based on the network topology between each device in the resource under test and a previously selected yaml template of another markup language. The yaml file includes the environmental information of the resource under test.

5. The method according to claim 1, characterized in that, Deploy a middleware in the DPU test system, and the middleware includes multiple message queues; Adding the test tasks corresponding to the test cases in the test case set to the message queue includes: Calculate the resource requirements of all test tasks in each of the test case sets; Match a message queue for the test case set based on the required resource requirements; Put the test tasks in the test case set into the message queue matched with it through the interface of the middleware.

6. The method according to any one of claims 1-5, characterized in that The test cases are written using Robot scripts and / or Pytest scripts.

7. The method according to any one of claims 1-5, characterized in that, After obtaining the environmental information of the resource under test, it further includes: Initialize and configure the board of the DPU under test by calling the embedded operating system; Initialize and configure the network interface of the DPU under test by calling the communication library function, Initialize and configure the storage space of the DPU under test by calling the driver.

8. A test device for a data processor DPU, characterized in that, The test device is configured in a DPU test system, the DPU test system is connected to the resource under test, and the resource under test includes a DPU under test, and includes: An environmental information acquisition module, configured to acquire the environmental information of the resource under test, and the environmental information of the resource under test at least includes: the path information of multiple test cases of the DPU under test; A test case acquisition module, configured to acquire multiple test cases from a preset use case library based on the path information of the multiple test cases; A test case set determination module, configured to group the multiple test cases to obtain multiple test case sets, where the test case sets include test cases belonging to the same test project; A test task addition module, configured to add the test tasks corresponding to the test cases in the test case set to the message queue; A test result receiving module, configured to send a test command corresponding to the test task in the message queue to the resource under test, and receive the test result of the test task, where the test result is obtained after the resource under test executes the test command; A test result analysis module, configured to analyze the test result of the test task to obtain a test report of the DPU under test.

9. An electronic device, characterized in that, The device includes: One or more processors; A storage device, configured to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the test method for the data processor DPU according to any one of claims 1-7.

10. A storage medium, on which a computer program is stored, characterized in that, When the program is executed by the processor, it implements the test method for the data processor DPU according to any one of claims 1-7.

Citation Information

Patent Citations

  • Test method and device based on test case

    CN114741300A

  • Automatic testing method and device for data processor and medium

    CN115904852A

  • Continuous integration method, device, equipment and medium

    CN117539750A

  • Test case screening method and device based on automatic testing

    CN117743144A

Cited By

  • Test method and device based on dynamic command tree and storage medium

    CN122173348A