CN115150298A - Virtual gateway testing method and device, storage medium and electronic equipment - Google Patents

Virtual gateway testing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN115150298A
CN115150298A CN202110351736.3A CN202110351736A CN115150298A CN 115150298 A CN115150298 A CN 115150298A CN 202110351736 A CN202110351736 A CN 202110351736A CN 115150298 A CN115150298 A CN 115150298A
Authority
CN
China
Prior art keywords
vgw
configuration file
test
cloud host
instance
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.)
Granted
Application number
CN202110351736.3A
Other languages
Chinese (zh)
Other versions
CN115150298B (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
Original Assignee
Beijing Kingsoft Cloud Network 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 filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202110351736.3A priority Critical patent/CN115150298B/en
Publication of CN115150298A publication Critical patent/CN115150298A/en
Application granted granted Critical
Publication of CN115150298B publication Critical patent/CN115150298B/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Landscapes

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

Abstract

The invention discloses a method and a device for testing a virtual gateway, a storage medium and electronic equipment, and belongs to the field of cloud services. Wherein, the method comprises the following steps: acquiring a configuration file of a target Virtual Gateway (VGW), wherein the target VGW runs on an online production network environment; generating a cloud host instance according to the configuration file; and issuing the configuration file in a test VGW, and testing the target VGW based on the configuration parameters of the configuration file and the cloud host instance, wherein the test VGW runs on-line test network environment. The invention solves the problem that the VGW tested by the related technology can not completely cover the configuration scene of the production environment, can find the problem caused by the configuration of bug in the production environment in the testing stage in advance, reduces the workload of manual testing, and considers the comprehensiveness and the high efficiency of the testing.

Description

Virtual gateway testing method and device, storage medium and electronic equipment
Technical Field
The invention relates to the field of cloud services, in particular to a method and a device for testing a virtual gateway, a storage medium and electronic equipment.
Background
In the related art, a VGW (Virtual Gateway/cloud Gateway) is a cloud computing node Virtual Gateway in the morning and is an important node in a cloud computing network system, functions of the VGW are similar to that of an Open vSwitch in an Open Stack, and the VGW is divided into a control plane and a data plane, wherein the control plane is responsible for issuing Virtual machine network configuration, and the data plane is responsible for forwarding data messages. The gateway mainly realizes the functions of two-layer exchange, three-layer routing, speed limitation, flow monitoring, data packet analysis and the like of a Virtual Machine (VM) in a Virtual Private network (VPC) network.
In the related technology, the configuration test scheme of the VGW manually constructs the configuration file according to the test function point, the test efficiency is low in the configuration construction process, and some configuration parameters are inconsistent with the configuration parameters used on the line, so that some problems cannot be found and the test efficiency is low.
In view of the above problems in the related art, no effective solution has been found at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for testing a virtual gateway, a storage medium and electronic equipment.
According to an aspect of an embodiment of the present invention, a method for testing a virtual gateway is provided, including: acquiring a configuration file of a target Virtual Gateway (VGW), wherein the target VGW runs on an online production network environment; generating a cloud host instance according to the configuration file; and issuing the configuration file in a test VGW, and testing the target VGW based on the configuration parameters of the configuration file and the cloud host instance, wherein the test VGW runs under an online test network environment.
Further, generating the cloud host instance according to the configuration file comprises: analyzing a plurality of Virtual Private Cloud (VPCs) in the configuration file; traversing the cloud host information under the VPCs, and generating a cloud host instance corresponding to the configuration file.
Further, parsing the number of VPCs in the configuration file comprises: analyzing the configuration file by taking the VPC as an analysis unit, and acquiring the following parameters of each VPC mounted on the target VGW: cloud host information, virtual machine VM network configuration information, speed limit intervals, security group information and Access Control Lists (ACLs).
Further, traversing the cloud host information under the plurality of VPCs, and generating a cloud host instance corresponding to the configuration file, including: traversing and reading configuration parameters of the VPCs; and generating a plurality of cloud host instances aiming at each VPC in the plurality of VPCs to obtain corresponding cloud host instances.
Further, issuing the configuration file in the test VGW includes: loading the configuration file in a test VGW; detecting whether the configuration parameters in the configuration file are successfully issued in the loaded test VGW; if the configuration parameters in the configuration file are successfully issued, determining that the configuration file is normally loaded; and if the configuration parameters in the configuration file fail to be issued, determining that the configuration file is not loaded normally.
Further, testing the target VGW based on the configuration parameters of the configuration file and the cloud host instance comprises: in the operation process of the test VGW, obtaining operation parameters of a test instance in the test VGW, wherein the test instance is a test host instance generated in the test VGW based on the configuration parameters of the configuration file, and the operation parameters include at least one of the following: cloud host information, VM network configuration information, speed limit intervals, security group information and ACL; judging whether the operation parameters are matched with the instance parameters of the cloud host instance; if the operation parameters are matched with the instance parameters of the cloud host instance, determining that the configuration file is effective in the test VGW; and if the operation parameters are not matched with the instance parameters of the cloud host instance, determining that the configuration file is not valid in the test VGW.
Further, if there are a plurality of cloud host instances, acquiring the operation parameters of the test instance in the test VGW includes: for each cloud host instance in the plurality of cloud host instances, searching a target test instance matched with the cloud host instance in a test instance list of the test VGW; and acquiring the operating parameters of the target test case.
According to another aspect of the embodiments of the present invention, there is provided a testing apparatus for a virtual gateway, including: the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a configuration file of a target virtual gateway VGW, and the target VGW runs on an online production network environment; the generating module is used for generating a cloud host instance according to the configuration file; and the testing module is used for issuing the configuration file in a testing VGW and testing the target VGW based on the configuration parameters of the configuration file and the cloud host instance, wherein the testing VGW tests the network environment under the operation on line.
Further, the generating module includes: the analysis unit is used for analyzing the virtual private cloud VPCs in the configuration file; and the generating unit is used for traversing the cloud host information under the VPCs and generating a cloud host instance corresponding to the configuration file.
Further, the parsing unit includes: an analysis subunit, configured to analyze the configuration file with the VPC as an analysis unit, and obtain the following parameters of each VPC mounted on the target VGW: cloud host information, virtual machine VM network configuration information, speed limit intervals, security group information and access control list ACL.
Further, the generation unit includes: the reading subunit is used for reading the configuration parameters of the VPCs in a traversing manner; and the generating subunit is used for generating a plurality of cloud host instances aiming at each VPC in the plurality of VPCs to obtain a corresponding cloud host instance.
Further, the test module includes: a loading unit, configured to load the configuration file in a test VGW; the detection unit is used for detecting whether the configuration parameters in the configuration file are successfully issued in the loaded test VGW; the first determining unit is used for determining that the configuration file is normally loaded if the configuration parameters in the configuration file are successfully issued; and if the configuration parameters in the configuration file fail to be issued, determining that the configuration file is not loaded normally.
Further, the test module includes: an obtaining unit, configured to obtain, during an operation process of the test VGW, operation parameters of a test instance in the test VGW, where the test instance is a test host instance generated in the test VGW based on configuration parameters of the configuration file, and the operation parameters include at least one of: cloud host information, VM network configuration information, speed limit intervals, security group information and ACL; the judging unit is used for judging whether the operation parameters are matched with the instance parameters of the cloud host instance; a second determining unit, configured to determine that the configuration file is in effect in the test VGW if the operation parameter matches an instance parameter of the cloud host instance; and if the operation parameters are not matched with the instance parameters of the cloud host instance, determining that the configuration file is not valid in the test VGW.
Further, if there are a plurality of cloud host instances, the obtaining unit includes: a searching subunit, configured to search, for each cloud host instance in the plurality of cloud host instances, a target test instance matching the cloud host instance in a test instance list of the test VGW; and the acquisition subunit is used for acquiring the operating parameters of the target test case.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium including a stored program which executes the above steps when the program is executed.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein: a memory for storing a computer program; a processor for executing the program stored in the memory to execute the steps of the 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 the steps of the above method.
According to the invention, the configuration file of the target virtual gateway VGW is obtained, the target VGW runs on an online production network environment, the cloud host instance is generated according to the configuration file, the configuration file is issued in the test VGW, and the target VGW is tested based on the configuration parameters of the configuration file and the cloud host instance, wherein the test VGW runs on the online testing network environment, the configuration scene on the line is simulated in the online testing environment based on the actual network configuration file of the cloud host instance on the online target VGW, the online environment is simulated, and the problem of the VGW in the production environment caused by the bug configuration is tested and discovered in advance. The problem that a VGW (variable geometry grid) tested by the related technology cannot completely cover a production environment configuration scene is solved, the problem caused by bug configuration in the production environment can be found in the testing stage in advance, the workload of manual testing is reduced, and the comprehensiveness and the high efficiency of the testing are both considered.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and do not limit the invention. In the drawings:
FIG. 1 is a block diagram of a hardware configuration of a computer according to an embodiment of the present invention;
fig. 2 is a flowchart of a testing method of a virtual gateway according to an embodiment of the present invention;
fig. 3 is a block diagram of a testing apparatus for a virtual gateway according to an embodiment of the present invention;
fig. 4 is a block diagram of an electronic device implementing an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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. It should be noted that the embodiments and features of the embodiments of the present invention may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
The method provided by the embodiment one of the invention can be executed in a computer, a server or similar test equipment. Taking an example of the present invention running on a computer, fig. 1 is a block diagram of a hardware structure of a computer according to an embodiment of the present invention. As shown in fig. 1, the computer may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally, a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those of ordinary skill in the art that the configuration shown in FIG. 1 is illustrative only and is not intended to limit the configuration of the computer described above. For example, a computer may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program and a module of application software, such as a computer program corresponding to a testing method of a virtual gateway in an embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to a computer through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet via wireless.
In this embodiment, a method for testing a virtual gateway is provided, and fig. 2 is a flowchart of a method for testing a virtual gateway according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, obtaining a configuration file of a target virtual gateway VGW, wherein the target VGW runs on-line production network environment;
optionally, the host may log in to an online host, and obtain the configuration file of the target VGW from the host, or obtain the configuration file of the target VGW through remote login. The online production network environment in which the target VGW operates may be an online environment on which the VGW is formally online, or an online environment before the VGW is formally online.
Step S204, generating a cloud host instance according to the configuration file;
the cloud host example of this embodiment is issued to the VPC of the target VGW through the control plane of the target VGW, and the forwarding of the data packet is realized through the data plane of the target VGW.
Step S206, issuing a configuration file in the VGW to be tested, and testing the target VGW based on the configuration parameters of the configuration file and the cloud host instance, wherein the VGW to be tested runs the online network environment;
optionally, if the test passes, a first test report of successful test is generated, and if the test fails, a second test report of failed test is generated.
Through the steps, a configuration file of a target virtual gateway VGW is obtained, the target VGW runs on an online production network environment, a cloud host instance is generated according to the configuration file, the configuration file is issued in testing the VGW, and the target VGW is tested based on configuration parameters of the configuration file and the cloud host instance, wherein the testing of the VGW runs on the online testing network environment, the configuration scene on the cable is simulated in the online testing environment based on the actual network configuration file of the cloud host instance on the online target VGW, the online environment is simulated, and the problem of the VGW in the production environment caused by the configuration bug is tested and found in advance. The problem that the VGW cannot completely cover the configuration scene of the production environment in the related technology test is solved, the problem caused by the configuration of bug in the production environment can be found in the test stage in advance, the workload of manual test is reduced, and the comprehensiveness and the high efficiency of the test are both considered.
In one implementation of the embodiments, generating the cloud host instance from the configuration file comprises:
s11, analyzing a plurality of virtual private cloud VPCs in the configuration file;
in one example, parsing a number of VPCs in a configuration file includes: analyzing the configuration file by taking the VPC as an analysis unit, and acquiring the following parameters of each VPC mounted on the target VGW: cloud host information, virtual machine VM network configuration information, speed limit intervals, security group information and access control list ACL.
The configuration file of the target VGW is read and analyzed through the automatic script, the automatic script is analyzed by taking VPC as a unit when the configuration file is analyzed, and cloud host information (such as MAC address), virtual machine network configuration information (such as subnet and IP address), speed limit interval (such as 0-1M/S), security group information (such as firewall list, account white list, application white list and the like), ACL (Access Control Lists) information under each VPC in the target VGW are obtained after analysis.
And S12, traversing the cloud host information under the VPCs, and generating a cloud host instance corresponding to the configuration file.
In an example of this embodiment, traversing the cloud host information under the VPCs to generate a cloud host instance corresponding to the configuration file includes: traversing and reading configuration parameters of a plurality of VPCs; and aiming at each VPC in the plurality of VPCs, generating a plurality of cloud host instances to obtain a corresponding cloud host instance. Wherein, one VPC corresponds to one or more cloud host instances.
In one example, 3 VPCs (VPC 1, VPC2, VPC 3) are configured in the configuration file, VPC1 mounts cloud host instance 1, VPC2 mounts cloud host instance 2 and cloud host instance 3, VPC3 mounts cloud host instance 4, cloud host instance 5 and cloud host instance 6, and 6 cloud host instances in the configuration file (cloud host instance 1, cloud host instance 2, cloud host instance 3, cloud host instance 4, cloud host instance 5, cloud host instance 6) can be generated by parsing 3 VPCs through traversal.
The VPC is a network space on an exclusive cloud based on cloud construction, provides network service for resources on the cloud, is completely logically isolated among different VPCs, can be managed in a software defined network mode, and realizes configuration management of functions such as IP addresses, subnets, routing tables, network ACLs, flow logs and the like. The embodiment takes a cloud host as an example for explanation, the cloud host setting specific parameters (calculation, storage, and network) is a cloud host instance (each cloud host instance corresponds to a tenant of a cloud service), after an analysis result is obtained, a corresponding cloud host instance configured on a line is generated by traversing the configuration on the line through an automated script, and the parameters of the cloud host instance may be but are not limited to: the fix ip (fixed ip), the MAC address, the speed limit interval, the security group information, the virtual machine network configuration information (such as vni (VXLAN network identifier, VXLAN network ID), fib (forwarding table), neighbor) of the cloud host are consistent with the configuration information in the configuration file in the target VGW.
In an embodiment of this embodiment, issuing the configuration file in the test VGW includes: loading a configuration file in a test VGW; detecting whether the configuration parameters in the configuration file are successfully issued in the loaded test VGW; if the configuration parameters in the configuration file are successfully issued, determining that the configuration file is normally loaded; and if the configuration parameters in the configuration file are failed to be issued, determining that the configuration file is not loaded normally.
In the embodiment, a newly generated configuration file is loaded to a test VGW, and after the loading is completed, the distribution result of configuration parameters in the configuration file is checked through an automatic script, so as to test whether the configuration file can be loaded normally. The issuing result comprises the following steps: the loading number of the VPCs, the number of the cloud host instances mounted by each VPC and the like, if the configuration file can analyze 6 cloud host instances, but only 5 cloud host instances can be loaded on the VGW, the configuration file cannot be loaded normally, and a test report of test failure is output.
In an embodiment of this embodiment, the configuration parameters based on the configuration file and the cloud host instance test target VGW include: in the operation process of testing the VGW, obtaining operation parameters of a test case in the VGW, wherein the test case is a test host case generated in the VGW based on the configuration parameters of the configuration file, and the operation parameters comprise at least one of the following parameters: cloud host information, VM network configuration information, speed limit intervals, security group information and ACL; judging whether the operation parameters are matched with the instance parameters of the cloud host instance; if the operation parameters are matched with the instance parameters of the cloud host instance, determining that the configuration file takes effect in the test VGW; and if the operation parameters are not matched with the instance parameters of the cloud host instance, determining that the configuration file is not effective in the test VGW.
In one implementation scenario, if there are multiple cloud host instances, acquiring the operation parameters of the test instance in the test VGW includes: for each cloud host instance in the plurality of cloud host instances, searching a target test instance matched with the cloud host instance in a test instance list of the test VGW; and acquiring the operating parameters of the target test case.
In one example, the operation parameters of 6 test cases (test case 1, test case 2, test case 3, test case 4, test case 5, and test case 6) are operated and tested in the VGW test, and whether the operation parameters (cloud host information, VM network configuration information, speed-limiting interval, security group information, ACL) of each test case are matched with the instance parameters of the cloud host instance analyzed from the configuration file, such as whether the MAC addresses of the cloud hosts are consistent, whether the network speed is within the speed-limiting interval, and the like, is respectively judged. And testing the service connectivity configured on the line by adopting the automatic script in the test VGW to determine whether the configuration file is effective.
The embodiment provides a scheme for testing an online configuration file of a VGW, which includes acquiring the configuration file of an online cloud gateway, reading and analyzing the online cloud gateway configuration file through an automatic script, analyzing the configuration file by taking a VPC as a unit when the configuration file is analyzed by the script, traversing the analysis result of the online configuration file through the automatic script after the analysis result is acquired, generating a cloud host instance corresponding to the online configuration file, loading the newly generated configuration file to the VGW used for testing, checking the configuration issuing result through the automatic script after the configuration issuing is completed, and testing the service connectivity configured on the line through the automatic script.
The scheme of the embodiment can check configuration validity of the on-line configuration command and check service connectivity of the on-line configuration, simulate a configuration scene on the outgoing line in an on-line test environment based on an actual network configuration file on the on-line computing node of the virtual machine, simulate the on-line environment as much as possible, find problems caused by configuration bug in a production environment in advance, do not need to manually construct a test case, and take account of the test comprehensiveness and high efficiency.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
In this embodiment, a testing apparatus for a virtual gateway is further provided, which is used to implement the foregoing embodiments and preferred embodiments, and the description already made is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 3 is a block diagram of a testing apparatus for a virtual gateway according to an embodiment of the present invention, as shown in fig. 3, the apparatus includes: an acquisition module 30, a generation module 32, a testing module 34, wherein,
an obtaining module 30, configured to obtain a configuration file of a target virtual gateway VGW, where the target VGW runs in an online production network environment;
a generating module 32, configured to generate a cloud host instance according to the configuration file;
the testing module 34 is configured to issue the configuration file in a test VGW, and test the target VGW based on the configuration parameters of the configuration file and the cloud host instance, where the test VGW runs on-line to test a network environment.
Optionally, the generating module includes: the analysis unit is used for analyzing the plurality of virtual private cloud VPCs in the configuration file; and the generating unit is used for traversing the cloud host information under the VPCs and generating the cloud host instance corresponding to the configuration file.
Optionally, the parsing unit includes: an analysis subunit, configured to analyze the configuration file with the VPC as an analysis unit, and obtain the following parameters of each VPC mounted on the target VGW: cloud host information, virtual machine VM network configuration information, speed limit intervals, security group information and access control list ACL.
Optionally, the generating unit includes: the reading subunit is used for reading the configuration parameters of the VPCs in a traversing manner; and the generation subunit is used for generating a plurality of cloud host instances for each VPC in the plurality of VPCs to obtain corresponding cloud host instances.
Optionally, the test module includes: a loading unit, configured to load the configuration file in a test VGW; the detection unit is used for detecting whether the configuration parameters in the configuration file are successfully issued in the loaded test VGW; the first determining unit is used for determining that the configuration file is normally loaded if the configuration parameters in the configuration file are successfully issued; and if the configuration parameters in the configuration file fail to be issued, determining that the configuration file is not loaded normally.
Optionally, the test module includes: an obtaining unit, configured to obtain, during an operation process of the test VGW, operation parameters of a test instance in the test VGW, where the test instance is a test host instance generated in the test VGW based on configuration parameters of the configuration file, and the operation parameters include at least one of: cloud host information, VM network configuration information, speed limit intervals, security group information and ACL; the judging unit is used for judging whether the operation parameters are matched with the instance parameters of the cloud host instance; a second determining unit, configured to determine that the configuration file is in effect in the test VGW if the operation parameter matches an instance parameter of the cloud host instance; and if the operation parameters are not matched with the instance parameters of the cloud host instance, determining that the configuration file is not valid in the test VGW.
Optionally, if there are multiple cloud host instances, the obtaining unit includes: a searching subunit, configured to search, for each cloud host instance in the plurality of cloud host instances, a target test instance matching the cloud host instance in a test instance list of the test VGW; and the acquisition subunit is used for acquiring the operating parameters of the target test case.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are located in different processors in any combination.
Example 3
Fig. 4 is a structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 4, the electronic device includes a processor 41, a communication interface 42, a memory 43, and a communication bus 44, where the processor 41, the communication interface 42, and the memory 43 complete mutual communication through the communication bus 44, and the memory 43 is used for storing a computer program; the processor 41, when executing the program stored in the memory 43, implements the following steps: acquiring a configuration file of a target Virtual Gateway (VGW), wherein the target VGW runs in an online production network environment; generating a cloud host instance according to the configuration file; and issuing the configuration file in a test VGW, and testing the target VGW based on the configuration parameters of the configuration file and the cloud host instance, wherein the test VGW runs on-line test network environment.
Further, generating the cloud host instance according to the configuration file comprises: analyzing a plurality of Virtual Private Cloud (VPCs) in the configuration file; traversing the cloud host information under the VPCs, and generating a cloud host instance corresponding to the configuration file.
Further, parsing the number of VPCs in the configuration file comprises: analyzing the configuration file by taking the VPC as an analysis unit, and acquiring the following parameters of each VPC mounted on the target VGW: cloud host information, virtual machine VM network configuration information, speed limit intervals, security group information and access control list ACL.
Further, traversing the cloud host information under the plurality of VPCs, and generating a cloud host instance corresponding to the configuration file, including: traversing and reading configuration parameters of the VPCs; and generating a plurality of cloud host instances aiming at each VPC in the plurality of VPCs to obtain a corresponding cloud host instance.
Further, issuing the configuration file in the test VGW includes: loading the configuration file in a test VGW; detecting whether the configuration parameters in the configuration file are successfully issued in the loaded test VGW; if the configuration parameters in the configuration file are successfully issued, determining that the configuration file is normally loaded; and if the configuration parameters in the configuration file are failed to be issued, determining that the configuration file is not loaded normally.
Further, testing the target VGW based on the configuration parameters of the configuration file and the cloud host instance comprises: in the operation process of the test VGW, obtaining operation parameters of a test instance in the test VGW, wherein the test instance is a test host instance generated in the test VGW based on the configuration parameters of the configuration file, and the operation parameters include at least one of the following: cloud host information, VM network configuration information, speed limit intervals, security group information and ACL; judging whether the operation parameters are matched with the instance parameters of the cloud host instance; if the operation parameters are matched with the instance parameters of the cloud host instance, determining that the configuration file is effective in the test VGW; and if the operation parameters are not matched with the instance parameters of the cloud host instance, determining that the configuration file is not valid in the test VGW.
Further, if there are a plurality of cloud host instances, acquiring the operation parameters of the test instance in the test VGW includes: for each cloud host instance in the plurality of cloud host instances, searching a target test instance matched with the cloud host instance in a test instance list of the test VGW; and acquiring the operating parameters of the target test case.
The communication bus mentioned in the above terminal 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 terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), 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, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In another embodiment provided by the present application, there is further provided a computer-readable storage medium, having stored therein instructions, which when run on a computer, cause the computer to execute the method for testing a virtual gateway described in any of the above embodiments.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method for testing a virtual gateway as described in any of the above embodiments.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, it 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 application 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.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.
The previous description is only an example of the present application, and is provided to enable any person skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for testing a virtual gateway is characterized by comprising the following steps:
acquiring a configuration file of a target Virtual Gateway (VGW), wherein the target VGW runs on an online production network environment;
generating a cloud host instance according to the configuration file;
and issuing the configuration file in a test VGW, and testing the target VGW based on the configuration parameters of the configuration file and the cloud host instance, wherein the test VGW runs on-line test network environment.
2. The method of claim 1, wherein generating a cloud host instance from the configuration file comprises:
analyzing a plurality of Virtual Private Cloud (VPCs) in the configuration file;
traversing the cloud host information under the VPCs, and generating a cloud host instance corresponding to the configuration file.
3. The method of claim 2, wherein parsing the number of VPCs in the configuration file comprises:
analyzing the configuration file by taking the VPC as an analysis unit, and acquiring the following parameters of each VPC mounted on the target VGW: cloud host information, virtual machine VM network configuration information, speed limit intervals, security group information and Access Control Lists (ACLs).
4. The method of claim 2, wherein traversing the cloud host information under the number of VPCs to generate the cloud host instance corresponding to the configuration file comprises:
traversing and reading configuration parameters of the VPCs;
and generating a plurality of cloud host instances aiming at each VPC in the plurality of VPCs to obtain corresponding cloud host instances.
5. The method of claim 1, wherein issuing the configuration file in testing VGW comprises:
loading the configuration file in a test VGW;
detecting whether the configuration parameters in the configuration file are successfully issued in the loaded test VGW;
if the configuration parameters in the configuration file are successfully issued, determining that the configuration file is normally loaded; and if the configuration parameters in the configuration file fail to be issued, determining that the configuration file is not loaded normally.
6. The method of claim 1, wherein testing the target VGW based on the configuration parameters of the configuration file and the cloud host instance comprises:
in the operation process of the test VGW, obtaining operation parameters of a test instance in the test VGW, wherein the test instance is a test host instance generated in the test VGW based on the configuration parameters of the configuration file, and the operation parameters comprise at least one of the following parameters: cloud host information, VM network configuration information, speed limit intervals, security group information and ACL;
judging whether the operation parameters are matched with the instance parameters of the cloud host instance;
if the operation parameters are matched with the instance parameters of the cloud host instance, determining that the configuration file is effective in the test VGW; and if the operation parameters are not matched with the instance parameters of the cloud host instance, determining that the configuration file is not valid in the test VGW.
7. The method of claim 6, wherein if there are multiple cloud host instances, obtaining operating parameters of test instances in the test VGW comprises:
for each cloud host instance in the plurality of cloud host instances, searching a target test instance matched with the cloud host instance in a test instance list of the test VGW;
and acquiring the operating parameters of the target test case.
8. A testing apparatus for a virtual gateway, comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a configuration file of a target virtual gateway VGW, and the target VGW runs on an online production network environment;
the generating module is used for generating a cloud host instance according to the configuration file;
and the testing module is used for issuing the configuration file in a testing VGW and testing the target VGW based on the configuration parameters of the configuration file and the cloud host instance, wherein the testing VGW tests a network environment under an online operation.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program is operative to perform the method steps of any of the preceding claims 1 to 7.
10. An electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus; wherein:
a memory for storing a computer program;
a processor for performing the method steps of any one of claims 1 to 7 by executing a program stored on a memory.
CN202110351736.3A 2021-03-31 2021-03-31 Virtual gateway testing method and device, storage medium and electronic equipment Active CN115150298B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110351736.3A CN115150298B (en) 2021-03-31 2021-03-31 Virtual gateway testing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110351736.3A CN115150298B (en) 2021-03-31 2021-03-31 Virtual gateway testing method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN115150298A true CN115150298A (en) 2022-10-04
CN115150298B CN115150298B (en) 2023-11-03

Family

ID=83403493

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110351736.3A Active CN115150298B (en) 2021-03-31 2021-03-31 Virtual gateway testing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN115150298B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571474A (en) * 2010-12-30 2012-07-11 北京首信科技股份有限公司 Virtualized Radius testing system and method
US20170064042A1 (en) * 2015-08-31 2017-03-02 Ayla Networks, Inc. Management of gateway device using virtual gateway device
CN107517119A (en) * 2016-06-17 2017-12-26 阿里巴巴集团控股有限公司 Virtual network detection method and device under VPC environment
CN108255720A (en) * 2018-01-12 2018-07-06 中国计量大学 Software automatic test system based on cloud computing framework
CN108563572A (en) * 2018-04-13 2018-09-21 唐山新质点科技有限公司 A kind of regression testing method, device and server
CN108694116A (en) * 2017-04-10 2018-10-23 北京金山云网络技术有限公司 A kind of network stabilization test method of VPC clusters, apparatus and system
US10310966B1 (en) * 2017-06-01 2019-06-04 Amazon Technologies, Inc. Automatic test stack creation via production system replication
CN110058920A (en) * 2019-03-04 2019-07-26 平安科技(深圳)有限公司 Virtual machine performance detection method and device, electronic equipment, storage medium
CN110198229A (en) * 2018-04-19 2019-09-03 腾讯科技(深圳)有限公司 Network collocating method and device, storage medium and electronic device
CN111008146A (en) * 2019-12-19 2020-04-14 北京首信科技股份有限公司 Method and system for testing safety of cloud host
CN111124597A (en) * 2019-10-12 2020-05-08 苏州浪潮智能科技有限公司 Method, equipment and medium for positioning fault item in Vtermination test
CN111277457A (en) * 2020-01-15 2020-06-12 平安银行股份有限公司 Method, device and equipment for switching network environment and readable storage medium
CN111813495A (en) * 2020-06-12 2020-10-23 北京金山云网络技术有限公司 Node testing method and device, storage medium and electronic device
CN112099902A (en) * 2020-08-17 2020-12-18 杭州安恒信息安全技术有限公司 Network adapter configuration method and device of virtual machine, electronic device and storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571474A (en) * 2010-12-30 2012-07-11 北京首信科技股份有限公司 Virtualized Radius testing system and method
US20170064042A1 (en) * 2015-08-31 2017-03-02 Ayla Networks, Inc. Management of gateway device using virtual gateway device
CN107517119A (en) * 2016-06-17 2017-12-26 阿里巴巴集团控股有限公司 Virtual network detection method and device under VPC environment
CN108694116A (en) * 2017-04-10 2018-10-23 北京金山云网络技术有限公司 A kind of network stabilization test method of VPC clusters, apparatus and system
US10310966B1 (en) * 2017-06-01 2019-06-04 Amazon Technologies, Inc. Automatic test stack creation via production system replication
CN108255720A (en) * 2018-01-12 2018-07-06 中国计量大学 Software automatic test system based on cloud computing framework
CN108563572A (en) * 2018-04-13 2018-09-21 唐山新质点科技有限公司 A kind of regression testing method, device and server
CN110198229A (en) * 2018-04-19 2019-09-03 腾讯科技(深圳)有限公司 Network collocating method and device, storage medium and electronic device
CN110058920A (en) * 2019-03-04 2019-07-26 平安科技(深圳)有限公司 Virtual machine performance detection method and device, electronic equipment, storage medium
CN111124597A (en) * 2019-10-12 2020-05-08 苏州浪潮智能科技有限公司 Method, equipment and medium for positioning fault item in Vtermination test
CN111008146A (en) * 2019-12-19 2020-04-14 北京首信科技股份有限公司 Method and system for testing safety of cloud host
CN111277457A (en) * 2020-01-15 2020-06-12 平安银行股份有限公司 Method, device and equipment for switching network environment and readable storage medium
CN111813495A (en) * 2020-06-12 2020-10-23 北京金山云网络技术有限公司 Node testing method and device, storage medium and electronic device
CN112099902A (en) * 2020-08-17 2020-12-18 杭州安恒信息安全技术有限公司 Network adapter configuration method and device of virtual machine, electronic device and storage medium

Also Published As

Publication number Publication date
CN115150298B (en) 2023-11-03

Similar Documents

Publication Publication Date Title
CN109194617B (en) Automatic parsing and packaging method and device for XML (extensive markup language) message
CN111431758B (en) Cloud network equipment testing method and device, storage medium and computer equipment
CN110943984B (en) Asset safety protection method and device
CN109491889B (en) Method and device for automatic test in NFV
CN109683997B (en) Method for accessing application program interface through sandbox, sandbox and sandbox equipment
CN105141449A (en) Addition method and device for monitoring configuration
CN112995163B (en) Authentication method and device for resource access, storage medium and electronic equipment
CN112751733A (en) Link detection method, device, equipment, system and switch
CN105577799A (en) Method and device for detecting fault of database cluster
CN109151075B (en) Log processing method and device and electronic equipment
CN110601915A (en) Method and device for testing gateway device
CN114338068A (en) Multi-node vulnerability scanning method and device, electronic equipment and storage medium
CN113038499B (en) Terminal Wi-Fi compatibility testing method, device, system, equipment and medium
CN106067879A (en) The detection method of information and device
CN114153668A (en) Automatic testing method and device, electronic equipment and storage medium
CN115150298B (en) Virtual gateway testing method and device, storage medium and electronic equipment
CN112637377A (en) Method and equipment for detecting IP address conflict
CN109039823B (en) Network system firewall detection method, device, equipment and storage medium
CN116436790A (en) Scene target drone network topology detection method and system in network target range
CN114244555B (en) Security policy adjusting method
CN111082860A (en) Testing method, server, system and storage medium of optical distribution node
CN110611678B (en) Method for identifying message and access network equipment
CN115037664B (en) Network connection testing method and device, repeater and storage medium
US20230208705A1 (en) Method and system for analysing virtual network health, and network device
CN114221808B (en) Security policy deployment method and device, computer equipment and readable storage 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
GR01 Patent grant
GR01 Patent grant