CN106470136B - Platform test method and platform test system - Google Patents

Platform test method and platform test system Download PDF

Info

Publication number
CN106470136B
CN106470136B CN201510520387.8A CN201510520387A CN106470136B CN 106470136 B CN106470136 B CN 106470136B CN 201510520387 A CN201510520387 A CN 201510520387A CN 106470136 B CN106470136 B CN 106470136B
Authority
CN
China
Prior art keywords
server
simulation
reply message
test
captured
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
CN201510520387.8A
Other languages
Chinese (zh)
Other versions
CN106470136A (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.)
Tencent Technology Beijing Co Ltd
Original Assignee
Tencent Technology Beijing 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 Tencent Technology Beijing Co Ltd filed Critical Tencent Technology Beijing Co Ltd
Priority to CN201510520387.8A priority Critical patent/CN106470136B/en
Publication of CN106470136A publication Critical patent/CN106470136A/en
Application granted granted Critical
Publication of CN106470136B publication Critical patent/CN106470136B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a platform testing method, which comprises the following steps: an online server captures a flow packet generated in the actual operation of a platform and sends the captured flow packet to a simulation server; the simulation server establishes session connection with a test server in a test environment and sends the flow packet to the test server through the session connection; the test server generates a reply message and feeds the reply message back to the simulation server; and the simulation server receives the reply message fed back by the test server. The invention also discloses a platform test system, which can deliver the simulation TCP session logic to a simulation server deployed in a test environment for execution and simulate a user in the test environment so as to avoid executing the simulation TCP session logic on the online server and reduce the influence on the online server.

Description

Platform test method and platform test system
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a platform test method and a platform test system.
Background
Tcpcopy is a copy-on-demand tool that captures TCP (transmission-Control Protocol) traffic from the production environment and sends the real traffic to the test server in the test environment, which has been widely used by simulating a near-real environment to make the test server misunderstand that it is interacting with a real user. However, in the conventional Tcpcopy, a simulated TCP session logic is executed on an online server in a production environment, for example, a traffic packet is directly sent from the online server in the production environment to a test server, and a user is simulated in the production environment, so that the Tcpcopy and the online server compete for CPU and memory resources, thereby affecting the online server.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a platform test method and a platform test system, aiming at submitting simulated TCP session logic to a simulated server deployed in a test environment for execution and simulating a user in the test environment so as to avoid executing the simulated TCP session logic on an online server and reduce the influence on the online server.
In order to achieve the above object, the present invention provides a platform testing method, which comprises the following steps:
an online server captures a flow packet generated in the actual operation of a platform and sends the captured flow packet to a simulation server;
the simulation server establishes session connection with a test server in a test environment and sends the flow packet to the test server through the session connection;
the test server generates a reply message and feeds the reply message back to the simulation server;
and the simulation server receives the reply message fed back by the test server.
In addition, to achieve the above object, the present invention also provides a platform test system, including:
the online server is used for capturing a flow packet generated in the actual operation of the platform and sending the captured flow packet to the simulation server;
the simulation server is used for establishing session connection with the test server in a test environment and sending the flow packet to the test server through the session connection;
the test server is used for generating a reply message and feeding the reply message back to the simulation server;
the simulation server is further configured to receive the reply message fed back by the test server.
According to the platform test method and the platform test system provided by the invention, the flow packet generated in the actual operation of the platform is captured through the online server, the captured flow packet is sent to the simulation server, the simulation server establishes session connection with the test server in a test environment, the flow packet is sent to the test server through the session connection, the test server generates a reply message and feeds the reply message back to the simulation server, and the simulation server receives the reply message fed back by the test server. Therefore, the simulated TCP session logic is delivered to a simulation server deployed in the test environment to be executed, and the user is simulated in the test environment, so that the simulated TCP session logic is prevented from being executed on the online server, and the influence on the online server is reduced.
Drawings
FIG. 1 is a functional block diagram of a platform test system according to a first embodiment of the present invention;
FIG. 2 is a block diagram of a first embodiment of a system according to an embodiment of the present invention;
FIG. 3 is a block diagram of a second embodiment of a system according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a detailed functional block of the on-line server of FIG. 1;
FIG. 5 is a schematic diagram of a detailed functional module of the first embodiment of the test server in FIG. 1;
FIG. 6 is a schematic diagram of a detailed functional module of a first embodiment of the simulation server of FIG. 1;
FIG. 7 is a schematic diagram of a detailed functional module of a second embodiment of the test server in FIG. 1;
FIG. 8 is a functional block diagram of a platform test system according to a second embodiment of the present invention;
FIG. 9 is a schematic diagram of a detailed functional module of a second embodiment of the simulation server of FIG. 1;
FIG. 10 is a schematic diagram of a detailed functional module of the target simulation server in FIG. 9;
FIG. 11 is a flowchart illustrating a first exemplary embodiment of a platform testing method according to the present invention;
FIG. 12 is a schematic diagram illustrating a detailed flow of the step in FIG. 11 in which the online server captures a traffic packet in the production environment and sends the captured traffic packet to the simulation server;
FIG. 13 is a flowchart illustrating a second exemplary embodiment of a platform testing method according to the present invention;
fig. 14 is a schematic detailed flowchart of the first embodiment in which the test server feeds back the reply message to the simulation server in the steps in fig. 11 or fig. 13;
FIG. 15 is a flowchart illustrating a third exemplary embodiment of a platform testing method according to the present invention;
fig. 16 is a schematic detailed flowchart of a second embodiment in which the test server feeds back the reply message to the simulation server in the steps in fig. 11 or fig. 13;
fig. 17 is a schematic flowchart illustrating a detailed process of the target simulation server in fig. 16 forwarding the reply packet to other simulation servers in the n simulation servers.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The core idea of the scheme of the embodiment of the invention is as follows: the method comprises the steps that a flow packet generated in actual operation of a platform is captured through an online server, the captured flow packet is sent to a simulation server, the simulation server establishes session connection with a test server in a test environment, the flow packet is sent to the test server through the session connection, the test server generates a reply message and feeds the reply message back to the simulation server, and the simulation server receives the reply message fed back by the test server. Therefore, the simulated TCP session logic is delivered to a simulation server deployed in the test environment to be executed, and the user is simulated in the test environment, so that the simulated TCP session logic is prevented from being executed on the online server, and the influence on the online server is reduced.
The present invention provides a platform test system 1, and referring to fig. 1, in an embodiment, the platform test system 1 includes:
the online server 10 is used for capturing a flow packet generated in the actual operation of the platform and sending the captured flow packet to the simulation server;
in this embodiment, the online server 10 is a background server providing a platform service for an application, and may be connected to the simulation server through a wired or wireless network. The simulation server is connected with the test server through a wired or wireless network. The simulation server and the test server may be in the same network segment or in different network segments, which is not limited in this embodiment. It can be understood that, referring to fig. 2 and 3, there may be one or more simulation servers, and specifically, the simulation servers may be reasonably arranged according to actual needs, and referring to fig. 3, when there are more simulation servers, the simulation servers may be connected in pairs. In the preferred embodiment, the platform is an advertisement platform, and in other embodiments, the platform may also be other application platforms, and may be set reasonably according to actual needs.
In this embodiment, the traffic packet is a request sent by the user to the online server 10 in actual operation of the platform, and the online server 10 sends real traffic data to the simulation server by capturing the traffic packet in the production environment, so that the simulation server can simulate the user in the test environment after obtaining the traffic packets, thereby avoiding executing a simulated TCP session logic on the online server 10, and reducing the influence on the online server 10.
The simulation server 20 is used for establishing session connection with the test server in the test environment and sending the flow packet to the test server through the session connection;
in this embodiment, the simulation server 20 establishes a TCP (Transmission Control Protocol) session connection with the test server in the test environment, and simulates a user request through the TCP session connection, so that the test server assumes that the test server is interacting with a real user, thereby reducing the processing load of the online server 10 and ensuring that the online server 10 can better respond to the user request of the real user.
After the online server 10 receives the user request, the simulation server 20 may establish a session connection with the test server, for example, the simulation server 20 may establish a TCP session with the test server, and send the user request to the test server through the established session connection. Specifically, the simulation server 20 may establish a session connection with the test server through the address and the port of the test server set in the command line, or may establish a session connection with the test server through the address and the port of the test server set in the configuration file, which is not limited in this embodiment.
Before the simulation server 20 establishes a session connection with the test server, the simulation server 20 may perform the following steps: it is detected whether all traffic packets belonging to the same TCP session forwarded by the online server 10 are received. All traffic packets belonging to the same TCP session refer to all traffic packets sent by the client and received by the online server 10. After receiving all traffic packets Of a TCP session, the session connection with the test server is established, and the real user starts to be simulated (i.e. the traffic packet is forwarded to the test server), so that the problem that the test server is attacked by DOS (Denial Of Service) because the test server waits for a traffic packet that can never arrive due to packet loss in the process Of forwarding the traffic packet to the simulation server 20 by the online server 10 is avoided.
The test server 30 is configured to generate a reply message and feed back the reply message to the simulation server 20;
the simulation server 20 is further configured to receive the reply message fed back by the test server 30.
In this embodiment, when the test server 30 successfully receives the traffic packet, it generates a reply message ACK (Acknowledgement), and the simulation server 20 receives the reply message fed back by the test server 30, and may discard the reply message after receiving the reply message. In this way, the reply packet is prevented from being forwarded to the external network, thereby avoiding an interruption of the TCP session between the simulation server 20 and the test server 30.
The platform test system 1 provided by the invention sends the captured flow packet to the simulation server 20 through the flow packet generated in the actual operation of the on-line server 10 platform, the simulation server 20 establishes a session connection with the test server 30 in a test environment and sends the flow packet to the test server 30 through the session connection, the test server 30 generates a reply message and feeds the reply message back to the simulation server 20, and the simulation server 20 receives the reply message fed back by the test server 30. In this way, the impact on the online server 10 is reduced by handing the simulated TCP session logic to the simulation server 20 deployed in the test environment to execute and simulating the user in the test environment to avoid executing the simulated TCP session logic on the online server 10.
In an embodiment, referring to fig. 4, on the basis of the above-mentioned embodiment of fig. 1, the online server 10 includes:
the first grabbing module 101 is used for grabbing the traffic packet in the production environment through a tcpdump instruction;
the first sending module 102 is configured to send the captured traffic packet to the simulation server 20 pointed to by the preset address information in a byte stream format through a netcat instruction.
In the preferred embodiment, the tcpdump command and the netcat command are a packet capture tool, which is a tool for network analysis and problem elimination in the Linux system, and can completely intercept the "header" of a packet transmitted in the network to provide analysis, support filtering for network layers, protocols, hosts, networks or ports, and provide logical statements such as and, or, not, etc. to help remove useless information. The netcat command is the "swiss saber" in the network, and can establish almost all types of network connections by reading and writing data via TCP or UDP protocols. Specifically, the following may be mentioned: tcpdump-i and dst port 80-s 0-w- | netcat 192.168.1.2001993. The preset address information may include a server address of the simulation server 20 and a port number of the listening port. Alternatively, the preset address information may be address information set in a command parameter of the tcpdump command, for example, for the command netcat 192.168.1.2001993, the online server 10 may know that the server address of the simulation server 20 is 192.168.1.200, and the port number of the listening port for listening to the information sent by the online server 10 is 1993. It is understood that the preferred embodiment uses standard Unix tools, and is not limited to tcpdump command and netcat command in the present embodiment.
Specifically, when the online server 10 sends a user request to the simulation server 20 in a byte stream format, the simulation server 20 may receive a traffic packet in the byte stream format accordingly. Thereafter, the simulation server 20 may screen the byte stream for user requests by examining the IP check value and the TCP check value.
In an embodiment, referring to fig. 5, on the basis of the above-mentioned embodiment of fig. 1 or fig. 4, the simulation server 20 and the test server 30 are in the same network segment, and the test server 30 includes:
the first feedback module 301 is configured to feed back the reply packet to the simulation server 20 according to first routing information, where the first routing information is information pointing to the simulation server 20.
In this embodiment, when the simulation server 20 and the test server 30 are in the same network segment, the reply message fed back by the test server 30 is sent to the simulation server 20 in a routing manner. If the address of the simulation server 20 preset in the first routing information is 192.168.1.200, after the test server 30 generates the reply message, the test server 30 may feed back the reply message to the simulation server 20 pointed to by 192.168.1.200 in the first routing information.
In an embodiment, referring to fig. 6, on the basis of the above-mentioned embodiment of fig. 1, the simulation server 20 includes:
a discarding module 201, configured to discard the reply packet.
Specifically, if the simulation server 20 forwards the reply packet to the external network after receiving the reply packet, the test server 30 may receive a RESET packet fed back from the external network, and after the test server 30 receives the RESET packet, the test server 30 disconnects the TCP session with the simulation server 20, that is, the communication between the test server 30 and the simulation server 20 cannot continue. In this way, the simulation server 20 in this embodiment avoids the TCP session interruption problem between the test server 30 and the simulation server 20 by discarding the received reply message.
In an embodiment, referring to fig. 7, based on the above-mentioned embodiment of fig. 1 or fig. 4, the simulation server 20 and the test server 30 are in different network segments, and the test server 30 includes:
a second capture module 302, configured to capture the reply packet through a tcpdump instruction in a TCP manner;
a second sending module 303, configured to send the captured reply packet to the monitoring port of the analog server 20 across network segments through a netcat instruction.
In this embodiment, when the simulation server 20 and the test server 30 are in different network segments, the reply packet fed back by the test server 30 cannot be sent to the simulation server 20 in a routing manner, at this time, a tcpdump instruction is used to capture the reply packet at the test server 30 in a TCP manner, and then a netcat instruction is used to send the captured reply packet to the monitoring port 1992 of the simulation server 20 across network segments. In this case, the main _ sniff _ method of the configuration file of the simulation server 20 needs to be set to TCP.
It should be added that the simulation server 20 may be provided with a configuration file, which is used for configuring the simulation server 20 to actively close the TCP session connection with the test server 30, or configuring the simulation server 20 to passively close the TCP session connection with the test server 30. After the TCP session between the simulation server 20 and the test server 30 is over, the simulation server 20 may actively close or passively close the TCP session connection with the test server 30 according to the configuration in the configuration file.
In an embodiment, referring to fig. 8, based on the above embodiment of fig. 1, the platform testing system 1 further includes a preset server 40, and the testing server 30 further includes a second feedback module 303:
the second feedback module 303 is configured to feed back the reply packet to the preset server 40 according to a preset packet reply mechanism and the second routing information;
the preset server 40 is configured to discard the reply message when receiving the reply message fed back by the test server 30 according to a preset message reply mechanism and second routing information to the preset server 40, where the second routing information is information pointing to the preset server 40, and the preset server 40 is a server in the same network segment as the test server 30.
In this embodiment, the test server 30 does not need to set routing information for directing to the simulation server 20, and further routes the reply message to the simulation server 20. However, according to the rule of the message reply mechanism, the test server 30 still needs to reply the reply message to a machine which is located in the same network segment as the test server 30 and has no routing function, that is, the test server 30 still needs to set the second routing information for pointing to the preset server 40 located in the same network segment as the test server 30, and reply the reply message to the preset server 40 according to the second routing information. For the same reason as the simulation server 20 discards the reply message in the above embodiment, after the preset server 40 receives the reply message, the preset server 40 may also discard the reply message. Of course, the reply mechanism of the test server 30 may be changed so that the test server 30 does not send the reply message to other machines in the same network segment, and at this time, after the test server 30 feeds the reply message back to the simulation server 20, the test server 30 may directly discard the reply message.
In an embodiment, referring to FIG. 9, on the basis of the above-mentioned embodiment of FIG. 1 or FIG. 8, the number of the simulation servers 20 is n, where n ≧ 2; the simulation server 20 includes:
the target simulation server 21 is configured to receive the reply message fed back by the test server 30;
and the other simulation server 22 is configured to receive the reply message forwarded by the target simulation server 21.
In this embodiment, when the simulation server 20 and the test server 30 are in the same network segment, the test server 30 may feed back a reply message to the target simulation server 21 of the n simulation servers 20 according to the first routing information; when the simulation server 20 and the test server 30 are in different network segments, the test server 30 captures the generated reply message through a tcpdump instruction, and sends the reply message to the target simulation server 21 of the n simulation servers 20 through a netcat instruction, and then the target simulation server 21 forwards the reply message to the other simulation servers 22 of the n simulation servers 20.
In an embodiment, referring to fig. 10, in addition to the above-mentioned embodiment of fig. 9, the target simulation server 21 is an i-th simulation server of the n simulation servers, where a starting value of i is 1, and the target simulation server 21 includes:
the first forwarding module 211 is configured to write the reply message into a preset file, read the reply message in the preset file through a read instruction, and forward the reply message to an (i + 1) th simulation server in the n simulation servers through a netcat instruction;
in this embodiment, for example, two adjacent simulation servers 20 in the n simulation servers 20 are supported by a named pipe/tmp/horos. fifo, after the ith simulation server 20 receives the reply message, the ith simulation server 20 may write the reply message into the/tmp/horos. fifo, read the reply message stored in the/tmp/horos. fifo by using the cat instruction in the standard UNIX tool, and then send the read reply message to the (i + 1) th simulation server 20 by using the netcat instruction. Accordingly, the (i + 1) th simulation server 20 may receive the reply message forwarded by the (i) th simulation server 20.
The second forwarding module 212 is configured to, when i +1< n, write the reply packet into the preset file, read the reply packet in the preset file through a read instruction, and forward the reply packet to the nth simulation server 20 through a netcat instruction.
In this embodiment, by performing the steps basically the same as those described above, it can be ensured that each simulation server 20 can receive the reply message fed back by the test server 30.
Based on the hardware architecture, the embodiment of the platform testing method is provided.
The present invention further provides a platform testing method, referring to fig. 11, in an embodiment, the platform testing method includes the following steps:
step S10, the online server 10 captures a traffic packet generated during actual operation of the platform, and sends the captured traffic packet to the simulation server 20;
in this embodiment, the online server 10 is a background server providing a platform service for an application, and may be connected to the simulation server 20 through a wired or wireless network. The simulation server 20 is connected to the test server 30 through a wired or wireless network. The simulation server 20 and the test server 30 may be located in the same network segment or in different network segments, which is not limited in this embodiment. It should be understood that, referring to fig. 2 and fig. 3, there may be one or more simulation servers 20, and specifically, the simulation servers 20 may be reasonably arranged according to actual needs, and referring to fig. 3, when there are more simulation servers 20, each simulation server 20 may be connected to another simulation server. In the preferred embodiment, the platform is an advertisement platform, and in other embodiments, the platform may also be other application platforms, and may be set reasonably according to actual needs.
In this embodiment, the traffic packet is a request sent by the user to the online server 10 in actual operation of the platform, and the online server 10 sends real traffic data to the simulation server 20 by capturing the traffic packet in the production environment, so that the simulation server 20 can simulate the user in the test environment after obtaining the traffic packets, thereby avoiding executing a simulated TCP session logic on the online server 10, and reducing the influence on the online server 10.
Step S20, the simulation server 20 establishes a session connection with the test server 30 in the test environment, and sends the traffic packet to the test server 30 through the session connection;
in this embodiment, the simulation server 20 establishes a TCP (Transmission Control Protocol) session connection with the test server 30 in the test environment, and simulates a user request through the TCP session connection, so that the test server 30 interacts with a real user as it is, thereby reducing the processing load of the on-line server 10 and ensuring that the on-line server 10 can better respond to the user request of the real user.
After the online server 10 receives the user request, the simulation server 20 may establish a session connection with the test server 30, for example, the simulation server 20 may establish a TCP session with the test server 30, and send the user request to the test server 30 through the established session connection. Specifically, the simulation server 20 may establish a session connection with the test server 30 through the address and the port of the test server 30 set in the command line, or may establish a session connection with the test server 30 through the address and the port of the test server 30 set in the configuration file, which is not limited in this embodiment.
Before the simulation server 20 establishes a session connection with the test server 30, the simulation server 20 may perform the following steps: it is detected whether all traffic packets belonging to the same TCP session forwarded by the online server 10 are received. All traffic packets belonging to the same TCP session refer to all traffic packets sent by the client and received by the online server 10. After receiving all traffic packets Of a TCP session, the session connection with the test server 30 is established, and the real user starts to be simulated (i.e. the traffic packet is forwarded to the test server 30), so that the problem that the test server 30 is attacked by DOS (Denial Of Service attack) because the test server 30 waits for a traffic packet that can never arrive due to packet loss in the process that the online server 10 forwards the traffic packet to the simulation server 20 is avoided.
Step S30, the test server 30 generates a reply message, and feeds back the reply message to the simulation server 20;
in step S40, the simulation server 20 receives the reply message fed back by the test server 30.
In this embodiment, when the test server 30 successfully receives the traffic packet, it generates a reply message ACK (Acknowledgement), and the simulation server 20 receives the reply message fed back by the test server 30, and may discard the reply message after receiving the reply message. In this way, the reply packet is prevented from being forwarded to the external network, thereby avoiding an interruption of the TCP session between the simulation server 20 and the test server 30.
According to the platform test method provided by the invention, a flow packet generated in the actual operation of a platform is captured through an online server 10, the captured flow packet is sent to a simulation server 20, the simulation server 20 establishes session connection with a test server 30 in a test environment, the flow packet is sent to the test server 30 through the session connection, the test server 30 generates a reply message and feeds the reply message back to the simulation server 20, and the simulation server 20 receives the reply message fed back by the test server 30. In this way, the simulated TCP session logic is handed to the simulation server deployed in the test environment to be executed, and the user is simulated in the test environment, so as to avoid executing the simulated TCP session logic on the online server 10, thereby reducing the influence on the online server 10.
In an embodiment, referring to fig. 12, on the basis of the embodiment of fig. 11, the step S10 includes:
step S101, the online server 10 captures a traffic packet in a production environment through a tcpdump instruction;
step S102, sending the captured traffic packet to the simulation server 20 pointed by the preset address information in a byte stream format through the netcat instruction.
In the preferred embodiment, the tcpdump command and the netcat command are a packet capture tool, which is a tool for network analysis and problem elimination in the Linux system, and can completely intercept the "header" of a packet transmitted in the network to provide analysis, support filtering for network layers, protocols, hosts, networks or ports, and provide logical statements such as and, or, not, etc. to help remove useless information. The netcat command is the "swiss saber" in the network, and can establish almost all types of network connections by reading and writing data via TCP or UDP protocols. Specifically, the following may be mentioned: tcpdump-i and dst port 80-s 0-w- | netcat 192.168.1.2001993. The preset address information may include a server address of the simulation server 20 and a port number of the listening port. Alternatively, the preset address information may be address information set in a command parameter of the tcpdump command, for example, for the command netcat 192.168.1.2001993, the online server 10 may know that the server address of the simulation server 20 is 192.168.1.200, and the port number of the listening port for listening to the information sent by the online server 10 is 1993. It is understood that the preferred embodiment uses standard Unix tools, and is not limited to tcpdump command and netcat command in the present embodiment.
Specifically, when the online server 10 sends a user request to the simulation server 20 in a byte stream format, the simulation server 20 may receive a traffic packet in the byte stream format accordingly. Thereafter, the simulation server 20 may screen the byte stream for user requests by examining the IP check value and the TCP check value.
In an embodiment, on the basis of the embodiment of fig. 12, the simulation server 20 and the test server 30 are in the same network segment, and the step of feeding back the reply message to the simulation server 20 in step S30 further includes:
the test server 30 feeds back the reply message to the simulation server 20 according to first routing information, where the first routing information is information pointing to the simulation server 20.
In this embodiment, when the simulation server 20 and the test server 30 are in the same network segment, the reply message fed back by the test server 30 is sent to the simulation server 20 in a routing manner. If the address of the simulation server 20 preset in the first routing information is 192.168.1.200, after the test server 30 generates the reply message, the test server 30 may feed back the reply message to the simulation server 20 pointed to by 192.168.1.200 in the first routing information.
In an embodiment, referring to fig. 13, on the basis of the embodiment of fig. 11, after the step S40, the method further includes:
in step S50, the simulation server 20 discards the reply message.
Specifically, if the simulation server 20 forwards the reply packet to the external network after receiving the reply packet, the test server 30 may receive a RESET packet fed back from the external network, and after the test server 30 receives the RESET packet, the test server 30 disconnects the TCP session with the simulation server 20, that is, the communication between the test server 30 and the simulation server 20 cannot continue. In this way, the simulation server 20 in this embodiment avoids the TCP session interruption problem between the test server 30 and the simulation server 20 by discarding the received reply message.
In an embodiment, referring to fig. 14, based on the embodiment of fig. 13, the simulation server 20 and the test server 30 are in different network segments, and the step of feeding back the reply message to the simulation server 20 in step S30 includes:
step S301, the test server 30 captures the reply packet through a tcpdump instruction in a TCP manner;
step S302, sending the captured reply packet to the monitoring port of the simulation server 20 across network segments through a netcat instruction.
In this embodiment, when the simulation server 20 and the test server 30 are in different network segments, the reply packet fed back by the test server 30 cannot be sent to the simulation server 20 in a routing manner, at this time, a tcpdump instruction is used to capture the reply packet at the test server 30 in a TCP manner, and then a netcat instruction is used to send the captured reply packet to the monitoring port 1992 of the simulation server 20 across network segments. In this case, the main _ sniff _ method of the configuration file of the simulation server 20 needs to be set to TCP.
It should be added that the simulation server 20 may be provided with a configuration file, which is used for configuring the simulation server 20 to actively close the TCP session connection with the test server 30, or configuring the simulation server 20 to passively close the TCP session connection with the test server 30. After the TCP session between the simulation server 20 and the test server 30 is over, the simulation server 20 may actively close or passively close the TCP session connection with the test server 30 according to the configuration in the configuration file.
In an embodiment, referring to fig. 15, on the basis of the above embodiment of fig. 11, after step S40, the method further includes:
s60, the test server 30 feeds back the reply message to the preset server 40 according to a preset message reply mechanism and the second routing information;
s70, when receiving the reply message fed back by the test server 30 according to a preset message reply mechanism and second routing information to the preset server 40, the preset server 40 discards the reply message, where the second routing information is information pointing to the preset server 40, and the preset server 40 is a server in the same network segment as the test server 30.
In this embodiment, the test server 30 does not need to set routing information for directing to the simulation server 20, and further routes the reply message to the simulation server 20. However, according to the rule of the message reply mechanism, the test server 30 still needs to reply the reply message to a machine which is located in the same network segment as the test server 30 and has no routing function, that is, the test server 30 still needs to set the second routing information for pointing to the preset server 40 located in the same network segment as the test server 30, and reply the reply message to the preset server 40 according to the second routing information. For the same reason as the simulation server 20 discards the reply message in the above embodiment, after the preset server 40 receives the reply message, the preset server 40 may also discard the reply message. Of course, the reply mechanism of the test server 30 may be changed so that the test server 30 does not send the reply message to other machines in the same network segment, and at this time, after the test server 30 feeds the reply message back to the simulation server 20, the test server 30 may directly discard the reply message.
In an embodiment, referring to fig. 16, on the basis of the above embodiment of fig. 11, the number of the simulation servers 20 is n, where n ≧ 2; the step of the test server 30 feeding back the reply message to the simulation server 20 in step S30 includes:
step S303, the test server 30 feeds back the reply packet to the target simulation server 21 in the n simulation servers 20;
in step S304, the target simulation server 21 forwards the reply message to other simulation servers 22 in the n simulation servers 20.
In this embodiment, when the simulation server 20 and the test server 30 are in the same network segment, the test server 30 may feed back a reply message to the target simulation server 21 of the n simulation servers 20 according to the first routing information; when the simulation server 20 and the test server 30 are in different network segments, the test server 30 captures the generated reply message through a tcpdump instruction, and sends the reply message to the target simulation server 21 of the n simulation servers 20 through a netcat instruction, and then the target simulation server 21 forwards the reply message to the other simulation servers 22 of the n simulation servers 20.
In an embodiment, referring to fig. 17, in addition to the above-mentioned embodiment of fig. 16, the target simulation server 21 is the i-th simulation server 20 of the n simulation servers 20, where the starting value of i is 1, and the step S304 includes:
step S3041, the ith simulation server 20 writes the reply message into a preset file, reads the reply message in the preset file through a read instruction, and forwards the reply message to the (i + 1) th simulation server 20 in the n simulation servers 20 through a netcat instruction;
in this embodiment, for example, two adjacent simulation servers 20 in the n simulation servers 20 are supported by a named pipe/tmp/horos. fifo, after the ith simulation server 20 receives the reply message, the ith simulation server 20 may write the reply message into the/tmp/horos. fifo, read the reply message stored in the/tmp/horos. fifo by using the cat instruction in the standard UNIX tool, and then send the read reply message to the (i + 1) th simulation server 20 by using the netcat instruction. Accordingly, the (i + 1) th simulation server 20 may receive the reply message forwarded by the (i) th simulation server 20.
Step S3042, when i +1 is less than n, the i +1 th simulation server 20 writes the reply packet into the preset file, reads the reply packet in the preset file through the read instruction, and forwards the reply packet to the nth simulation server 20 through the netcat instruction.
In this embodiment, by performing the steps basically the same as those described above, it can be ensured that each simulation server 20 can receive the reply message fed back by the test server 30.
It should also be noted that, in this document, 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 like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. 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.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. A platform test method is characterized by comprising the following steps:
an online server captures a traffic packet generated in the actual operation of the platform through a tcpdump instruction, wherein preset address information is set in an instruction parameter of the tcpdump instruction, the captured traffic packet is sent to a simulation server pointed by the preset address information through a netcat instruction, and the preset address information comprises a server address of the simulation server and a port number of a first monitoring port;
the simulation server screens out user requests from received flow packets, establishes TCP session connection with a test server in a test environment, starts to simulate real users, and sends the user requests to the test server through the TCP session connection;
the test server generates a reply message;
under the condition that the simulation server and the test server are in different network segments, the test server executes the following operations:
replying the reply message to a preset server which is in the same network segment with the test server and has no routing function, wherein the preset server discards the received reply message;
and capturing the reply message in a TCP (transmission control protocol) mode, and sending the captured reply message to a second monitoring port of the analog server in a cross-network segment mode, wherein the analog server discards the received reply message.
2. The method according to claim 1, wherein the step of capturing the reply packet by means of TCP and sending the captured reply packet to the second listening port of the analog server across network segments comprises:
the test server captures the reply message through a tcpdump instruction;
and sending the captured reply message to a second monitoring port of the analog server across the network segment through a netcat instruction.
3. The platform test method according to claim 1, wherein the number of the simulation servers is n, n is greater than or equal to 2, and the simulation servers comprise a target simulation server and other simulation servers; the step of sending the captured reply message to the second monitoring port of the analog server across network segments comprises:
the test server feeds back the captured reply message to the target simulation server;
and the target simulation server forwards the captured reply message to other simulation servers in the n simulation servers.
4. The method according to claim 3, wherein the target simulation server is the ith simulation server of the n simulation servers, the starting value of i is 1, and the step of forwarding the grabbed reply message by the target simulation server to the other simulation servers of the n simulation servers comprises:
the ith simulation server writes the captured reply message into a preset file, reads the captured reply message in the preset file through a reading instruction, and forwards the captured reply message to an (i + 1) th simulation server in the n simulation servers through a netcat instruction;
when i +1< n, the (i + 1) th simulation server writes the captured reply message into the preset file, reads the captured reply message in the preset file through a read instruction, and forwards the captured reply message to the nth simulation server through a netcat instruction.
5. A platform test system, the platform test system comprising:
the system comprises an online server, a simulation server and a first monitoring port, wherein the online server is used for capturing a traffic packet generated in the actual operation of a platform through a tcpdump instruction, preset address information is set in an instruction parameter of the tcpdump instruction, the captured traffic packet is sent to the simulation server pointed by the preset address information through a netcat instruction, and the preset address information comprises a server address of the simulation server and a port number of the first monitoring port;
the simulation server is used for screening out user requests from the received flow packets, establishing TCP session connection with the test server in a test environment, starting to simulate real users, and sending the user requests to the test server through the TCP session connection;
the test server is used for generating a reply message; under the condition that the simulation server and the test server are in different network segments, the following operations are executed: replying the reply message to a preset server which is in the same network segment with the test server and has no routing function, wherein the preset server discards the received reply message; capturing the reply message in a TCP (transmission control protocol) mode, and sending the captured reply message to a second monitoring port of the analog server in a cross-network segment manner;
the simulation server is further configured to discard the received reply message.
6. The platform test system of claim 5, wherein the test server comprises, when the simulation server and the test server are in different network segments:
the second capturing module is used for capturing the reply message through a tcpdump instruction;
and the second sending module is used for sending the captured reply message to a second monitoring port of the simulation server in a cross-network section mode through a netcat instruction.
7. The platform test system of claim 5, wherein the number of simulation servers is n, n ≧ 2; the simulation server includes:
the target simulation server is used for receiving the captured reply message fed back by the test server;
and the other simulation servers are used for receiving the captured reply message forwarded by the target simulation server.
8. The platform test system of claim 7, wherein the target simulation server is an ith simulation server of the n simulation servers, i having a starting value of 1,
the ith simulation server is used for writing the captured reply message into a preset file, reading the captured reply message in the preset file through a reading instruction, and forwarding the captured reply message to the (i + 1) th simulation server in the n simulation servers through a netcat instruction;
when i +1< n, the (i + 1) th simulation server is used for writing the captured reply message into the preset file, reading the captured reply message in the preset file through a reading instruction, and forwarding the captured reply message to the nth simulation server through a netcat instruction.
CN201510520387.8A 2015-08-21 2015-08-21 Platform test method and platform test system Active CN106470136B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510520387.8A CN106470136B (en) 2015-08-21 2015-08-21 Platform test method and platform test system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510520387.8A CN106470136B (en) 2015-08-21 2015-08-21 Platform test method and platform test system

Publications (2)

Publication Number Publication Date
CN106470136A CN106470136A (en) 2017-03-01
CN106470136B true CN106470136B (en) 2022-04-12

Family

ID=58229100

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510520387.8A Active CN106470136B (en) 2015-08-21 2015-08-21 Platform test method and platform test system

Country Status (1)

Country Link
CN (1) CN106470136B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107273252A (en) * 2017-06-13 2017-10-20 北京小度信息科技有限公司 Method of testing and device
CN107395464A (en) * 2017-09-11 2017-11-24 北京奇艺世纪科技有限公司 A kind of server test method, apparatus and API gateway
CN109274669B (en) * 2018-09-18 2021-04-27 四川长虹电器股份有限公司 WAF reverse proxy method based on online flow mirror image bypass
CN110955607B (en) * 2019-12-16 2023-03-28 广州品唯软件有限公司 Monitoring method, monitor and readable storage medium for simulation test tool
CN111371650B (en) * 2020-03-06 2022-03-25 中国银行股份有限公司 Flow forwarding-based quasi-production equipment testing method and system
CN112165408B (en) * 2020-09-16 2022-07-22 杭州安恒信息技术股份有限公司 Test method and device for simulating client serial deployment environment
CN113407431A (en) * 2021-07-14 2021-09-17 杭州雾联科技有限公司 Pressure testing method for flow on simulation line
CN116233905A (en) * 2021-12-03 2023-06-06 腾讯科技(深圳)有限公司 Test method and device of wireless local area network equipment, medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103580943A (en) * 2012-08-03 2014-02-12 亿赞普(北京)科技有限公司 Network software online testing method and system
US8904239B2 (en) * 2012-02-17 2014-12-02 American Express Travel Related Services Company, Inc. System and method for automated test configuration and evaluation
US8924192B1 (en) * 2005-06-10 2014-12-30 Wapp Tech Corp. Systems including network simulation for mobile application development and online marketplaces for mobile application distribution, revenue sharing, content distribution, or combinations thereof
CN104410542A (en) * 2014-11-18 2015-03-11 小米科技有限责任公司 Method and device for simulation test

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6922663B1 (en) * 2000-03-02 2005-07-26 International Business Machines Corporation Intelligent workstation simulation-client virtualization
US7516216B2 (en) * 2001-10-01 2009-04-07 Ixia Generating traffic for testing a system under test
US7194535B2 (en) * 2001-10-01 2007-03-20 Ixia Methods and systems for testing stateful network communications devices
US7467202B2 (en) * 2003-09-10 2008-12-16 Fidelis Security Systems High-performance network content analysis platform
US20060029016A1 (en) * 2004-06-29 2006-02-09 Radware Limited Debugging application performance over a network
US8352777B2 (en) * 2010-10-04 2013-01-08 Hewlett-Packard Development Company, L.P. Replaying captured network traffic
CN103248540B (en) * 2013-05-27 2015-09-30 济南大学 Based on FPGA network traffics generation systems and the method for multi-fractal wavelet model

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8924192B1 (en) * 2005-06-10 2014-12-30 Wapp Tech Corp. Systems including network simulation for mobile application development and online marketplaces for mobile application distribution, revenue sharing, content distribution, or combinations thereof
US8904239B2 (en) * 2012-02-17 2014-12-02 American Express Travel Related Services Company, Inc. System and method for automated test configuration and evaluation
CN103580943A (en) * 2012-08-03 2014-02-12 亿赞普(北京)科技有限公司 Network software online testing method and system
CN104410542A (en) * 2014-11-18 2015-03-11 小米科技有限责任公司 Method and device for simulation test

Also Published As

Publication number Publication date
CN106470136A (en) 2017-03-01

Similar Documents

Publication Publication Date Title
CN106470136B (en) Platform test method and platform test system
EP3331205B1 (en) Data packet transmission method utilized in ipv6 network and device utilizing same
US8605720B2 (en) Analyzing a network with a cache advance proxy
US10129722B2 (en) Service processing method and network device
CN106375139B (en) Method, device and system for copying request
US8938794B2 (en) Access relay method and access gateway device
EP2056559A1 (en) Method and system for network simulation
JP2011160041A (en) Front end system and front end processing method
CN109496409B (en) Data transmission method and virtual switch
CN108141409B (en) Communication system, address notification device, communication control device, terminal, communication method, and program
EP3070891B1 (en) Packet processing method and device
CN111431871A (en) Processing method and device of TCP (Transmission control protocol) semi-transparent proxy
CN102739462B (en) Test message sending method and device
US11252184B2 (en) Anti-attack data transmission method and device
CN107241297B (en) Communication interception method and device, and server
CN110601989A (en) Network traffic balancing method and device
Katsura et al. Quick Blocking Operation of Firewall System Cooperating with IDS and SDN
CN108243196B (en) Method and system for introducing TCP protocol stack under Netfilter architecture, intermediate device and medium
EP3200433A1 (en) Ipv6 address management method, device and terminal
CN106067864B (en) Message processing method and device
WO2020162207A1 (en) Communication system and method of verifying continuity
CN113422716B (en) Mail security control method and system
CN110932979B (en) Method and device for rapidly forwarding message
Takai et al. Quick Blocking Operation of IDS/SDN Cooperative Firewall Systems by Reducing Communication Overhead
CN114050918A (en) Audio data processing method and device, detection server and 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