A kind of device selection method and system of automatic test
Technical field
The invention belongs to the automatization testing technique fields of data communication, and in particular to according to setting in a kind of automatic test
The method and system of standby characteristic dynamic select physical equipment.
Background technique
During existing automatic test is realized, the main survey of usually specifying it to execute in a test assignment and auxiliary survey
Device type maps physical equipment.This realization there is a problem of obvious: one, increasing necessary when the physical equipment of test
Remodify the device type of main survey and the auxiliary survey of test assignment, it appears cumbersome;Two, when testing a new equipment, automation
Operational staff does not know its modular character supported, therefore cannot rapidly and accurately configure the required logical device of test assignment
Type is easy error, increases the difficulty of configuration.
Summary of the invention
Present invention aim to address, carry out to come from based on device characteristics when automatic test in the prior art
The problem of carrying out the mapping between logical device and physical equipment dynamicly.
The technical solution of the present invention is as follows: a kind of device selection method of automatic test, specifically comprises the following steps:
S1: logging in all physical equipments in test envelope, executes characteristic and judges that command sequence obtains the branch of every physical equipment
Characteristic is held, the support characteristic of every physical equipment to get forms set as element, generates every according to obtained set
The characteristic of physical equipment supports information;
S2: the property requirements information of all logical device is described in test assignment T;
S3: information is supported according to the property requirements information of logical device and the characteristic of physical equipment, is one by one all logics
The corresponding physical equipment of device map;
It further, include the property requirements of at least one logical device and every logical device in the test assignment T
Information;
Further, in the step S1 acquisition every physical equipment support characteristic specifically includes the following steps:
S11: a wherein physical equipment in test envelope is logged in, the serial number of characteristic to be judged is initialized;
S12: obtaining the characteristic to be judged of current sequence number, if currently characteristic to be judged is sky, carries out step S15, ties
The characteristic of beam present physical equipment supports acquisition of information, otherwise carries out step S13;
S13: according to the current characteristic to be judged got, executing characteristic and judge command sequence, obtains physical equipment to working as
The support result of preceding characteristic to be judged;The support result includes supporting and not supporting;
S14: result write-in physical equipment characteristic will be supported to support message file, and the serial number for executing characteristic to be judged adds certainly
One, return continues to execute step S12;
S15: the characteristic for terminating present physical equipment supports acquisition of information;
Further, the physical equipment characteristic supports that message file includes current properties and physical equipment to current spy
Property support or the information do not supported;
Further, the S3 specifically include it is following step by step:
S31: test assignment T, initialization logic equipment serial number are executed;
S32: obtaining the logical device of the current sequence number of test assignment T, judges whether current logical device is empty, if
The logical device of current sequence number is sky, shows that all logical device of test assignment T all map physical equipment success, is then walked
Otherwise rapid S37 carries out step S33;
S33: the property requirements information of current logic equipment is read;
S34: traversing idle physical equipment set, chooses present physical equipment, if present physical equipment is sky, shows
The logical device of the failure of current logic device map physical equipment, entire test assignment T maps failure, then carries out step S37, no
Then carry out step S35;
S35: the characteristic for reading present physical equipment supports message file, with the property requirements information of current logic equipment into
Row characteristic supports matching, if present physical equipment does not support the property requirements information of current logic equipment, shows current object
Reason equipment is unsatisfactory for the requirement of current logic equipment, then return step S34, otherwise carries out step S36;
S36: record current logic equipment and present physical equipment successful match information, while present physical equipment from
It is deleted in idle physical equipment set, executes logical device serial number from adding one, then return step S32, carries out next logic
The mapping of equipment;
S37: all logical device mapping results of record test assignment T;
Further, the physical equipment set of the free time is according to all physics equipment groups before mapping into free physical
Cluster tool, if present physical equipment and current logic equipment successful match, by present physical equipment from free physical equipment
It is deleted in set, and updates idle physical equipment set;
Further, the logical device and physical equipment matching process are as follows: according to the characteristic need of current logic equipment
Information is sought, the characteristic of message file record is supported to support for the characteristic of inquiry present physical equipment as a result, if characteristic supports result
To support, then current logic equipment and present physical equipment successful match, otherwise it fails to match;
The present invention also provides a kind of device selection system of automatic test in order to solve the technical problem, comprising: physical equipment
Characteristic acquiring unit, test assignment unit and equipment selecting unit;
The physical equipment characteristic acquiring unit judges that command sequence obtains the branch of every physical equipment by executing characteristic
Characteristic is held, is element composition set according to the support characteristic of the every physical equipment acquired, is generated according to obtained set
The characteristic of all devices supports information, and supports result write-in physical equipment characteristic to support message file characteristic;
The test assignment unit describes the property requirements information of all logical device and counterlogic equipment;
The equipment selecting unit according to the demand characteristics information of logical device and the support characteristic information of physical equipment, by
One maps corresponding physical equipment for all logical device;
Further, the test assignment unit, which describes at least one logical device and the characteristic of counterlogic equipment, needs
Seek information;
Further, the equipment selecting unit, according to the property requirements of the logical device of test assignment unit description
Information, inquiry physical equipment characteristic support message file record characteristic support as a result, if characteristic support result be support,
Logical device and physical equipment successful match, otherwise it fails to match.
Beneficial effects of the present invention: a kind of device selection method and system of automatic test proposed by the present invention pass through
All physical equipments execute the feature collection that characteristic judges command sequence acquisition equipment support in automated log on test envelope, thus raw
Information is supported at the characteristic of all devices, supports the feature set that record has every physical equipment to support in information in device characteristics
It closes;Test assignment supports situation to automatically select suitable object in mapping logic equipment, according to the characteristic in equipment characteristic information
Reason equipment is tested;Time-consuming cumbersome manual configuration task time is eliminated by the method, and will not be malfunctioned, is simplified
The execution work of automation.
Detailed description of the invention
Fig. 1 is dynamic acquisition physical equipment characteristic of the present invention and carries out logical device and the matched whole process of physical equipment
Schematic diagram.
Fig. 2 is the signal of information accessed by the characteristic of all physical equipments supports of dynamic acquisition test envelope of the present invention
Figure.
Fig. 3 is that the demand of characteristic needed for all logical device in test assignment of the present invention limits the schematic diagram of explanation.
Fig. 4 is the schematic diagram of the invention for mapping physical equipment process for logical device automatically.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention more comprehensible, right hereinafter, referring to the drawings and the embodiments,
Scheme of the present invention elaborates.
One of the embodiment of the present invention provides a kind of device selection method of automatic test, referring to Fig.1, the present embodiment
Assuming that all physical equipments all connect normally, transmitting order to lower levels can be logged in, while having test assignment T.Specific step is as follows:
S1: logging in all physical equipments in test envelope, executes characteristic and judges that command sequence obtains the branch of every physical equipment
Characteristic is held, the support characteristic of every physical equipment to get forms set as element, generates every according to obtained set
The characteristic of physical equipment supports information;
S2: the demand characteristics information of all logical device is described in test assignment T;
S3: information is supported according to the characteristic of the property requirements of logical device and physical equipment, is one by one all logical device
Map a physical equipment.
It is the process that dynamic acquisition separate unit physical equipment supports characteristic in the present invention referring to Fig. 2, Fig. 2, the specific steps are as follows:
S11: a wherein physical equipment in test envelope is logged in, the serial number of characteristic to be judged is initialized;Such as initial compound
Manage device characteristics serial number m=1;
S12: obtaining the characteristic to be judged of current sequence number, if currently characteristic to be judged is sky, carries out step S15, ties
The characteristic of beam present physical equipment supports acquisition of information, otherwise carries out step S13;Such as get the spy to be judged of current sequence number
Property Fm, wherein m indicates physics device characteristics serial number, such as works as m=1, then Fm is F1, indicates the characteristic to be judged of serial number 1;
Currently whether characteristic Fm to be judged is that sky carries out step S15, otherwise carry out if currently characteristic Fm to be judged is sky for judgement
Step S13;
S13: according to the current characteristic to be judged got, executing characteristic and judge command sequence, obtains physical equipment to working as
The support result of preceding characteristic to be judged;
S14: result write-in physical equipment characteristic will be supported to support message file, and the serial number for executing characteristic to be judged adds certainly
One, return continues to execute step S12;Such as physical equipment supports currently characteristic Fm to be judged, then result Y will be supported to support to write
Enter physical equipment characteristic and support message file, if physical equipment does not support currently characteristic Fm to be judged, will support that result N is
It does not support write-in physical equipment characteristic to support message file, then executes m=m+1, continue step S12;
S15: the characteristic for terminating present physical equipment supports acquisition of information.
As shown in figure 3, the property requirements of the logical device of test assignment T illustrate, there is 1 to patrol to multiple in a test assignment
Equipment is collected, such as test assignment T includes logical device L1, logical device L2 ... logical device Ln, wherein n=1,2,3, n;
Logical device L1 includes its demand characteristics F1, and F3, logical device L2 include its demand characteristics F4, and F5, logical device Ln include it
Demand characteristics F7, F8;
It is the process for being automatically logical device mapping physical equipment referring to Fig. 4, Fig. 4.Specific step is as follows:
S31: test assignment T, initialization logic equipment serial number are executed;Such as initialization logic equipment serial number n=1;
S32: obtaining the logical device of the current sequence number of test assignment T, judges whether current logic equipment is sky, if worked as
Preceding logical device is sky, then carries out step S37, shows that all logical device of test assignment T all map physical equipment success, no
Then carry out step S33;Such as obtaining the current sequence number of test assignment T is the logical device Ln of n, judges that current logic equipment Ln is
No is sky, then carries out step S37 for sky, otherwise carries out step S33;
S33: the property requirements information of current logic equipment is read;Such as serial number n=1, then current logic equipment is read
The property requirements of L1 are L1, L3;
S34: traversing idle physical equipment set, chooses present physical equipment, if present physical equipment is sky, into
Row step S37 shows logical device mapping physical equipment failure, and the logical device of entire test assignment T maps failure, otherwise after
It is continuous to carry out step S35;
S35: the characteristic for reading present physical equipment supports message file, carries out with the special type demand of current logic equipment special
Property support matching, if present physical equipment does not support the demand characteristics of current logic equipment, return step S34 shows to work as
Preceding physical equipment is unsatisfactory for the requirement of current logic equipment, otherwise carries out step S36;Such as the characteristic of present physical equipment is supported
Message file includes: that present physical equipment P1 (physical equipment of P1 expression serial number 1) supports characteristic F1, then supports that result is Y,
Present physical equipment P1 does not support characteristic F2, then supports that result is that N ... present physical equipment P1 supports characteristic Fn, then support to tie
Fruit is Y, if the special type demand of current logical device L1 is F1, F3, the characteristic for searching present physical equipment supports information text
To characteristic F1 in part, the support of F3 carries out step S36, otherwise return step S34 as a result, if supporting that result is all Y;
S36: record current logic equipment and present physical equipment successful match information, while present physical equipment from
It is deleted in idle physical equipment set, executes logical device serial number from adding one, then return step S32, carries out next patrols
Collect the mapping of equipment;Such as before logical device mapping, physical equipment P1, P2 ... Pe are idle, form idle physics and set
Standby set, after physical equipment P1 and logical device Ln successful match, by physical equipment P1 from idle physical equipment set
It deletes, and executes n=n+1, return step S32 carries out the mapping of next logical device;
S37: all logical device mapping results of test assignment.
Another embodiment of the present invention provides a kind of device selection system of automatic test, comprising: physical equipment characteristic
Acquiring unit, test assignment unit and equipment selecting unit;The physical equipment characteristic acquiring unit is sentenced by executing characteristic
Disconnected command sequence obtains the support characteristic of every physical equipment, is member according to the support characteristic of the every physical equipment acquired
Element composition set supports information according to the characteristic that obtained set generates all devices;The test assignment unit description is all
The demand characteristics information of logical device and all logical device;The equipment selecting unit is according to the demand characteristics of logical device
The support characteristic information of information and physical equipment maps a physical equipment one by one for all logical device;
The physical equipment characteristic acquiring unit judges command sequence by executing characteristic, obtains characteristic and supports as a result, will
Characteristic supports result write-in physical equipment characteristic to support message file;
The equipment selecting unit inquires object according to the demand characteristics information of the logical device of test assignment unit description
Managing device characteristics supports the characteristic of message file record to support as a result, if characteristic supports that result is Y, logical device and physics
Equipment successful match, otherwise it fails to match.
In conclusion the characteristic that the present invention is supported by dynamically obtaining equipment, while with simple in test assignment
Mode states the property requirements of required logical device, to automatically select suitable equipment in test envelope when test assignment executes
It is tested;Key of the invention is physical equipment characteristic and the command sequence of characteristic judgement supported to illustrate to formulate, and
The characteristic that all physical equipments of dynamic acquisition are supported;Meanwhile it being said in test assignment by the property requirements of logical device for the first time
It is bright, reach when equipment is selected the mesh for illustrating to map corresponding physical equipment for all logical device automatically according to property requirements
's.
Those of ordinary skill in the art will understand that the embodiments described herein, which is to help reader, understands this hair
Bright principle, it should be understood that protection scope of the present invention is not limited to such specific embodiments and embodiments.This field
Those of ordinary skill disclosed the technical disclosures can make according to the present invention and various not depart from the other each of essence of the invention
The specific variations and combinations of kind, these variations and combinations are still within the scope of the present invention.