A kind of server positioning function test method and system
Technical field
The present invention relates to server the field of test technology more particularly to a kind of server positioning function test method and it is
System.
Background technique
Traditional server positioning function test method is to be placed on smart machine (such as intelligent sound box, smartwatch)
Different area connection internet, the server of smart machine position equipment, are sentenced by judging equipment export IP address
The physical address of disconnected equipment, so that whether authentication server positioning function is normal.The equipment export IP address is smart machine
The outlet real IP address (non-local net IP address) of network is accessed.But it is just needed to obtain equipment export IP address
Smart machine is placed into true physical location, and is separated by distance different in size between multiple physical locations.For example, in benefit
When detecting multiple physical address with a smart machine, needs a smart machine being placed on multiple physical locations and detect,
And it needs that smart machine is transferred to next physical location again after waiting a physical location detection during detecting and examines
It surveys;When for another example detecting multiple physical address using multiple smart machines, need multiple smart machines being placed on multiple physical locations
It is detected.In either case, conventional test methodologies are inconvenient prompt and time-consuming, and cost is big, difficulty is high, limitation is very strong.
Application for a patent for invention CN103873315A discloses server physical position positioning system and method, and specifically discloses
System is applied to control host, control host connection server cabinet and IP video camera;System includes: logging modle, is used for
Record distributes to the IP address information of the Servers-all in server cabinet;Control module, for according to IP address to service
Every server in device cabinet sends the first control command, extinguishes the hard disk lamp of the Servers-all in server cabinet, also
For reading any one IP address for the server distributed in server cabinet, according to the IP address to corresponding server
The second control command is sent, is extinguished after ordering the hard disk lamp of the server to light preset time, lights devices use in hard disk lamp
IP video camera shoots to obtain the real-time imaging of server cabinet;Analysis module, for receiving the server machine of IP video camera passback
The real-time imaging of cabinet analyzes the real-time imaging and obtains physical location information of the server in server cabinet;And association mould
Block for the IP address of the server is associated with physical location information, and records the Servers-all in server cabinet
IP address and physical location incidence relation.What the invention was related to positioning server location in server test process
System and method is the image acted under control module control using IP camera record server hard disc lamp, and utilizes and divide
It analyses module analysis and obtains physical location information, and then the corresponding IP address of the physical location information is known by relating module, most
The server to go wrong can be quickly navigated to from multiple servers eventually.However, the case and not solving above-mentioned traditional server
In positioning function tests test method there are the problem of.
Summary of the invention
In view of the problems of the existing technology the present invention, proposes and a kind of tests service convenient, time saving, that testing cost is low
Device positioning function test method and system.
The present invention connects proxy server between test equipment and server to be measured, utilizes proxy server transmitted test
Device package, in proxy server setting act as export agent IP address and by equipment export IP address modification fall so as to be measured
The modified equipment export IP address of server selection, without reading the equipment export real IP limited by true physical location
Address, it is only necessary to test server to be measured to modified equipment export IP address (hereinafter referred to as equipment export virtual ip address)
It is positioned and is verified, solve the problems, such as that operation of the existing technology is time-consuming, cost is big, high, limitation is strong.
The present invention is achieved by the following technical solutions:
A kind of server positioning function test method, comprising:
Proxy server is connected between test equipment and server to be measured by step S01, wherein the test equipment
With the equipment export IP address that network is accessed, data packet of the proxy server for transmitted test equipment gives clothes to be measured
Business device;
The IP address of acting as export agent of proxy server is arranged in step S02, and the equipment export IP address of test equipment is modified
For IP address of acting as export agent;
Step S03 judges it according to the location information for the test equipment that server to be measured is navigated to by proxy server
When consistent with IP address of acting as export agent, server positioning function is normal.
Preferably, method further includes step S04, step S02 and step S03 is repeated, multiple server selection function is carried out
It can detect, the IP address of acting as export agent in each step S02 is all different.
Preferably, step S02 is specifically included:
IP address detection list of acting as export agent, the IP address inspection of acting as export agent is arranged in step S21 in proxy server
Surveying list includes detection order and IP address of acting as export agent corresponding with detection order;
The equipment export IP address of test equipment is revised as corresponding with detection order by step S22 according to detection order
It acts as export agent IP address.
Preferably, step S03 is specifically included:
Step S31, server to be measured pass through the location information of proxy server assignment test equipment;
Step S32, when judging location information and consistent IP address of acting as export agent corresponding with current detection order, server
Positioning function is normal.
Preferably, when there is multiple servers to be measured to connect through a proxy server with test equipment, step S02
It specifically includes:
IP address detection list of acting as export agent, the IP address of acting as export agent is arranged in step S21 ' in proxy server
Detection list includes detection order, server to be measured number and agency corresponding with server to be measured number and detection order
Export IP address;
The equipment export IP address of test equipment is revised as by step S22 ' according to server to be measured number, detection order
IP address of acting as export agent corresponding with server to be measured number and detection order.
Preferably, step S03 is specifically included:
Step S31 ', server to be measured pass through the location information of proxy server assignment test equipment;
Step S32 ', judges location information, and with server to be measured number and current detection order is corresponding acts as export agent
When IP address is consistent, server positioning function is normal.
A kind of server positioning function test macro, comprising:
Test equipment has the equipment export IP address that network is accessed;
Proxy server for the IP address of acting as export agent of proxy server to be arranged, and is used for the equipment of test equipment
Outlet IP address is revised as IP address of acting as export agent;And
Server to be measured, for passing through the location information of proxy server assignment test equipment;
Wherein, the proxy server is connected between test equipment and server to be measured, and the proxy server is used for
The data packet of transmitted test equipment gives server to be measured;The location information be used to judge consistent with IP address of acting as export agent
When, server positioning function to be measured is normal.
Preferably, system further includes control terminal, for obtaining the location information of server to be measured, and for judging position
When information is consistent with IP address of acting as export agent, server positioning function to be measured is normal.
Preferably, when there is multiple servers to be measured to connect through a proxy server with test equipment, the generation
It manages server and one IP address of acting as export agent is set;The control terminal is used to obtain the location information of multiple servers to be measured, and
When location information for judging multiple servers to be measured is all identical, all the positioning function of server to be measured is normal.
Preferably, when the control terminal is used to judge that the location information of multiple servers to be measured is not all identical, it is described
Control terminal includes multiple control units, and described control unit is used to judge the location information of a server to be measured and acts as export agent
When IP address is identical, the server positioning function of server to be measured is normal.
The invention has the following advantages:
A kind of server positioning function test method of the present invention and system, test are not only restricted to true physical location, simplify
Testing process, reduces testing cost.
Detailed description of the invention
Fig. 1 is the flow chart under an a kind of example of server positioning function test method of the present invention;
Fig. 2 is the flow chart under a kind of another example of server positioning function test method of the present invention;
Fig. 3 is the sub-process figure according to the step S02 of the embodiment under example shown in Fig. 2;
Fig. 4 is the sub-process figure according to the step S03 of the embodiment under example shown in Fig. 2;
Fig. 5 is the sub-process figure according to the step S02 of another embodiment under example shown in Fig. 2;
Fig. 6 is the sub-process figure according to the step S03 of another embodiment under example shown in Fig. 2;
Fig. 7 is the functional block diagram under an a kind of example of server positioning function test macro of the present invention;
Fig. 8 is the functional block diagram under a kind of another example of server positioning function test macro of the present invention.
Specific embodiment
Following is a specific embodiment of the present invention in conjunction with the accompanying drawings, technical scheme of the present invention will be further described,
However, the present invention is not limited to these examples.
Embodiment one
Such as Fig. 1, a kind of server positioning function test method of the present invention includes:
Proxy server is connected between test equipment and server to be measured by step S01;
Wherein, the test equipment has the equipment export IP address that network is accessed, and the proxy server is for turning
The data packet of test equipment is sent out to server to be measured;
The IP address of acting as export agent of proxy server is arranged in step S02, and the equipment export IP address of test equipment is modified
For IP address of acting as export agent;
Step S03 judges it according to the location information for the test equipment that server to be measured is navigated to by proxy server
When consistent with IP address of acting as export agent, server positioning function is normal.
The test equipment can be true smart machine, such as intelligent sound box, smartwatch, or can also be to connect
Mouth testing tool, analog smart machine are interacted with server.The test equipment connects internet, and network is accessed
Real IP address is exported, then test equipment has the equipment export IP address that network is accessed.
IP address of acting as export agent is set in the proxy server, such as selects the IP address of designated area for the IP that acts as export agent
Address, such as select Pekinese's IP address for IP address of acting as export agent.Proxy server is true by the equipment export of smart machine
IP address is revised as equipment export virtual ip address, that is, IP address of acting as export agent, such as " 119.10.67.144 " IP address.
The server to be measured can position to obtain by proxy server test equipment location information, and by location information
IP address carries out judgement verifying with acting as export agent, and when the two address is consistent, then the server positioning function to be measured is normal, otherwise
It is abnormal.
Above-mentioned IP address of acting as export agent can be configured as needed, next when needing to carry out server to be measured repeatedly test
Judge whether positioning function is normal, then different IP address of acting as export agent is set every time, after completing above-mentioned steps S01-S03 every time
New IP address of acting as export agent is reset, if test result can navigate to and act as export agent the consistent position of IP address several times
Information, then the positioning function of server to be measured is normal.Repeatedly test avoids the primary possibility tested and casual testing mistake occur,
Improve test accuracy rate.
Test method under this example can be used for carrying out a server to be measured server positioning function and test, be more
Secondary server positioning function test;It can also be used for the test of multiple servers to be measured, and testing process is to be measured for one every time
Server carries out.
Test method under this example, can be by detecting people about judging whether location information and IP address of acting as export agent are consistent
Member checks the location information navigated to and IP address of acting as export agent, artificial judgment obtain result;Also it can use and service to be measured
The control terminal of device connection, reads the location information of server to be measured, and compares location information and IP address of acting as export agent, automation
Judgement obtains result.
The present invention is not limited to by physical location, it is only necessary to the IP address of acting as export agent of proxy server be arranged, and this is modified
For equipment export IP address mode can complete server positioning function test, the test of even multiple and different IP address,
Convenient, time-saving and efficiency is operated, and is reduced costs.
Embodiment two
Such as Fig. 2-4, a kind of server positioning function test method of the present invention includes:
Proxy server is connected between test equipment and server to be measured by step S01;
Wherein, the test equipment has the equipment export IP address that network is accessed, and the proxy server is for turning
The data packet of test equipment is sent out to server to be measured;
The IP address of acting as export agent of proxy server is arranged in step S02, and the equipment export IP address of test equipment is modified
For IP address of acting as export agent;
Step S03 judges it according to the location information for the test equipment that server to be measured is navigated to by proxy server
When consistent with IP address of acting as export agent, server positioning function is normal;
Step S04 repeats step S02 and step S03, carries out multiple server positioning function detection, in each step S02
IP address of acting as export agent be all different.
The test equipment can be true smart machine, such as intelligent sound box, smartwatch, or can also be to connect
Mouth testing tool, analog smart machine are interacted with server.The test equipment connects internet, and network is accessed
Real IP address is exported, then test equipment has the equipment export IP address that network is accessed.
IP address of acting as export agent is set in the proxy server, such as selects the IP address of designated area for the IP that acts as export agent
Address, such as select Pekinese's IP address for IP address of acting as export agent.Proxy server is true by the equipment export of smart machine
IP address is revised as equipment export virtual ip address, that is, IP address of acting as export agent, such as " 119.10.67.144 " IP address.
The server to be measured can position to obtain by proxy server test equipment location information, and by location information
IP address carries out judgement verifying with acting as export agent, and when the two address is consistent, then the server positioning function to be measured is normal, otherwise
It is abnormal.
Specifically, such as Fig. 3, the step S02 further comprises:
IP address detection list of acting as export agent, the IP address inspection of acting as export agent is arranged in step S21 in proxy server
Surveying list includes detection order and IP address of acting as export agent corresponding with detection order;
The equipment export IP address of test equipment is revised as corresponding with detection order by step S22 according to detection order
It acts as export agent IP address.
The IP address detection list of acting as export agent, such as " detection order: 1, IP address of acting as export agent: Beijing
119.10.67.144;Detection order: 2, IP address of acting as export agent: Hangzhou 220.184.213.143;Detection order: 3, it acts on behalf of out
Mouth IP address: Guangxi 118.190.95.35 ".Wherein, the cycle-index of the detection order above method.When to server to be measured into
When row is repeatedly tested, according to testing time, IP address detection list of as above acting as export agent is set, proxy server is according to circulation
Number, the IP address of acting as export agent tested every time by sequence modification.
Such as Fig. 4, the step S03 further comprises:
Step S31, server to be measured pass through the location information of proxy server assignment test equipment;
Step S32, when judging location information and consistent IP address of acting as export agent corresponding with current detection order, server
Positioning function is normal.
For example, when detection order be 1 when, server selection to be measured to Pekinese's location information, judge the location information and
When IP address of acting as export agent is consistent, then server positioning function to be measured is normal under this detection;It is to be measured when detection order is 2
Server selection is to the location information in Hangzhou, when judging that the location information is consistent with IP address of acting as export agent, then under this detection
Server positioning function to be measured is normal, when multiple test is correct, show that server positioning function to be measured is normal, otherwise not just
Often.Repeatedly test avoids the primary possibility tested and casual testing mistake occur, improves test accuracy rate.
Test method under this example can be used for carrying out multiple server positioning function test to a server to be measured;?
It can be used for the test of multiple servers to be measured, and testing process is carried out for a server to be measured every time.
Test method under this example, can be by detecting people about judging whether location information and IP address of acting as export agent are consistent
Member checks the location information navigated to and IP address of acting as export agent, artificial judgment obtain result;Also it can use and service to be measured
The control terminal of device connection, reads the location information of server to be measured, and compares location information and IP address of acting as export agent, automation
Judgement obtains result.
The present invention is not limited to by physical location, it is only necessary to the IP address of acting as export agent of proxy server be arranged, and this is modified
For equipment export IP address mode can complete server positioning function test, the test of even multiple and different IP address,
Convenient, time-saving and efficiency is operated, and is reduced costs.
Embodiment three
Such as Fig. 2,5,6, a kind of server positioning function test method of the present invention includes:
Proxy server is connected between test equipment and server to be measured by step S01;
Wherein, the test equipment has the equipment export IP address that network is accessed, and the proxy server is for turning
The data packet of test equipment is sent out to server to be measured;
The IP address of acting as export agent of proxy server is arranged in step S02, and the equipment export IP address of test equipment is modified
For IP address of acting as export agent;
Step S03 judges it according to the location information for the test equipment that server to be measured is navigated to by proxy server
When consistent with IP address of acting as export agent, server positioning function is normal;
Step S04 repeats step S02 and step S03, carries out multiple server positioning function detection, in each step S02
IP address of acting as export agent be all different.
The test equipment can be true smart machine, such as intelligent sound box, smartwatch, or can also be to connect
Mouth testing tool, analog smart machine are interacted with server.The test equipment connects internet, and network is accessed
Real IP address is exported, then test equipment has the equipment export IP address that network is accessed.
IP address of acting as export agent is set in the proxy server, such as selects the IP address of designated area for the IP that acts as export agent
Address, such as select Pekinese's IP address for IP address of acting as export agent.Proxy server is true by the equipment export of smart machine
IP address is revised as equipment export virtual ip address, that is, IP address of acting as export agent, such as " 119.10.67.144 " IP address.
The server to be measured can position to obtain by proxy server test equipment location information, and by location information
IP address carries out judgement verifying with acting as export agent, and when the two address is consistent, then the server positioning function to be measured is normal, otherwise
It is abnormal.
The present embodiment three and the difference of embodiment two are that the present embodiment is to work as to have multiple servers to be measured to act on behalf of through one
When server is connect with test equipment, the positioning function detection of multiple servers to be measured is carried out.
Specifically, such as Fig. 5, the step S02 further comprises:
IP address detection list of acting as export agent, the IP address of acting as export agent is arranged in step S21 ' in proxy server
Detection list includes detection order, server to be measured number and agency corresponding with server to be measured number and detection order
Export IP address;
The equipment export IP address of test equipment is revised as by step S22 ' according to server to be measured number, detection order
IP address of acting as export agent corresponding with server to be measured number and detection order.
The IP address detection list of acting as export agent, such as " server number to be measured: 1, detection order: 1, it acts as export agent
IP address: Beijing 119.10.67.144;Detection order: 2, IP address of acting as export agent: Hangzhou 220.184.213.143;Detection time
Sequence: 3, IP address of acting as export agent: Guangxi 118.190.95.35 ";" server number to be measured: 2, detection order: 1, it acts as export agent
IP address: Beijing 119.10.67.144;Detection order: 2, IP address of acting as export agent: Shanghai 61.152.230.26;Detection time
Sequence: 3, IP address of acting as export agent: Shandong 119.188.162.165 " wherein, the cycle-index of the detection order above method.When right
When multiple servers to be measured are repeatedly tested, according to server to be measured number, testing time, the IP that as above acts as export agent is set
Address detected list, proxy server numbers according to server to be measured, cycle-index, acts as export agent by what sequence modification was tested every time
IP address.Above-mentioned IP address detection list of acting as export agent can be detected different by above-mentioned setting by different servers to be measured
It acts as export agent IP address;It is identical with acting as export agent IP that all identical or parts can also be detected by different servers to be measured
Location.Wherein, detection number can also be adjusted as needed.
Such as Fig. 6, step S03 further comprises:
Step S31 ', server to be measured pass through the location information of proxy server assignment test equipment;
Step S32 ' judges location information, and act as export agent IP corresponding with server to be measured number, current detection order
When address is consistent, server positioning function is normal.
For example, when server to be measured number be 1 when, the IP address of acting as export agent of proxy server according to detection order sequentially
It is detected, when detection order is 1, server selection to be measured judges the location information and act on behalf of out to Pekinese's location information
When mouth IP address is consistent, then server positioning function to be measured is normal under this detection;When detection order is 2, server to be measured
The location information for navigating to Hangzhou, when judging that the location information is consistent with IP address of acting as export agent, then clothes to be measured under this is detected
Device positioning function of being engaged in is normal, when multiple test is correct, show that server positioning function to be measured is normal, otherwise abnormal.When
When server number to be measured is 1, the IP address of acting as export agent of proxy server is sequentially detected according to detection order, detection time
When sequence is 1, server selection to be measured is to Pekinese's location information, when judging that the location information is consistent with IP address of acting as export agent,
Then server positioning function to be measured is normal under this detection;When detection order is 2, the position of server selection to be measured to Shanghai
Information, when judging that the location information is consistent with IP address of acting as export agent, then server positioning function to be measured is normal under this detection,
When multiple test is correct, show that server positioning function to be measured is normal, it is otherwise abnormal.Wherein, proxy server is arranged
The port of multiple connection differences server to be measured, in order to which multiple servers to be measured are detected, there is an agency in each port
IP address is exported, which is arranged according to IP address detection list of acting as export agent.
Using repeatedly test, this avoid primary tests casual testing occurs for each server positioning function test to be measured
The possibility of mistake improves test accuracy rate.It, can be efficiently convenient to multiple servers to be measured also, compared to previous embodiment
Positioning function detection.
Test method under this example, can be by detecting people about judging whether location information and IP address of acting as export agent are consistent
Member checks the location information navigated to and IP address of acting as export agent, artificial judgment obtain result;Also it can use and service to be measured
The control terminal of device connection, reads the location information of server to be measured, and compares location information and IP address of acting as export agent, automation
Judgement obtains result.
The present invention is not limited to by physical location, it is only necessary to the IP address of acting as export agent of proxy server be arranged, and this is modified
For equipment export IP address mode can complete server positioning function test, the test of even multiple and different IP address,
Convenient, time-saving and efficiency is operated, and is reduced costs.
Example IV
Such as Fig. 7, a kind of server positioning function test macro of the present invention includes 101, agency's clothes of a test equipment
Business 102, servers 103 to be measured of device.The proxy server 102 be connected to test equipment 101 and server 103 to be measured it
Between, data packet of the proxy server 102 for transmitted test equipment 101 gives server 103 to be measured.
The test equipment 101 can be true smart machine, such as intelligent sound box, smartwatch, or can be with
For interface testing tool, analog smart machine is interacted with server.The test equipment 101 connects internet, access
To the outlet real IP address of network, then test equipment 101 has the equipment export IP address that network is accessed.
IP address of acting as export agent is set in the proxy server 102, such as selects the IP address of designated area to act on behalf of out
Mouth IP address, such as select Pekinese's IP address for IP address of acting as export agent.Proxy server 102 goes out the equipment of smart machine
Mouth real IP address is revised as equipment export virtual ip address, that is, IP address of acting as export agent, such as " 119.10.67.144 " IP
Location.
The server to be measured 103 can be positioned by proxy server 102 and obtain 101 location information of test equipment, and
Location information and IP address of acting as export agent are subjected to judgement verifying, when the two address is consistent, then the server 103 to be measured positions
Function is normal, otherwise abnormal.
Embodiment one, the server positioning function test method of embodiment two can be used in the system.
It, can be by under the system using the present embodiment about judging whether location information and IP address of acting as export agent are consistent
Testing staff checks the location information navigated to and IP address of acting as export agent, artificial judgment obtain result;Also can use with to
The control terminal for surveying server connection, reads the location information of server to be measured, and compares location information and IP address of acting as export agent,
Automatization judgement obtains result.For this purpose, control terminal is stored in advance to be arranged in proxy server the system also includes control terminal
IP address detection list of acting as export agent, pass through the location information for obtaining server to be measured and IP address of acting as export agent detect list
Interior acts as export agent IP address to judge whether server positioning function to be measured is normal.
When carrying out the positioning function test of multiple servers to be measured, it can be equipped with multiple groups above system, it can also be at one group
After above system detects, the mode of the server to be measured more renewed is tested.
Embodiment five
Such as Fig. 8, a kind of server positioning function test macro of the present invention includes 201, agency's clothes of a test equipment
Business device 202, multiple servers 203 to be measured.The proxy server 202 be connected to test equipment 201 and server 203 to be measured it
Between, data packet of the proxy server 202 for transmitted test equipment 201 gives server 203 to be measured.
The test equipment 201 can be true smart machine, such as intelligent sound box, smartwatch, or can be with
For interface testing tool, analog smart machine is interacted with server.The test equipment 101 connects internet, access
To the outlet real IP address of network, then test equipment 101 has the equipment export IP address that network is accessed.
IP address of acting as export agent is set in the proxy server 202, such as selects the IP address of designated area to act on behalf of out
Mouth IP address, such as select Pekinese's IP address for IP address of acting as export agent.Proxy server 202 goes out the equipment of smart machine
Mouth real IP address is revised as equipment export virtual ip address, that is, IP address of acting as export agent, such as " 119.10.67.144 " IP
Location.
The server to be measured 203 can be positioned by proxy server 202 and obtain 201 location information of test equipment, and
Location information and IP address of acting as export agent are subjected to judgement verifying, when the two address is consistent, then the server 203 to be measured positions
Function is normal, otherwise abnormal.
The server positioning function test method of embodiment three can be used in the system.In addition, can also be in embodiment three
On the basis of without act as export agent IP address and location information judgement process, such as the proxy server be arranged one act on behalf of out
Mouthful IP address, i.e., multiple server selections to be measured to location information be it is same, when location information positions all the same, then recognize
Positioning function for all servers to be measured is normal, and testing staff can manually judge;But if all not identical, then according to reality
It applies example three and carries out testing process.
It, can be by under the system using the present embodiment about judging whether location information and IP address of acting as export agent are consistent
Testing staff checks the location information navigated to and IP address of acting as export agent, artificial judgment obtain result;Also can use with to
The control terminal for surveying server connection, reads the location information of server to be measured, and compares location information and IP address of acting as export agent,
Automatization judgement obtains result.For this purpose, control terminal is stored in advance to be arranged in proxy server the system also includes control terminal
IP address detection list of acting as export agent, pass through the location information for obtaining server to be measured and IP address of acting as export agent detect list
Interior acts as export agent IP address to judge whether server positioning function to be measured is normal.
Further, the control terminal includes multiple control units, the inspection of the corresponding server to be measured of each control unit
It surveys, reads the location information of server to be measured, and compare location information and IP address of acting as export agent, automatization judgement is tied
Fruit.
Specific embodiment described herein is only an example for the spirit of the invention.The neck of technology belonging to the present invention
The technical staff in domain can make various modifications or additions to the described embodiments or replace by a similar method
In generation, however, it does not deviate from the spirit of the invention or beyond the scope of the appended claims.