Summary of the invention
The purpose of the embodiment of the present application is to provide a kind of compatibility test method and device, performs effect with improve compatibility test
Rate.
For solving above-mentioned technical problem, the embodiment of the present application provides a kind of compatibility test method and device to be achieved in that
A kind of compatibility test method, including: obtain test parameter;Described test parameter includes: compatibility calls the name of service
Claim and described compatibility calls the code release of service in service;Determine that code release combines according to described test parameter;Obtain
The IP address of server to be measured, according to the corresponding relation of default IP address Yu service code version, determines and described code version
The destination server that this combination is corresponding;Described destination server is carried out compatibility test.
In preferred version, the combination of described code release includes: described compatibility calls all combinations of service code version in service
In one or more.
In preferred version, the combination of described code release is chosen described compatibility according to preset rules and is called service code version in service
All combinations in one or more.
In preferred version, the IP address that described basis is preset determines destination server, specifically with the corresponding relation of service code version
Including: according to the combination of described code release and described corresponding relation, determine the IP address that the combination of each code release is corresponding, institute
The server stating IP address corresponding is defined as destination server.
In preferred version, described test parameter also includes: case script to be measured;Described case script to be measured includes one or many
Individual test case.
In preferred version, described destination server is carried out compatibility test, specifically includes: determine institute according to described use-case to be measured
State the test path list of destination server, send described case script to be measured according to described test path list and take to described target
Business device carries out compatibility test.
In preferred version, described test path list includes one or more server test path.
In preferred version, determine the test path list of described destination server according to described use-case to be measured, including: according to described
What test case was corresponding calls the order of service name, determines the order calling described destination server, described invocation target service
The order of device is test path.
In preferred version, described compatibility test method also includes: verify IP address legal of the server to be measured of described acquisition
Property;Correspondingly, described determine that destination server includes: determine destination server to be measured, root according to described legitimacy check results
The destination server in destination server to be measured is determined according to the corresponding relation of default IP address Yu service code version.
In preferred version, the legitimacy of the IP address of the server to be measured of the described acquisition of described verification, including: obtain IP address
List, verifies the IP address whether comprising described server to be measured in described IP address list, if comprising, and described service to be measured
The IP address of device is legal.
A kind of device for testing compatibility, including: the combination of parameter acquiring unit, code release determines that unit, destination server determine
Unit and test cell;Wherein, described parameter acquiring unit, it is used for obtaining test parameter;Described test parameter includes: compatible
Property call the title of service and described compatibility calls the code release of service in service;Described test parameter also includes use to be measured
Case script;The combination of described code release determines unit, for determining code version according to the test parameter in described parameter acquiring unit
This combination;Described destination server determines unit, for obtaining the IP address of server to be measured, according to default IP address with
The corresponding relation of service code version, determines the target corresponding with the code release combination that the combination of described code release determines in unit
Server;Described test cell, for determining that to described destination server the destination server determined in unit carries out compatible survey
Examination.
In preferred version, described destination server determines that unit includes: server ip address acquiring unit to be measured and server determine
Unit;Wherein, described server ip acquiring unit to be measured, for obtaining the IP address of server to be measured;Described server is true
Cell, single for determining that described server ip to be measured obtains according to the corresponding relation of the IP address preset with service code version
Destination server in server to be measured in unit.
In preferred version, described destination server determines that unit also includes IP address validation unit;Described IP address validation unit,
For obtaining IP address list, verify server to be measured in described server ip acquiring unit to be measured according to described IP address list
The legitimacy of IP address;Correspondingly, described server determines unit, for according to the IP address preset and service code version
Corresponding relation determine the destination server in server to be measured legal in described IP address validation unit.
In preferred version, described compatibility test unit includes: test list construction unit and test case send performance element;
Wherein, described test list construction unit, for according to described use-case to be measured, determining the test path row of described destination server
Table;Described test path list includes one or more server test path;Described test case sends performance element, is used for
The test list determined according to described test list construction unit sends described case script to be measured to described destination server and carries out
Compatibility test.
The technical scheme provided from above the embodiment of the present application, a kind of compatibility test method disclosed in the embodiment of the present application and
Device, calls the title of service according to the described compatibility obtained and described compatibility calls the code release of service in service,
Automatic deployment code release combines.According to the corresponding relation of default IP address Yu service code version, can quickly determine out
The destination server corresponding with the combination of described code release.Test case according to obtaining can build test list automatically.Therefore,
Compatibility test method disclosed in the embodiment of the present application and device need not manual deployment and combine with switch code version, can improve
The execution efficiency of compatibility test, will not omit a certain situation calling path simultaneously during can ensure that deployment, thus
Improve the accuracy of compatibility test.
Detailed description of the invention
The embodiment of the present application provides a kind of compatibility test method and device.
For the technical scheme making those skilled in the art be more fully understood that in the application, below in conjunction with in the embodiment of the present application
Accompanying drawing, the technical scheme in the embodiment of the present application is clearly and completely described, it is clear that described embodiment is only
It is some embodiments of the present application rather than whole embodiments.Based on the embodiment in the application, ordinary skill people
The every other embodiment that member is obtained under not making creative work premise, all should belong to the scope of the application protection.
Fig. 1 is the flow chart of one embodiment of the application compatibility test method.As it is shown in figure 1, described compatibility test method can
To include:
S100: obtain test parameter;Described test parameter includes: compatibility calls the title of service and described compatibility is called
The code release of service in service.
Device for testing compatibility can obtain test parameter, described test parameter may include that compatibility call the title of service with
And described compatibility calls the code release of service in service.
Described compatibility is called the title of service and be can be used to indicate that the title needing to carry out the service of compatibility test.
Such as, a certain software can include servicing A, B, C and D, and described compatibility is called the title of service and be may include that clothes
Business A, service B and service D, can represent and need testing service A, service B and the compatibility of service D.
The code release of the described compatibility service of calling in service may be used for stating described compatibility and calls and need test in service
The code release included by service.Such as, service A can include that new version of code and early version code, service B can include
Early version code.
Described test parameter can also include: the information such as case script to be measured.Described case script to be measured may be used for testing needs
The service of test.Described case script to be measured can include one or more test case.
S200: determine that code release combines according to described test parameter.
Device for testing compatibility calls the title of service according to described compatibility and described compatibility calls the generation of service in service
Code version, it may be determined that code release combines.
The combination of described code release may include that described compatibility calls the one in service in all combinations of service code version
Or it is multiple.The combination of described code release can be chosen described compatibility according to preset rules and call the institute of service code version in service
There are one or more in combination, such as, can choose described compatibility according to the information of user preset and call service code in service
One or more in all combinations of version.
Such as, described service A includes that new version of code and early version code, described service B include early version code, described service
D includes new version of code and early version code.So, the combination of described code release may include that " new A, old B and new D ",
" new A, old B and old D ", " old A, old B and new D ", and " old A, old B and old D ".Described code release combines
Can also be " new A, old B and new D ".The combination of described code release can be chosen according to preset rules.
S300: obtain the IP address of server to be measured, according to the corresponding relation of default IP address Yu service code version, determines
The destination server corresponding with the combination of described code release.
Device for testing compatibility can obtain the IP address of server to be measured.The IP address of described server to be measured can be to set in advance
Fixed, it is also possible to it is that user sets.The IP address of described server to be measured can represent the service needing to carry out compatibility test
The IP address of device.The IP address of described server to be measured can include the IP address of one or more server.
Described default IP address and the corresponding relation of service code version, may be used for stating the service corresponding to described IP address
The version of the service code run on device.The corresponding server of sending out in such as IP address " xxx.xx.xxx.01 " is " server 1 ", institute
Stating " server 1 " upper service code run is " fresh code of A service ".
Corresponding relation according to described default IP address Yu service code version may determine that destination server.Specifically, according to
The combination of each code release and described corresponding relation in the combination of described code release, it may be determined that the combination of each code release is right
The IP address answered, server corresponding to described IP address may determine that as destination server.
Described destination server can correspond to one or more servers of the code combination of described compatibility test, each group
Code combination can be to there being one or more destination server.
In another embodiment, described compatibility test method can also include: verifies the IP of the server to be measured of described acquisition
The legitimacy of address.Specifically may include that acquisition IP address list, verify whether described IP address list comprises described to be measured
The IP address of server, if comprising, the IP address of described server to be measured can be legal.Described IP address list can include
The IP address of all available servers.Described IP address list can be obtained by configuration center, and described configuration center can be used
IP address in storage Servers-all.
Correspondingly, described determine that destination server may include that the IP rejected in described IP address list with described server to be measured
The IP address that address differs, the server corresponding to IP address list after described rejecting can be destination server to be measured, root
Corresponding relation according to default IP address Yu service code version, it may be determined that with each in the IP address list after described rejecting
The IP address that code release combination is corresponding, server corresponding to described IP address may determine that as destination server.
S400: described destination server is carried out compatibility test.
Device for testing compatibility can carry out compatibility test to described destination server, specifically may include that according to described to be measured
Use-case may determine that the test path list of described destination server, can send described use to be measured according to described test path list
Case script to described destination server carries out compatibility test.
Described test path list can include one or more server test path.Described server test path may be used for
Represent the server that a test case is tested during carrying out a compatibility test successively.
Determine the test path list of described destination server according to described use-case to be measured, may include that according to described test case
The corresponding order calling service name, determines the order calling described destination server, the order of described invocation target server
It can be test path.
For example, it is assumed that a certain code release is combined as: A early version, B early version and D redaction, combine with described code release
Corresponding destination server is as shown in table 1.
Table 1
Destination server title |
Service release |
Server 1 |
A early version |
Server 2 |
A early version |
Server 3 |
B early version |
Server 4 |
B early version |
Server 5 |
D redaction |
Server 6 |
D redaction |
It is assumed that the order calling service name corresponding to a certain test case is followed successively by: service B → service A → service D.
It is possible to determine that the server test path list corresponding with this test case may include that
Test path 1: server 3 → server, 1 → server 5;
Test path 2: server 3 → server, 1 → server 6;
Test path 3: server 3 → server, 2 → server 5;
Test path 4: server 3 → server, 2 → server 5;
Test path 5: server 4 → server, 1 → server 5;
Test path 6: server 4 → server, 1 → server 5;
Test path 2: server 4 → server, 2 → server 5;
Test path 7: server 4 → server, 2 → server 6.
Described test case can be sent according to described test path 1-7 and carry out compatibility test.
Described case script to be measured can pass through the mode extremely described target clothes that ssh (Secure Shell, safety shell protocol) instructs
Business device, and perform described case script to be measured.
In another embodiment, described compatibility test method can also include: obtains compatibility test result.
Described compatibility test result can be obtained by third party's instrument.Further, it is also possible to described compatibility test is tied
Fruit is analyzed.It is possible to further show described compatibility test result and described analysis result.
Have a kind of compatibility test method disclosed in above-described embodiment, according to obtain described compatibility call service title and
Described compatibility calls the code release of service in service, and automatic deployment code release combines.According to default IP address and service
The corresponding relation of code release, can quickly determine out the destination server corresponding with the combination of described code release.According to acquisition
Test case can automatically build test list.Compatibility test method disclosed in the embodiment of the present application need not manual dispose and
Switch code version combines, and can improve the execution efficiency of compatibility test, will not lose during can ensure that deployment simultaneously
Leak a certain situation calling path, thus improve the accuracy of compatibility test.
Fig. 2 is the module map of one embodiment of the application device for testing compatibility.As in figure 2 it is shown, described device for testing compatibility can
To include: the combination of parameter acquiring unit 100, code release determines that unit 200, destination server determine that unit 300 and test are single
Unit 400.Wherein,
Described parameter acquiring unit 100, may be used for obtaining test parameter.Described test parameter may include that compatibility is called
The title of service and described compatibility call the code release of service in service.Described test parameter can also include use-case to be measured
The information such as script.
The combination of described code release determines unit 200, may be used for according to the test parameter in described parameter acquiring unit 100 true
Determine code release combination.
Described destination server determines unit 300, may be used for obtaining the IP address of server to be measured, according to default IP ground
Location and the corresponding relation of service code version, determine that the code release combination determining in unit 200 with the combination of described code release is right
The destination server answered.
Fig. 3 is the module map that in the application device for testing compatibility embodiment, destination server determines unit.As it is shown on figure 3, institute
State destination server and determine that unit 300 may include that server ip address acquiring unit 301 to be measured and server determine unit
302。
Described server ip acquiring unit 301 to be measured, may be used for obtaining the IP address of server to be measured.
Described server determines unit 302, may be used for the corresponding relation according to the IP address preset with service code version and determines
Destination server in server to be measured in described server ip acquiring unit 301 to be measured.
In another embodiment, described destination server determines that unit 300 can also include: IP address validation unit 303.
Described IP address validation unit 303, may be used for obtaining IP address list, described to be measured according to the checking of described IP address list
The legitimacy of server ip address to be measured in server ip acquiring unit 301.
Correspondingly, described server determines unit 302, may be used for the IP address according to presetting corresponding with service code version
Relation determines the destination server in server to be measured legal in described IP address validation unit 303.
Described test cell 400, may be used for described destination server determining, the destination server determined in unit 300 is carried out
Compatibility test.
Fig. 4 is the module map of test cell in the application device for testing compatibility embodiment.As shown in Figure 4, described test cell
400 may include that test list construction unit 401 and test case send performance element 402.
Described test list construction unit 401, may be used for may determine that the survey of described destination server according to described use-case to be measured
Examination path list.Described test path list can include one or more server test path.Described server test path
Can be used to indicate that the server that a test case is tested during carrying out a compatibility test successively.
Described test case sends performance element 402, may be used for the test determined according to described test list construction unit 401
List sends described case script to be measured to described destination server and carries out compatibility test.
In another embodiment, described device for testing compatibility can also include: test result unit 500.Described test knot
Really unit 500, may be used for obtaining compatibility test result.Further, described test result unit 500 can be also used for right
Described compatibility test result is analyzed.Further, described test result unit 500 can be also used for showing described compatibility
Property test result and described analysis result.
A kind of device for testing compatibility disclosed in above-described embodiment is corresponding with the compatibility test method embodiment of the application, permissible
Realize the application embodiment of the method, reach the technique effect of the application embodiment of the method.
In the nineties in 20th century, can clearly distinguish for the improvement of a technology is that the improvement on hardware is (such as, to two
The improvement of the circuit structures such as pole pipe, transistor, switch) or software on improvement (for the improvement of method flow).But,
Along with the development of technology, the improvement of current a lot of method flows can be considered as directly improving of hardware circuit.Design
Personnel nearly all obtain corresponding hardware circuit by being programmed in hardware circuit by the method flow of improvement.Therefore, no
Can say that the improvement of a method flow cannot realize by hardware entities module.Such as, PLD
(Programmable Logic Device, PLD) (such as field programmable gate array (Field Programmable Gate
Array, FPGA)) it is exactly such a integrated circuit, device programming is determined by its logic function by user.By designer
Member's programming voluntarily comes a digital display circuit " integrated " on a piece of PLD, without chip maker please designing and make
Make special IC chip 2.And, nowadays, replacing and manually make IC chip, this programming changes the most mostly
Realize with " logic compiler (logic compiler) " software, software compiler phase used when it is write with program development
Similar, and the most handy specific programming language of source code before compiling is write, this is referred to as hardware description language
(Hardware Description Language, HDL), and HDL the most not only has one, but have many kinds, such as ABEL
(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、
Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware
Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description
Language) etc., that commonly use most is VHDL (Very-High-Speed Integrated Circuit Hardware
Description Language) and Verilog2.Those skilled in the art also it should also be apparent that, it is only necessary to by method flow with above-mentioned
Several hardware description languages are slightly made programming in logic and are programmed in integrated circuit, it is possible to be readily available and realize this logical method stream
The hardware circuit of journey.
Controller can be implemented in any suitable manner, such as, controller can take such as microprocessor or processor and
Storage can by this (micro-) processor perform computer readable program code (such as software or firmware) computer-readable medium,
Gate, switch, special IC (Application Specific Integrated Circuit, ASIC), FPGA
Controller and the form of embedding microcontroller, the example of controller includes but not limited to following microcontroller: ARC 625D, Atmel
AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, Memory Controller can also quilt
It is embodied as a part for the control logic of memorizer.
It is also known in the art that in addition to realizing controller in pure computer readable program code mode, the most permissible
Make controller with gate, switch, special IC, FPGA control by method step carries out programming in logic
The form of device processed and embedding microcontroller etc. realizes identical function.The most this controller is considered a kind of Hardware Subdivision
Part, and the structure in hardware component can also be considered as to include in it for the device realizing various function.Or even, may be used
To be considered as the device being used for realizing various function being not only the software module of implementation method but also can be the knot in hardware component
Structure.
System, device, module or the unit that above-described embodiment illustrates, specifically can be realized by computer chip or entity, or
Realized by the product with certain function.
For convenience of description, it is divided into various unit to be respectively described with function when describing apparatus above.Certainly, the application is being implemented
Time the function of each unit can be realized in same or multiple softwares and/or hardware.
As seen through the above description of the embodiments, those skilled in the art it can be understood that to the application can be by soft
Part adds the mode of required general hardware platform and realizes.Based on such understanding, the technical scheme of the application is the most in other words
The part contributing prior art can embody with the form of software product, and in a typical configuration, calculating sets
For including one or more processor (CPU), input/output interface, network interface and internal memory.This computer software product is permissible
Including some instructions with so that a computer equipment (can be personal computer, server, or the network equipment etc.) is held
Each embodiment of row the application or the method described in some part of embodiment.This computer software product can be stored in internal memory
In, internal memory potentially includes the volatile memory in computer-readable medium, random access memory (RAM) and/or non-volatile
The forms such as property internal memory, such as read only memory (ROM) or flash memory (flash RAM).Internal memory is the example of computer-readable medium.Meter
Calculation machine computer-readable recording medium includes that removable media permanent and non-permanent, removable and non-can be realized by any method or technology
Information stores.Information can be computer-readable instruction, data structure, the module of program or other data.The storage of computer
The example of medium includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), dynamic randon access
Memorizer (DRAM), other kinds of random access memory (RAM), read only memory (ROM), electrically erasable
Read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read only memory (CD-ROM), numeral
Multifunctional optical disk (DVD) or other optical storage, magnetic cassette tape, tape magnetic rigid disk storage other magnetic storage apparatus or appoint
What his non-transmission medium, can be used for the information that storage can be accessed by a computing device.According to defining herein, computer can
Read medium and do not include of short duration computer readable media (transitory media), such as data signal and the carrier wave of modulation.
Each embodiment in this specification all uses the mode gone forward one by one to describe, and between each embodiment, identical similar part is mutual
Seeing, what each embodiment stressed is the difference with other embodiments.Especially for system embodiment
Speech, owing to it is substantially similar to embodiment of the method, so describe is fairly simple, relevant part sees the part of embodiment of the method
Illustrate.
The application can be used in numerous general or special purpose computing system environments or configuration.Such as: personal computer, server
Computer, handheld device or portable set, laptop device, multicomputer system, system based on microprocessor, top set
Box, programmable consumer-elcetronics devices, network PC, minicomputer, mainframe computer, include any of the above system or equipment
Distributed computing environment etc..
The application can be described in the general context of computer executable instructions, such as program module.
Usually, program module include perform particular task or realize the routine of particular abstract data type, program, object, assembly,
Data structure etc..The application can also be put into practice in a distributed computing environment, in these distributed computing environment, by passing through
Communication network and connected remote processing devices performs task.In a distributed computing environment, program module may be located at bag
Include storage device in interior local and remote computer-readable storage medium.
Although depicting the application by embodiment, it will be appreciated by the skilled addressee that the application have many deformation and a change and
Without departing from spirit herein, it is desirable to appended claim includes that these deformation and change are without deviating from spirit herein.