Container network plug-in testing method and device, storage medium and electronic equipment

Through automated testing methods, test cases are generated based on the gateway type of the container cluster and tested on the work node, which solves the problem of huge time-consuming testing of container network plug-in in the prior art and the results are easily affected by personal experience, achieving efficient and accurate testing results.

CN120075090APending Publication Date: 2025-05-30INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510212702.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the prior art, the testing of container network plug-ins mainly relies on manual testing, which is time-consuming and cannot meet the project's rapid iteration needs. It is susceptible to the experience of testers, resulting in errors in the test results and unsatisfactory test results.

Method used

Provide a container network plug-in testing method, which generates corresponding test cases by determining the gateway type used by the worker node in the target container cluster, and performs automated testing on the worker node to obtain test results.

Benefits of technology

The automated test container network plug-in is implemented, which improves testing efficiency and accuracy, reduces human errors, and can adapt to the needs of fast iterating projects more quickly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120075090A_ABST
    Figure CN120075090A_ABST
Patent Text Reader

Abstract

The invention discloses a container network plug-in testing method and device, a storage medium and electronic equipment. The method relates to the field of cloud computing, and comprises the following steps: determining the type of a gateway used by a working node in a target container cluster, the working node being used for providing operation resources for containers in the target container cluster; according to the gateway type, a first test case of a container network plug-in to be tested is generated, and the container network plug-in is used for providing a network communication service for a container on the working node; and based on the first test case, testing at the working node to obtain a first test result. According to the invention, the problem that the test effect of the container network plug-in is not ideal in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing, and in particular, to a method, device, storage medium, and electronic device for testing a container network plugin. Background Art

[0002] As a new generation of virtualization technology, container virtualization technology has replaced traditional virtualization technology with its lightweight virtualization method, making container technology widely used in technical fields such as cloud computing, big data, and microservices. The development of container technology has promoted the widespread use of container network plugin technology. Therefore, the testing work of container network plugins has become increasingly important. In related technologies, the testing of container network plugins mainly uses manual testing methods, which require a lot of time and actual human input. During the manual testing process, testers need to execute test cases one by one and record the test results to form a test report. This not only takes a huge amount of time but also cannot meet the rapid iteration requirements of the project. At the same time, manual testing is easily affected by the personal experience of testers, which may lead to errors in test results. Therefore, there is a problem that the testing effect of container network plugins is not ideal.

[0003] In view of the problem that the testing effect of container network plugins in related technologies is not ideal, no effective solution has been proposed yet. Summary of the Invention

[0004] The main purpose of the present application is to provide a method, device, storage medium, and electronic device for testing a container network plugin to solve the problem that the testing effect of container network plugins in related technologies is not ideal.

[0005] To achieve the above object, according to one aspect of the present application, a method for testing a container network plugin is provided. The method includes: determining the gateway type used by the working nodes in the target container cluster, where the working nodes are used to provide running resources for the containers in the target container cluster; generating a first test case for the container network plugin to be tested according to the gateway type, where the container network plugin is used to provide network communication services for the containers on the working nodes; and performing a test on the working nodes based on the first test case to obtain a first test result.

[0006] Optionally, generating a first test case for the container network plugin to be tested according to the gateway type includes: determining the network interface configuration information and network connection strategy of the working nodes according to the gateway type; and determining the first test case based on the network interface configuration information and the network connection strategy.

[0007] Optionally, according to the gateway type, determine the network interface configuration information of the working node and the network connection policy, including: in the case where the gateway type is a centralized gateway, determine the network interface configuration information based on the global address management policy of the centralized gateway, where the global address management policy is used to control the network interface creation and binding processing of N first nodes sharing the centralized gateway, and N first nodes include the working node, and N is a positive integer; determine the network connection policy based on the global routing information of the centralized gateway, where the global routing information is determined based on the global isolation requirements configured for the centralized gateway, the virtual local area network (VLAN) corresponding to each of the N first nodes, and the media access control (MAC) address.

[0008] Optionally, according to the gateway type, determine the network interface configuration information of the working node and the network connection policy, including: in the case where the gateway type is a distributed gateway, determine the network interface configuration information based on the network isolation requirements set in the distributed gateway, where the distributed gateway is the gateway corresponding to the working node, and the network isolation requirements are determined based on the isolation level of the working node; determine the network connection policy based on the local routing information of the distributed gateway, where the local routing information is determined based on the VLAN of the working node, the MAC address, and the isolation requirements.

[0009] Optionally, based on the first test case, perform a test on the working node to obtain a first test result, including: compile based on the first test case using the initial source code to obtain a compiled binary file; upload the binary file to the working node through the target running script to obtain the first test result.

[0010] Optionally, the method further includes: in response to the update processing of the test case, determine the execution permission of the target running script; in the case where the execution permission meets the predetermined permission requirements, upload to the working node based on the updated test case through the target running script to obtain a third test result.

[0011] Optionally, the method further includes: determine the master node in the target container cluster, where the master node is used to control the scheduling of node resources in the target container cluster, and the node resources are used to control the corresponding working node to provide the resource amount for running the containers set on the corresponding working node; determine a second test case according to the resource information allocated by the master node for the container network plugin; perform a test on the master node based on the second test case to obtain a second test result.

[0012] To achieve the above object, according to another aspect of the present application, a container network plugin testing device is provided. The device includes: a gateway type determination module, configured to determine the gateway type used by a working node in a target container cluster, where the working node is used to provide running resources for containers in the target container cluster; a first test case generation module, configured to generate a first test case of a container network plugin to be tested according to the gateway type, where the container network plugin is used to provide network communication services for containers on the working node; and a first test result determination module, configured to perform a test on the working node based on the first test case to obtain a first test result.

[0013] Optionally, the first test case generation module includes: a first determination module, configured to determine the network interface configuration information and network connection policy of the working node according to the gateway type; and a second determination module, configured to determine the first test case based on the network interface configuration information and network connection policy.

[0014] Optionally, the first determination module includes: a first network interface configuration information determination module, configured to, when the gateway type is a centralized gateway, determine the network interface configuration information based on the global address management policy of the centralized gateway, where the global address management policy is used to control the network interface creation and binding processing of N first nodes sharing the centralized gateway, and the N first nodes include the working node, and N is a positive integer; and a first network connection policy determination module, configured to determine the network connection policy based on the global routing information of the centralized gateway, where the global routing information is determined based on the global isolation requirements configured by the centralized gateway, the virtual local area network (VLAN) corresponding to each of the N first nodes, and the media access control (MAC) address.

[0015] Optionally, the first determination module includes: a second network interface configuration information determination module, configured to, when the gateway type is a distributed gateway, determine the network interface configuration information based on the network isolation requirements set in the distributed gateway, where the distributed gateway is the gateway corresponding to the working node, and the network isolation requirements are determined based on the isolation level of the working node; and a second network connection policy determination module, configured to determine the network connection policy based on the local routing information of the distributed gateway, where the local routing information is determined based on the VLAN of the working node, the MAC address, and the isolation requirements.

[0016] Optionally, the first test result determination module includes: a binary file generation module, configured to compile based on the first test case using the initial source code to obtain a compiled binary file; and a third determination module, configured to upload the binary file to the working node through a target running script to obtain a first test result.

[0017] Optionally, the device further includes: an execution permission determination module, configured to determine the execution permission of a target running script in response to an update process of a test case; and a third test result determination module, configured to, when the execution permission meets a predetermined permission requirement, upload the updated test case to a worker node through the target running script to obtain a third test result.

[0018] Optionally, the device further includes: a master node determination module, configured to determine a master node in a target container cluster, where the master node is used to control the scheduling of node resources in the target container cluster, and the node resources are used to control corresponding worker nodes to provide a resource amount for running resources of containers disposed on the corresponding worker nodes; a second test case determination module, configured to determine a second test case according to resource information allocated by the master node for a container network plugin; and a second test result determination module, configured to perform a test on the master node based on the second test case to obtain a second test result.

[0019] To achieve the above object, according to another aspect of the present application, there is provided a computer-readable storage medium, where the computer-readable storage medium includes a stored executable program, and when the executable program runs, it controls a device where the computer-readable storage medium is located to execute the container network plugin test method of any one of the above.

[0020] To achieve the above object, according to another aspect of the present application, there is provided an electronic device, including: a memory storing an executable program; and a processor configured to run the program, where when the program runs, it executes the container network plugin test method of any one of the above.

[0021] Through the present application, the following steps are adopted: determining a gateway type used by a worker node in a target container cluster, where the worker node is used to provide running resources for containers in the target container cluster; generating a first test case of a container network plugin to be tested according to the gateway type, where the container network plugin is used to provide network communication services for containers on the worker node; and performing a test on the worker node based on the first test case to obtain a first test result. The object of automatically testing the container network plugin is achieved, and the problem that the test effect of the container network plugin in the related art is not ideal is solved. Furthermore, the effect of improving the test efficiency and accuracy of the container network plugin is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The schematic embodiments of the present application and the descriptions thereof are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:

[0023] Figure 1 A hardware structure block diagram of a computer terminal for implementing the container network plugin test method is shown;

[0024] Figure 2 is a flowchart of a container network plugin testing method provided according to an embodiment of the present application;

[0025] Figure 3 is a structural diagram of a container network plugin testing method provided according to an embodiment of the present application;

[0026] Figure 4 is a schematic diagram of a container network plugin testing device provided according to an embodiment of the present application;

[0027] Figure 5 is a structural block diagram of an electronic device according to an embodiment of the present application. Detailed implementation manners

[0028] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0030] First, some nouns or terms that appear in the process of describing the embodiments of the present application are applicable to the following explanations:

[0031] CNI (Container Network Interface), is a lightweight network interface standard designed for the container environment, mainly used to define how a container network plugin creates and manages the network connections of containers. The purpose of CNI is to provide a standard and unified network interface between the container runtime and the container runtime environment, so that containers can run in different network environments and can be conveniently network-configured and managed.

[0032] An IP (Internet Protocol) address, short for Internet Protocol address, is a unique digital label assigned to each device on the Internet, used to locate and address these devices in the network. The IP address enables data packets to be transmitted on the Internet and ultimately reach the correct destination. In Internet communication, each data packet carries the source IP address and the destination IP address to ensure the correct sending and receiving of data.

[0033] A VLAN (Virtual Local Area Network) is a technology that logically divides a physical local area network into multiple broadcast domains. A VLAN can create multiple independent, small, logical broadcast domains in a large physical network, and devices within each VLAN can communicate as if they were in the same physical local area network.

[0034] A MAC (Media Access Control address) is an address used to uniquely identify a network device at the physical network level.

[0035] etcd is a distributed, consistent key-value storage system for sharing configurations and storing service states, used to provide a reliable way to store critical data that needs to be shared and replicated across multiple nodes in a distributed system.

[0036] It should be noted that the information collected in this application (including but not limited to user device information, user personal information, network configuration information, IP address information, MAC address information, etc.) and data (including but not limited to data for display, analysis, node data, test case data, etc.) are information and data authorized by the user or fully authorized by all parties. Moreover, the processing of relevant data, such as collection, storage, use, processing, transmission, provision, disclosure, and application, complies with relevant laws, regulations, and standards, takes necessary confidentiality measures, does not violate public order and good customs, and provides corresponding operation entrances for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.

[0037] Embodiment 1

[0038] According to an embodiment of the present application, a method embodiment of a container network plugin test method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0039] The method embodiment provided by the first embodiment of this application can be executed in a mobile terminal, a computer terminal, or a similar computing device. Figure 1 The following shows a hardware block diagram of a computer terminal (or mobile device) for implementing a container network plugin testing method. As Figure 1 shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b,..., 102n in the figure) (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may further include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply, and / or a camera. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only illustrative and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 may further include more or fewer components than Figure 1 those shown, or have a different configuration from Figure 1 that shown.

[0040] It should be noted that the above one or more processors 102 and / or other data processing circuits are generally referred to as "data processing circuits" in this article. The data processing circuit may be embodied in whole or in part as software, hardware, firmware, or any combination thereof. In addition, the data processing circuit may be a single independent processing module, or be incorporated in whole or in part into any one of the other elements in the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuit is a kind of processor control (such as the selection of a variable resistor terminal path connected to an interface).

[0041] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the container network plugin testing method in the embodiments of this application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the above-mentioned container network plugin testing method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely set relative to the processor 102, and these remote memories can be connected to the computer terminal 10 through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0042] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0043] The display can be, for example, a touch-screen liquid crystal display (LCD), which enables the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0044] Under the above operating environment, this application provides a Figure 2 container network plugin testing method as shown. Figure 2 It is a flowchart of the container network plugin testing method provided by an embodiment of this application.

[0045] Step S201, determine the gateway type used by the working nodes in the target container cluster, where the working nodes are used to provide running resources for the containers in the target container cluster;

[0046] It can be understood that during the container network plugin testing process, the working nodes are used to provide running resources for each container in the target container cluster, such as computing resources, storage resources, and network resources. When performing container network plugin testing, it is necessary to determine the gateway type used by the working nodes in the target container cluster. By automatically identifying the gateway type, the workload of manually configuring the test environment is reduced, enabling testers to locate and deploy the test environment faster. This not only improves the testing efficiency but also avoids errors and omissions that may occur in manual operations, ensuring the reliability and consistency of the testing.

[0047] Optionally, the gateway types used by the above-mentioned working nodes can adopt a centralized gateway and an enhanced gateway (i.e., a distributed gateway). When performing container network plugin testing, a test target container cluster is set up. The target container cluster includes a master node (i.e., the main node) and several node nodes (i.e., working nodes), where the types of node nodes include node nodes connected under the centralized gateway and node nodes connected under the enhanced gateway. The detailed information of the nodes, including the configuration of the network plugin, can be obtained by querying the target container cluster. By analyzing the configuration information of the network plugin, the gateway type used by the nodes can be judged.

[0048] Step S202: Generate a first test case for the container network plugin to be tested according to the gateway type, where the container network plugin is used to provide network communication services for containers on the worker node.

[0049] It can be understood that according to the gateway type, a first test case used for testing the container network plugin to be tested is generated. Among them, the above-mentioned container network plugin is used to provide network communication services for containers on the worker node, such as the CNI plugin. By automatically generating test cases, the workload of testers can be reduced, the testing process can be accelerated, the testing cycle can be shortened, and thus the testing frequency can be increased to meet the requirements of rapidly iterative projects. At the same time, automated testing avoids the negligence and errors that may occur during manual testing, improves the accuracy and reliability of testing, and ensures the stability and performance of the container network plugin under different gateway types.

[0050] Optionally, in the container network plugin testing method provided in the embodiments of the present application, generating a first test case for the container network plugin to be tested according to the gateway type includes: determining the network interface configuration information of the worker node and the network connection policy according to the gateway type; determining the first test case based on the network interface configuration information and the network connection policy.

[0051] It can be understood that according to the gateway type, the network environment of the worker node is analyzed to determine the network interface configuration information and network connection policy of the containers on the worker node. Based on the above network interface configuration information and network connection policy, a first test case is generated. The generated first test case is targeted at a specific gateway type, which can more accurately evaluate the performance of the container network plugin in different environments, improve the pertinence and effectiveness of testing, and the above testing process not only tests the basic functions of the container network plugin, but also deeply examines its performance, stability and compatibility with network interface configuration and network connection policy in a specific gateway environment, achieving more comprehensive test coverage.

[0052] Optionally, the above network interface configuration information may include the type of container interface, network speed, used MAC address, IP address, etc.; the network connection policy may involve how to handle network traffic between containers, such as direct connection, forwarding through the gateway, load balancing policy, etc. According to the type of gateway, a targeted test scenario is designed to verify the performance of the container network plugin under this type of gateway. For example, if a centralized gateway is used, the test case may focus on checking whether the communication between containers is carried out through the central gateway, and the load and performance of the central gateway; if it is an enhanced gateway, the test case may pay more attention to the high availability and failover ability of the gateway.

[0053] Optionally, the first test case can be encoded using Golang (i.e., a programming language) source code. First, the tester writes or adds specific test cases (including the first test case and the second test case), such as gateway type judgment, container creation, container deletion, container reconstruction, fault simulation, and version upgrade adaptation test cases, etc., and forms a test case document. The test case document is parsed, and test case scripts are automatically generated. For example, in the way of program parsing, the content in the above test case document (such as container creation, container deletion, container reconstruction, etc.) is parsed to generate corresponding test case code.

[0054] Optionally, in the container network plugin test method provided in the embodiments of the present application, according to the gateway type, the network interface configuration information of the working node and the network connection strategy are determined, including: in the case where the gateway type is a centralized gateway, based on the global address management strategy of the centralized gateway, the network interface configuration information is determined, where the global address management strategy is used to control the network interface creation and binding processing of N first nodes sharing the centralized gateway, and the N first nodes include the working node, and N is a positive integer; based on the global routing information of the centralized gateway, the network connection strategy is determined, where the global routing information is determined based on the global isolation requirements configured for the centralized gateway, the virtual local area network VLANs respectively corresponding to the N first nodes, and the media access control address MAC.

[0055] It can be understood that if the gateway type is a centralized gateway, by parsing the global address management strategy of the centralized gateway, the network interface configuration information of the container is determined, where the global address management strategy is used to control the network interface creation and binding processing of N first nodes (including the working node) sharing the centralized gateway. For example, for a newly created container, the expected network interface, IP, VLAN, and MAC configuration information is predicted and generated according to the global address management strategy. The global routing information of the centralized gateway is parsed, including the virtual local area network VLAN information and the media access control MAC address table respectively corresponding to the N first nodes configured based on the global isolation requirements. Based on the above global routing information, the network connection strategy is determined, including how to achieve container isolation and communication among the N first nodes. By identifying and parsing the global address management and routing strategies of the centralized gateway, the test system can perform more refined tests to ensure that the container network plugin can correctly handle address allocation, network isolation, and communication strategies under the centralized gateway.

[0056] Optionally, the above global address management policy is used to specify how to allocate IP addresses, VLANs, and MAC addresses for containers, and how to handle the creation, binding, and update of container network interfaces on N first nodes (i.e., worker nodes). The above global routing information is used to determine the network communication policies between containers or between nodes. For example, whether containers in different VLANs can communicate, and whether the communication path meets the expectations.

[0057] Optionally, in the container network plugin testing method provided in the embodiments of the present application, according to the gateway type, determine the network interface configuration information of the worker node and the network connection policy, including: in the case where the gateway type is a distributed gateway, based on the network isolation requirements set in the distributed gateway, determine the network interface configuration information, where the distributed gateway is the gateway corresponding to the worker node, and the network isolation requirements are determined based on the isolation level of the worker node; based on the local routing information of the distributed gateway, determine the network connection policy, where the local routing information is determined based on the virtual local area network (VLAN), media access control address (MAC), and isolation requirements of the worker node.

[0058] It can be understood that if the gateway type is a distributed gateway, according to the isolation levels of each worker node in the distributed gateway, determine the network isolation requirements of each worker node, and based on the determined network isolation requirements, determine the network interface configuration information of the containers. Analyze the local routing information of the distributed gateway, where the local routing information is determined according to the VLAN, MAC address, and isolation requirements of the worker node. Based on the local routing information, determine the network connection policy, such as setting specific routing rules, firewall rules, or network policies to simulate different levels of network isolation and connection requirements, and verify whether the container network plugin can correctly handle these policies in a distributed gateway environment. By determining the network interface configuration information based on the network isolation requirements, it can accurately verify whether the container network plugin can achieve the expected network isolation, which helps to ensure the security and compliance of the container environment. At the same time, by analyzing and using the local routing information of the distributed gateway, the testing system can verify the routing ability of the container network plugin in a multi-node, multi-VLAN environment, ensure that the communication between containers follows the correct path, and improve the reliability and stability of network configuration.

[0059] Optionally, the above network isolation requirements include the division of virtual local area networks (VLANs), the allocation of media access control addresses (MACs), the setting of IP addresses, etc., to ensure that each container can be correctly network-isolated under the distributed gateway and access the network according to the expected rules; the above local routing information is set according to the VLAN, MAC address, and network isolation requirements of the worker node to ensure that the communication between containers follows the correct routing path, and when a container needs to access the external network, it can be forwarded through the correct gateway.

[0060] Optionally, for the Container Network Interface (CNI) plugin, the container network plugin can be coded using the source code of Golang, a programming language. Specifically, it includes editing the source code of the CNI plugin part of the container network plugin and the source code of the CNI controller part of the container network plugin. The CNI controller is a control loop or component responsible for detecting and adjusting the state of specific resources. The functions of the plugin part are as follows: to implement the creation of the corresponding network for the container, including the creation, binding, and update of the container network port (i.e., port), and the update of IP, VLAN, and MAC information, and at the same time, it is adapted to both the centralized gateway and the enhanced gateway types; the controller maintains the states of various custom resources defined by the container network plugin in Kubernetes, such as network (a custom resource used to define network policies or network configurations), networkclaim (a resource used for the container to claim network requirements), secret (a resource used to store sensitive information), and port, so that the states meet the predefined requirements and need to interact with etcd (used to store the entire state and its configuration of the cluster).

[0061] Optionally, in order to execute the test process on the master node and the worker nodes using test cases, the above CNI plugin source code and CNI controller source code need to be compiled into binary files. The specific process is to compile the Golang source code into the CNI plugin binary file and the CNI controller binary file by running a script containing the compilation command.

[0062] Step S203: Based on the first test case, perform tests on the worker nodes to obtain the first test result.

[0063] It can be understood that the first test case is deployed to the corresponding worker nodes of the target container cluster, the test process is executed on the worker nodes, and the first test result is generated. Automated testing can quickly execute the first test case without manual deployment and execution, which not only improves the efficiency of test execution, shortens the test cycle, but also ensures the accuracy and reliability of the test, providing a strong guarantee for the stability and performance evaluation of the container network plugin.

[0064] Optionally, in the container network plugin test method provided in the embodiment of the present application, based on the first test case, performing tests on the worker nodes to obtain the first test result includes: compiling based on the first test case using the initial source code to obtain the compiled binary file; uploading the binary file to the worker nodes through the target running script to obtain the first test result.

[0065] It can be understood that the first test case using the initial source code is compiled, that is, an automated build tool is used to compile the source code in the first test case into a binary file. The compiled binary file, along with related configuration files, dependent libraries, etc., is packaged into a deployable medium, and the above medium is uploaded to the worker node through the target run script. The test process is executed on the worker node, and the first test result is generated. By automating the compilation, packaging, and uploading of the test medium, as well as automating the execution of the test script, the efficiency and automation of the test are improved, human errors and the test cycle are reduced, providing strong support for the continuous integration and rapid iteration of the software.

[0066] Optionally, in order to execute the test process on the master node and the worker node using the test case, it is necessary to upload the above CNI plugin medium to the worker node. Through the run script, the CNI plugin medium is automatically uploaded to the node of the target container cluster. The node includes two types: the node hanging under the centralized gateway and the node hanging under the enhanced gateway (i.e., the distributed gateway).

[0067] Optionally, after uploading the CNI plugin medium to the node of the target container cluster, it is also necessary to automatically upload the test case code script of the first test case. The test case script generated after parsing the above first test case is uploaded to the node of the target container cluster through the target run script. After granting the target run script executable permission, the test process is executed on the worker node, and the first test result is generated.

[0068] Optionally, in the container network plugin test method provided in the embodiment of the present application, the method further includes: in response to the update processing of the test case, determining the execution permission of the target run script; in the case where the execution permission meets the predetermined permission requirements, based on the updated test case, uploading it to the worker node through the target run script to obtain the third test result.

[0069] It can be understood that after detecting the update of the test case, the execution permission of the target run script is verified to determine whether the execution permission of the target run script meets the predetermined permission requirements. If the verification result is that the execution permission meets the predetermined permission requirements, the updated test case is uploaded to the worker node through the target run script, and the test process is executed on the worker node to generate the third test result; if the verification result is that the execution permission does not meet the predetermined permission requirements, the test case is not updated. Through the permission verification mechanism, it is ensured that only authorized personnel or systems can update the test case, avoiding the destruction of the test environment or security vulnerabilities caused by unauthorized updates. At the same time, the real-time update processing can ensure that the system can quickly respond to new test requirements and enhance the system's adaptability to changes.

[0070] Optionally, in the container network plugin testing method provided in the embodiments of the present application, the method further includes: determining a master node in the target container cluster, where the master node is used to control the scheduling of node resources in the target container cluster, and the node resources are used to control the corresponding worker nodes and provide the amount of resources for running the containers disposed on the corresponding worker nodes; determining a second test case according to the resource information allocated by the master node for the container network plugin; and based on the second test case, performing a test on the master node to obtain a second test result.

[0071] It can be understood that the target container cluster includes worker nodes and a master node. The worker nodes are used to provide running resources for the containers in the target container cluster, such as computing resources, storage resources, and network resources, etc. The master node controls the corresponding worker nodes by scheduling the node resources in the target container cluster, and provides the amount of resources for running the containers disposed on the worker nodes corresponding to the node resources. The node resources are used to control the corresponding worker nodes. Determine the master node in the target container cluster, and collect the resource information related to the container network plugin from the master node, including the resource requirements (such as memory) of the containers, network resources (such as IP addresses, VLANs, etc.), and the available resources of the nodes. According to the above resource information, determine the second test case. Upload the second test case to the master node through the target running script, and execute the test process on the master node to generate a second test result. By executing the second test case on the master node, the optimized performance of the container network plugin in terms of resource scheduling and management can be verified, ensuring that the plugin can run stably and correctly process network resources under resource constraints or complex allocation policies.

[0072] Optionally, in order to enable the second test case to execute the test process on the master node, it is necessary to upload the CNIcontroller medium to the master node first. Automatically upload the CNI controller medium to the master node of the target container cluster through a running script.

[0073] Optionally, after uploading the CNI controller medium to the master node of the target container cluster, it is also necessary to automatically upload the test case code script of the second test case. Upload the test case script generated after parsing the above second test case to the master node of the target container cluster through the target running script, and after granting the target running script executable permission, execute the test process on the master node and generate a second test result.

[0074] Through the above step S201, determine the gateway type used by the working nodes in the target container cluster, where the working nodes are used to provide running resources for the containers in the target container cluster; step S202, generate a first test case for the container network plugin to be tested according to the gateway type, where the container network plugin is used to provide network communication services for the containers on the working nodes; step S203, based on the first test case, perform tests on the working nodes to obtain a first test result. The purpose of automatically testing the container network plugin can be achieved, and the technical effects of improving the test efficiency and accuracy of the container network plugin are realized, thereby solving the technical problem of the unsatisfactory test effect of the container network plugin.

[0075] Based on the above embodiments and optional embodiments, the present application proposes an optional implementation manner to perform automated testing on the CNI plugin by using the container network plugin testing method. Among them, the above container refers to a standard software executable unit that bundles the application code with relevant configuration files, libraries, and dependencies required for running references. The main purpose is to run the application program therein, isolate it from the outside world, and facilitate the migration of this executable unit to other host devices. Essentially, a container is a special process that divides resources, files, devices, and configurations into an independent space through namespaces, control groups, and technologies. The above container network plugin refers to a container network plugin that must be configured and loaded when the container runs, so as to build a cluster network model and then realize network communication within the cluster. The above automated testing refers to the process of using software and tools to automatically execute test cases.

[0076] Figure 3 is a structural diagram of the container network plugin testing method provided by the embodiments of the present application. As Figure 3 shown, the process of performing automated testing on the CNI plugin is as follows.

[0077] Step S1: Set up a test target container cluster. The cluster contains one master node (i.e., the main node) and several node nodes (i.e., worker nodes). The types of node nodes include node nodes attached to a centralized gateway and node nodes attached to an enhanced gateway. The target container cluster not only contains master nodes and node nodes, but also includes components such as the controller-manager component, the kubelet component, the api-server component, and the scheduler component. Among them, the controller-manager component is used to manage the long-term running state of resources in the cluster to ensure that the actual situation of the cluster conforms to the expected state; the kubelet component is used to directly interact with the nodes in the cluster; the api-server component is the front end of the target container cluster and is the entry point for all clients to interact with the target container cluster. Through this component, the entire cluster can be managed, such as detecting resource status, configuring and updating the cluster, etc.; the scheduler component is used to allocate unscheduled container packaging units (i.e., the basic units for deploying and managing container applications) to appropriate nodes in the cluster for running.

[0078] During the container network plugin test, the worker nodes are used to provide running resources for each container in the target container cluster, such as computing resources, storage resources, and network resources, etc. The master node schedules the node resources in the target container cluster, and then controls the worker nodes corresponding to the node resources and provides the amount of running resources for the containers set on the worker nodes corresponding to the node resources. Among them, the node resources are used to control the corresponding worker nodes. When conducting the container network plugin test, it is necessary to determine the gateway type used by the worker nodes in the target container cluster. By automatically identifying the gateway type, the workload of manually configuring the test environment is reduced, enabling testers to locate and deploy the test environment faster. This not only improves the test efficiency but also avoids possible errors and omissions in manual operations, ensuring the reliability and consistency of the test.

[0079] Step S2, edit the Golang source code of the container network plugin. Specifically, edit the source code of the CNIplugin (i.e., the plugin) part of the container network plugin and the source code of the CNI controller (i.e., the control loop or component responsible for detecting and adjusting the state of specific resources) part of the container network plugin. The function of the plugin part is to implement the creation of the network corresponding to the container, including the creation, binding, and update of the container network port (port), and the update of IP, VLAN, and MAC information, and at the same time adapt to both the centralized gateway and the enhanced gateway types; the controller maintains the state of various custom resources defined by the container network plugin in the target container cluster, such as network (i.e., the custom resource used to define network policies or network configurations), networkclaim (i.e., the resource used for the container to claim network requirements), secret (i.e., the resource used to store sensitive information), port, and makes the state meet the predefined requirements, and needs to interact with etcd (used to store the entire state and its configuration of the cluster).

[0080] Step S3, automatically compile and generate binary files. This refers to the step of compiling the Golang source code in Step S2 into the CNI plugin binary file and the CNI controller binary file by running a script containing the compilation command.

[0081] Step S4, automatically upload the CNI plugin medium. This refers to automatically uploading the CNI plugin medium generated in Step S3 to the node nodes of the target container cluster by running a script (i.e., the target running script). The node nodes include two types: the node nodes under the centralized gateway and the node nodes under the enhanced gateway.

[0082] Step S5, automatically upload the CNI controller medium. This refers to automatically uploading the CNI controller medium generated in Step S3 to the master node of the target container cluster by running a script.

[0083] Step S6, write test cases. This refers to the tester writing or adding specific test cases (including the first test case and the second test case), such as gateway type judgment, container creation, container deletion, container reconstruction, fault simulation, and version upgrade adaptation test cases, etc., and forming a test case document.

[0084] Step S7, parse the test case document and automatically generate test case scripts. This refers to using a program parsing method to parse the content (container creation, container deletion, container reconstruction, etc.) in the test case document generated in Step S6 to generate the corresponding test case code.

[0085] Step S8: Automatically upload the test case script and execute the test process. This refers to the test case code scripts produced in step S7 (including the test case code script of the first test case and the test case code script of the second test case). The scripts are automatically uploaded to the master node and node nodes of the target container cluster, and after granting the scripts executable permissions, the test process is automatically executed. Among them, the test case code script of the first test case is uploaded to the node node, and the test case code script of the second test case is uploaded to the master node.

[0086] Step S9: Automatically generate a test report. This refers to automatically generating a container network plugin test report based on the results of automatically executing the test case scripts in step S8 (i.e., the first test result and the second test result).

[0087] The above container network plugin test method overcomes the deficiencies in the related technology, such as the large amount of manpower consumed and the possibility of omissions when container network plugin testing depends on manual testing. As long as the tester modifies the test cases, a test report can be automatically generated, thus realizing the automated test process of the container network plugin.

[0088] The above backup method achieves the following effects: automatically generating test cases according to different gateway types, reducing the workload of testers, accelerating the test process, shortening the test cycle, avoiding the negligence and errors that may occur during manual testing, and improving the accuracy and reliability of testing; automatically compiling and uploading test cases, improving the test efficiency and automation level, reducing human errors and the test cycle, and providing strong support for the continuous integration and rapid iteration of software.

[0089] The container network plugin test method provided by the embodiment of the present application determines the gateway type used by the working nodes in the target container cluster, where the working nodes are used to provide running resources for the containers in the target container cluster; generates the first test case of the container network plugin to be tested according to the gateway type, where the container network plugin is used to provide network communication services for the containers on the working nodes; and performs testing on the working nodes based on the first test case to obtain the first test result. This solves the problem of unsatisfactory test results of container network plugins in the related technology. Furthermore, it achieves the effect of improving the test efficiency and accuracy of container network plugins.

[0090] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0091] Embodiment 2

[0092] The embodiments of the present application also provide a container network plugin testing device. It should be noted that the container network plugin testing device in the embodiments of the present application can be used to execute the container network plugin testing method provided by the embodiments of the present application. The following introduces the container network plugin testing device provided by the embodiments of the present application.

[0093] According to the embodiments of the present application, there is also provided a device for implementing the above-mentioned container network plugin testing method. Figure 4 is a schematic diagram of the container network plugin testing device provided by the embodiments of the present application, as Figure 4 shown, the device includes: a gateway type determination module 401, configured to determine the gateway type used by the working nodes in the target container cluster, where the working nodes are used to provide running resources for the containers in the target container cluster; a first test case generation module 402, connected to the gateway type determination module 401, configured to generate a first test case for the container network plugin to be tested according to the gateway type, where the container network plugin is used to provide network communication services for the containers on the working nodes; a first test result determination module 403, connected to the first test case generation module 402, configured to perform a test on the working nodes based on the first test case to obtain a first test result.

[0094] The container network plugin testing device provided by the embodiments of the present application, through the gateway type determination module 401, is configured to determine the gateway type used by the working nodes in the target container cluster, where the working nodes are used to provide running resources for the containers in the target container cluster; the first test case generation module 402, connected to the gateway type determination module 401, is configured to generate a first test case for the container network plugin to be tested according to the gateway type, where the container network plugin is used to provide network communication services for the containers on the working nodes; the first test result determination module 403, connected to the first test case generation module 402, is configured to perform a test on the working nodes based on the first test case to obtain a first test result. It solves the problem that the testing effect of the container network plugin in the related art is not ideal. Furthermore, it achieves the effect of improving the testing efficiency and accuracy of the container network plugin.

[0095] Optionally, in the container network plugin testing device provided by the embodiments of the present application, the first test case generation module includes: a first determination module, configured to determine the network interface configuration information and network connection policy of the working nodes according to the gateway type; a second determination module, configured to determine the first test case based on the network interface configuration information and network connection policy.

[0096] Optionally, in the container network plugin testing device provided in the embodiments of the present application, the first determination module includes: a first network interface configuration information determination module, configured to determine network interface configuration information based on the global address management policy of the centralized gateway when the gateway type is a centralized gateway, where the global address management policy is used to control the network interface creation and binding processes of N first nodes sharing the centralized gateway, and the N first nodes include working nodes, and N is a positive integer; a first network connection policy determination module, configured to determine a network connection policy based on the global routing information of the centralized gateway, where the global routing information is determined based on the global isolation requirements configured for the centralized gateway, the virtual local area network (VLAN) corresponding to each of the N first nodes, and the media access control address (MAC).

[0097] Optionally, in the container network plugin testing device provided in the embodiments of the present application, the first determination module includes: a second network interface configuration information determination module, configured to determine network interface configuration information based on the network isolation requirements set in the distributed gateway when the gateway type is a distributed gateway, where the distributed gateway is the gateway corresponding to the working node, and the network isolation requirements are determined based on the isolation level of the working node; a second network connection policy determination module, configured to determine a network connection policy based on the local routing information of the distributed gateway, where the local routing information is determined based on the virtual local area network (VLAN) of the working node, the media access control address (MAC), and the isolation requirements.

[0098] Optionally, in the container network plugin testing device provided in the embodiments of the present application, the first test result determination module includes: a binary file generation module, configured to compile based on a first test case using the initial source code to obtain a compiled binary file; a third determination module, configured to upload the binary file to the working node through a target running script to obtain a first test result.

[0099] Optionally, in the container network plugin testing device provided in the embodiments of the present application, the device further includes: an execution permission determination module, configured to determine the execution permission of the target running script in response to an update process of the test case; a third test result determination module, configured to, when the execution permission meets the predetermined permission requirements, upload to the working node through the target running script based on the updated test case to obtain a third test result.

[0100] Optionally, in the container network plugin testing device provided in the embodiments of the present application, the device further includes: a master node determination module, configured to determine a master node in a target container cluster, where the master node is used to control the scheduling of node resources in the target container cluster, and the node resources are used to control corresponding worker nodes to provide a resource amount for running resources of containers disposed on the corresponding worker nodes; a second test case determination module, configured to determine a second test case according to the resource information allocated by the master node for the container network plugin; and a second test result determination module, configured to perform a test on the master node based on the second test case to obtain a second test result.

[0101] It should be noted here that the above gateway type determination module 401, the first test case generation module 402, and the first test result determination module 403 correspond to steps S201 to S203 in Embodiment 1. The functions and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the content disclosed in the above Embodiment 1. It should be noted that the above modules or units may be hardware components or software components stored in a memory (for example, memory 104) and processed by one or more processors (for example, processors 102a, 102b,..., 102n). The above modules may also be part of the device and may run in the computer terminal 10 provided in Embodiment 1.

[0102] Embodiment 3

[0103] Embodiments of the present application may provide an electronic device. Figure 5 It is a structural block diagram of an electronic device according to an embodiment of the present application. As Figure 5 shown, the electronic device may include: one or more ( Figure 5 only one is shown in the figure) processors 502, a memory 504, a storage controller, and a peripheral interface, where the peripheral interface is connected to a radio frequency module, an audio module, and a display.

[0104] Among them, the memory may be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implements the above methods. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other non-volatile solid-state memories. In some instances, the memory may further include a memory remotely disposed relative to the processor, and these remote memories may be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, an enterprise internal network, a local area network, a mobile communication network, and combinations thereof.

[0105] The processor can call the information and application programs stored in the memory through the transmission device to execute the following steps: determine the gateway type used by the working nodes in the target container cluster, where the working nodes are used to provide running resources for the containers in the target container cluster; generate a first test case for the container network plugin to be tested according to the gateway type, where the container network plugin is used to provide network communication services for the containers on the working nodes; based on the first test case, conduct tests on the working nodes to obtain the first test result.

[0106] The processor can also call the information and application programs stored in the memory through the transmission device to execute the following steps: determine the network interface configuration information and network connection policy of the working nodes according to the gateway type; based on the network interface configuration information and network connection policy, determine the first test case.

[0107] The processor can also call the information and application programs stored in the memory through the transmission device to execute the following steps: in the case where the gateway type is a centralized gateway, determine the network interface configuration information based on the global address management policy of the centralized gateway, where the global address management policy is used to control the network interface creation and binding processing of N first nodes sharing the centralized gateway, and the N first nodes include the working nodes, and N is a positive integer; determine the network connection policy based on the global routing information of the centralized gateway, where the global routing information is determined based on the global isolation requirements configured for the centralized gateway, the virtual local area network (VLAN) corresponding to each of the N first nodes, and the media access control (MAC) address.

[0108] The processor can also call the information and application programs stored in the memory through the transmission device to execute the following steps: in the case where the gateway type is a distributed gateway, determine the network interface configuration information based on the network isolation requirements set in the distributed gateway, where the distributed gateway is the gateway corresponding to the working node, and the network isolation requirements are determined based on the isolation level of the working node; determine the network connection policy based on the local routing information of the distributed gateway, where the local routing information is determined based on the VLAN of the working node, the MAC address, and the isolation requirements.

[0109] The processor can also call the information and application programs stored in the memory through the transmission device to execute the following steps: compile based on the first test case using the initial source code to obtain a compiled binary file; upload the binary file to the working node through the target running script to obtain the first test result.

[0110] The processor can also call the information and application programs stored in the memory through the transmission device to execute the following steps: in response to the update processing of the test case, determine the execution permission of the target running script; when the execution permission meets the predetermined permission requirements, upload the updated test case through the target running script to the working node to obtain the third test result.

[0111] The processor can also call the information and application programs stored in the memory through the transmission device to execute the following steps: determine the master node in the target container cluster, where the master node is used to control the scheduling of node resources in the target container cluster, and the node resources are used to control the corresponding working nodes to provide the resource amount of running resources for the containers set on the corresponding working nodes; determine the second test case according to the resource information allocated by the master node for the container network plugin; based on the second test case, perform tests on the master node to obtain the second test result.

[0112] By adopting the embodiment of the present application, a solution for a container network plugin testing method is provided. By determining the gateway type used by the working nodes in the target container cluster, where the working nodes are used to provide running resources for the containers in the target container cluster; generating the first test case of the container network plugin to be tested according to the gateway type, where the container network plugin is used to provide network communication services for the containers on the working nodes; performing tests on the working nodes based on the first test case to obtain the first test result. Thus, the purpose of improving the testing efficiency and accuracy of the container network plugin is achieved, and further the technical problem of unsatisfactory testing effect of the container network plugin caused by manual testing is solved.

[0113] Those of ordinary skill in the art can understand that Figure 5 the structure shown is only schematic, and the electronic device can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, and terminal devices such as Mobile Internet Devices (MID), PAD, etc. Figure 5 It does not limit the structure of the above electronic device. For example, the electronic device may further include more or fewer components (such as a network interface, a display device, etc.) than those shown Figure 5 in the figure, or have a different configuration from that shown Figure 5 in the figure.

[0114] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware of the terminal device through a program, and the program can be stored in a computer-readable storage medium. The storage medium can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disk, etc.

[0115] Embodiment 4

[0116] An embodiment of the present application also provides a storage medium. Optionally, in this embodiment, the above storage medium can be used to store the program code executed by the container network plugin test method provided in the first embodiment above.

[0117] Optionally, in this embodiment, the above storage medium can be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.

[0118] The present application also provides a computer program product, which is suitable for executing a program for the steps of the container network plugin test method when executed on a data processing device.

[0119] The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0120] In the above embodiments of the present application, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0121] In the several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the above division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some interfaces, and the indirect coupling or communication connection of units or modules can be in an electrical or other form.

[0122] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0123] In addition, in each embodiment of the present application, each functional unit can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0124] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the above-mentioned methods in each embodiment of the present application. The foregoing storage medium includes: various media such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs that can store program codes.

[0125] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.

Claims

1. A container network plug-in testing method, characterized in that: include: Determine a gateway type used by a working node in a target container cluster, wherein the working node is used to provide operating resources for containers in the target container cluster; Generate a first test case of a container network plug-in to be tested according to the gateway type, wherein the container network plug-in is used to provide network communication services for the container on the working node; Based on the first test case, a test is performed at the working node to obtain a first test result.

2. The method according to claim 1, characterized in that The step of generating a first test case for the container network plug-in to be tested according to the gateway type includes: According to the gateway type, determine the network port configuration information and the network connection strategy of the working node; based on the network port configuration information and the network connection strategy, determine the first test case.

3. The method according to claim 2, characterized in that Determining the network port configuration information and the network connection strategy of the working node according to the gateway type includes: In the case where the gateway type is a centralized gateway, the network port configuration information is determined based on a global address management policy of the centralized gateway, wherein the global address management policy is used to control the network port creation and binding processing of N first nodes that share the centralized gateway, the N first nodes include the working node, and N is a positive integer; The network connection strategy is determined based on the global routing information of the centralized gateway, wherein the global routing information is determined based on the global isolation requirements configured for the centralized gateway, the virtual local area networks VLANs corresponding to the N first nodes, and the media access control addresses MAC.

4. The method according to claim 2, characterized in that Determining the network port configuration information and the network connection strategy of the working node according to the gateway type includes: In the case where the gateway type is a distributed gateway, the network port configuration information is determined based on a network isolation requirement set in the distributed gateway, wherein the distributed gateway is a gateway corresponding to the working node, and the network isolation requirement is determined based on the isolation level of the working node; The network connection strategy is determined based on the local routing information of the distributed gateway, wherein the local routing information is determined based on the virtual local area network VLAN, the media access control address MAC, and the isolation requirement of the working node.

5. The method according to claim 1, characterized in that: The step of performing a test on the working node based on the first test case to obtain a first test result includes: Compile based on the first test case using the initial source code to obtain a compiled binary file; Based on the binary file, the target runs the script and uploads it to the working node to obtain the first test result.

6. The method according to claim 5, characterized in that The method further comprises: In response to the update processing of the test case, determining the execution permission of the target running script; In the case where the execution authority meets the predetermined authority requirement, based on the updated test case, the target running script is uploaded to the working node to obtain a third test result.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Determine a master node in the target container cluster, wherein the master node is used to control the scheduling of node resources in the target container cluster, and the node resources are used to control corresponding working nodes to provide a resource amount of running resources for a container set on the corresponding working node; Determining a second test case according to resource information allocated by the master node to the container network plug-in; Based on the second test case, a test is performed on the master node to obtain a second test result.

8. A container network plug-in testing device, characterized in that: include: A gateway type determination module, used to determine the gateway type used by a working node in a target container cluster, wherein the working node is used to provide operating resources for containers in the target container cluster; A first test case generation module, configured to generate a first test case for a container network plug-in to be tested according to the gateway type, wherein the container network plug-in is configured to provide a network communication service for a container on the working node; The first test result determination module is used to perform a test on the working node based on the first test case to obtain a first test result.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the container network plug-in testing method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 7 when running.