CN105071981A - Method and system for automatically testing webapi interfaces with same domain name - Google Patents
Method and system for automatically testing webapi interfaces with same domain name Download PDFInfo
- Publication number
- CN105071981A CN105071981A CN201510417328.8A CN201510417328A CN105071981A CN 105071981 A CN105071981 A CN 105071981A CN 201510417328 A CN201510417328 A CN 201510417328A CN 105071981 A CN105071981 A CN 105071981A
- Authority
- CN
- China
- Prior art keywords
- domain name
- test
- numbering
- webapi
- server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 106
- 238000000034 method Methods 0.000 title claims abstract description 21
- 230000002159 abnormal effect Effects 0.000 claims description 16
- 230000009286 beneficial effect Effects 0.000 description 4
- 230000003247 decreasing effect Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000012423 maintenance Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000010276 construction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/30—Managing network names, e.g. use of aliases or nicknames
- H04L61/3015—Name registration, generation or assignment
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Debugging And Monitoring (AREA)
- Test And Diagnosis Of Digital Computers (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a method for automatically testing webapi interfaces with a same domain name. The method comprises the steps of numbering server ips with the same domain name; configuring the domain name into a configuration file of a reverse proxy server and numbering the domain name; analyzing the numbered server ips and the domain names to a testing client; testing webapi interfaces which correspond with all domain names with different numbers; and continuing to test the webapi interfaces which correspond with all domain names with different numbers after a preset time period. The invention further provides a system for automatically testing the webapi interfaces with the same domain name, wherein the system can perform automatic testing on the webapi interfaces with the same domain name.
Description
Technical field
The present invention relates to computer network field, particularly relate to a kind of method and system of webapi interface of automatic test same domain name.
Background technology
The previous website of order often can dispose multiple server; by load balancing or DNS intelligently parsing; service is resolved to different servers by the region different at different circuits; but when server parses goes wrong; need to test separately to each station server; this results in test and become difficulty, and often need to configure independent domain name for each station server and just can automatically test, add resource cost.
Summary of the invention
Technical problem to be solved by this invention is: how automatically to test the webapi interface of same domain name.
In order to solve the problems of the technologies described above, the technical solution used in the present invention is:
A method for the webapi interface of automatic test same domain name, comprising:
The server ip of all same domain name is numbered;
Configuration domain name, in the configuration file of Reverse Proxy, is numbered domain name;
Server ip after parsing numbering and domain name are to test client;
Test the webapi interface that the domain name of all difference numberings is corresponding;
The webapi interface that the domain name of test all differences numbering is corresponding is continued after preset time period.
The beneficial effect of the method for the webapi interface of above-mentioned automatic test same domain name is: by being numbered server ip, thus distinguish the different server of same domain name, configuration domain name is in Reverse Proxy, domain name is numbered, thus differentiate different webapi interfaces according to domain name, domain name after parsing numbering and server ip are to test client, therefore undertaken testing the abnormal conditions can knowing different webapi interface by the webapi interface that the domain name of numbering difference is corresponding, the webapi interface that the domain name of the different numbering of test is corresponding is continued after preset time period, thus test every preset time period, realize test automation, improve the availability of system, certain the webapi interface decreased due to different server breaks down the situation being difficult to judge which station server goes wrong, improve the efficiency of process problem.
A system for the webapi interface of automatic test same domain name, comprising:
Ip numbering module, for being numbered the server ip of all same domain name;
Domain name numbering module, for configuring domain name in the configuration file of Reverse Proxy, is numbered domain name;
Parsing module, for resolving the server ip after numbering and domain name to test client;
Test module, the webapi interface that the domain name for testing all difference numberings is corresponding;
Loop module, the webapi interface that the domain name for continuing test all differences numbering after preset time period is corresponding.
The beneficial effect of the system of the webapi interface of above-mentioned automatic test same domain name is: ip numbering module is numbered server ip, thus determine a unique identity for the different server of same domain name, and by domain name numbering module, domain name is numbered, thus different webapi interfaces can be distinguished according to domain name, domain name after parsing module parsing numbering and server ip are to test client, therefore test module is undertaken by the webapi interface that the domain name of numbering difference is corresponding testing the abnormal conditions can knowing different webapi interface, webapi interface corresponding to the loop module domain name of numbering difference every preset time period is tested, thus realize test automation.
Accompanying drawing explanation
Fig. 1 is the method flow diagram that the embodiment of the present invention one tests the webapi interface of same domain name automatically;
Fig. 2 is the method flow diagram that the embodiment of the present invention one tests the webapi interface of same domain name automatically;
Fig. 3 is the system construction drawing that the embodiment of the present invention two tests the webapi interface of same domain name automatically.
Label declaration:
1, ip numbering module; 2, domain name numbering module; 3, parsing module; 4, test module; 5, loop module; 6, logging modle; 7, module is rewritten.
Embodiment
By describing technology contents of the present invention in detail, realized object and effect, accompanying drawing is coordinated to be explained below in conjunction with execution mode.
The design of most critical of the present invention is: be numbered server ip, and configures domain name in the configuration file of Reverse Proxy, is numbered domain name, thus can distinguish different webapi interfaces by the domain name of different numbering.
The explanation of technical terms that the present invention relates to:
Please refer to Fig. 1 and Fig. 2,
A method for the webapi interface of automatic test same domain name, comprising:
S1, the server ip of all same domain name to be numbered;
S2, configuration domain name, in the configuration file of Reverse Proxy, are numbered domain name;
Server ip after S3, parsing numbering and domain name are to test client;
S4, test the webapi interface corresponding to domain name of all difference numberings;
The webapi interface that the domain name of test all differences numbering is corresponding is continued after S5, preset time period.
The beneficial effect of the method for the webapi interface of above-mentioned automatic test same domain name is: by being numbered server ip, thus distinguish the different server of same domain name, configuration domain name is in Reverse Proxy, domain name is numbered, thus differentiate different webapi interfaces according to domain name, domain name after parsing numbering and server ip are to test client, therefore undertaken testing the abnormal conditions can knowing different webapi interface by the webapi interface that the domain name of numbering difference is corresponding, the webapi interface that the domain name of the different numbering of test is corresponding is continued after preset time period, thus test every preset time period, realize test automation, improve the availability of system, certain the webapi interface decreased due to different server breaks down the situation being difficult to judge which station server goes wrong, improve the efficiency of process problem.
Further, the method for the webapi interface of described automatic test same domain name also comprises: S6, when testing out webapi interface and being abnormal, recording exceptional is to daily record.
From foregoing description, the abnormal conditions of webapi interface can be analyzed by daily record, be convenient to the maintenance that it normally works.
Further, described " the server ip after parsing numbering and domain name are to test client " is specially: the server ip after numbering and domain name are directed in the hosts file of test client operating system.
Further, also comprise after described " configuration domain name in the configuration file of Reverse Proxy, domain name is numbered ": S21, amendment domain name after renumbering is unnumbered domain name.
From foregoing description, the domain name after renumbering is unnumbered domain name, thus does not change for domain name other servers, does not affect it and normally works.
Please refer to Fig. 3,
A system for the webapi interface of automatic test same domain name, comprising:
Ip numbering module 1, for being numbered the server ip of all same domain name;
Domain name numbering module 2, for configuring domain name in the configuration file of Reverse Proxy, is numbered domain name;
Parsing module 3, for resolving the server ip after numbering and domain name to test client;
Test module 4, the webapi interface that the domain name for testing all difference numberings is corresponding;
Loop module 5, the webapi interface that the domain name for continuing test all differences numbering after preset time period is corresponding.
The beneficial effect of the system of the webapi interface of above-mentioned automatic test same domain name is: ip numbering module 1 couple of server ip is numbered, thus determine a unique identity for the different server of same domain name, and be numbered by domain name numbering module 2 pairs of domain names, thus different webapi interfaces can be distinguished according to domain name, domain name after parsing module 3 parsing numbering and server ip are to test client, therefore test module 4 is undertaken by the webapi interface that the domain name of numbering difference is corresponding testing the abnormal conditions can knowing different webapi interface, webapi interface corresponding to loop module 5 domain name of numbering difference every preset time period is tested, thus realize test automation.
Further, the system of the webapi interface of described automatic test same domain name also comprises: logging modle 6, and for when testing out webapi interface and being abnormal, recording exceptional is to daily record.
From foregoing description, the abnormal conditions of webapi interface can be analyzed by the daily record of logging modle 6, be convenient to the maintenance that it normally works.
Further, the system of the webapi interface of described automatic test same domain name also comprises: rewrite module 7, for revise and renumbering after domain name be unnumbered domain name.
From foregoing description, the domain name after renumbering is unnumbered domain name, thus does not change for domain name other servers, does not affect it and normally works.
Further, described Reverse Proxy is ngnix server.
Please refer to Fig. 1 and Fig. 2, embodiments of the invention one are:
A method for the webapi interface of automatic test same domain name, comprising:
S1, the server ip of all same domain name to be numbered;
S2, configuration domain name, in the configuration file of Reverse Proxy, are numbered domain name; S21, amendment and renumbering after domain name be unnumbered domain name; Preferably, described Reverse Proxy;
Server ip after S3, parsing numbering and domain name are to test client; Be specially: the server ip after numbering and domain name are directed in the hosts file of test client operating system;
S4, test the webapi interface corresponding to domain name of all difference numberings;
The webapi interface that the domain name of test all differences numbering is corresponding is continued after S5, preset time period; Preferably, described preset time period is 1 hour;
S6, when testing out webapi interface and being abnormal, recording exceptional is to daily record.
Such as, test the server that four domain names are server1.com, because server domain name is identical, server ip is different, is first numbered server ip; Four station server ip and domain name are configured in ngnix reverse proxy configuration file, thus domain name is numbered, such as: " 1.server1.com ", " 2.server1.com ", " 3.server1.com " and " 4.server1.com "; Then can distinguish different servers and the webapi of correspondence from the domain name after numbering, server ip after numbering and domain name are directed in the hosts file of test client operating system, the webapi calling test program corresponding to the domain name after numbering tests, because domain name is numbered, so each webapi is also corresponding have unique identity, namely judge that the webapi that specifically which station server is corresponding is abnormal by test; The all webapi of loop test, continue the webapi that loop test is all after 1 hour; Realize test automatically; If there is abnormal then log; After domain name numbering, the domain name in amendment overwrite request after numbering is be the domain name of numbering originally, thus does not change for domain name other servers, does not affect it and normally works.
Please refer to Fig. 3, embodiments of the invention two are:
A system for the webapi interface of automatic test same domain name, comprising:
Ip numbering module 1, for being numbered the server ip of all same domain name;
Domain name numbering module 2, for configuring domain name in the configuration file of Reverse Proxy, is numbered domain name; Rewrite module 7, for revise and renumbering after domain name be unnumbered domain name; Preferably, described Reverse Proxy is ngnix server;
Parsing module 3, for resolving the server ip after numbering and domain name to test client;
Test module 4, the webapi interface that the domain name for testing all difference numberings is corresponding;
Loop module 5, the webapi interface that the domain name for continuing test all differences numbering after preset time period is corresponding;
Logging modle 6, for when testing out webapi interface and being abnormal, recording exceptional is to daily record.
In sum, the method and system of the webapi interface of automatic test same domain name provided by the invention, ip numbering module is numbered server ip, and domain name will be configured in Reverse Proxy, by domain name numbering module, domain name is numbered, thus distinguishes different webapi interfaces according to the domain name of difference numbering; After domain name numbering, the domain name rewritten in module amendment overwrite request after numbering is be the domain name of numbering originally, thus does not change for domain name other servers, does not affect it and normally works; After parsing module resolves the domain name after numbering and server ip to test client, the webapi interface that test module is corresponding to the domain name that difference is numbered is tested, thus record the abnormal conditions of different webapi, and when measuring abnormal webapi interface, logging modle is by exception record daily record, is convenient to the maintenance that server normally works; Webapi interface corresponding to the loop module domain name of numbering difference every preset time period is tested, realize test automation, improve the availability of system, certain the webapi interface decreased due to different server breaks down the situation being difficult to judge which station server goes wrong, and improves the efficiency of process problem.
The foregoing is only embodiments of the invention; not thereby the scope of the claims of the present invention is limited; every equivalents utilizing specification of the present invention and accompanying drawing content to do, or be directly or indirectly used in relevant technical field, be all in like manner included in scope of patent protection of the present invention.
Claims (8)
1. automatically test a method for the webapi interface of same domain name, it is characterized in that, comprising:
The server ip of all same domain name is numbered;
Configuration domain name, in the configuration file of Reverse Proxy, is numbered domain name;
Server ip after parsing numbering and domain name are to test client;
Test the webapi interface that the domain name of all difference numberings is corresponding;
The webapi interface that the domain name of test all differences numbering is corresponding is continued after preset time period.
2. the method for the webapi interface of automatic test same domain name according to claim 1, is characterized in that, also comprise: when testing out webapi interface and being abnormal, recording exceptional is to daily record.
3. the method for the webapi interface of automatic test same domain name according to claim 1, it is characterized in that, described " the server ip after parsing numbering and domain name are to test client " is specially: the server ip after numbering and domain name are directed in the hosts file of test client operating system.
4. the method for the webapi interface of automatic test same domain name according to claim 1, it is characterized in that, also comprise after described " configuration domain name in the configuration file of Reverse Proxy, domain name is numbered ": amendment domain name after renumbering is unnumbered domain name.
5. automatically test a system for the webapi interface of same domain name, it is characterized in that, comprising:
Ip numbering module, for being numbered the server ip of all same domain name;
Domain name numbering module, for configuring domain name in the configuration file of Reverse Proxy, is numbered domain name;
Parsing module, for resolving the server ip after numbering and domain name to test client;
Test module, the webapi interface that the domain name for testing all difference numberings is corresponding;
Loop module, the webapi interface that the domain name for continuing test all differences numbering after preset time period is corresponding.
6. the system of the webapi interface of automatic test same domain name according to claim 5, is characterized in that, also comprise: logging modle, and for when testing out webapi interface and being abnormal, recording exceptional is to daily record.
7. the system of the webapi interface of automatic test same domain name according to claim 5, is characterized in that, also comprise: rewrite module, for revise and renumbering after domain name be unnumbered domain name.
8. the system of the webapi interface of automatic test same domain name according to claim 5, is characterized in that, described Reverse Proxy is ngnix server.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510417328.8A CN105071981B (en) | 2015-07-16 | 2015-07-16 | The method and system of the webapi interface of automatic test same domain name |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510417328.8A CN105071981B (en) | 2015-07-16 | 2015-07-16 | The method and system of the webapi interface of automatic test same domain name |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN105071981A true CN105071981A (en) | 2015-11-18 |
| CN105071981B CN105071981B (en) | 2019-01-22 |
Family
ID=54501268
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510417328.8A Active CN105071981B (en) | 2015-07-16 | 2015-07-16 | The method and system of the webapi interface of automatic test same domain name |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN105071981B (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106453296A (en) * | 2016-09-30 | 2017-02-22 | 乐视控股(北京)有限公司 | Request service isolating method and system |
| CN112367344A (en) * | 2020-09-11 | 2021-02-12 | 浙江大学 | Construction method of endogenous security load balancing server |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1642099A (en) * | 2004-01-15 | 2005-07-20 | 英业达股份有限公司 | Computer network domain name system configuration method and platform |
| US20100030914A1 (en) * | 2008-07-31 | 2010-02-04 | Sparks Robert J | Methods, systems, and computer readable media for throttling traffic to an internet protocol (ip) network server using alias hostname identifiers assigned to the ip network server with a domain name system (dns) |
| CN101699825A (en) * | 2009-10-28 | 2010-04-28 | 成都市华为赛门铁克科技有限公司 | Network file system access method, device and system |
| US20100153228A1 (en) * | 2008-12-16 | 2010-06-17 | Ahmavaara Kalle I | Apparatus and Method for Bundling Application Services With Inbuilt Connectivity Management |
| CN104009880A (en) * | 2013-02-27 | 2014-08-27 | 阿里巴巴集团控股有限公司 | Web testing method, proxy server and Web testing device |
-
2015
- 2015-07-16 CN CN201510417328.8A patent/CN105071981B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1642099A (en) * | 2004-01-15 | 2005-07-20 | 英业达股份有限公司 | Computer network domain name system configuration method and platform |
| US20100030914A1 (en) * | 2008-07-31 | 2010-02-04 | Sparks Robert J | Methods, systems, and computer readable media for throttling traffic to an internet protocol (ip) network server using alias hostname identifiers assigned to the ip network server with a domain name system (dns) |
| US20100153228A1 (en) * | 2008-12-16 | 2010-06-17 | Ahmavaara Kalle I | Apparatus and Method for Bundling Application Services With Inbuilt Connectivity Management |
| CN101699825A (en) * | 2009-10-28 | 2010-04-28 | 成都市华为赛门铁克科技有限公司 | Network file system access method, device and system |
| CN104009880A (en) * | 2013-02-27 | 2014-08-27 | 阿里巴巴集团控股有限公司 | Web testing method, proxy server and Web testing device |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106453296A (en) * | 2016-09-30 | 2017-02-22 | 乐视控股(北京)有限公司 | Request service isolating method and system |
| CN112367344A (en) * | 2020-09-11 | 2021-02-12 | 浙江大学 | Construction method of endogenous security load balancing server |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105071981B (en) | 2019-01-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Gunawi et al. | Why does the cloud stop computing? lessons from hundreds of service outages | |
| US10356214B2 (en) | Composing monolithic applications based on multi-container applications | |
| US10474519B2 (en) | Server fault analysis system using event logs | |
| US10025678B2 (en) | Method and system for automatically detecting and resolving infrastructure faults in cloud infrastructure | |
| US20120311111A1 (en) | Dynamic reconfiguration of cloud resources | |
| US10542071B1 (en) | Event driven health checks for non-HTTP applications | |
| WO2016209713A1 (en) | Resilience as a service | |
| CN107391092B (en) | Method and system for automatically deploying associated software | |
| CN103944757A (en) | Network anomaly detecting method and device | |
| CN103152229A (en) | Dynamic configuration method for monitoring index item | |
| CN103970655A (en) | Expect-based automatic server cluster testing method | |
| US20230161871A1 (en) | System and method for detecting excessive permissions in identity and access management | |
| CN105227379A (en) | A kind of centralized monitor for java web application and method for early warning | |
| CN104869163A (en) | Dynamic service call method based on agent under cluster environment | |
| Matic et al. | Pythia: a framework for the automated analysis of web hosting environments | |
| US9830177B1 (en) | Computer implemented method and system, and computer program product, for determining compliance with a configuration parameter before deployment of a virtual appliance into a network appliance | |
| CN105071981A (en) | Method and system for automatically testing webapi interfaces with same domain name | |
| JP2015133025A (en) | Data management device | |
| US9384074B1 (en) | Redirecting service calls using endpoint overrides | |
| CN110912779A (en) | Cluster host health detection method, system, equipment and readable storage medium | |
| CN107566203A (en) | A kind of online service method of testing and system | |
| EP3060985B1 (en) | Methods and systems for automatic configuration of algorithms in a system based on self aware algorithms | |
| CN102984229B (en) | For configuring the method and system of trust machine | |
| US20230221983A1 (en) | Techniques for providing third party trust to a cloud computing environment | |
| CN103713982B (en) | Remote service is returned the method and apparatus that result is monitored |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |