Background technology
Network test instrument be a kind of can to osi model definition physical layer, data link layer, Internet,
Transport layer, session layer, expression layer and application layer carry out function, performance, vulnerability testing, and can assist
View concordance and portable, the visual intelligent detection equipment of emulation testing, be primarily adapted for use in disparate networks product
Test.
Test currently with tester, rely primarily on tester's Artificial Control.Tester is as one
Share resource, be typically managed collectively by special messenger, application to be preengage before tester's use.When really using,
First to check that the resource of application is the most idle, can only wait or again preengage if occupied.Before test starts,
Tester typically can first be familiar with the related content of test case, such as testing tool, test environment, test mesh
, testing procedure, test oracle etc., afterwards the tested network equipment is connected with tester, builds test
Environment.Tester can be with reference to the requirement of test case, the parameter of manual configuration tester.After configuration,
Bring into operation test.Tester will test run process all the time, record and contrast the result that tester obtains
With the expection of test case, if having multiple processes result it is necessary to repeatedly.After test run terminates,
Tester terminates test, and release tester uses for other people, so far, completes whole test process.
Existing tester is utilized during testing, to be primarily present following problem:
1, test instrumentation resource utilization is low.In current test environment, the port of instrument is exclusive formula
The when that use pattern, i.e. tester needing to use certain test instrumentation in test assignment, just by instrument
It is placed in an independent test environment with networking products, after having tested, removes test environment, instrument port
Could discharge and be used by other test assignments.Owing to instrument port is very limited, and test and generally require
Take multiple port, and the time is uncertain, often occur that several tester waits in line to use tester
Table, and the unmanned inconsistency used of instrument sometimes, this occupation mode affects tester's work efficiency,
Cause test instrumentation resource utilization relatively low.
2, test instrumentation configuration management is complicated.In current test environment, the measuring executing process of instrument is
It is automatically performed, but instrument arrangement management and test data collection process have been manually done.Tester
Need the requirement according to test assignment, the various parameters in configuration instrument, collect and arrange various test result
Data.Due to test instrumentation function from strength to strength, configuration also become increasingly complex, the configuration of test instrumentation
Considerable background knowledge is needed with the process of use;And different vendor, the instrument arrangement of different model and make
Method have the biggest difference, the study of tester and to be familiar with process longer.
3, manual configuration test instrumentation is unfavorable for carrying out parallel of multiple test assignment.Manually instrument is joined
Put operation and be always likely to occur mistake, particularly in the case of instrument becomes increasingly complex.Often lift one
The example seen, each test assignment uses different ports, if tester obscures during configuration
The instrument port of two tasks, then just producing between two tasks and interfere with each other, this situation is manually
It is recurrent during configuration.
Summary of the invention
In view of above-mentioned analysis, it is desirable to provide a kind of system realizing automatic adaptation of network testing instrument
And method, in order to solve, the existing network test instrumentation utilization of resources is insufficient, testing efficiency low, test can
Problem by property difference.
The purpose of the present invention is mainly achieved through the following technical solutions:
The invention provides a kind of system realizing automatic adaptation of network testing instrument, including:
Adapted resource parsing module, for resolving the adapted resource file of current test script definition, is fitted
Join resource characteristic bit string;
Virtual instrument describing module, in advance by abstract for test instrumentation for having standard attribute, operation and side
The virtual instrument file of method;
Virtual instrument parsing module, describes file, Shen for resolving the virtual instrument of virtual instrument describing module
Please obtain virtual instrument example;
Virtual instrument Registering modules, for the adapted resource characteristic information obtained according to adapted resource parsing module
The virtual instrument example that string and virtual instrument parsing module obtain, the virtual instrument that registration obtains embodying is real
Example;
Physics instrument describing module, describes file and physics instrument adapter, each physics including physics instrument
The corresponding physics instrument of instrument adapter;
Physics instrument parsing module, is used for resolving physics instrument and describes file, obtain physics instrument adapter
Index mapping table;
Physical vlan instrument binding module, for reflecting the index of virtual instrument example with physics instrument adapter
Firing table carries out rule match, is moved with the physics instrument adapter that the match is successful by virtual instrument example afterwards
State is bound, and obtains the physics instrument embodied;
Test script running module, for loading the test process file of current test script definition, drives tool
Physics instrument after body, performs test process.
Further, described physical vlan instrument binding module is additionally operable to, after test completes, by Virtual instrument
Table example and physics instrument adapter carry out solving binding, the physics instrument that release embodies.
Further, described virtual instrument Registering modules is additionally operable to, and nullifies virtual instrument example, and exports survey
Result of trial operation.
Present invention also offers a kind of method realizing automatic adaptation of network testing instrument, including:
Loading test script, test script includes adapted resource file and test process file;
Adapted resource parsing module resolves the adapted resource file of current test script definition, obtains adapted resource
Characteristic information string;
Virtual instrument parsing module resolves the predefined virtual instrument of virtual instrument describing module, and application obtains
Virtual instrument example;
Virtual instrument Registering modules, for the adapted resource characteristic information obtained according to adapted resource parsing module
The virtual instrument example that string and virtual instrument parsing module obtain, the virtual instrument that registration obtains embodying is real
Example;
Physics instrument parsing module, is used for resolving physics instrument and describes file, obtain physics instrument adapter
Index mapping table;
The index mapping table of virtual instrument example Yu physics instrument adapter is carried out rule match, afterwards by void
Intend instrument example and carry out dynamic binding with the physics instrument adapter that the match is successful, obtain the physics instrument embodied
Table;
Test script running module loads the test process file of current test script definition, drives after embodying
Physics instrument, perform test process.
Further, also include:
After having tested, described physical vlan instrument binding module is adaptive with physics instrument by virtual instrument example
Device carries out solving binding, the physics instrument that release embodies.
Further, also include:
Described virtual instrument Registering modules nullifies virtual instrument example, and exports test run result.
The present invention has the beneficial effect that:
The system and method that the present invention provides, the abstract basic feature of test instrumentation, user can call void
The feature interface intending instrument handles materialization test instrumentation, and it is suitable to be added as needed on corresponding test instrumentation
Without the concern for specifically during orchestration, it is ensured that autgmentability is strong, and ease for use is good, and system framework and scripting
The details of operation of test instrumentation, processing mode is simple, and efficiency is high.
Other features and advantages of the present invention will illustrate in the following description, and, part from explanation
Book becomes apparent, or understands by implementing the present invention.The purpose of the present invention and other advantages can
Realize by structure specifically noted in the description write, claims and accompanying drawing and obtain
?.
Detailed description of the invention
Specifically describing the preferred embodiments of the present invention below in conjunction with the accompanying drawings, wherein, accompanying drawing constitutes the application one
Part, and together with embodiments of the present invention for explaining the principle of the present invention.For purpose of clarity and simplification,
When it may make subject of the present invention smudgy, will omit in device described herein known function and
Illustrating in detail of structure.
First, in conjunction with accompanying drawing 1, system described in the embodiment of the present invention is described in detail.
As it is shown in figure 1, Fig. 1 is the structural representation of system described in the embodiment of the present invention, specifically may include that
Adapted resource parsing module 101, virtual instrument describing module 102, virtual instrument parsing module 103, virtual
Instrument Registering modules 104, physics instrument describing module 105, physics instrument parsing module 106, physical vlan
Instrument binding module 107 and test script running module 108, wherein,
Adapted resource parsing module 101, this module is used for resolving the adapted resource file of test script definition,
To adapted resource characteristic information string.Adapted resource characteristic information string uses the form of JSON string, and i.e. one unordered
" ' name/value ' to " set.Using ", " (comma) to separate between " ' name/value ' to ", ": " (emits
Number) it is above " title ", ": " (colon) is followed by " value ".It is exactly that adapted resource resolves specifically
Module is according to the test-types of adapted resource document definition, test event, test time, test instrumentation
Model, test instrumentation management address, surveyed protocol type, required port quantity, required port speed, institute
Needing the characteristic informations such as port address, wherein characteristic information is as title, and the value of characteristic information is as value, successively
By above-mentioned information composition some " ' name/value ' to ", finally by these characteristic informations to being assembled into adapted resource
Characteristic information string.
The form of adapted resource characteristic information string is described below by a concrete example, as follows:
Virtual instrument describing module 102, this module is that virtual instrument describes file, is used for all kinds of test instrumentations
Abstract is general " virtual instrument " with standard attribute, operation and method.Standard attribute is virtual
The internal data set of instrument, for recording the various software and hardware information of test instrumentation, and for standard operation and
Standard method is called;Standard operation is the interface that virtual instrument is supplied to outside, in order to handles test instrumentation and holds
The various test processs of row;Standard method is the interface that virtual instrument is supplied to outside, in order to monitor test in real time
The running status of instrument and software and hardware information.
Wherein, the standard attribute of virtual instrument includes title, type, model, hardware description information, software
Description information, board quantity, board port number, port model, port speed, port communication rate;Virtual
The standard operation of instrument includes initialization of virtual instrument, loads adapted resource characteristic information string, the common association of operation
Association is combined in view flow, operation benchmark protocol traffic, operation attack traffic, Dynamic simulation protocol traffic, operation
View flow, operation playback protocol traffic, port switching state, statistics error message, acquisition real-time testing knot
Really, final testing result is obtained;The standard method of virtual instrument includes checking virtual instrument title, checking void
Intend meter type, check virtual instrument model, check virtual instrument hardware description information, check virtual instrument
Software description information, check virtual instrument board quantity, check the port number of virtual instrument board, check void
Intend instrument port model, check virtual instrument port speed, check virtual instrument port communication rate, check void
Intend instrument CPU usage, check virtual instrument memory usage.
Virtual instrument parsing module 103, this module is used for resolving the virtual instrument of virtual instrument describing module and describes
File, application initialization of virtual instrument example.Virtual instrument parsing module describes file according to virtual instrument
Content, dynamically generate the virtual instrument example including all of standard attribute, operation and method, depend on afterwards
Secondary give default value for standard attribute, thus complete the initialization of virtual instrument example.
Virtual instrument Registering modules 104, this module is used for the adapted resource obtained according to virtual instrument parsing module
The virtual instrument example that characteristic information string and virtual instrument parsing module obtain, registration obtains the void embodied
Intend instrument example;After test run terminates, before generating test result, this module is additionally operable to nullify void
Intend instrument example.
The process of registration virtual instrument includes verifying adapted resource characteristic information string, by adapted resource characteristic information
String is dynamically loaded into virtual instrument example.First, the grammatical structure that virtual instrument Registering modules is gone here and there according to JSON,
Adapted resource characteristic information string is carried out syntactic verification, afterwards, includes if characteristic information string is split into one
The set of dry " ' name/value ' to ", then, obtains title and the value of each " ' name/value ' to " successively,
And carry out the verification of span, so far complete the checking procedure of characteristic information string, finally by characteristic information value
Rule match is carried out, when characteristic information and complete of a certain standard attribute with the standard attribute of virtual instrument example
Timing, is entered as this feature value of information by standard attribute, until all characteristic informations are loaded into virtual instrument
Example, thus complete whole registration process.
Physics instrument describing module 105, this module is to describe physics instrument attribute and control the adapter of operation
Set.Physics instrument describing module includes that multiple physics instrument describes file and multiple physics instrument adapter.
Model according to physics instrument is different, has different types of physics instrument adapter.Physics instrument adapter
General-purpose attribute include test-types, test event and test instrumentation model.Physics instrument adapter general
Control operation to include the initialization of physics instrument, loading configuration file, testing results, output test result and whole
Only test.
Physics instrument describes file and uses XML file format, below by a concrete example, physics is described
Instrument describes the form of file, as follows:
Physics instrument parsing module 106, this module is used for resolving physics instrument and describes file, obtains physics instrument
The index mapping table of adapter.First, physics instrument describing module resolves the adapter element describing file,
Obtain the content of element.In above example, i.e. obtain three file daughter elements of adapter element, this table
Bright this describes file and includes three adapters.And then, more successively resolve adapter element content, fitted
Orchestration title, description information and storage position.In above example, i.e. resolve each file attribute of an element,
Name attribute correspondence adapter name, path attribute correspondence adapter storage position, desc attribute correspondence is adaptive
Device describes information.Finally, the above-mentioned Adapter Information obtained is saved in index mapping table.This index maps
Table is with physics instrument adapter name for index, for recording description information and the storage position of adapter, its
In the corresponding call number of each physics instrument adapter name.
Physical vlan instrument binding module 107, this module is used for virtual instrument example and physics instrument adapter
Index mapping table carry out rule match, when test instrumentation model and the physics instrument of virtual instrument example are adaptive
When a certain index of the index mapping table of device mates completely, then show that the match is successful, otherwise, it fails to match.
Afterwards virtual instrument example is carried out dynamic binding with the physics instrument adapter that the match is successful, obtain and embody
Physics instrument.This module is additionally operable to, after test run terminates, before generating test result, by void
Intend instrument example and carry out solving binding, the physics instrument that release embodies with physics instrument adapter.
Test script running module 108, this module is used for loading the test process literary composition of current test script definition
Part, drives the physics instrument after embodying, and performs test process.
It follows that combine accompanying drawing 2, method described in the embodiment of the present invention is described in detail.
As in figure 2 it is shown, Fig. 2 is the schematic flow sheet of method described in the embodiment of the present invention, this process employs
Said apparatus, specifically may include steps of:
Step 201: loading test script, test script includes adapted resource file and test process file;
Step 202: resolve the adapted resource file of current test script definition;That is, according to adapted resource file
The management of the test-types of definition, test event, test time, test instrumentation model, test instrumentation
The characteristic informations such as location, surveyed protocol type, required port quantity, required port speed, required port address,
Generate adapted resource characteristic information string;
Step 203: virtual instrument parsing module resolves the predefined virtual instrument of virtual instrument describing module,
Application obtains virtual instrument example;
Step 204: registration virtual instrument example, including three steps: initialization of virtual instrument example, verification
Adapted resource characteristic information string, is dynamically loaded into virtual instrument example by adapted resource characteristic information string;
Step 205: the adapted resource feature letter that virtual instrument Registering modules obtains according to virtual instrument parsing module
The virtual instrument example that breath string and virtual instrument parsing module obtain, registration obtains the virtual instrument embodied
Example;
Step 206: physics instrument parsing module resolves physics instrument and describes file, obtains physics instrument adapter
Index mapping table;
Step 207: the index mapping table of virtual instrument example Yu physics instrument adapter is carried out rule match,
Afterwards virtual instrument example is carried out dynamic binding with the physics instrument adapter that the match is successful, obtain and embody
Physics instrument;
Step 208: test script running module loads the test process file of current test script definition, drives
Physics instrument after materialization, performs test process;
Step 209: stop test instrumentation, completes test;
Step 210: after having tested, physical vlan instrument binding module is by virtual instrument example and physics instrument
Adapter carries out solving binding, the physics instrument that release embodies;
Step 211: virtual instrument Registering modules nullifies virtual instrument example;
Step 212: output test run result.
In sum, embodiments provide a kind of system realizing automatic adaptation of network testing instrument and
Method, test instrumentation is quoted and handles respectively by adapted resource file and virtual instrument by test script,
And the process obtaining test instrumentation is by virtual instrument and the dynamic binding of physics instrument, the completeest by system
Become.
Having the beneficial effect that of the embodiment of the present invention:
(1) test instrumentation Resource dynamic allocation and release.Improve the utilization ratio of instrument, improve test assignment
Concurrency.
(2) provide unified configuration file, reduce the requirement to tester, reduce the probability of maloperation.
As long as tester is familiar with a kind of configuration file format, it is not necessary to learn the operational approach of every kind of instrument, and
The instrument resource corresponding to this task can only be configured, disturb between elimination task, reduce manual errors probability.
(3) test instrumentation Typical Disposition case, automatization, improves testing efficiency.Native system can be in nothing
Automatically work in the case of people is on duty, even if also being able to automatically perform test assignment in the quitting time.
(4) test process is repeatable.Test script file is all stored in server, when needing to retest,
Only need to recall corresponding file just can automatically test, it is not necessary to manual repetition configures instrument.
The above, the only present invention preferably detailed description of the invention, but protection scope of the present invention not office
Being limited to this, any those familiar with the art, can be easily in the technical scope that the invention discloses
The change expected or replacement, all should contain within protection scope of the present invention.Therefore, the protection of the present invention
Scope should be as the criterion with the protection domain of claims.