CN112887163B - Connectivity test method, connectivity test device, electronic equipment and storage medium - Google Patents

Connectivity test method, connectivity test device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112887163B
CN112887163B CN201911206791.2A CN201911206791A CN112887163B CN 112887163 B CN112887163 B CN 112887163B CN 201911206791 A CN201911206791 A CN 201911206791A CN 112887163 B CN112887163 B CN 112887163B
Authority
CN
China
Prior art keywords
tested
test
equipment
address
connectivity
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.)
Active
Application number
CN201911206791.2A
Other languages
Chinese (zh)
Other versions
CN112887163A (en
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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud 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 Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201911206791.2A priority Critical patent/CN112887163B/en
Publication of CN112887163A publication Critical patent/CN112887163A/en
Application granted granted Critical
Publication of CN112887163B publication Critical patent/CN112887163B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Abstract

The embodiment of the invention provides a connectivity testing method, a connectivity testing device, electronic equipment and a storage medium. The scheme is as follows: the test equipment can determine a first IP address of the first equipment to be tested and service access information of the second equipment to be tested when connectivity test is carried out on the first equipment to be tested and the second equipment to be tested, wherein the second equipment to be tested is a virtual machine containing a mirror image file for network service; and accessing the network service of the second equipment to be tested by using the target software based on the service access information, and transmitting the first IP address to the second equipment to be tested so that the second equipment to be tested performs connectivity test with the first equipment to be tested based on the first IP address. Through the technical scheme provided by the embodiment of the invention, in the communication test process, the first device to be tested and the second device to be tested do not need to be bound with the EIP, and the method and the device can be suitable for test scenes that a virtual machine cannot access an external network, thereby realizing the communication test in different test scenes.

Description

Connectivity test method, connectivity test device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of automated testing technologies, and in particular, to a connectivity testing method and apparatus, an electronic device, and a storage medium.
Background
With the continuous development of virtualization technology, the use of virtual private networks is more and more widespread. Currently, when an automation test is performed on a virtual private network, an Application Programming Interface (API) test and a network connectivity test may be mainly included. The network connectivity test is implemented by binding a virtual machine in a host machine with an extranet Enterprise Information Portal (EIP), and logging in one of the virtual machines in a Secure Shell (SSH) manner, so as to execute an Internet Packet explorer (PING) command to implement a network connectivity test between the two virtual machines in the virtual machine according to an Internet Protocol (IP) address of the other virtual machine.
The connectivity test method is only applicable to connectivity tests of two virtual machines in a test scenario in which the virtual machines bind the EIP, but not applicable to a test scenario in which the virtual machines cannot access the external Network, such as a test scenario in which Network Address Translation (NAT), PEER-to-PEER link (PEER), Load balancing of an internal Network Server (SLB), and the like. Due to the test scenes, the virtual machines cannot access the external network, so that the test equipment cannot log in the virtual machines through SSH (secure Shell), and the connectivity test among the virtual machines is influenced.
Disclosure of Invention
The embodiment of the invention aims to provide a connectivity test method, a connectivity test device, electronic equipment and a storage medium, so as to realize connectivity tests in different test scenes. The specific technical scheme is as follows:
the embodiment of the invention provides a connectivity test method, which is applied to test equipment, wherein the test equipment is provided with target software for accessing internal network services of a virtual machine through a host machine, and the method comprises the following steps:
when connectivity test is performed on a first device to be tested and a second device to be tested, determining a first Internet Protocol (IP) address of the first device to be tested and service access information of the second device to be tested, wherein the second device to be tested is a virtual machine containing a mirror image file for network service;
and based on the service access information, accessing the network service of the second device to be tested by using the target software, and transmitting the first IP address to the second device to be tested so as to enable the second device to be tested to perform connectivity test with the first device to be tested based on the first IP address.
Optionally, the service access information includes a second IP address of a host machine on which the second device to be tested is installed and a virtual Network Identifier (VXLAN Network Identifier, VNI);
the accessing, by using the target software, the network service of the second device under test based on the service access information and transmitting the first IP address to the second device under test includes:
and based on the second IP address and the VNI, accessing the network service of the second device to be tested through the host machine by using the target software, and transmitting the first IP address to the second device to be tested.
Optionally, the method further includes:
and obtaining a test result of the connectivity test between the first device to be tested and the second device to be tested.
Optionally, before accessing the network service of the second device under test and transmitting the first IP address to the second device under test by using the target software based on the service access information, the method further includes:
respectively detecting whether the first equipment to be tested and the second equipment to be tested are started;
the accessing, by using the target software, the network service of the second device under test based on the service access information and transmitting the first IP address to the second device under test includes:
and when the first equipment to be tested and the second equipment to be tested are both started, accessing the network service of the second equipment to be tested by using the target software based on the service access information, and transmitting the first IP address to the second equipment to be tested.
The embodiment of the invention also provides a connectivity test method, which is applied to a second device to be tested, wherein the second device to be tested is a virtual machine containing an image file for network service, and the method comprises the following steps:
receiving a first IP address of a first device to be tested, which is transmitted by the testing device; the test equipment is provided with target software for accessing the internal network service of the virtual machine through a host, and the first IP address is a parameter which is transmitted to the second equipment to be tested and is used for accessing the network service of the second equipment to be tested by utilizing the target software based on the service access information of the second equipment to be tested when the test equipment performs connectivity test on the first equipment to be tested and the second equipment to be tested;
and performing connectivity test with the first equipment to be tested based on the first IP address.
Optionally, the image file in the second device under test is started by default.
Optionally, the performing, based on the first IP address, a connectivity test with the first device to be tested includes:
and executing Ping operation on the first IP address based on the image file in a preset test environment.
Optionally, the method further includes:
and feeding back the test result of the connectivity test to the test equipment.
The embodiment of the invention also provides a connectivity testing device, which is applied to testing equipment, wherein the testing equipment is provided with target software for accessing the internal network service of the virtual machine through a host machine, and the connectivity testing device comprises:
the device comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining a first IP address of a first device to be tested and service access information of a second device to be tested when connectivity test is carried out on the first device to be tested and the second device to be tested, and the second device to be tested is a virtual machine containing a mirror image file for network service;
and the access module is used for accessing the network service of the second device to be tested by utilizing the target software based on the service access information and transmitting the first IP address to the second device to be tested so as to enable the second device to be tested to perform connectivity test with the first device to be tested based on the first IP address.
Optionally, the service access information includes a second IP address of a host computer on which the second device to be tested is installed and a VNI;
the access module is specifically configured to access, by using the target software, a network service of the second device to be tested through the host based on the second IP address and the VNI, and transmit the first IP address to the second device to be tested.
Optionally, the apparatus further comprises:
and the obtaining module is used for obtaining a test result of the connectivity test between the first device to be tested and the second device to be tested.
Optionally, the apparatus further comprises:
the detection module is used for respectively detecting whether the first equipment to be detected and the second equipment to be detected are started;
the access module is specifically configured to, when both the first device under test and the second device under test are started, access the network service of the second device under test by using the target software based on the service access information, and transmit the first IP address to the second device under test.
An embodiment of the present invention further provides a connectivity testing apparatus, applied to a second device to be tested, where the second device to be tested is a virtual machine including an image file for network service, and the apparatus includes:
the receiving module is used for receiving a first IP address of a first device to be tested, which is transmitted by the testing device; the test equipment is provided with target software for accessing the internal network service of the virtual machine through a host, and the first IP address is a parameter which is transmitted to the second equipment to be tested and is used for accessing the network service of the second equipment to be tested by utilizing the target software based on the service access information of the second equipment to be tested when the test equipment performs connectivity test on the first equipment to be tested and the second equipment to be tested;
and the testing module is used for performing connectivity test with the first equipment to be tested based on the first IP address.
Optionally, the image file in the second device under test is started by default.
Optionally, the test module is specifically configured to, in a preset test environment, execute Ping operation on the first IP address based on the image file.
Optionally, the apparatus further comprises:
and the feedback module is used for feeding back the test result of the connectivity test to the test equipment.
The embodiment of the invention also provides electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the above steps of the connectivity test method when executing the program stored in the memory.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when being executed by a processor, the computer program implements any of the above described steps of the connectivity testing method.
Embodiments of the present invention also provide a computer program product containing instructions, which when run on a computer, cause the computer to perform any one of the above described connectivity testing methods.
The embodiment of the invention has the following beneficial effects:
by adopting the technical scheme provided by the embodiment of the invention, when the connectivity test is carried out on the first device to be tested and the second device to be tested, because the test equipment is provided with the target software which can directly access the internal network service of the virtual machine through the host machine and the second device to be tested comprises the mirror image file for the network service, the test equipment can directly transmit the IP address of the first device to be tested to the second device to be tested by using the target software, so that the second device to be tested can carry out the connectivity test with the first device to be tested by using the IP address of the first device to be tested. In the communication direction testing process, the first device to be tested and the second device to be tested do not need to be bound with the EIP, and the method can be suitable for testing scenes that a virtual machine cannot access an external network, so that the communication tests in different testing scenes are realized.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a first flowchart of a connectivity testing method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a connectivity testing method according to an embodiment of the present invention;
fig. 3 is a third flowchart illustrating a connectivity testing method according to an embodiment of the present invention;
fig. 4 is a fourth flowchart illustrating a connectivity testing method according to an embodiment of the present invention;
fig. 5 is a fifth flowchart illustrating a connectivity testing method according to an embodiment of the present invention;
FIG. 6 is a signaling diagram of a connectivity test provided by the practice of the present invention;
fig. 7 is a schematic diagram of a first structure of a connectivity testing apparatus according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a second structure of a connectivity testing apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a second electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, 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 derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problem that the conventional connectivity test method cannot be applied to a test scenario that a virtual machine cannot access an external network, the embodiment of the invention provides a connectivity test method. The method may be applied to any electronic device. The electronic device may be a test device for performing connectivity test, or may be a device to be tested for performing connectivity test. In the method provided by the embodiment of the invention, when connectivity test is carried out on a first device to be tested and a second device to be tested, a first IP address of the first device to be tested is determined, wherein the second device to be tested is a virtual machine containing an image file for network service; and accessing the network service of the second device to be tested by using the target software, and transmitting the first IP address to the second device to be tested so as to enable the second device to be tested to perform connectivity test with the first device to be tested based on the first IP address.
In the embodiment of the present invention, the test device is installed with target software that accesses the internal network service of the virtual machine through the host. The target software is software which is based on a engine kernel and is obtained by rewriting commands in a command line Uniform Resource Locator (CURL). The target software is added with two parameters on the basis of the CURL, namely a parameter hip and a parameter vni. The command composed of the parameter hip and the parameter vni can access the virtual machine internal network service, such as World Wide Web (Web) service, through the host machine.
In addition, in the embodiment of the present invention, the image file for the network service included in the second device under test is a customized image file. An interface of a network service, such as a Web service interface, is deployed in the image file. The mirror image file has the function that after an IP address is received, PING operation can be executed on the received IP address, and then testing data returned by the PING operation are obtained. In addition, in the embodiment of the invention, the image file is started by default and is started by self, and the second device to be tested is started by using the image file.
By the method provided by the embodiment of the invention, when the connectivity test is performed on the first device to be tested and the second device to be tested, because the test device is provided with the target software which can directly access the internal network service of the virtual machine through the host machine, and the second device to be tested comprises the image file for the network service, the test device can directly transmit the IP address of the first device to be tested to the second device to be tested by using the target software, so that the second device to be tested can perform the connectivity test with the first device to be tested by using the IP address of the first device to be tested. In the communication direction testing process, the first device to be tested and the second device to be tested do not need to be bound with the EIP, and the method can be suitable for testing scenes that a virtual machine cannot access an external network, so that the communication tests in different testing scenes are realized.
The following examples illustrate the embodiments of the present invention.
As shown in fig. 1, fig. 1 is a schematic flowchart of a connectivity testing method according to an embodiment of the present invention. The method is applied to test equipment and specifically comprises the following steps.
Step S101, when connectivity test is performed on a first device to be tested and a second device to be tested, a first IP address of the first device to be tested and service access information of the second device to be tested are determined, wherein the second device to be tested is a virtual machine containing an image file for network service.
In an optional embodiment, after determining to perform connectivity test on the first device under test and the second device under test, the tester may send a test request for performing connectivity test on the first device under test and the second device under test to the test device. The test request comprises the IP address of the first device to be tested and the service access information of the second device to be tested. The test device may detect in real time whether the test request is received. Upon receiving the test request, the test device may determine to perform connectivity testing on the first device under test and the second device under test. At this time, the test device may obtain the IP address of the first device under test, that is, the first IP address, from the test request, and obtain the service access information of the second device under test.
The service access information of the second device to be tested includes, but is not limited to, a second IP address of a host machine on which the second device to be tested is installed, and a VNI of a Virtual eXtensible Local Area Network (VXLAN). The host machine is host machine equipment provided with second equipment to be tested.
The VXLAN described above is a network virtualization technology. By encapsulating an original two-layer network message into a User Datagram Protocol (UDP) data packet and then forwarding the data packet by a bearer network, the encapsulated two-layer message is increased by 50 bytes, which includes: an 8 byte VXLAN header, an 8 byte UDP header, a 20 byte IP header, and a 14 byte ethernet header. Wherein, the IP header carries the source IP address and the IP address of the target edge node. The VXLAN header carries a 24-bit VNI that is used to identify different VXLANs.
In the embodiment of the present invention, the second device under test is a master test device for connectivity test, and the first device under test is a slave test device for connectivity test. Namely, the second device to be tested and the first device to be tested are utilized to carry out connectivity test. The second device under test is a virtual machine including an image file for network service. The first device to be tested can be a physical machine and can also be a virtual machine containing an image file for network service. Here, the above-described first device to be tested is not particularly limited.
And S102, accessing the network service of the second device to be tested by using the target software based on the service access information, and transmitting the first IP address to the second device to be tested so that the second device to be tested performs connectivity test with the first device to be tested based on the first IP address.
In this step, the test device may access, by using the target software, the network service inside the second device to be tested through the host machine in which the second device to be tested is installed according to the service access information of the second device to be tested, and transmit the first IP address of the first device to be tested to the second device to be tested. After receiving the first IP address of the first device to be tested, the second device to be tested may perform connectivity test with the first device to be tested based on the received first IP address. The specific procedures for the delivery of the first IP address and the connectivity test can be referred to the following description, and are not specifically described here.
By the method shown in fig. 1, when connectivity test is performed on the first device to be tested and the second device to be tested, because the test device is installed with target software capable of directly accessing the internal network service of the virtual machine through the host, and the second device to be tested includes the image file for the network service, the test device can directly transmit the IP address of the first device to be tested to the second device to be tested by using the target software, so that the second device to be tested can perform connectivity test with the first device to be tested by using the IP address of the first device to be tested. In the communication direction testing process, the first device to be tested and the second device to be tested do not need to be bound with the EIP, and the method can be suitable for testing scenes that a virtual machine cannot access an external network, so that the communication tests in different testing scenes are realized.
In an optional embodiment, the service access information of the second device under test includes a second IP address of a host on which the second device under test is installed and a VNI.
In step S102, based on the service access information, the target software is used to access the network service of the second device under test, and transmit the first IP address to the second device under test, which may specifically be represented as:
and accessing the network service of the second equipment to be tested through the host machine by using the target software based on the second IP address and the VNI, and transmitting the first IP address to the second equipment to be tested.
In this step, the test device may use the target application to encapsulate the data on the bottom layer, and forward the encapsulated data packet to the network service interface of the second device to be tested through the host installed with the second device to be tested, so as to transmit the first IP address of the first device to be tested to the second device to be tested.
In an alternative embodiment, the test device may execute the following command to pass the first IP address to the second device under test.
R/bin/xcurl http:// virtual machine ip:80/index. php? First IP address-hip second IP address-VNI.
The method comprises the steps that a virtual machine IP:80 represents an IP address of a host machine accessed by the testing equipment and a port number of a network service interface, index.php represents that the network service in the second equipment to be tested is written by adopting a Hypertext Preprocessor (PHP) language, hip indicates the IP address of the host machine corresponding to the second equipment to be tested, and VNI indicates the VNI corresponding to the second equipment to be tested accessed by the testing equipment.
For convenience of understanding, the above-mentioned first IP address of the first device under test is IP1, the second IP address of the host machine on which the second device under test is installed is IP2, and VNI is id 1.
The above command may be expressed as: // usr/bin/xcoll http:// IP1:80/index, phpIPP 1- -hip IP2- -vni ID 1.
In an optional embodiment, according to the method shown in fig. 1, an embodiment of the present invention further provides a method for connectivity test. As shown in fig. 2, fig. 2 is a schematic flowchart of a connectivity testing method according to an embodiment of the present invention. The method comprises the following steps.
Step S201, when performing connectivity test on a first device to be tested and a second device to be tested, determining a first IP address of the first device to be tested and service access information of the second device to be tested, where the second device to be tested is a virtual machine including an image file for network service.
Step S202, based on the service access information, the target software is utilized to access the network service of the second device to be tested, and the first IP address is transmitted to the second device to be tested, so that the second device to be tested and the first device to be tested can conduct connectivity test based on the first IP address.
The above steps S201 to S202 are the same as the above steps S101 to S102.
Step S203, obtaining a test result of the connectivity test between the first device to be tested and the second device to be tested.
In an optional embodiment, after the second device under test and the first device under test complete connectivity testing, the second device under test may obtain a testing result of the connectivity testing. At this time, the second device under test may directly feed back the test result to the test device. The test device may receive a test result fed back by the second device under test.
In another optional embodiment, the test device may actively request to obtain the test result of the connectivity test from the second device to be tested after the first IP address is transmitted to the second device to be tested for the preset duration, the second device to be tested may send the test result to the test device after receiving the request, and the test device receives the test result fed back by the second device to be tested.
In the embodiment of the present invention, the test result includes information such as a test success or a test failure, a requested test, requested response data, a network delay, a packet loss condition, and the like.
By the method shown in fig. 2, the testing device can obtain the testing result from the second device to be tested after the connectivity test is completed, so that the testing personnel can obtain the testing result of the connectivity test in time.
In an optional embodiment, according to the method shown in fig. 1, an embodiment of the present invention further provides a method for connectivity test. As shown in fig. 3, fig. 3 is a third schematic flow chart of a connectivity testing method according to an embodiment of the present invention. The method comprises the following steps.
Step S301, when performing connectivity test on a first device to be tested and a second device to be tested, determining a first IP address of the first device to be tested and service access information of the second device to be tested, wherein the second device to be tested is a virtual machine containing an image file for network service.
Step S301 is the same as step S101.
Step S302, respectively detecting whether the first device under test and the second device under test are started. If both are activated, step S303 is executed.
In an optional embodiment, the image file in the second device under test is started by default, that is, when the host of the second device under test is started, the image file is automatically started, and the second device under test can be started by using the image file. Therefore, the test equipment can detect whether the host machine corresponding to the second device to be tested is started. When the host computer is started, the image file of the second device to be tested in the host computer is synchronously started, and at the moment, the second device to be tested can be synchronously started.
In the embodiment of the present invention, the execution sequence of the above steps S301 and S302 is not particularly limited.
Step S303, based on the service access information, accessing the network service of the second device to be tested by using the target software, and transmitting the first IP address to the second device to be tested, so that the second device to be tested performs connectivity test with the first device to be tested based on the first IP address.
Step S303 is the same as step S102.
In an optional embodiment, if any one of the first device under test and the second device under test is not started, the test device may send a prompt message to the tester, so as to prompt the tester that the device under test is not started. For example, the test device may display the prompting message in a front page. When receiving the prompt message, the tester can start the test equipment which is not started in time.
Based on the same inventive concept, according to the connectivity testing method provided by the embodiment of the invention, the embodiment of the invention also provides a connectivity testing method. As shown in fig. 4, fig. 4 is a fourth flowchart illustrating a connectivity testing method according to an embodiment of the present invention. The method is applied to the second device to be tested and specifically comprises the following steps.
Step S401, receiving a first IP address of a first device to be tested, which is transmitted by the testing device; the test equipment is provided with target software for accessing the internal network service of the virtual machine through the host, and the first IP address is a parameter which is transmitted to the second equipment to be tested by the test equipment based on the service access information of the second equipment to be tested and based on the service access information of the second equipment to be tested when the test equipment performs connectivity test on the first equipment to be tested and the second equipment to be tested.
In this step, when the test device determines to test the first device to be tested and the second device to be tested, the test device may determine the first IP address of the first device to be tested and the service access information of the second device to be tested, so as to access the network service of the second device to be tested by using the installed target software based on the service access information, and transmit the first IP address to the second device to be tested. The second device under test may receive the first IP address passed by the test device. Reference is made to the above embodiments for the delivery of the first IP address, which is not specifically described here.
And S402, performing connectivity test with the first device to be tested based on the first IP address.
In this step, after receiving the first IP address transmitted by the test device, the second device under test may determine to perform connectivity test with the first device under test. At this time, the second device under test may perform connectivity test with the first device under test by using the included image file based on the received first IP address. The method for connectivity test can be referred to the following description, and is not specifically described here.
By the method shown in fig. 4, when connectivity test is performed on the first device to be tested and the second device to be tested, because the test device is installed with target software capable of directly accessing the internal network service of the virtual machine through the host, and the second device to be tested includes the image file for the network service, the test device can directly transmit the IP address of the first device to be tested to the second device to be tested by using the target software, so that the second device to be tested can perform connectivity test with the first device to be tested by using the IP address of the first device to be tested. In the communication direction testing process, the first device to be tested and the second device to be tested do not need to be bound with the EIP, and the method can be suitable for testing scenes that a virtual machine cannot access an external network, so that the communication tests in different testing scenes are realized.
In an optional embodiment, in step S402, based on the first IP address, a connectivity test is performed on the first device to be tested, which may specifically be represented as:
and in a preset test environment, executing Ping operation on the first IP address based on the mirror image file.
In this step, the second device under test may perform a PING operation on the first IP address based on the image file included in the second device under test in a preset test environment, that is, execute a PING command, and detect whether the PING can be passed through the first IP address.
In the embodiment of the present invention, the preset test environments include, but are not limited to, NAT, PERR, intranet SLB, and other test environments.
In an alternative embodiment, according to the method shown in fig. 4, an embodiment of the present invention further provides a connectivity testing method. As shown in fig. 5, fig. 5 is a fifth flowchart of a connectivity testing method according to an embodiment of the present invention.
Step S501, receiving a first IP address of a first device to be tested, which is transmitted by the testing device; the test equipment is provided with target software for accessing the internal network service of the virtual machine through the host, and the first IP address is a parameter which is transmitted to the second equipment to be tested by the test equipment based on the service access information of the second equipment to be tested and based on the service access information of the second equipment to be tested when the test equipment performs connectivity test on the first equipment to be tested and the second equipment to be tested.
Step S502, based on the first IP address, a connectivity test is carried out with the first device to be tested.
The above steps S501 to S502 are the same as the above steps S401 to S402.
Step S503, feeding back the test result of the connectivity test to the test equipment.
In an optional embodiment, the second device under test may actively send the test result to the test device after the connectivity test is completed.
In another optional embodiment, after the connectivity test is completed, the second device under test may send the test result to the test device when receiving the request for obtaining the test result sent by the test device
By the method shown in fig. 5, the second device under test feeds back the test result to the test device, so that the tester can know the test result of the connectivity test in time.
For convenience of understanding, the connectivity test method is described below by taking fig. 6 as an example. Fig. 6 is a signaling diagram of a connectivity test provided by the implementation of the present invention.
The test equipment can respectively determine a first IP address of the first device to be tested, a second IP address of the second device to be tested corresponding to the host and a VNI of a VXLAN network where the second device to be tested is located.
The test device may execute the above-mentioned command with the installed target application, that is, the command: r/bin/xcurl http:// virtual machine ip:80/index. php? And the first IP address, the hip second IP address and the VNI access the network service in the second device to be tested through the host machine corresponding to the second device to be tested, and transmit the first IP address of the first device to be tested to the second device to be tested.
And the second equipment to be tested performs PING operation on the first IP address by using the included mirror image file, receives test data of the PING operation returned by the first equipment to be tested, namely a test result of the connectivity test, and completes the connectivity test of the second equipment to be tested and the first equipment to be tested. The second device under test may feed back the test results to the test device.
Based on the same inventive concept, according to the connectivity testing method provided by the embodiment of the invention, the embodiment of the invention also provides a connectivity testing device. As shown in fig. 7, fig. 7 is a schematic view of a first structure of a connectivity testing apparatus according to an embodiment of the present invention. The device is a test device and specifically comprises the following modules.
A determining module 701, configured to determine a first IP address of a first device to be tested and service access information of a second device to be tested when connectivity tests are performed on the first device to be tested and the second device to be tested, where the second device to be tested is a virtual machine including an image file for network service;
the access module 702 is configured to access, based on the service access information, the network service of the second device to be tested by using the target software, and transmit the first IP address to the second device to be tested, so that the second device to be tested performs connectivity test with the first device to be tested based on the first IP address.
Optionally, the service access information includes a second IP address of a host computer on which a second device to be tested is installed and a VNI;
the access module 702 may be specifically configured to access, by using the target software, the network service of the second device to be tested through the host based on the second IP address and the VNI, and transmit the first IP address to the second device to be tested.
Optionally, the connectivity testing apparatus may further include:
and the acquisition module is used for acquiring a test result of the connectivity test between the first device to be tested and the second device to be tested.
Optionally, the connectivity testing apparatus may further include:
the detection module is used for respectively detecting whether the first equipment to be detected and the second equipment to be detected are started;
the access module 702 may be specifically configured to, when both the first device under test and the second device under test are started, access the network service of the second device under test by using the target software based on the service access information, and transmit the first IP address to the second device under test.
Based on the same inventive concept, according to the connectivity testing method provided by the embodiment of the invention, the embodiment of the invention also provides a connectivity testing device. As shown in fig. 8, fig. 8 is a schematic diagram of a second structure of a connectivity testing apparatus according to an embodiment of the present invention. The apparatus is the second device under test, and specifically includes the following modules.
A receiving module 801, configured to receive a first IP address of a first device to be tested, where the first IP address is transmitted by the testing device; the test equipment is provided with target software for accessing the internal network service of the virtual machine through the host, and the first IP address is a parameter which is transmitted to the second equipment to be tested by the test equipment by using the target software based on the service access information of the second equipment to be tested when the test equipment performs connectivity test on the first equipment to be tested and the second equipment to be tested;
the testing module 802 is configured to perform connectivity testing with a first device to be tested based on the first IP address.
Optionally, the image file in the second device under test is started by default.
Optionally, the testing module 802 may be specifically configured to execute Ping operation on the first IP address based on the image file in a preset testing environment.
Optionally, the connectivity testing apparatus may further include:
and the feedback module is used for feeding back the test result of the connectivity test to the test equipment.
By the device provided by the embodiment of the invention, when the connectivity test is performed on the first device to be tested and the second device to be tested, because the test device is provided with the target software which can directly access the internal network service of the virtual machine through the host machine, and the second device to be tested comprises the image file for the network service, the test device can directly transmit the IP address of the first device to be tested to the second device to be tested by using the target software, so that the second device to be tested can perform the connectivity test with the first device to be tested by using the IP address of the first device to be tested. In the communication direction testing process, the first device to be tested and the second device to be tested do not need to be bound with the EIP, and the method can be suitable for testing scenes that a virtual machine cannot access an external network, so that the communication tests in different testing scenes are realized.
Based on the same inventive concept, according to the connectivity testing method provided by the embodiment of the present invention, the embodiment of the present invention further provides an electronic device, which is a testing device. As shown in fig. 9, the system comprises a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902 and the memory 903 are communicated with each other through the communication bus 904;
a memory 903 for storing computer programs;
the processor 901 is configured to implement the following steps when executing the program stored in the memory 903:
when connectivity test is carried out on a first device to be tested and a second device to be tested, a first IP address of the first device to be tested and service access information of the second device to be tested are determined, wherein the second device to be tested is a virtual machine containing a mirror image file for network service;
and accessing the network service of the second equipment to be tested by using the target software based on the service access information, and transmitting the first IP address to the second equipment to be tested so that the second equipment to be tested performs connectivity test with the first equipment to be tested based on the first IP address.
Based on the same inventive concept, according to the connectivity testing method provided in the above embodiment of the present invention, an embodiment of the present invention further provides an electronic device, where the electronic device is the second device under test. As shown in fig. 10, the system comprises a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004, wherein the processor 1001, the communication interface 1002 and the memory 1003 complete communication with each other through the communication bus 1004;
a memory 1003 for storing a computer program;
the processor 1001 is configured to implement the following steps when executing the program stored in the memory 1003:
receiving a first IP address of a first device to be tested, which is transmitted by the testing device; the test equipment is provided with target software for accessing the internal network service of the virtual machine through the host, and the first IP address is a parameter which is transmitted to the second equipment to be tested by the test equipment by using the target software based on the service access information of the second equipment to be tested when the test equipment performs connectivity test on the first equipment to be tested and the second equipment to be tested;
and performing connectivity test with the first device to be tested based on the first IP address.
By the electronic equipment provided by the embodiment of the invention, when connectivity test is carried out on the first equipment to be tested and the second equipment to be tested, because the test equipment is provided with the target software which can directly access the internal network service of the virtual machine through the host machine, and the second equipment to be tested comprises the image file for the network service, the test equipment can directly transmit the IP address of the first equipment to be tested to the second equipment to be tested by using the target software, so that the second equipment to be tested can carry out connectivity test with the first equipment to be tested by using the IP address of the first equipment to be tested. In the communication direction testing process, the first device to be tested and the second device to be tested do not need to be bound with the EIP, and the method can be suitable for testing scenes that a virtual machine cannot access an external network, so that the communication tests in different testing scenes are realized.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
Based on the same inventive concept, according to the connectivity testing method provided in the above embodiments of the present invention, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the connectivity testing methods described above.
Based on the same inventive concept, according to the connectivity testing method provided by the above embodiment of the present invention, the embodiment of the present invention also provides a computer program product containing instructions, which when run on a computer, causes the computer to execute any of the connectivity testing methods in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be 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 phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for embodiments such as the apparatus, the electronic device, the computer-readable storage medium, and the computer program product, since they are substantially similar to the method embodiments, the description is simple, and for relevant points, reference may be made to part of the description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (18)

1. A connectivity test method is applied to test equipment, the test equipment is provided with target software for accessing internal network services of a virtual machine through a host, the target software is software obtained by rewriting commands in a command line uniform resource positioning system (CURL), the target software is added with an Internet Protocol (IP) address hip and a virtual network identifier (vni) of the host on the basis of the CURL, and the commands formed by the hip and the vni can access the internal network services of the virtual machine through the host, and the method comprises the following steps:
when connectivity test is carried out on a first device to be tested and a second device to be tested, a first IP address of the first device to be tested and service access information of the second device to be tested are determined, wherein the second device to be tested is a virtual machine containing a mirror image file for network service;
and based on the service access information, accessing the network service of the second device to be tested by using the target software, and transmitting the first IP address to the second device to be tested so as to enable the second device to be tested to perform connectivity test with the first device to be tested based on the first IP address.
2. The method according to claim 1, wherein the service access information includes a second IP address of a host on which the second device under test is installed and a virtual network identity, VNI;
the accessing, by using the target software, the network service of the second device under test based on the service access information and transmitting the first IP address to the second device under test includes:
and based on the second IP address and the VNI, accessing the network service of the second device to be tested through the host machine by using the target software, and transmitting the first IP address to the second device to be tested.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
and obtaining a test result of the connectivity test between the first device to be tested and the second device to be tested.
4. The method of claim 1, further comprising, before accessing the network service of the second device under test using the target software based on the service access information and communicating the first IP address to the second device under test:
respectively detecting whether the first equipment to be tested and the second equipment to be tested are started;
the accessing, by using the target software, the network service of the second device under test based on the service access information and transmitting the first IP address to the second device under test includes:
and when the first equipment to be tested and the second equipment to be tested are both started, accessing the network service of the second equipment to be tested by using the target software based on the service access information, and transmitting the first IP address to the second equipment to be tested.
5. A connectivity test method is applied to a second device under test, wherein the second device under test is a virtual machine including an image file for a network service, and the method includes:
receiving a first Internet Protocol (IP) address of a first device to be tested, which is transmitted by the testing device; the testing equipment is provided with target software for accessing the internal network service of the virtual machine through a host, the first IP address is a parameter which is transmitted to the second equipment to be tested by utilizing the target software to access the network service of the second equipment to be tested based on the service access information of the second equipment to be tested when the testing equipment performs connectivity test on the first equipment to be tested and the second equipment to be tested, the target software is software which rewrites a command in a CURL, the target software is additionally provided with hip and vni on the basis of the CURL, and the command formed by the hip and the vni can access the internal network service of the virtual machine through the host;
and performing connectivity test with the first equipment to be tested based on the first IP address.
6. The method of claim 5, wherein the image file in the second device under test is booted by default.
7. The method of claim 5, wherein performing a connectivity test with the first device under test based on the first IP address comprises:
and executing the Ping operation of an Internet packet explorer on the first IP address based on the mirror image file in a preset test environment.
8. The method according to any one of claims 5-7, further comprising:
and feeding back the test result of the connectivity test to the test equipment.
9. A connectivity testing device is applied to a testing device, the testing device is provided with target software for accessing internal network services of a virtual machine through a host, the target software is software obtained by rewriting commands in a CURL, the target software is added with hip and vni on the basis of the CURL, and the commands formed by the hip and the vni can access the internal network services of the virtual machine through the host, the connectivity testing device comprises:
the device comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining a first Internet Protocol (IP) address of a first device to be tested and service access information of a second device to be tested when connectivity test is carried out on the first device to be tested and the second device to be tested, and the second device to be tested is a virtual machine containing a mirror image file for network service;
and the access module is used for accessing the network service of the second device to be tested by utilizing the target software based on the service access information and transmitting the first IP address to the second device to be tested so as to enable the second device to be tested to perform connectivity test with the first device to be tested based on the first IP address.
10. The apparatus according to claim 9, wherein the service access information includes a second IP address of a host on which the second device under test is installed and a virtual network identity, VNI;
the access module is specifically configured to access, by using the target software, a network service of the second device to be tested through the host based on the second IP address and the VNI, and transmit the first IP address to the second device to be tested.
11. The apparatus of claim 9 or 10, further comprising:
and the obtaining module is used for obtaining a test result of the connectivity test between the first device to be tested and the second device to be tested.
12. The apparatus of claim 9, further comprising:
the detection module is used for respectively detecting whether the first equipment to be detected and the second equipment to be detected are started;
the access module is specifically configured to, when both the first device under test and the second device under test are started, access the network service of the second device under test by using the target software based on the service access information, and transmit the first IP address to the second device under test.
13. A connectivity testing apparatus, applied to a second device under test, where the second device under test is a virtual machine including an image file for a network service, the apparatus comprising:
the receiving module is used for receiving a first Internet Protocol (IP) address of a first device to be tested, which is transmitted by the testing device; the testing equipment is provided with target software for accessing the internal network service of the virtual machine through a host, the first IP address is a parameter which is transmitted to the second equipment to be tested by utilizing the target software to access the network service of the second equipment to be tested based on the service access information of the second equipment to be tested when the testing equipment performs connectivity test on the first equipment to be tested and the second equipment to be tested, the target software is software which rewrites a command in a CURL, the target software is additionally provided with hip and vni on the basis of the CURL, and the command formed by the hip and the vni can access the internal network service of the virtual machine through the host;
and the testing module is used for performing connectivity testing with the first equipment to be tested based on the first IP address.
14. The apparatus of claim 13, wherein the image file in the second dut is booted by default.
15. The apparatus of claim 13, wherein the testing module is specifically configured to perform an internet packet explorer Ping operation on the first IP address based on the image file in a preset testing environment.
16. The apparatus of any of claims 13-15, further comprising:
and the feedback module is used for feeding back the test result of the connectivity test to the test equipment.
17. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 4 or 5 to 8 when executing a program stored in the memory.
18. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method steps of any one of claims 1 to 4 or 5 to 8.
CN201911206791.2A 2019-11-29 2019-11-29 Connectivity test method, connectivity test device, electronic equipment and storage medium Active CN112887163B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911206791.2A CN112887163B (en) 2019-11-29 2019-11-29 Connectivity test method, connectivity test device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911206791.2A CN112887163B (en) 2019-11-29 2019-11-29 Connectivity test method, connectivity test device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112887163A CN112887163A (en) 2021-06-01
CN112887163B true CN112887163B (en) 2022-08-05

Family

ID=76039731

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911206791.2A Active CN112887163B (en) 2019-11-29 2019-11-29 Connectivity test method, connectivity test device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112887163B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114520778A (en) * 2022-01-13 2022-05-20 深信服科技股份有限公司 Connectivity detection method, connectivity detection device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106059853A (en) * 2016-05-26 2016-10-26 中国建设银行股份有限公司 Network connectivity test method and device
CN107329803A (en) * 2017-07-07 2017-11-07 北京金山安全管理系统技术有限公司 Virtual machine management method and device
CN107566152A (en) * 2017-06-13 2018-01-09 中国银联股份有限公司 Method and device for virtual network link detection
CN107634871A (en) * 2016-07-19 2018-01-26 北京金山云网络技术有限公司 A kind of continuity testing method, apparatus and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067220B (en) * 2012-12-19 2016-02-10 中兴通讯股份有限公司 Two-way link forwarding detection (BFD) method and device under parameter update status

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106059853A (en) * 2016-05-26 2016-10-26 中国建设银行股份有限公司 Network connectivity test method and device
CN107634871A (en) * 2016-07-19 2018-01-26 北京金山云网络技术有限公司 A kind of continuity testing method, apparatus and system
CN107566152A (en) * 2017-06-13 2018-01-09 中国银联股份有限公司 Method and device for virtual network link detection
CN107329803A (en) * 2017-07-07 2017-11-07 北京金山安全管理系统技术有限公司 Virtual machine management method and device

Also Published As

Publication number Publication date
CN112887163A (en) 2021-06-01

Similar Documents

Publication Publication Date Title
US9300594B2 (en) Preferred resource selector
CN110990205B (en) Interface call testing method, device and computer readable storage medium
US11194640B2 (en) Validation framework for runtime connected API systems
US7519004B1 (en) Loopback testing of a network interface device from a user-space software layer
US11438252B2 (en) Packet drop detection in local networking stack through packet correlation
CN109587258B (en) Service activity detection method and device
US10097442B2 (en) Methods, systems, and computer readable media for receiving test configuration information
CN109739711B (en) Interface test method, device, equipment and storage medium
CN114205342B (en) Service debugging routing method, electronic equipment and medium
WO2019184664A1 (en) Method, apparatus, and system for detecting malicious file
CN110943984B (en) Asset safety protection method and device
CN110113440B (en) Request response method, device and terminal
CN109040039A (en) A kind of leak detection method, apparatus and system
CN115643112B (en) Safety protection capability testing method and device
CN104468265A (en) Method and device for detecting online states of local area network terminals
CN112887163B (en) Connectivity test method, connectivity test device, electronic equipment and storage medium
CN112671574B (en) Front-end and back-end joint debugging method and device, proxy equipment and storage medium
CN113206850B (en) Malicious sample message information acquisition method, device, equipment and storage medium
CN114826969A (en) Network connectivity checking method, device, equipment and storage medium
US9686175B2 (en) Methods, systems, and computer readable media for testing network devices using simulated application traffic
CN112231209A (en) Parameter acquisition method and device, computer equipment and storage medium
CN115396501A (en) Information processing method and device, electronic equipment and readable storage medium
CN112448948B (en) Firewall opening result verification method, device, equipment and storage medium
CN109495330A (en) A kind of method and device realized UDP and intercept test
CN112771835A (en) Processing method and device for outer chain rewriting

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
GR01 Patent grant
GR01 Patent grant