A method, device and medium for automatic flow testing
Through automated traffic testing methods and systems, the SDN network environment is automatically constructed and tested, which solves the problem of repetitive work in SDN network testing and improves testing efficiency and production efficiency.
Patent Information
- Application Number
- CN202310148233.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-20
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2043-02-20
AI Technical Summary
During the SDN network testing process, testers need to perform a lot of repetitive work, resulting in reduced testing efficiency.
Use automated traffic testing methods and systems to determine test environment data through the database, build a test network environment, and connect with the cloud platform to automatically construct test data, conduct automated testing of the test network connectivity status, and generate and display test results.
It reduces duplication of work in test environment installation and traffic connectivity testing, improves testing efficiency, simplifies the SDN testing process, and significantly improves production efficiency.
Smart Images

Figure CN116170345B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an automated flow testing method, device and medium. Background Art
[0002] With the development of cloud computing, the application of SDN networks has become more and more common. Therefore, the SDN network testing process involves a lot of basic work such as the installation of the test environment and the testing of traffic connectivity. As a result, there are more and more tests in the laboratory environment, and testers need to perform a lot of repetitive work, which reduces the test efficiency. Summary of the invention
[0003] In order to solve the above problems, the present application proposes an automated traffic testing method, which is applied to an automated traffic testing system, wherein the automated traffic testing system includes a database and a cloud platform; the method includes: determining test environment data through the database to build a test network environment according to the test environment data; connecting with the cloud platform through the test network environment, and determining test data through the cloud platform; testing the connectivity status of the test network according to the test data to obtain test results.
[0004] In one example, the automated traffic testing system also includes an SDN server; before determining the test environment data through the database, the method also includes: determining the networking information of the SDN server and sending the networking information to the database for storage; calling the interface of the SDN server through a pre-set Python script to extract the networking information, thereby determining the test environment data based on the networking information.
[0005] In one example, the automated traffic testing system also includes a switch; determining the networking information of the SDN server, specifically including: initializing the configuration of the switch, and determining the configuration information of the switch, and pre-saving the configuration information through the database; determining the environmental attributes of the test environment network, and classifying and saving the configuration information according to the environmental attributes, thereby forming the networking information.
[0006] In one example, building a test network environment according to the test environment data specifically includes: calling a preset Requests module through the Python script to obtain the test environment data through the Requests module; sending the test environment data to the SDN server to build the test network environment through the SDN server.
[0007] In one example, testing the connectivity status of the test network according to the test data specifically includes: obtaining network parameters of the test network, wherein the network parameters include but are not limited to a network ID and a virtual machine IP; and testing the connectivity of the test network according to the network parameters.
[0008] In one example, the method further includes: sending the test results to the database for storage, and aggregating the test results to form an HTML page according to the test results; and displaying the HTML page.
[0009] In one example, the method further includes: determining a connectivity value of the test network based on the test result, and comparing the test result with a preset connectivity threshold; if the test result is less than the connectivity threshold, marking the test network, clearing the test network environment, and performing a new test.
[0010] In one example, the test data includes but is not limited to routers, networks, subnets, virtual machines, firewalls, and external networks.
[0011] On the other hand, the present application also proposes an automated flow testing device, which is used in an automated flow testing system, wherein the automated flow testing system includes a database and a cloud platform; the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the automated flow testing device can execute: determine test environment data through the database to build a test network environment based on the test environment data; connect with the cloud platform through the test network environment, and determine test data through the cloud platform; test the connectivity status of the test network based on the test data to obtain test results.
[0012] On the other hand, the present application also proposes a non-volatile computer storage medium storing computer executable instructions, which is applied to an automated flow testing system, wherein the automated flow testing system includes a database and a cloud platform; the computer executable instructions are configured to: determine test environment data through the database to build a test network environment based on the test environment data; connect with the cloud platform through the test network environment, and determine test data through the cloud platform; test the connectivity status of the test network based on the test data to obtain test results.
[0013] This application is used for the traffic test system of SDN docking with Openstack. Through this test system, the test environment can be automatically installed, the test network can be integrated, the test data can be prefabricated, and the connectivity of the traffic can be automatically counted. This provides a simple and efficient method for the installation and deployment of the test environment, the connectivity of the traffic, and the repeated execution of test tasks. This application can track and cover basic traffic test items, reduce a lot of repetitive work for the integration of the test environment during the SDN test process, and at the same time reduce a lot of test content for the connectivity test of the traffic, thereby providing great help to improve the production efficiency of SDN testers. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0015] Figure 1 A schematic diagram of a flow chart of an automated flow testing method in an embodiment of the present application;
[0016] Figure 2 This is a schematic diagram of an automated flow testing device in an embodiment of the present application. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0018] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0019] like Figure 1 As shown, in order to solve the above problems, an automated traffic testing method provided in an embodiment of the present application is applied to an automated traffic testing system. The system includes an SDN physical server, a Mysql database, network devices for networking, and an Openstack cloud platform and other devices. OpenStack is an open source cloud computing management platform project. It is an open source project that provides software for the construction and management of public and private clouds. Mysql is a relational database management system. Among them, the SDN physical server is used to install the SDN controller environment, the Mysql database is used to solidify the environmental information, and the network devices and the Openstack cloud platform are used for SDN networking. The method includes:
[0020] S101. Determine test environment data through the database to build a test network environment according to the test environment data.
[0021] The system saves the information of the SDN server to the Mysql database in advance for the convenience of Python programs. The corresponding SDN server is built through the pre-determined Paramiko module. Paramiko is a third-party library of Python that can remotely connect to the Linux server and operate Linux through Python. It can download and upload files to the remote server. Testers cannot manually perform the installation steps of the SDN server. The physical networking information of the SDN network environment is written to the Mysql server in advance. In the integration of the SDN network environment, the pre-set Rest interface of the SDN server is called through the Python script to automatically integrate the actual physical environment. In this process, testers do not need to manually perform the network integration steps. Rest is the presentation layer state transfer, which is a popular request method now.
[0022] In one embodiment, the system determines the infrastructure such as SDN control system, switch equipment, cloud computing platform, etc. When the environment is initialized, it is confirmed whether the physical devices such as switches are zero-configuration devices and their current configurations are backed up. Before the test starts, the device information that needs to be configured is preset through the database and distinguished by the environment name to adapt to different environments.
[0023] Use the database to create a table of SDN environment information and save it. Use the Pymysql module in Python to read the database information, and then use the Paramiko module to connect to the corresponding server and automatically install the SDN environment.
[0024] For the integration of SDN network environment, Python is used in combination with the Requests module to read the database to read the Underlay network information from the database, and then send a Rest request to the SDN server so that the network environment can be automatically integrated. The Underlay network is a bearer network composed of various physical devices, such as TOR switches, aggregation switches, core switches, load balancing devices, and firewall devices. The Underlay network uses routing protocols (OSPF, IS-IS, BGP, etc.) to ensure the interconnection between devices on the entire network. It is the underlying network responsible for the transmission of data packets between networks.
[0025] S102: Connecting with the cloud platform through the test network environment, and determining test data through the cloud platform.
[0026] After the SDN network environment is automatically integrated, it can be connected to the Openstack cloud platform. By executing Python to call Paramiko or Rest requests, the Openstack cloud platform automatically constructs test data and constructs a large number of routers, networks, subnets, virtual machines, firewalls, and external networks. Testers do not need to manually participate in the construction of repeated data.
[0027] In one embodiment, for the test data of the Openstack environment, Python is combined with the Paramiko module to automatically construct the data or the cloud platform is constructed through the rest interface, thereby constructing the test environment and test data to avoid repetitive work such as manual operations.
[0028] S103: Testing the connectivity status of the test network according to the test data to obtain a test result.
[0029] After the Openstack cloud platform constructs a large amount of test data, to test the network connectivity of the Openstack virtual machine, you can use Python to call the Paramiko module to execute the Openstack CLI command line, record the Openstack network ID, virtual machine IP, and other information into the database, use the Ipnetns module to execute the SSH command, connect to the corresponding virtual machine, and automatically execute the corresponding ping, curl and other network requests to test the network connectivity, protocol connectivity and other test contents. Ipnetns is used to manage network namespaces, which can achieve network isolation. Each network namespace provides a completely independent network protocol stack, including network device interfaces, IPV4 and IPV6 protocol stacks, IP routing tables, firewall rules, ports, sockets, etc.
[0030] In one embodiment, after the test content is executed, the data is stored in the database. The results of each test content of each virtual machine are saved in the Mysql database. Finally, the test content is summarized and output as an HTML page, and the test results are displayed on the page. By storing the above data and building the traffic test code, the test data can be built at one time, and all traffic connectivity can be tested at one time, so as to quickly obtain the availability of the SDN network.
[0031] In one embodiment, the connectivity value of the test network is determined based on the test result, and the test result is compared with a preset connectivity threshold; if the test result is less than the connectivity threshold, the test network is marked and confirmed as a bug, then the environment can be cleared, and the above script can be repeatedly executed to perform the corresponding test items.
[0032] In one embodiment, the system pre-builds data and solidifies the data in the database to facilitate subsequent reuse. The collected data is also updated and stored for subsequent testing, and it is convenient for test result statistics. Before the test begins, the device configuration information is saved. When the test environment needs to be reintegrated, it is convenient for the device to restore the configuration to the initialized state in time. Before the test, the environment wiring and SDN environment information are solidified in the database for storage. When the environment installation script starts to execute, the SDN environment information is read from the database and automatic installation is performed. After the SDN environment is installed, the environment is integrated, and the wiring information saved in the database is integrated into the SDN network.
[0033] In one embodiment, after the environmental test data is constructed, Python is combined with Paramiko to obtain the data of the cloud platform, including network_uuid, network_name, and the IP of the virtual machine. Then, these data are stored in the database, the virtual machine is connected through Ipnetns, and the corresponding network connectivity is tested. The test results are collected and stored in the database to obtain specific network connectivity results.
[0034] like Figure 2 As shown, an automated flow test device is applied to an automated flow test system, wherein the automated flow test system includes a database and a cloud platform; the device includes:
[0035] at least one processor; and,
[0036] a memory communicatively connected to the at least one processor; wherein,
[0037] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the automated flow testing device to perform:
[0038] Determine the test environment data through the database to build a test network environment according to the test environment data;
[0039] Connecting with the cloud platform through the test network environment and determining test data through the cloud platform;
[0040] The connectivity status of the test network is tested according to the test data to obtain a test result.
[0041] The embodiment of the present application further provides a non-volatile computer storage medium storing computer executable instructions, which is applied to an automated flow test system, wherein the automated flow test system includes a database and a cloud platform; the computer executable instructions are configured as follows:
[0042] Determine the test environment data through the database to build a test network environment according to the test environment data;
[0043] Connecting with the cloud platform through the test network environment and determining test data through the cloud platform;
[0044] The connectivity status of the test network is tested according to the test data to obtain a test result.
[0045] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0046] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0047] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0048] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0049] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0050] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0051] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0052] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0053] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0054] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0055] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. An automated flow testing method, characterized in that: The method is applied to an automated flow test system, wherein the automated flow test system includes a database and a cloud platform; the method includes: Determine the test environment data through the database to build a test network environment according to the test environment data; Connecting with the cloud platform through the test network environment and determining test data through the cloud platform; Testing the connectivity status of the test network according to the test data to obtain a test result; The automated traffic testing system also includes an SDN server; Before determining the test environment data through the database, the method further includes: Determine the networking information of the SDN server, and send the networking information to the database for storage; Calling the interface of the SDN server through a preset Python script to extract the networking information, thereby determining the test environment data according to the networking information; The automated flow testing system also includes a switch; Determining the networking information of the SDN server specifically includes: Initializing the configuration of the switch, determining the configuration information of the switch, and pre-saving the configuration information through the database; Determining the environment attributes of the test environment network, and classifying and saving the configuration information according to the environment attributes, thereby forming the networking information; Building a test network environment according to the test environment data specifically includes: Calling a preset Requests module through the Python script to obtain the test environment data through the Requests module; The test environment data is sent to the SDN server to build a test network environment through the SDN server.
2. The method according to claim 1, characterized in that Testing the connectivity status of the test network according to the test data specifically includes: Obtain network parameters of the test network, wherein the network parameters include but are not limited to a network ID and a virtual machine IP; The connectivity of the test network is tested according to the network parameters.
3. The method according to claim 1, characterized in that The method further comprises: Sending the test results to the database for storage, and summarizing the test results to form an HTML page according to the test results; The HTML page is displayed.
4. The method according to claim 1, characterized in that: The method further comprises: Determine a connectivity value of the test network according to the test result, and compare the test result with a preset connectivity threshold; If the test result is less than the connectivity threshold, the test network is marked, the test network environment is cleared, and a new test is performed.
5. The method according to claim 1, characterized in that The test data includes but is not limited to routers, networks, subnets, virtual machines, firewalls, and external networks.
6. An automated flow testing device, characterized in that: The invention is applied in an automated flow test system, wherein the automated flow test system includes a database and a cloud platform; the device includes: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the automated flow testing device to perform: Determine the test environment data through the database to build a test network environment according to the test environment data; Connecting with the cloud platform through the test network environment and determining test data through the cloud platform; Testing the connectivity status of the test network according to the test data to obtain a test result; The automated traffic testing system also includes an SDN server; Before determining the test environment data through the database, Determine the networking information of the SDN server, and send the networking information to the database for storage; Calling the interface of the SDN server through a preset Python script to extract the networking information, thereby determining the test environment data according to the networking information; The automated flow testing system also includes a switch; Determining the networking information of the SDN server specifically includes: Initializing the configuration of the switch, determining the configuration information of the switch, and pre-saving the configuration information through the database; Determining the environment attributes of the test environment network, and classifying and saving the configuration information according to the environment attributes, thereby forming the networking information; Building a test network environment according to the test environment data specifically includes: Calling a preset Requests module through the Python script to obtain the test environment data through the Requests module; The test environment data is sent to the SDN server to build a test network environment through the SDN server.
7. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The invention is applied in an automated flow test system, wherein the automated flow test system includes a database and a cloud platform; the computer executable instructions are configured as follows: Determine the test environment data through the database to build a test network environment according to the test environment data; Connecting with the cloud platform through the test network environment and determining test data through the cloud platform; Testing the connectivity status of the test network according to the test data to obtain a test result; The automated traffic testing system also includes an SDN server; Before determining the test environment data through the database, Determine the networking information of the SDN server, and send the networking information to the database for storage; Calling the interface of the SDN server through a preset Python script to extract the networking information, thereby determining the test environment data according to the networking information; The automated flow testing system also includes a switch; Determining the networking information of the SDN server specifically includes: Initializing the configuration of the switch, determining the configuration information of the switch, and pre-saving the configuration information through the database; Determining the environment attributes of the test environment network, and classifying and saving the configuration information according to the environment attributes, thereby forming the networking information; Building a test network environment according to the test environment data specifically includes: Calling a preset Requests module through the Python script to obtain the test environment data through the Requests module; The test environment data is sent to the SDN server to build a test network environment through the SDN server.
