How to build SAI Thrift automated testing framework
By configured the network device to minimize systems and install multi -PTF containers, the SAI Thrift test is solved by high requirements for multi -network cards and multi -ports, and the stability and efficiency of testing are achieved, and the cost is reduced.
Patent Information
- Application Number
- CN202210709625.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-22
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-06-22
AI Technical Summary
The existing SAI Thrift testing framework requires Test Machine's multi-network card and multi-port requirements, resulting in high server costs, and the test exclusively occupies network port resources, wasting server computing and storage resources.
By selecting the network device as a test server, the configuration minimizes system, cutting the upper layer application container, only retain the basic container, and install multi -PTF containers based on port resources to form a customized network equipment test environment.
The stability of the Sai Thrift test is achieved, the development and test efficiency of the SAI engineering are improved, the cost of the server is reduced, and the network resources are effectively used.
Smart Images

Figure CN114936166B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network communication, and in particular to a method for constructing a SAI Thrift automated testing framework. Background Art
[0002] Thrift is a cross-language and cross-platform service deployment framework. It defines RPC interfaces and data types through an interface definition language, and then generates different language codes (supporting C++, Java, Python, PHP, Ruby, Erlang, etc.) through the Thrift compiler. The generated code is responsible for the implementation of the RPC protocol layer and the transport layer. RPC (Remote Procedure Call) is a remote call protocol. Simply put, it enables applications to call remote procedures or services like calling local methods. It can be applied to many scenarios such as distributed services, distributed computing, and remote service calls.
[0003] SAI Thrift is a SAI functional testing framework based on Thrift technology. Figure 1 As shown in the figure, it consists of a server (Test Machine) and a device under test (DUT, Device Under Test). The server's network card is directly connected to the network port of the device under test. The DUT acts as the SAI Thrift test server, and the server Test Machine acts as the client of the SAI Thrift test. The SAI Server Container, also known as the Thrift Test Server, is run on the device under test Switch; a server with multiple INTF network cards installed is used as the Test Machine, also known as the SAIThrift Test Client, and the server interface is physically connected to the device under test; the test PTF script is executed on the SAI Thrift TestClient to test the function and performance of the device under test. The current test device and the test server are interconnected using multiple network ports to perform functional testing of the device. The Test Machine server first remotely calls the SAI external interface on the DUT to configure the Device; the Test Machine server then constructs and assembles the message and sends it to the DUT through the network card; then checks whether the network card has received the message from the DUT. If the message is received, further checks whether the message format meets the expectations, so as to achieve the purpose of testing the DUT message forwarding function.
[0004] In the application practice of SAI Thrift, some test cases require more network ports, which puts forward the requirement of multiple network cards and multiple ports for Test Machine. Test Machine usually uses a server as a test machine, and the requirement of multiple network cards introduces the problem of high server costs. SAI THRIFT test is an exclusive mode for network port resources, which means that the network resources of the server are fully utilized, but the computing and storage resources of the server are wasted. Summary of the invention
[0005] According to an embodiment of the present invention, a method for constructing a SAI Thrift automated testing framework is provided, comprising the following steps:
[0006] Select a network device, define the network device as a test server, and configure a minimized system on the network device;
[0007] The upper application container in the minimized system is trimmed, and only the basic container is retained to serve as the interface of the network device;
[0008] Initialize the minimized system;
[0009] According to the division of port resources of the network device, the installation of multiple PTF containers of the network device is completed.
[0010] Furthermore, the minimized system is an open source SONiC system.
[0011] Furthermore, the minimized system may also be a private network system.
[0012] Furthermore, the upper application container includes: a dhcp-relay container, a pmon container, a snmp container, a lldp container, a bgp container, and a teamd container.
[0013] Furthermore, the basic container includes: a syncd container, a swss container, and a database container.
[0014] Further, initializing the minimized system includes the following sub-steps:
[0015] Close the active packet sending service in the minimized system;
[0016] After the basic container is started, close the VLAN check of all ports of the network device;
[0017] Initialize ACL resources, create several ACL rules, match the message types involved in the SAI Thrift test, and send all messages received from the ingress direction of the network device to the CPU for processing;
[0018] Initialize statistics resources, create statistics counters, and bind statistics to each ACL rule.
[0019] Further, according to the division of port resources of the network device, the installation of multiple PTF containers of the network device is completed as follows:
[0020] Install the PTF container according to the division of port resources of network devices;
[0021] Set the port properties of the network device and initialize the environment;
[0022] Complete the installation of multiple PTF containers for network devices.
[0023] According to the method for constructing the SAI Thrift automated testing framework of the embodiment of the present invention, the network device provided by the present invention is used as a solution for hosting servers with multiple PTF containers, which can ensure the stability of the SAI THRIFT test, effectively improve the efficiency of SAI engineering development and SAI THRIFT testing, and has important significance in practical applications.
[0024] It is to be understood that both the foregoing general description and the following detailed description are exemplary, and are intended to provide further explanation of the technology as claimed. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 The figure is a schematic diagram of the SAI Thrift test topology connection in the prior art.
[0026] Figure 2 FIG. 4 is a schematic diagram of a SAI THRIFT test framework according to an embodiment of the present invention.
[0027] Figure 3 It is a schematic diagram of a customized network device according to an embodiment of the present invention.
[0028] Figure 4 Schematic diagram of a SONiC minimum system according to an embodiment of the present invention.
[0029] Figure 5 The present invention is a flowchart of the steps for installing multiple PTFs in a network device according to an embodiment of the present invention.
[0030] Figure 6 The figure is a flowchart of a method for constructing a SAI Thrift automated testing framework according to an embodiment of the present invention.
[0031] Figure 7 The figure is a flow chart of sub-steps of a method for constructing a SAI Thrift automated testing framework according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings to further illustrate the present invention.
[0033] First, combine Figures 2 to 6 The method for constructing a SAI Thrift automated testing framework according to an embodiment of the present invention is described, which can simultaneously support multiple SAI Thrift Client test container instances on a test server to form multiple independent SAI Thrift development and testing environments, and has a wide range of application scenarios.
[0034] like Figures 2 to 6 As shown, the method for constructing the SAI Thrift automated testing framework according to an embodiment of the present invention comprises the following steps:
[0035] like Figure 6 As shown, in S1, a network device is selected, the network device is defined as a test server, and a minimized system is configured on the network device. The minimized system is an open source SONiC system, and can also be a private network system. In this embodiment, by making full use of the rich characteristics of the network port of the network device, the configuration of computing and storage is improved to adapt to the needs of supporting multiple SAI THRIFT Client test instances.
[0036] like Figure 3 As shown in the figure, the network device used as the PTF server is specially customized according to the resource characteristics of conventional network devices. Computing power: configure a high-computing processor to improve computing power; at the same time, use a customized software minimum system, cancel other useless functions, and liberate computing power for the PTF container. Storage capacity: increase the memory configuration, configure large storage, or externally connect a large-capacity solid-state hard drive, or a large-capacity storage card resource. Network capacity: logically divide the network interface resources into fixed groups, and isolate the network forwarding services between each group.
[0037] like Figure 6 As shown, in S2, the upper application container in the minimized system is trimmed, and only the basic container is retained to serve as the interface of the network device. In this embodiment, the upper application container includes: dhcp-relay container, pmon container, snmp container, lldp container, bgp container and teamd container; the basic container includes: syncd container, swss container and database container.
[0038] like Figure 6 As shown, in S3, the minimized system is initialized.
[0039] Further, if Figure 7 As shown, initializing the minimized system includes the following sub-steps:
[0040] like Figure 7 As shown, in S31, the active packet sending service in the minimized system is turned off.
[0041] like Figure 7 As shown, in S32, after the basic container is started, the VLAN check of all ports of the network device is closed.
[0042] like Figure 7 As shown, in S33, ACL resources are initialized, several ACL rules are created, the message types involved in the SAI Thrift test are matched, and all messages received in the ingress direction of the network device are sent to the CPU for processing.
[0043] like Figure 7 As shown, in S34, statistical resources are initialized, statistical counters are created, and statistics are bound to each ACL rule.
[0044] like Figure 6 As shown, in S4, the installation of multiple PTF containers of the network device is completed according to the division of the port resources of the network device. Further, in this embodiment, the installation of multiple PTF containers of the network device is completed according to the division of the port resources of the network device as follows: according to the division of the port resources of the network device, the PTF container is installed; the port attributes of the network device are set to initialize the environment; and the installation of multiple PTF containers of the network device is completed.
[0045] Above, refer to Figures 2 to 7 The present invention describes a method for constructing a SAI Thrift automated testing framework according to an embodiment of the present invention. The network device provided by the present invention is used as a solution for a multi-PTF container hosting server, which can ensure the stability of the SAI THRIFT test and effectively improve the efficiency of SAI engineering development and SAI THRIFT testing, and is of great significance in practical applications.
[0046] It should be noted that, in this specification, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprises..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0047] Although the content of the present invention has been described in detail through the above preferred embodiments, it should be appreciated that the above description should not be considered as a limitation of the present invention. After reading the above content, it will be apparent to those skilled in the art that various modifications and substitutions of the present invention will occur. Therefore, the protection scope of the present invention should be limited by the appended claims.
Claims
1. A method for constructing a SAI Thrift automated testing framework, characterized in that: The following steps are included: Selecting a network device, defining the network device as a test server, and configuring a minimized system on the network device; Cutting the upper application container in the minimized system and retaining only the basic container for serving as the interface of the network device; Initializing the minimized system; According to the division of the port resources of the network device, complete the installation of multiple PTF containers of the network device; The minimized system is an open source SONiC system; Initializing the minimized system includes the following sub-steps: Turn off the active packet sending service in the minimized system; After the basic container is started, the VLAN check of all ports of the network device is closed; Initialize ACL resources, create several ACL rules, match the message types involved in the SAI Thrift test, and send all messages received from the ingress direction of the network device to the CPU for processing; Initialize statistical resources, create statistical counters, and bind statistics to each of the ACL rules.
2. The method for constructing the SAI Thrift automated testing framework as claimed in claim 1, characterized in that: The minimized system may also be a private network system.
3. The method for constructing the SAI Thrift automated testing framework as claimed in claim 1, characterized in that: The upper layer application container includes: a dhcp-relay container, a pmon container, a snmp container, a lldp container, a bgp container and a teamd container.
4. The method for constructing the SAI Thrift automated testing framework as claimed in claim 1 or 3, characterized in that: The basic container includes: a syncd container, a swss container and a database container.
5. The method for constructing the SAI Thrift automated testing framework as claimed in claim 1, characterized in that: According to the division of the port resources of the network device, the installation of the multiple PTF containers of the network device is completed as follows: Installing a PTF container according to the division of port resources of the network device; Setting the port attributes of the network device to initialize the environment; The installation of multiple PTF containers of the network device is completed.
Citation Information
Patent Citations
Automated testing system and automated testing method
CN110515848A
Operating system customization method, batch deployment method and batch deployment system
CN110825392A