CN115442285A - Network testing method, device, equipment and medium based on virtualization configuration - Google Patents

Network testing method, device, equipment and medium based on virtualization configuration Download PDF

Info

Publication number
CN115442285A
CN115442285A CN202211052255.3A CN202211052255A CN115442285A CN 115442285 A CN115442285 A CN 115442285A CN 202211052255 A CN202211052255 A CN 202211052255A CN 115442285 A CN115442285 A CN 115442285A
Authority
CN
China
Prior art keywords
tested
port
network
virtual machine
network card
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202211052255.3A
Other languages
Chinese (zh)
Inventor
冯晨洁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211052255.3A priority Critical patent/CN115442285A/en
Publication of CN115442285A publication Critical patent/CN115442285A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4604LAN interconnection over a backbone network, e.g. Internet, Frame Relay
    • H04L12/462LAN interconnection over a bridge based backbone

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a network testing method, a device, equipment and a medium based on virtualization configuration, which relate to the technical field of computers, and the method comprises the following steps: respectively binding a first port to be tested of a first network card to be tested and a second port to be tested of a second network card to be tested with corresponding first virtual machine and second virtual machine, and respectively constructing a bridge between the first port to be tested and the second port to be tested and the first virtual machine and the second virtual machine so as to execute a preset network test script and generate log data; and determining a current network test result between the first network card to be tested and the second network card to be tested based on the log data. By the method, the network card to be detected does not need to be subjected to network test under a plurality of servers, and the network card to be detected does not need to be interconnected by using the switches, so that the limitation of a test environment is eliminated, the network test can be carried out, the efficiency is improved, and the cost is reduced.

Description

Network testing method, device, equipment and medium based on virtualization configuration
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a network testing method, apparatus, device, and medium based on virtualization configuration.
Background
With the rapid development of internet science and technology, the use of network technology for big data transceiving, transmission, information interaction, resource sharing and integration has become a necessary trend of social development. The network technology is applied to various fields such as communication, traffic, education, medical treatment, social public service, government and the like. Meanwhile, the internet technology can not be realized by network devices such as a physical computer, a server, a network card and the like. Servers provide information services to other computers in a networked environment, including databases, searching, high-performance computing, virtualization, and the like. The virtualization technology is gradually called as a mainstream, can simultaneously execute a plurality of operating systems on one server, and has the advantages of reducing running energy consumption, saving cost, improving the utilization rate of hardware resources and the like. In the network communication process, the transceiving and transmission processes of a plurality of data packets and messages need to be completed, so that the network safety and stability are particularly important, and if the problems of message forwarding blockage, packet loss of the data packets and the like are encountered, the test process is seriously influenced. Therefore, the test efficiency and the test stability are met, and the test environment requirements of customers can be met.
Currently, the mainstream network card testing method is to interconnect a plurality of servers or switches, install a corresponding OS testing system at a testing end, set a corresponding physical port and a corresponding network port, and perform network testing and restarting through a ping IP Address (Internet Protocol Address). A plurality of servers or switches are interconnected, and the time and the labor are consumed due to the limitation of a test environment.
In summary, it is a problem to be solved in the art how to improve the flexibility of network testing, reduce the cost and improve the efficiency.
Disclosure of Invention
In view of this, an object of the present invention is to provide a network testing method, apparatus, device and medium based on virtualization configuration, which improves flexibility of network testing, reduces cost and improves efficiency. The specific scheme is as follows:
in a first aspect, the present application discloses a network testing method based on virtualization configuration, which includes:
respectively binding a first port to be tested of a first network card to be tested and a second port to be tested of a second network card to be tested with corresponding first virtual machine and second virtual machine, and respectively constructing a bridge between the first port to be tested and the second port to be tested and the first virtual machine and the second virtual machine so as to execute a preset network test script and generate log data;
and determining a current network test result between the first network card to be tested and the second network card to be tested based on the log data.
Optionally, before the port binding the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the corresponding second virtual machine, the method further includes:
and screening out a target network based on the current network load condition, and constructing a first virtual machine and a second virtual machine under the target network.
Optionally, before the port binding the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the corresponding second virtual machine, the method further includes:
and determining a first port to be tested of the first network card to be tested and a second port to be tested of the second network card to be tested.
Optionally, after determining the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested, the method further includes:
and acquiring output information of the first port to be tested and the second port to be tested, and clearing corresponding historical port binding and historical bridges based on the output information.
Optionally, after clearing the corresponding historical port binding and the historical bridge based on the output information, the method further includes:
closing the first port to be tested and the second port to be tested so as to respectively bind the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the second virtual machine;
correspondingly, the port binding of the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the corresponding second virtual machine, and the bridge construction between the first port to be tested and the second port to be tested and the first virtual machine and the second virtual machine respectively includes:
respectively carrying out port binding on a first to-be-tested port of a first to-be-tested network card and a second to-be-tested port of a second to-be-tested network card with a corresponding first virtual machine and a corresponding second virtual machine to obtain target port binding information and a target binding function, and respectively constructing a network bridge among the first to-be-tested port, the second to-be-tested port, the first virtual machine and the second virtual machine to obtain target network bridge information and a target network bridge function;
and starting the target binding function and the target network bridge function so as to execute a preset network test script and generate log data.
Optionally, after the target binding function and the target bridge function are started, the method further includes:
and setting an IP address in the target port binding information and the target bridge information.
Optionally, the determining a current network test result between the current host and the virtual machine host based on the log data includes:
and determining a current network test result between the first network card to be tested and the second network card to be tested based on the drop information, the error information and the crc information in the log data.
In a second aspect, the present application discloses a network testing apparatus based on virtualization configuration, including:
the network testing module is used for respectively binding a first port to be tested of a first network card to be tested and a second port to be tested of a second network card to be tested with corresponding first virtual machine and second virtual machine, and respectively constructing a network bridge between the first port to be tested and the second port to be tested and the first virtual machine and the second virtual machine so as to execute a preset network testing script and generate log data;
and the result determining module is used for determining the current network test result between the first network card to be tested and the second network card to be tested based on the log data.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the virtualization configuration based network testing method disclosed in the foregoing.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the steps of the virtualization configuration based network testing method disclosed in the foregoing.
The network testing method based on virtualization configuration includes the steps that a first port to be tested of a first network card to be tested and a second port to be tested of a second network card to be tested are respectively bound with corresponding first virtual machines and second virtual machines, and bridges among the first port to be tested, the second port to be tested, the first virtual machines and the second virtual machines are respectively established so as to execute a preset network testing script and generate log data; and determining a current network test result between the first network card to be tested and the second network card to be tested based on the log data. Therefore, the method and the device do not need a plurality of servers or switches for port interconnection, only need to bind the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the second virtual machine respectively, construct the corresponding network bridge, and then execute the preset network test script to generate the log data in the network test process, so as to determine the current network test result between the first network card to be tested and the second network card to be tested based on the log data.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a network testing method based on virtualization configuration disclosed in the present application;
FIG. 2 is a schematic diagram of a specific network test disclosed herein;
FIG. 3 is a schematic diagram of a specific network test disclosed herein;
FIG. 4 is a flowchart of a specific network testing method based on virtualization configuration disclosed herein;
FIG. 5 is a schematic diagram of a network test apparatus based on virtualization configuration according to the present disclosure;
fig. 6 is a block diagram of an electronic device disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
With the rapid development of internet science and technology, the use of network technology for big data transceiving, transmission, information interaction, resource sharing and integration has become a necessary trend of social development. The network technology is applied to various fields such as communication, traffic, education, medical treatment, social public service, government and the like. Meanwhile, the internet technology can not be realized without network devices such as a physical computer, a server, a network card and the like. Servers provide information services to other computers in a networked environment, including databases, searching, high-performance computing, virtualization, and the like. The virtualization technology is gradually called as a mainstream, can simultaneously execute a plurality of operating systems on one server, and has the advantages of reducing running energy consumption, saving cost, improving the utilization rate of hardware resources and the like. In the network communication process, the transceiving and transmission processes of a plurality of data packets and messages need to be completed, so that the network safety and stability are particularly important, and if the problems of message forwarding blockage, packet loss of the data packets and the like are encountered, the test process is seriously influenced. Therefore, the test efficiency and the test stability are met, and the test environment requirements of customers can be met.
Currently, the mainstream network card testing method is to use a plurality of servers or switches for interconnection, install a corresponding OS (Operating System) testing System at a testing end, set corresponding physical ports and network ports, and perform network testing and restarting through a ping IP address. A plurality of servers or switches are interconnected, and the time and the labor are consumed due to the limitation of a test environment.
Therefore, the network testing scheme based on the virtualization configuration is correspondingly provided, the flexibility of network testing is improved, the cost is reduced, and the efficiency is improved.
Referring to fig. 1, an embodiment of the present application discloses a network testing method based on virtualization configuration, including:
step S11: respectively binding a first port to be tested of a first network card to be tested and a second port to be tested of a second network card to be tested with corresponding first virtual machine and second virtual machine, and respectively constructing a bridge between the first port to be tested and the second port to be tested and the first virtual machine and the second virtual machine so as to execute a preset network test script and generate log data.
In this embodiment, as shown in a specific schematic diagram of network testing shown in fig. 2, in a conventional network test, ports of network cards to be tested under different servers need to be interconnected through a switch, for example, a switch is used to interconnect port1 and port2 of Host1 with port1 and port2 of Host2, and to bond port1 and port2 of Host1, and to bond port1 and port2 of Host2, and to establish a bridge1 and bridge2, so that not only different servers need to be used, but also the switch needs to complete interconnection of the ports to be tested of the network cards to be tested of different servers, and therefore, many test conditions need to be performed, and the switch needs to be manually completed to perform interconnection work on the switch, which is high in cost and low in efficiency. As shown in fig. 3, a specific network test diagram is shown, that is, in the present application, a switch is not needed, and the constructed Host1 and Host2 may be a first virtual machine and a second virtual machine under the same server, or a first virtual machine and a second virtual machine under different servers and the same network, so that the test conditions are reduced, and efficiency and cost are improved because no switch interconnection work is needed. And because the first virtual machine and the second virtual machine can be under the same server, a complex link does not need to be built by virtue of an external switch or the server, and whether configuration problems exist among the internal virtual machines or not does not need to be checked one by one, self-checking can be efficiently realized only by setting the port interconnection of the equipment per se, and meanwhile, relevant error reporting information counted by the tested port is obtained. It is to be noted that the number of the first port to be tested and the second port to be tested needs to be determined based on actual conditions.
In this embodiment, before the port binding is performed between the first to-be-tested port of the first to-be-tested network card and the second to-be-tested port of the second to-be-tested network card and the corresponding first virtual machine and second virtual machine, the method further includes: determining a first port to be tested of the first network card to be tested and a second port to be tested of the second network card to be tested, wherein the code of the port to be determined is, for example:
ETHER_PORT0='ens802f0'
ETHER_PORT1='ens802f1'
for example, it is determined that the first to-be-tested port of the first to-be-tested network card is the ens802f0 and the ens802f1, respectively.
Step S12: and determining a current network test result between the first network card to be tested and the second network card to be tested based on the log data.
In this embodiment, the server creates network links among multiple virtual devices, or is used for network card testing in the state of interconnection of virtual machines of different servers. The tool can timely and effectively check the stability of the network card under the condition that the client environment is limited, so that the test is orderly carried out, the tool is convenient and efficient to execute, time-saving and labor-saving, and the tool can also be applied to processes of part selection, introduction, authentication and the like of the network card.
The network testing method based on virtualization configuration includes the steps that a first port to be tested of a first network card to be tested and a second port to be tested of a second network card to be tested are respectively bound with corresponding first virtual machines and second virtual machines, and bridges among the first port to be tested, the second port to be tested, the first virtual machines and the second virtual machines are respectively established so as to execute a preset network testing script and generate log data; and determining a current network test result between the first network card to be tested and the second network card to be tested based on the log data. Therefore, the method and the device do not need a plurality of servers or switches for port interconnection, only need to bind the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the second virtual machine respectively, construct the corresponding network bridge, and then execute the preset network test script to generate the log data in the network test process, so as to determine the current network test result between the first network card to be tested and the second network card to be tested based on the log data.
Referring to fig. 4, an embodiment of the present application discloses a specific network testing method based on virtualization configuration, including:
step S21: and screening out a target network based on the current network load condition, and constructing a first virtual machine and a second virtual machine under the target network.
In this embodiment, it needs to be ensured that the target networks of the first virtual machine and the second virtual machine are the same network, and the target network may be selected based on the current network load condition, or determined based on the networks of the first network card to be tested and the second network card to be tested.
Step S22: and respectively binding a first port to be tested of a first network card to be tested and a second port to be tested of a second network card to be tested with the corresponding first virtual machine and the second virtual machine, and respectively constructing a bridge between the first port to be tested and the second port to be tested and the first virtual machine and the second virtual machine so as to execute a preset network test script and generate log data.
In this embodiment, before port binding is performed between a first port to be tested of a first network card to be tested and a second port to be tested of a second network card to be tested and the corresponding first virtual machine and the corresponding second virtual machine, the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested are determined, output information of the first port to be tested and the second port to be tested is obtained, and corresponding historical port binding and the historical network bridge are eliminated based on the output information. The relevant codes for obtaining output information and clearing corresponding historical port bindings and historical bridges are as follows:
dmesg-c>/dev/null
ip link delete bond1 2>/dev/null
ip link delete br1 2>/dev/null
ip link add name bond1 type bond mode active-backup
it can be understood that, before testing, the network card driver is installed first, a virtual environment and a virtual machine are created at the testing end and the service end, a port and an IP address to be tested are selected, and relevant binding and a network bridge before testing are cleared.
In this embodiment, after clearing the corresponding historical port binding and the historical bridge based on the output information, the method further includes: and closing the first port to be tested and the second port to be tested so as to respectively bind the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the second virtual machine. The relevant codes for closing the first port to be tested and the second port to be tested can be as follows:
ip link set"$ETHER_PORT0"down
ip link set"$ETHER_PORT1"down
ethtool--set-priv-flags"$ETHER_PORT0"link-down-on-close on
ethtool--set-priv-flags"$ETHER_PORT1"link-down-on-close on
in the embodiment, a first to-be-tested port of a first to-be-tested network card and a second to-be-tested port of a second to-be-tested network card are respectively subjected to port binding with a corresponding first virtual machine and a corresponding second virtual machine so as to obtain target port binding information and a target binding function, and network bridges among the first to-be-tested port, the second to-be-tested port, the first virtual machine and the second virtual machine are respectively constructed so as to obtain target bridge information and a target bridge function; and starting the target binding function and the target network bridge function so as to execute a preset network test script and generate log data. The relevant codes of port binding, bridge construction, target binding function starting and target bridge function can be as follows:
ip link set"$ETHER_PORT0"master bond1
ip link set"$ETHER_PORT1"master bond1
ip link add name br1 type bridge
ip link set dev bond1 master br1
ip link set br1 up
ip link set bond1 up
ip link set"$ETHER_PORT0"up
ip link set"$ETHER_PORT1"up
in this embodiment, after the target binding function and the target bridge function are started, the method further includes: and setting an IP address in the target port binding information and the target bridge information. The relevant code in which the IP address is set may be as follows:
ip address add 100.0.0.1/24dev br1
after the IP address is set, a script corresponding to a preset network test script needs to be executed, for example, the script code shown below:
Figure BDA0003824133760000091
and executing corresponding scripts in the preset network test scripts, such as a cycle command, generating log data when the cycle is finished, and finishing the test.
Step S23: and determining a current network test result between the first network card to be tested and the second network card to be tested based on drop information, error information and crc information in the log data.
In this embodiment, after the preset network test script is executed, the test log data is automatically collected, so that the drop information, the error information and the crc information of the log data are checked, and the current network test result between the first network card to be tested and the second network card to be tested is determined based on the drop information, the error information and the crc information in the log data. It can be understood that, in this embodiment, generally, in the data link layer, a bridge may link local area networks, forward and package data frames according to different MAC addresses, and the like, thereby breaking physical limitations and increasing availability. The binding function may virtualize a plurality of network cards into one network card and set an IP address with one ethernet interface. Through set br1 up, the network communication of a plurality of network cards among different local area networks can be easily realized in a mode of binding a port set bond1 up on a network bridge. This improves network bandwidth and network reliability, and also improves test efficiency during network card test
Therefore, the first virtual machine and the second virtual machine can be directly established in the test end server, the preset network test script is executed under the system and is connected to the first virtual machine and the second virtual machine in a bridging mode, and finally, the preset network test script is utilized to realize the network stability test of the relevant ports of the first network card to be tested and the second network card to be tested.
Referring to fig. 5, an embodiment of the present application discloses a network testing apparatus based on virtualization configuration, including:
the network testing module 11 is configured to perform port binding on a first port to be tested of a first network card to be tested and a second port to be tested of a second network card to be tested respectively with a corresponding first virtual machine and a corresponding second virtual machine, and respectively construct a bridge between the first port to be tested and the second port to be tested and the first virtual machine and the second virtual machine, so as to execute a preset network testing script and generate log data;
and a result determining module 12, configured to determine a current network test result between the first network card to be tested and the second network card to be tested based on the log data.
The network testing device based on virtualization configuration is specifically configured to: and determining a first port to be tested of the first network card to be tested and a second port to be tested of the second network card to be tested.
The network testing device based on virtualization configuration is specifically configured to: the method comprises the steps of screening out a target network based on the current network load condition, and constructing a first virtual machine and a second virtual machine under the target network, wherein it can be understood that the target networks of the first virtual machine and the second virtual machine are required to be ensured to be the same network, and the target network can be selected based on the current network load condition or determined based on the networks of a first network card to be tested and a second network card to be tested.
The network testing device based on virtualization configuration is specifically configured to: and acquiring output information of the first port to be tested and the second port to be tested, and clearing corresponding historical port binding and historical bridges based on the output information.
The network testing device based on virtualization configuration is specifically configured to: and closing the first port to be tested and the second port to be tested so as to respectively bind the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the second virtual machine.
The network test module 11 is specifically configured to: respectively carrying out port binding on a first to-be-tested port of a first to-be-tested network card and a second to-be-tested port of a second to-be-tested network card with a corresponding first virtual machine and a corresponding second virtual machine to obtain target port binding information and a target binding function, and respectively constructing a network bridge among the first to-be-tested port, the second to-be-tested port, the first virtual machine and the second virtual machine to obtain target network bridge information and a target network bridge function; and starting the target binding function and the target network bridge function so as to execute a preset network test script and generate log data.
The network testing device based on virtualization configuration is specifically configured to: and setting an IP address in the target port binding information and the target bridge information.
The result determining module 12 is specifically configured to: after the preset network test script is executed, test log data are automatically collected, so that the drop information, the error information and the crc information of the log data are checked, and the current network test result between the first network card to be tested and the second network card to be tested is determined based on the drop information, the error information and the crc information in the log data. It can be understood that, in this embodiment, generally, in the data link layer, a bridge may link local area networks, forward and package data frames according to different MAC addresses, and the like, thereby breaking physical limitations and increasing availability.
The network testing method based on the virtualization configuration is characterized by comprising the steps of respectively binding a first port to be tested of a first network card to be tested and a second port to be tested of a second network card to be tested with a corresponding first virtual machine and a corresponding second virtual machine, and respectively constructing a network bridge between the first port to be tested and the second port to be tested and the first virtual machine and between the second port to be tested and the second virtual machine so as to execute a preset network testing script and generate log data; and determining a current network test result between the first network card to be tested and the second network card to be tested based on the log data. Therefore, the method and the device do not need a plurality of servers or switches for port interconnection, only need to bind the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the second virtual machine respectively, construct the corresponding network bridge, and then execute the preset network test script to generate the log data in the network test process, so as to determine the current network test result between the first network card to be tested and the second network card to be tested based on the log data.
In some embodiments, the network test apparatus based on virtualization configuration includes:
and the virtual mechanism establishing unit is used for screening out a target network based on the current network load condition and establishing a first virtual machine and a second virtual machine under the target network.
In some embodiments, the network test apparatus based on virtualization configuration includes:
and the port determining unit is used for determining a first port to be tested of the first network card to be tested and a second port to be tested of the second network card to be tested.
In some embodiments, the network test apparatus based on virtualization configuration includes:
and the clearing unit is used for acquiring the output information of the first port to be tested and the second port to be tested and clearing the corresponding historical port binding and the historical bridge based on the output information.
In some embodiments, the network test apparatus based on virtualization configuration includes:
and the binding unit is used for closing the first port to be tested and the second port to be tested so as to bind the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the second virtual machine respectively.
In some embodiments, the network test module 11 includes:
the log data generating unit is used for respectively carrying out port binding on a first to-be-tested port of a first to-be-tested network card and a second to-be-tested port of a second to-be-tested network card and a corresponding first virtual machine and a corresponding second virtual machine so as to obtain target port binding information and a target binding function, and respectively constructing a network bridge among the first to-be-tested port, the second to-be-tested port, the first virtual machine and the second virtual machine so as to obtain target network bridge information and a target network bridge function; and starting the target binding function and the target network bridge function so as to execute a preset network test script and generate log data.
In some embodiments, the network test apparatus based on virtualization configuration includes:
and the address setting unit is used for setting an IP address in the target port binding information and the target bridge information.
In some embodiments, the result determining module 12 includes:
and the network test result determining unit is used for determining the current network test result between the first network card to be tested and the second network card to be tested based on the drop information, the error information and the crc information in the log data.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The method specifically comprises the following steps: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. Wherein the memory 22 is adapted to store a computer program, which is loaded and executed by the processor 21, to implement the steps of:
respectively binding a first port to be tested of a first network card to be tested and a second port to be tested of a second network card to be tested with corresponding first virtual machine and second virtual machine, and respectively constructing a bridge between the first port to be tested and the second port to be tested and the first virtual machine and the second virtual machine so as to execute a preset network test script and generate log data;
and determining a current network test result between the first network card to be tested and the second network card to be tested based on the log data.
In some embodiments, the processor, by executing the computer program stored in the memory, may specifically implement the following steps:
and screening out a target network based on the current network load condition, and constructing a first virtual machine and a second virtual machine under the target network.
In some embodiments, the processor may specifically implement the following steps by executing the computer program stored in the memory:
and determining a first port to be tested of the first network card to be tested and a second port to be tested of the second network card to be tested.
In some embodiments, the processor may specifically implement the following steps by executing the computer program stored in the memory:
and acquiring output information of the first port to be tested and the second port to be tested, and clearing corresponding historical port binding and historical bridges based on the output information.
In some embodiments, the processor may specifically implement the following steps by executing the computer program stored in the memory:
closing the first port to be tested and the second port to be tested so as to respectively bind the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the second virtual machine;
correspondingly, the port binding of the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the corresponding second virtual machine, and the bridge construction between the first port to be tested and the second port to be tested and the first virtual machine and the second virtual machine respectively includes:
respectively performing port binding on a first port to be tested of a first network card to be tested and a second port to be tested of a second network card to be tested with a corresponding first virtual machine and a corresponding second virtual machine to obtain target port binding information and a target binding function, and respectively constructing a network bridge among the first port to be tested, the second port to be tested, the first virtual machine and the second virtual machine to obtain target network bridge information and a target network bridge function;
and starting the target binding function and the target network bridge function so as to execute a preset network test script and generate log data.
In some embodiments, the processor may specifically implement the following steps by executing the computer program stored in the memory:
and setting an IP address in the target port binding information and the target bridge information.
In some embodiments, the processor, by executing the computer program stored in the memory, may further include:
and determining a current network test result between the first network card to be tested and the second network card to be tested based on the drop information, the error information and the crc information in the log data.
In this embodiment, the power supply 23 is configured to provide a working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and an external device, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
The processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 21 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in a wake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor for processing a calculation operation related to machine learning.
In addition, the storage 22 is used as a carrier for storing resources, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., the resources stored thereon include an operating system 221, a computer program 222, data 223, etc., and the storage mode may be a transient storage mode or a permanent storage mode.
The operating system 221 is used for managing and controlling hardware devices and computer programs 222 on the electronic device, so as to implement operations and processing of the mass data 223 in the memory 22 by the processor 21, and may be Windows, unix, linux, or the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the virtualization configuration-based network test method performed by the electronic device disclosed in any of the foregoing embodiments. The data 223 may include data received by the electronic device and transmitted from an external device, or may include data collected by the input/output interface 25 itself.
Further, an embodiment of the present application further discloses a computer-readable storage medium, where a computer program is stored in the storage medium, and when the computer program is loaded and executed by a processor, the method steps executed in a network test process based on virtualization configuration, which are disclosed in any of the foregoing embodiments, are implemented.
Finally, it should also be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The network testing method, device, equipment and medium based on virtualization configuration provided by the present invention are introduced in detail, and a specific example is applied in the text to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A network testing method based on virtualization configuration is characterized by comprising the following steps:
respectively binding a first port to be tested of a first network card to be tested and a second port to be tested of a second network card to be tested with a corresponding first virtual machine and a corresponding second virtual machine, and respectively constructing a network bridge between the first port to be tested and the second port to be tested and the first virtual machine and between the second port to be tested and the second virtual machine so as to execute a preset network test script and generate log data;
and determining a current network test result between the first network card to be tested and the second network card to be tested based on the log data.
2. The network testing method based on virtualization configuration of claim 1, wherein before the port binding of the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the corresponding second virtual machine, the method further comprises:
and screening out a target network based on the current network load condition, and constructing a first virtual machine and a second virtual machine under the target network.
3. The network testing method based on virtualization configuration of claim 1, wherein before the port binding of the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the corresponding second virtual machine, the method further comprises:
and determining a first to-be-tested port of the first to-be-tested network card and a second to-be-tested port of the second to-be-tested network card.
4. The network testing method based on virtualization configuration of claim 3, wherein after determining the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested, further comprising:
and acquiring output information of the first port to be tested and the second port to be tested, and clearing corresponding historical port binding and historical bridges based on the output information.
5. The virtualization configuration-based network testing method of claim 4, wherein after clearing the corresponding historical port bindings and historical bridges based on the output information, further comprising:
closing the first port to be tested and the second port to be tested so as to respectively bind the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the second virtual machine;
correspondingly, the port binding of the first port to be tested of the first network card to be tested and the second port to be tested of the second network card to be tested with the corresponding first virtual machine and the second virtual machine respectively, and the construction of the bridge between the first port to be tested and the second port to be tested and the first virtual machine and the second virtual machine respectively comprises:
respectively carrying out port binding on a first to-be-tested port of a first to-be-tested network card and a second to-be-tested port of a second to-be-tested network card with a corresponding first virtual machine and a corresponding second virtual machine to obtain target port binding information and a target binding function, and respectively constructing a network bridge among the first to-be-tested port, the second to-be-tested port, the first virtual machine and the second virtual machine to obtain target network bridge information and a target network bridge function;
and starting the target binding function and the target network bridge function so as to execute a preset network test script and generate log data.
6. The virtualization configuration-based network testing method of claim 5, wherein after the target binding function and the target bridge function are started, the method further comprises:
and setting an IP address in the target port binding information and the target bridge information.
7. The virtualization configuration-based network test method according to any one of claims 1 to 6, wherein the determining a current network test result between the current host and the virtual machine host based on the log data comprises:
and determining a current network test result between the first network card to be tested and the second network card to be tested based on the drop information, the error information and the crc information in the log data.
8. A network test apparatus based on virtualization configuration, comprising:
the network testing module is used for respectively binding a first port to be tested of a first network card to be tested and a second port to be tested of a second network card to be tested with a corresponding first virtual machine and a corresponding second virtual machine, and respectively constructing a network bridge between the first port to be tested and the second port to be tested and the first virtual machine and between the second port to be tested and the second virtual machine so as to execute a preset network testing script and generate log data;
and the result determining module is used for determining the current network test result between the first network card to be tested and the second network card to be tested based on the log data.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the virtualization configuration based network testing method of any of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the steps of the virtualization configuration based network test method of any one of claims 1 to 7.
CN202211052255.3A 2022-08-31 2022-08-31 Network testing method, device, equipment and medium based on virtualization configuration Withdrawn CN115442285A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211052255.3A CN115442285A (en) 2022-08-31 2022-08-31 Network testing method, device, equipment and medium based on virtualization configuration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211052255.3A CN115442285A (en) 2022-08-31 2022-08-31 Network testing method, device, equipment and medium based on virtualization configuration

Publications (1)

Publication Number Publication Date
CN115442285A true CN115442285A (en) 2022-12-06

Family

ID=84245478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211052255.3A Withdrawn CN115442285A (en) 2022-08-31 2022-08-31 Network testing method, device, equipment and medium based on virtualization configuration

Country Status (1)

Country Link
CN (1) CN115442285A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116684913A (en) * 2023-06-25 2023-09-01 上海移柯通信技术股份有限公司 4G communication module testing method, system, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116684913A (en) * 2023-06-25 2023-09-01 上海移柯通信技术股份有限公司 4G communication module testing method, system, electronic equipment and storage medium
CN116684913B (en) * 2023-06-25 2024-02-13 上海移柯通信技术股份有限公司 4G communication module testing method, system, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US11411828B2 (en) Host network analyzer
CN102316043B (en) Port virtualization method, switch and communication system
CN107666493B (en) Database configuration method and equipment thereof
US10628198B2 (en) Hypervisor management of migration notification and response messages for virtual machines
CN109639488B (en) Multi-extranet shunt acceleration method and system
CN111669284A (en) OpenStack automatic deployment method, electronic device, storage medium and system
EP3985508A1 (en) Network state synchronization for workload migrations in edge devices
CN115442285A (en) Network testing method, device, equipment and medium based on virtualization configuration
CN103501295A (en) Virtual machine migration-based remote access method and equipment
CN103795603A (en) Edge virtual bridging method and device based on multiple network interface cards
CN114995888A (en) Intelligent network card deployment method, device and medium
CN113127144B (en) Processing method, processing device and storage medium
CN110795209B (en) Control method and device
CN110311861B (en) Method and device for guiding data flow
CN110324202B (en) Method and device for detecting line quality
CN114650223B (en) Network configuration method and device of Kubernetes cluster and electronic equipment
CN113886153B (en) Network card pressure testing method and device based on container
CN114172841B (en) Message forwarding method and device, electronic equipment and read storage medium
CN113612643B (en) Network configuration method, device and equipment of cloud mobile phone and storage medium
CN115827148A (en) Resource management method and device, electronic equipment and storage medium
CN109150941B (en) Data center physical resource floating method
CN113890789B (en) UDP tunnel traffic shunting method and traffic forwarding method suitable for data center
CN112671561B (en) Network card configuration method and equipment of cloud host
CN114780241A (en) Acceleration card setting method, device and medium applied to server
CN111756651A (en) Traffic transmission method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20221206