CN108574604B - Test method and device - Google Patents

Test method and device Download PDF

Info

Publication number
CN108574604B
CN108574604B CN201710130628.7A CN201710130628A CN108574604B CN 108574604 B CN108574604 B CN 108574604B CN 201710130628 A CN201710130628 A CN 201710130628A CN 108574604 B CN108574604 B CN 108574604B
Authority
CN
China
Prior art keywords
target server
information
server
test
domain name
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
CN201710130628.7A
Other languages
Chinese (zh)
Other versions
CN108574604A (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 Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710130628.7A priority Critical patent/CN108574604B/en
Publication of CN108574604A publication Critical patent/CN108574604A/en
Application granted granted Critical
Publication of CN108574604B publication Critical patent/CN108574604B/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/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/04Processing captured monitoring data, e.g. for logfile generation

Landscapes

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

Abstract

The application discloses a testing method and a testing device. One embodiment of the method comprises: receiving an Internet Protocol (IP) address sent by a user terminal, and matching the IP address with the domain name of each server to be tested in a server cluster to be tested; taking a server to be tested indicated by the domain name matched with the IP address as a target server, and acquiring port information of the target server; generating test information based on the domain name and the port information of the target server, and sending the test information to the target server; and generating a test result based on the feedback information of the target server, and returning the test result to the user terminal, wherein the feedback information is information related to the test information. This embodiment improves the testing efficiency.

Description

Test method and device
Technical Field
The application relates to the technical field of computers, in particular to the technical field of internet, and particularly relates to a testing method and a testing device.
Background
Interface testing is typically a test that tests an interface between components of a system. The method is mainly used for detecting interaction points between external systems and between internal subsystems. Particularly in the test of interactive development among multiple systems or the development of an application system with multiple subsystems, the interface test is usually applied to a bottom system and a central service system which provide services for other systems, and mainly tests interfaces provided by the systems to the outside to verify the correctness and stability of the interfaces.
Currently, before testing, testers often need to write test data according to the format requirements of the service to be tested. Since the format requirements of different services are often different, when a new service to be tested is added, a tester needs to add new test data or modify existing test data, which affects the test efficiency.
Disclosure of Invention
It is an object of the present application to provide an improved testing method and apparatus to solve the technical problems mentioned in the background section above.
In a first aspect, an embodiment of the present application provides a testing method, where the method includes: receiving an Internet Protocol (IP) address sent by a user terminal, and matching the IP address with the domain name of each server to be tested in a server cluster to be tested; taking a server to be tested indicated by a domain name matched with the IP address as a target server, and acquiring port information of the target server; generating test information based on the domain name and the port information of the target server, and sending the test information to the target server; and generating a test result based on the feedback information of the target server, and returning the test result to the user terminal, wherein the feedback information is information related to the test information.
In some embodiments, generating test information based on the domain name and port information of the target server and sending the test information to the target server comprises: generating a Uniform Resource Locator (URL) based on the domain name and the port information of the target server; and sending the URL as test information to the target server.
In some embodiments, generating a test result based on the feedback information of the target server, and returning the test result to the user terminal includes: and if the feedback information of the target server is the page content corresponding to the URL, taking the page content as a test result and returning the test result to the user terminal.
In some embodiments, generating a test result based on the feedback information of the target server, and returning the test result to the user terminal includes: and if the feedback information of the target server is the page content corresponding to the URL, taking the domain name and the port information of the target server as a test result, and returning the test result to the user terminal.
In some embodiments, generating the test information based on the domain name and port information of the target server comprises: determining whether the number of ports indicated by the port information of the target server is greater than a first preset value; if yes, selecting a preset number of ports from the ports indicated by the port information of the target server, and generating a preset number of test information based on the domain name of the target server and the port information of the selected ports.
In a second aspect, an embodiment of the present application provides a testing apparatus, including: the receiving unit is configured to receive an Internet Protocol (IP) address sent by a user terminal and match the IP address with a domain name of each server to be tested in the server cluster to be tested; the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to take a server to be tested indicated by a domain name matched with an IP address as a target server and acquire port information of the target server; the generating unit is configured to generate test information based on the domain name and the port information of the target server and send the test information to the target server; and the feedback unit is configured to generate a test result based on the feedback information of the target server and return the test result to the user terminal, wherein the feedback information is information related to the test information.
In some embodiments, the generating unit further comprises: a generation subunit configured to generate a uniform resource locator URL based on the domain name and the port information of the target server; and the sending subunit is configured to send the URL as the test information to the target server.
In some embodiments, the feedback unit is further configured to: and if the feedback information of the target server is the page content corresponding to the URL, taking the page content as a test result and returning the test result to the user terminal.
In some embodiments, the feedback unit is further configured to: and if the feedback information of the target server is the page content corresponding to the URL, taking the domain name and the port information of the target server as a test result, and returning the test result to the user terminal.
In some embodiments, the generating unit is further configured to: determining whether the number of ports indicated by the port information of the target server is greater than a first preset value; if yes, selecting a preset number of ports from the ports indicated by the port information of the target server, and generating a preset number of test information based on the domain name of the target server and the port information of the selected ports.
In a third aspect, an embodiment of the present application provides a server, where the server includes: one or more processors; storage means for storing one or more programs which, when executed by one or more processors, cause the one or more processors to carry out a test method as described in any one of the implementations of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the testing method as described in any implementation manner of the first aspect.
According to the testing method and the testing device provided by the embodiment of the application, the IP address sent by the user terminal is matched with the domain name of each server to be tested in the server cluster to be tested, and the server to be tested indicated by the matched domain name is used as a target server; then acquiring port information of the target server; generating test information based on the domain name and the port information of the target server, and sending the test information to the target server; and generating a test result based on the feedback information of the target server so as to return to the user terminal. Therefore, even if a new server to be tested is added in the server cluster to be tested, the corresponding test information can be generated based on the domain name and the port information of the new server to be tested. Therefore, modification of test data can be reduced, and test efficiency is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a testing method according to the present application;
FIG. 3 is a flow chart of yet another embodiment of a testing method according to the present application;
FIG. 4 is a diagram illustrating an application scenario of the testing method in the embodiment of FIG. 3;
FIG. 5 is a schematic block diagram of one embodiment of a test apparatus according to the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing a server according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the testing method or testing apparatus of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include user terminals 101, 102, 103, networks 104, 106, a server 105 and servers to be tested 107, 108. The network 104 serves as a medium for providing communication links between the user terminals 101, 102, 103 and the server 105. The network 106 serves as a medium for providing a communication link between the server 105 and the servers 107, 108 to be tested. The networks 104, 106 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may use the user terminals 101, 102, 103 to interact with the server 105 over the network 104 to receive or send messages or the like. The user terminals 101, 102, 103 may have installed thereon various communication client applications, such as a web browser application, an application service testing tool, a shopping application, a search application, an instant messaging tool, a mailbox client, and the like.
The user terminals 101, 102, 103 may be various electronic devices having a display screen including, but not limited to, smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like.
The servers to be tested 107, 108 may be servers providing various services, such as background application servers providing support for various applications on the user terminals 101, 102, 103.
The server 105 may be a server that provides various services, for example, a background processing server that processes a test request including an IP (Internet Protocol) address transmitted by the user terminals 101, 102, 103. The background processing server may analyze and process the received IP address and the data such as the domain name and the port information of the servers 107 and 108 to be tested, and feed back the processing result (e.g., the testing result) to the user terminal.
It should be noted that the testing method provided in the embodiment of the present application is generally executed by the server 105, and accordingly, the testing apparatus is generally disposed in the server 105.
It should be understood that the number of user terminals, networks, servers and servers to be tested in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, servers, and servers to be tested, as desired for implementation. It should be noted that the server 105 and the servers 107 and 108 to be tested may be sub-servers in the same server to implement different service functions.
With continued reference to FIG. 2, a flow 200 of one embodiment of a testing method according to the present application is shown. The test method comprises the following steps:
step 201, receiving an internet protocol IP address sent by a user terminal, and matching the IP address with a domain name of each server to be tested in a server cluster to be tested.
In this embodiment, the electronic device (e.g., the server 105 shown in fig. 1) on which the test method operates may receive the IP address from the user terminal through a wired connection or a wireless connection. And matching the IP address with the domain name of each server to be tested in the cluster of servers to be tested. The electronic equipment is in communication connection with each server to be tested in the server cluster to be tested.
In this embodiment, the user may send the IP address on the user terminal in various ways. For example, the user may enter an IP address in a browser on the user terminal or an input field of the test platform. The test platform may be built using Web page Web framework tools. For example, a Web application framework based on the object-oriented, transliterated computer programming language python, such as: django, Tornado, Bottle, or Web. In addition, the user can also send a plurality of IP addresses simultaneously, and the IP addresses can be separated by commas (but not limited to).
In this embodiment, the IP version of the IP address is not limited. The IP version of the IP address may be either IPv4 or IPv 6. The IP address sent by the user terminal may be an IP address corresponding to the domain name of the server to be tested, or an IP address corresponding to the domain name of another server. Thus, before testing, the test method running on the electronic device can be preliminarily tested and verified.
In this embodiment, since the domain name of one server to be tested usually corresponds to one IP address, the electronic device may match the IP address corresponding to the domain name of each server to be tested after receiving the IP address sent by the user terminal. The electronic device may pre-store a domain name and an IP address of each server to be tested in a server cluster to be tested, which is in communication connection with the electronic device. If the IP address which is the same as the IP address sent by the user terminal exists in the IP addresses corresponding to the domain names of the servers to be tested, the domain name of the server to be tested which is matched with the IP address sent by the user terminal can be determined to exist. If the domain name of the server to be tested does not exist and is matched with the IP address sent by the user terminal, prompt information (such as the absence of the IP address or the failure of matching and the like) can be sent to the user terminal. It can be understood that, in the present application, the storage locations of the domain name and the IP address of each server to be tested are not limited, and the electronic device may also obtain corresponding information from each server to be tested.
Step 202, taking the server to be tested indicated by the domain name matched with the IP address as a target server, and acquiring port information of the target server.
In this embodiment, based on the IP address received in step 201, the electronic device may first determine the server to be tested indicated by the domain name matched with the IP address as a target server, and then obtain port information of the target server.
In this embodiment, the target server may have a physical port (e.g., a serial port, a parallel port, etc.) or a virtual port (e.g., a protocol port). The electronic device mainly obtains port information of a port (for example, 80 ports allocated to WWW (World Wide Web) services or 21 ports allocated to FTP (File transfer protocol) services) externally provided by a target server. The port information may include, but is not limited to, a communication protocol, a port address, a port name, and the like. The communication Protocol may include an HTTP (Hypertext Transfer Protocol), an FTP (FTP Protocol), an SMTP (Simple Mail Transfer Protocol), and the like.
In this embodiment, the electronic device may obtain the port information of the target server in various manners. For example, the electronic device may store port information of each server to be tested in advance, and find the port information of the target server in the information. As an example, the electronic device may also obtain port information of each server to be tested by using a Web service in a service-oriented architecture technology. Because the existing Web service generally includes SOAP (Simple Object Access Protocol) and WSDL (Web services description Language). These port information are transmitted in the form of XML (Extensible markup language) files, and thus can be transmitted between different servers and read.
Step 203, generating test information based on the domain name and the port information of the target server, and sending the test information to the target server.
In this embodiment, based on the domain name and the port information of the target server obtained in step 202, the electronic device may generate test information that is recognizable by the target server. And sending the test information to the target server.
In this embodiment, the electronic device may generate different test information according to different service functions described by the port information of the target server. For example: the destination server has a port address of 21, typically an FTP service. At this time, the electronic device may transmit a passive mode PASV command (i.e., test information) to the target server. When the control link is successfully established, the target server sends a port number to the electronic device. If the electronic device receives the port number (i.e. the feedback information) sent by the target server, it may preliminarily determine that the test is passed. Further, the electronic device may initiate a data link request to the target server and send data (as test information) to the target server after success. After the target server feeds back the status code, the electronic device may further determine whether the test passes or not according to the status code (as feedback information). Such as: 2xx indicates that the current operation was successful, and it can be determined that the test passed. For another example: the destination server has a port address of 25, typically SMTP service. At this time, after the electronic device establishes a link with the target server, if the state code returned by the target server 220 is received, it may be preliminarily determined that the test is passed. Further, the electronic device may issue an HELO or EHLO command (i.e., test information) to the target server. Here, the HELO command refers to a default SMTP service, and the EHLO command refers to support an extended service in addition to the default service. The HELO commands and EHLO commands are programming languages commonly used in prior art SMTP services, and these programs are commercially available. The electronic device may further determine whether the test passes or not according to the status code (i.e., feedback information) fed back by the target server.
In some optional implementations of this embodiment, the electronic device may generate the test information based on the domain name and the port information of the target server by using the following steps: determining whether the number of ports indicated by the port information of the target server is greater than a first preset value; if yes, selecting a preset number of ports from the ports indicated by the port information of the target server, and generating a preset number of test information based on the domain name of the target server and the port information of the selected ports. It should be noted that the method for selecting the predetermined number of ports is not limited in this embodiment, and may be random selection, or may be selection according to a preset method, for example, selection according to a sequence of port addresses from small to large.
And step 204, generating a test result based on the feedback information of the target server, and returning the test result to the user terminal.
In this embodiment, the electronic device may generate the test result based on the feedback information of the target server. And the electronic equipment can return the test result to the user terminal in a wired connection or wireless connection mode. The feedback information may be information related to the test information (as in the embodiment shown in step 203). The test results may include, but are not limited to, a test pass or a test fail. As an example, the electronic device may further generate a test report with the domain name and port information of the target server and the information of whether the test is passed or not, as a test result. The template of the test report may be stored in the electronic device in advance. Therefore, management and maintenance are convenient, and the target server and the port which do not pass the test can be found and solved in time.
In this embodiment, the user terminal may present the test result to the user in various ways, such as a browser or a test platform.
In the testing method provided by the embodiment of the application, the IP address sent by the user terminal is matched with the domain name of each server to be tested in the server cluster to be tested, and the server to be tested indicated by the matched domain name is used as a target server; then acquiring port information of the target server; generating test information based on the domain name and the port information of the target server, and sending the test information to the target server; and finally, generating a test result based on the feedback information of the target server so as to return to the user terminal. Therefore, even if a new server to be tested is added in the server cluster to be tested, the corresponding test information can be generated based on the domain name and the port information of the new server to be tested. Therefore, modification of test data can be reduced, and test efficiency is improved.
With further reference to fig. 3, a flow 300 of yet another embodiment of the testing method of the present application is shown. The process 300 of the test method includes the following steps:
step 301, receiving an IP address sent by a user terminal, and matching the IP address with a domain name of each server to be tested in a server cluster to be tested.
In this embodiment, the electronic device (for example, the server 105 shown in fig. 1) on which the test method operates may receive the IP address sent by the user terminal through a wired connection or a wireless connection. And the electronic equipment can match the IP address with the domain name of each server to be tested in the server cluster to be tested. Specifically, refer to step 201 in the embodiment shown in fig. 2, which is not described herein again.
Step 302, taking the server to be tested indicated by the domain name matched with the IP address as a target server, and acquiring port information of the target server.
In this embodiment, the electronic device may use a server to be tested indicated by a domain name matched with the IP address as a target server, and obtain port information of the target server. The port information may include, but is not limited to, a communication protocol, a port address, a port name, and the like. Specifically, refer to step 202 in the embodiment shown in fig. 2, which is not described herein again.
Step 303, generating a uniform resource locator URL based on the domain name and the port information of the target server, and sending the URL as test information to the target server.
In this embodiment, the electronic device may generate the URL based on the domain name and the port information of the target server. For example: com, port information including HTTP protocol, port number 80, and may generate a URL HTTP:// www. 80 or http:// www. And the electronic device may use the URL as test information to send a test request containing the URL to the target server. In addition, the electronic device may also acquire content from the target server by using a Get method in the httplib module in Python, or submit information to the target server by using a Post method. It should be noted that Python and httplib modules are well known technologies that are widely researched and applied at present, and are not described herein again.
And step 304, if the feedback information of the target server is the page content corresponding to the URL, taking the page content as a test result, and returning the test result to the user terminal.
In this embodiment, after receiving the information of the page content corresponding to the URL fed back by the target server, the electronic device may return the page content to the user terminal in a wired connection or wireless connection manner as a test result.
In this embodiment, the user terminal may present the page content corresponding to the URL to the user in a browser or a test platform. The test platform may select an appropriate HTML (Hypertext markup language) template according to a data structure of the page content to display the page content.
In some optional implementation manners of this embodiment, if the feedback information of the target server is the page content corresponding to the URL, the electronic device may use the domain name and the port information of the target server as the test result, and return the test result to the user terminal.
As can be seen from fig. 3, compared with the embodiment corresponding to fig. 2, the flow 300 of the testing method in this embodiment highlights the steps of generating the testing information and the testing result. Therefore, the scheme described in the embodiment can introduce more application services of the server to be tested, so that more comprehensive test information and richer test results are realized.
With continued reference to fig. 4, fig. 4 is a schematic diagram of an application scenario of the testing method according to the embodiment shown in fig. 3. In the application scenario of fig. 4, the user may first enter the IP address of 172 ######inan input field on the test platform, clicking on the "test" button (as indicated by reference numeral 401). Thereafter, the user terminal may send the IP address to the server. The server may first match the received IP address of the 172 ######' with the domain name of each server to be tested in the cluster of servers to be tested. Then, after determining that the domain name matching the 172 ·##### · #is www.A ×. com, the server to be tested having the domain name www.A ×. com is taken as a target server, and port information of the target server is acquired. And then generating http: com, and sending it to the target server. And finally, the server returns the page content returned by the target server to the user terminal as a test result. The user terminal can display the result 1 on the test platform (such as a mailbox account login page) to the user in a webpage form according to the data structure of the page content, and the test homepage is the homepage of the test platform. The mailbox account login page includes a "mailbox account or phone number @163. com", "password", "login" button and a "register" button (as shown at reference numeral 402).
With further reference to FIG. 5, the present application provides one embodiment of a test apparatus as an implementation of the methods illustrated in the above figures. The embodiment of the device corresponds to the embodiment of the method shown in fig. 2, and the device can be applied to various electronic devices.
As shown in fig. 5, the test apparatus 500 of the present embodiment includes: a receiving unit 501, an obtaining unit 502, a generating unit 503 and a feedback unit 504. The receiving unit 501 is configured to receive an internet protocol IP address sent by a user terminal, and match the IP address with a domain name of each server to be tested in a server cluster to be tested; the obtaining unit 502 is configured to use a server to be tested indicated by a domain name matched with the IP address as a target server, and obtain port information of the target server; the generating unit 503 is configured to generate test information based on the domain name and the port information of the target server, and send the test information to the target server; the feedback unit 504 is configured to generate a test result based on feedback information of the target server, and return the test result to the user terminal, where the feedback information is information related to the test information.
In this embodiment, specific implementation manners and advantageous effects of the receiving unit 501, the obtaining unit 502, the generating unit 503 and the feedback unit 504 may refer to step 201, step 202, step 203 and step 204 in fig. 2, respectively, and are not described herein again.
In some optional implementations of this embodiment, the generating unit 503 may further include: a generation subunit (not shown in the figure) configured to generate a uniform resource locator URL based on the domain name and the port information of the target server; a sending subunit (not shown in the figure) configured to send the URL as test information to the target server.
In some optional implementations of this embodiment, the feedback unit 504 may be further configured to: and if the feedback information of the target server is the page content corresponding to the URL, taking the page content as a test result and returning the test result to the user terminal.
In some optional implementations of this embodiment, the feedback unit 504 may be further configured to: and if the feedback information of the target server is the page content corresponding to the URL, taking the domain name and the port information of the target server as a test result, and returning the test result to the user terminal.
In some optional implementations of this embodiment, the generating unit 503 may be further configured to: determining whether the number of ports indicated by the port information of the target server is greater than a first preset value; if yes, selecting a preset number of ports from the ports indicated by the port information of the target server, and generating a preset number of test information based on the domain name of the target server and the port information of the selected ports.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing a server according to embodiments of the present application. The server shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601. It should be noted that the computer readable medium mentioned above in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit, an obtaining unit, a generating unit, and a feedback unit. The names of these units do not in some cases form a limitation on the unit itself, for example, the receiving unit may also be described as a unit that receives an internet protocol IP address sent by a user terminal and matches the IP address with a domain name of each server to be tested in the server cluster to be tested.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the server described in the above embodiments; or may exist separately and not be assembled into the server. The computer readable medium carries one or more programs which, when executed by the server, cause the server to: receiving an Internet Protocol (IP) address sent by a user terminal, and matching the IP address with the domain name of each server to be tested in a server cluster to be tested; taking a server to be tested indicated by a domain name matched with the IP address as a target server, and acquiring port information of the target server; generating test information based on the domain name and the port information of the target server, and sending the test information to the target server; and generating a test result based on the feedback information of the target server, and returning the test result to the user terminal, wherein the feedback information is information related to the test information.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. A method of testing, the method comprising:
receiving an Internet Protocol (IP) address sent by a user terminal, and matching the IP address with a domain name of each server to be tested in a server cluster to be tested;
taking a server to be tested indicated by the domain name matched with the IP address as a target server, and acquiring port information of the target server;
generating test information based on the domain name and the port information of the target server, and sending the test information to the target server;
and generating a test result based on the feedback information of the target server, and returning the test result to the user terminal, wherein the feedback information is information related to the test information.
2. The method of claim 1, wherein generating test information based on the domain name and port information of the target server and sending the test information to the target server comprises:
generating a Uniform Resource Locator (URL) based on the domain name and the port information of the target server;
and sending the URL as test information to the target server.
3. The method of claim 2, wherein the generating a test result based on the feedback information of the target server and returning the test result to the user terminal comprises:
and if the feedback information of the target server is the page content corresponding to the URL, taking the page content as a test result and returning the test result to the user terminal.
4. The method of claim 2, wherein the generating a test result based on the feedback information of the target server and returning the test result to the user terminal comprises:
and if the feedback information of the target server is the page content corresponding to the URL, taking the domain name and the port information of the target server as a test result, and returning the test result to the user terminal.
5. The method of claim 1, wherein generating test information based on the domain name and port information of the target server comprises:
determining whether the number of ports indicated by the port information of the target server is greater than a first preset value;
if yes, selecting a preset number of ports from the ports indicated by the port information of the target server, and generating the preset number of test information based on the domain name of the target server and the port information of the selected ports.
6. A test apparatus, the apparatus comprising:
the receiving unit is configured to receive an Internet Protocol (IP) address sent by a user terminal and match the IP address with a domain name of each server to be tested in the server cluster to be tested;
the acquisition unit is configured to take a server to be tested indicated by the domain name matched with the IP address as a target server and acquire port information of the target server;
the generating unit is configured to generate test information based on the domain name and the port information of the target server and send the test information to the target server;
and the feedback unit is configured to generate a test result based on feedback information of the target server and return the test result to the user terminal, wherein the feedback information is information related to the test information.
7. The apparatus of claim 6, wherein the generating unit further comprises:
a generation subunit configured to generate a uniform resource locator, URL, based on the domain name and the port information of the target server;
and the sending subunit is configured to send the URL as test information to the target server.
8. The apparatus of claim 7, wherein the feedback unit is further configured to:
and if the feedback information of the target server is the page content corresponding to the URL, taking the page content as a test result and returning the test result to the user terminal.
9. The apparatus of claim 7, wherein the feedback unit is further configured to:
and if the feedback information of the target server is the page content corresponding to the URL, taking the domain name and the port information of the target server as a test result, and returning the test result to the user terminal.
10. The apparatus of claim 6, wherein the generating unit is further configured to:
determining whether the number of ports indicated by the port information of the target server is greater than a first preset value;
if yes, selecting a preset number of ports from the ports indicated by the port information of the target server, and generating the preset number of test information based on the domain name of the target server and the port information of the selected ports.
11. A server, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201710130628.7A 2017-03-07 2017-03-07 Test method and device Active CN108574604B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710130628.7A CN108574604B (en) 2017-03-07 2017-03-07 Test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710130628.7A CN108574604B (en) 2017-03-07 2017-03-07 Test method and device

Publications (2)

Publication Number Publication Date
CN108574604A CN108574604A (en) 2018-09-25
CN108574604B true CN108574604B (en) 2020-09-29

Family

ID=63577078

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710130628.7A Active CN108574604B (en) 2017-03-07 2017-03-07 Test method and device

Country Status (1)

Country Link
CN (1) CN108574604B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109324914B (en) * 2018-09-26 2021-06-22 多点生活(成都)科技有限公司 Service calling method, service calling device and central server
CN109542756B (en) * 2018-09-29 2023-04-11 中国平安人寿保险股份有限公司 Method and device for automatically configuring script, electronic equipment and storage medium
CN110475268A (en) * 2019-07-05 2019-11-19 深圳壹账通智能科技有限公司 Short chain test method, system, equipment and storage medium
CN110457197B (en) * 2019-08-19 2023-05-09 中国工商银行股份有限公司 Service testing method, device, computer equipment and storage medium
CN110795343B (en) * 2019-10-12 2024-03-15 车智互联(北京)科技有限公司 Test system, test method and computing device
CN111049912A (en) * 2019-12-17 2020-04-21 用友网络科技股份有限公司 Debugging method, test development device, and computer-readable storage medium
CN113630802B (en) * 2020-05-07 2024-02-20 大唐联仪科技有限公司 NR user plane service testing method and device
CN112306858A (en) * 2020-05-21 2021-02-02 北京字节跳动网络技术有限公司 Test method and device and electronic equipment
CN114006847B (en) * 2020-07-14 2023-07-07 成都鼎桥通信技术有限公司 Automatic test method for private network terminal
CN114071119B (en) * 2020-07-31 2024-03-19 北京达佳互联信息技术有限公司 Resource testing method and device, electronic equipment and storage medium
CN112363879A (en) * 2020-11-20 2021-02-12 上海连尚网络科技有限公司 Cache server performance test method, device, equipment and medium
CN113641575B (en) * 2021-08-06 2024-04-09 上海浦东发展银行股份有限公司 Test method, device, equipment and storage medium
CN114629888A (en) * 2022-03-18 2022-06-14 中国农业银行股份有限公司 Server load testing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100694248B1 (en) * 2006-04-25 2007-03-27 충남대학교산학협력단 Apparatus for testing security policies in network security system and its method
CN101447898A (en) * 2008-11-19 2009-06-03 中国人民解放军信息安全测评认证中心 Test system used for network safety product and test method thereof
CN101841436A (en) * 2010-03-02 2010-09-22 北京星网锐捷网络技术有限公司 Method for testing performance of IPFIX (Internet Protocol Flow Information Export) server, device and system thereof
CN103746885A (en) * 2014-01-28 2014-04-23 中国人民解放军信息安全测评认证中心 Test system and test method oriented to next-generation firewall
CN105868058A (en) * 2015-12-14 2016-08-17 乐视网信息技术(北京)股份有限公司 Cross-machine room test method and apparatus

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1435783A (en) * 2002-10-22 2003-08-13 交大铭泰(北京)软件有限公司 Reverse domain name analysis method
CN102571466A (en) * 2010-12-16 2012-07-11 中国移动通信集团安徽有限公司 Method, device and system for testing service
CN103220372B (en) * 2012-01-19 2016-08-10 中国移动通信集团公司 Data service access method and system
CN103685590B (en) * 2012-09-14 2017-06-23 阿里巴巴集团控股有限公司 Obtain the method and system of IP address
CN102916958A (en) * 2012-10-15 2013-02-06 福建榕基软件股份有限公司 Method and system for realizing access encryption of mobile terminal browser
CN104125308B (en) * 2013-04-25 2018-04-10 阿里巴巴集团控股有限公司 For the method and domain name analysis system of the domain name mapping of multi-user
CN104915288A (en) * 2014-03-13 2015-09-16 阿里巴巴集团控股有限公司 Testing method and device
CN104090931A (en) * 2014-06-25 2014-10-08 华南理工大学 Information prediction and acquisition method based on webpage link parameter analysis
CN105430108B (en) * 2014-08-25 2020-03-03 腾讯科技(深圳)有限公司 Test environment access method and proxy server
WO2016195644A1 (en) * 2015-05-29 2016-12-08 Hewlett Packard Enterprise Development Lp Potential blocking impacts
CN105099811B (en) * 2015-06-03 2019-01-22 北京金山安全软件有限公司 Interface testing method and device
CN106131016B (en) * 2016-07-13 2019-05-03 北京知道创宇信息技术有限公司 Malice URL detects interference method, system and device
CN106302002B (en) * 2016-07-29 2019-10-01 北京小米移动软件有限公司 Test method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100694248B1 (en) * 2006-04-25 2007-03-27 충남대학교산학협력단 Apparatus for testing security policies in network security system and its method
CN101447898A (en) * 2008-11-19 2009-06-03 中国人民解放军信息安全测评认证中心 Test system used for network safety product and test method thereof
CN101841436A (en) * 2010-03-02 2010-09-22 北京星网锐捷网络技术有限公司 Method for testing performance of IPFIX (Internet Protocol Flow Information Export) server, device and system thereof
CN103746885A (en) * 2014-01-28 2014-04-23 中国人民解放军信息安全测评认证中心 Test system and test method oriented to next-generation firewall
CN105868058A (en) * 2015-12-14 2016-08-17 乐视网信息技术(北京)股份有限公司 Cross-machine room test method and apparatus

Also Published As

Publication number Publication date
CN108574604A (en) 2018-09-25

Similar Documents

Publication Publication Date Title
CN108574604B (en) Test method and device
CN110442524B (en) Method and device for testing web service interface with authentication authorization
CN110708346B (en) Information processing system and method
CN112187558B (en) Data verification method and device and electronic equipment
CN109815107B (en) Method and device for automatic testing
CN108459953A (en) test method and device
CN109656799B (en) Test method and device
CN107305528B (en) Application testing method and device
CN113076153B (en) Interface calling method and device
CN110704200A (en) Method and device for converting call interface
CN108694120B (en) Method and device for testing service component
CN111767229A (en) Performance test method, device and equipment
CN111600920B (en) JS-based data request proxy method, device, equipment and readable storage medium
CN113761428A (en) Page rendering method, device and system, storage medium and electronic equipment
CN114840379A (en) Log generation method, device, server and storage medium
CN112015383A (en) Login method and device
CN112084102A (en) Interface pressure testing method and device
CN113407229B (en) Method and device for generating offline scripts
CN109889402B (en) Method and apparatus for generating information
CN114416597A (en) Test case record generation method and device
CN112131095B (en) Pressure testing method and device
CN113271300A (en) Authentication system and method
CN113760727A (en) Interface regression testing method and device
CN112929453A (en) Method and device for sharing session data
CN115577200B (en) Page loading method, device, equipment 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