CN101013977A - Network testing method and system - Google Patents
Network testing method and system Download PDFInfo
- Publication number
- CN101013977A CN101013977A CN 200710026833 CN200710026833A CN101013977A CN 101013977 A CN101013977 A CN 101013977A CN 200710026833 CN200710026833 CN 200710026833 CN 200710026833 A CN200710026833 A CN 200710026833A CN 101013977 A CN101013977 A CN 101013977A
- Authority
- CN
- China
- Prior art keywords
- interpreter
- sub
- equipment under
- test
- under test
- 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.)
- Pending
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses one network test method, which comprises the following steps: running test legs aiming for each tested device to generate relative sub explanation process and running sub explanation process and to test the said device. The invention method can execute test leg to test multiple device to reduce execution time and to improve test efficiency.
Description
Technical field
The present invention relates to the communications field, relate in particular to a kind of method and system of network test.
Background technology
Along with the scale and the technical complexity of network are increasing, the quantity of miscellaneous service data sharply increases, the network operation, to administer and maintain cost also more and more higher, and the construction of network test adjoint network, operation, management and safeguard one, improving network test efficient is one of approach that reduces cost.Script technology is generally adopted in network automatically test at present, and further development is that Object-oriented Technique is introduced in the network test.Carry out abstract to test process, equipment, tester etc. and encapsulation by OO script technology, greatly improved sharing and repeat usage of script, thereby improved testing efficiency.
Present script system is the utilization interpretative code, and (Tool CommandLanguage TCL), carries out writing of test script, realizes the purpose of test automatically as Tool Command Language.And by OO interpretative code, as OO Tool Command Language (Incr Tool Command Language, ITCL), equipment class, tester class are encapsulated, and an encapsulation test action, the synthetic order serial of test script is carried out, test result is contrasted automatically, improve the efficient of writing of script, had the characteristics of consistency, repeatability, high transplantability.
In long-term practice process, it is very complicated to find to work as the network of testing, under a lot of situation of equipment under test, need to carry out information interaction with each equipment, as shown in Figure 1, operate under single interpreter condition at existing test script, be that serial is carried out, be after single interpreter Run Script is tested first equipment under test 1, single interpreter script that reruns is tested second equipment under test, and the time of an equipment under test of operation is T, if N equipment under test arranged, then need to move the time of T * N, thereby cause the script executing time long, influence testing efficiency.
Summary of the invention
Embodiment of the invention technical problem to be solved is, a kind of method and system of network test are provided, and can reduce the script executing time, improves testing efficiency.
In order to solve the problems of the technologies described above, the method for a kind of network test of the embodiment of the invention comprises at least:
The operation test script generates corresponding sub-interpreter process at each equipment under test;
The sub-interpreter process of parallel running is tested described equipment under test.
Correspondingly, a kind of network test system of the embodiment of the invention, this system comprises at least: main interpreter, at least one equipment under test, the sub-interpreter corresponding with each described equipment under test, wherein,
Main interpreter is used to move test script, generates corresponding sub-interpreter process at each described equipment under test;
Sub-interpreter is used to move described sub-interpreter process, tests the equipment under test of this sub-interpreter correspondence.
In sum, a kind of network test method and system of the embodiment of the invention are by generating a corresponding sub-interpreter at each equipment under test, many equipment under tests just have a plurality of sub-interpreters, all sub-interpreter parallel running scripts come all equipment under tests are tested simultaneously, reduce script in the time of running time, also improved testing efficiency.
Description of drawings
Fig. 1 is the structural representation of the test frame under single interpreter condition in the prior art;
Fig. 2 is the structural representation of a kind of network test system of the embodiment of the invention;
Fig. 3 is the structural representation of a kind of main interpreter of the embodiment of the invention;
Fig. 4 is the structural representation of a kind of sub-interpreter of the embodiment of the invention;
Fig. 5 is the flow chart of method of a kind of network test of the embodiment of the invention;
Fig. 6 is the flow chart that utilizes the step of executed in parallel order executed in parallel script in a kind of method of network test of the embodiment of the invention;
Fig. 7 is the flow chart that utilizes the step of sharing the order shared variable in a kind of method of network test of the embodiment of the invention;
Fig. 8 utilizes synch command to make the flow chart of the synchronous step of each process in a kind of method of network test of the embodiment of the invention.
Embodiment
The method and system of a kind of network test that the embodiment of the invention provides are by generating corresponding sub-interpreter according to each equipment under test, and when test, all sub-interpreters of parallel running simultaneously all equipment under tests test.
Specifically set forth the technical scheme of method and system of a kind of network test of the embodiment of the invention below in conjunction with accompanying drawing.
With reference to figure 2, be the structural representation of a kind of network test system of the embodiment of the invention; According to this figure, a kind of network Auto-Test System comprises: script memory cell 21, main interpreter 22, an a N equipment under test and corresponding N sub-interpreter, what wherein, couple with first equipment under test 25 is the first sub-interpreter 23, what couple with second equipment under test 26 is the second sub-interpreter 2, what couple with the N equipment under test is the sub-interpreter of N.
Wherein, script memory cell 21 is used to store and is used for the automatically test script of test of network;
When carrying out network test, system starts N the sub-interpreter process of sub-interpreter parallel running simultaneously, walk abreast N equipment under test tested, that is: 23 pairs first equipment under tests 25 of the first sub-interpreter are tested, 24 pairs second equipment under tests 26 of the second sub-interpreter are tested, the sub-interpreter of N is tested the N equipment under test.
When specific implementation, as shown in Figure 3, the main interpreter 22 among described Fig. 2 comprises at least:
Context copied cells 33 couples with sub-interpreter generation unit 32, is used for the test script of the context of main interpreter and described each equipment under test correspondence is copied to respectively the sub-interpreter of this equipment under test correspondence.
When specific implementation, as shown in Figure 4, the sub-interpreter among described Fig. 2 comprises at least:
Script operation unit 42 is used to move described test script;
Operation result feedback unit 43 couples with script operation unit 42, is used for the operation result of described sub-interpreter is backfilling into described main interpreter.
More than elaborate the technical scheme of a kind of network test system of the embodiment of the invention, elaborated the technical scheme of method of a kind of network test of the embodiment of the invention below in conjunction with Fig. 5, Fig. 6, Fig. 7 and Fig. 8.
The method of a kind of network test of the embodiment of the invention comprises at least: the operation test script generates corresponding sub-interpreter process at each equipment under test; The sub-interpreter process of parallel running is tested described equipment under test.
When specific implementation,, be the flow chart of method of a kind of network test of the embodiment of the invention with reference to figure 5; Can utilize object-oriented interpretative code (ITCL) to carry out writing of test script.As known in the figure, a kind of method of network test comprises:
Step S501, main interpreter is moved test script initialization and configuration equipment under test, and generates its corresponding equipment under test dummy unit at each equipment under test, as: object;
Step S502, main interpreter generates corresponding sub-interpreter (as, TCL interpreter) according to each described equipment under test dummy unit;
Step S503, main interpreter copies to the test script of its context and each equipment under test correspondence respectively in the sub-interpreter of this equipment under test correspondence to generate corresponding sub-interpreter process;
Step S504, the described sub-interpreter process of parallel running is tested described equipment under test;
Step S505, when all equipment under tests all test finish after, system will walk abreast and remove the configuration of equipment under test.
Wherein, in step S504, the sub-interpreter process of described parallel running is tested described equipment under test and is specially, and can move sub-interpreter process by the executed in parallel order, and the test script of each equipment under test correspondence of executed in parallel specifically comprises:
Global variable corresponding with described sub-interpreter in the described main interpreter is copied in each sub-interpreter the described test script of operation in described each sub-interpreter process respectively;
Operation result is backfilling in the main interpreter process.
When specific implementation, described executed in parallel order can be ordered example for PAL:
Object 1 PAL{
Test script 1
}
Object 2 PAL{
Test script 2
}
Object n PAL{
Test script n
}
As shown in Figure 6, when system carries out above-mentioned PAL order, executed in parallel is comprised the script of n object correspondence of object 1, object 2, wherein, specifically can comprise at the step of object 1:
Step S601, the object 1 that calls the PAL order obtains object 1 corresponding device classification;
Step S602 in the first sub-interpreter of object 1 correspondence that generates, generates the object of same title according to the equipment class under the object 1, also is referred to as object 1;
Step S603 copies to the global variable of object in the main interpreter 1 in the first sub-interpreter of its correspondence;
Step S604, the journal file title and the path thereof that obtain main interpreter are left in the same daily record log information of sub-interpreter and main interpreter in;
Step S605, the test script 1 of object 1 correspondence that operation PAL order comprises in the first sub-interpreter;
Step S606 is backfilling into operation result in the main interpreter.
According to this figure as can be known, system is when carrying out object 1, object 2 and object n are also in operation, and the step at the step of other object and object 1 is identical, only be that title has become, such as: change object 1 into object 2, the corresponding first sub-interpreter changes the second sub-interpreter into, test script 1 changes test script 2 into.
Executed in parallel order among this embodiment, we are only with the PAL name, and for those of ordinary skills, its name and concrete syntax structure can be easy to associate also has other replacement schemes, is not limited to this.
Alternatively, in the specific implementation, the invention process regular meeting relates to the situation that some variable calls simultaneously or revises in a plurality of processes, therefore, in the method for a kind of network test shown in Figure 5, can also comprise and utilize the step of sharing order shared variable between a plurality of processes, described shared order can be SET order, its syntactic structure can for:
SET?variable?value?
Wherein, variable is a name variable;
Value is a parameter value, is with this parameter value, and variable variable assignment value is given in representative; Do not represent the value of query interface variable with this parameter value.
As process transfer SET variable? value? the time, the step that system carries out specifically comprises as shown in Figure 7:
Step S70 judges after SET orders whether have parameter value (value);
When the judged result of step S70 is that value exists, then enter step S711, that is: judge whether to exist the internal memory of depositing described parameter value, if, then enter step S712, otherwise, execution in step S714;
Step S712 has judged whether that other process operates described internal memory, if, then enter step S713, otherwise, step S715 entered;
Step S713, wait for that other process operation finishes after, directly enter step S715;
Step S714 is to value application internal memory;
Step S715 writes value in the described internal memory.
When the judged result of step S70 is that value does not exist, then enter step S721, that is: search the internal memory of depositing value, enter step S722 then
Step S722 has judged whether that other process operates described internal memory, if, execution in step S723, otherwise, step S724 entered;
Step S723, wait for that other process finishes to described internal memory operation after, directly enter step S724;
Step S724 obtains value.
Shared order among this embodiment, we are only with the SET name, and for those of ordinary skills, its name and concrete syntax structure can be easy to associate also has other replacement schemes, is not limited to this.
Alternatively, when specific implementation, the invention process regular meeting relates to provides each process synchronously or wait for the situation that the preferential operation of some process finishes, the method of then described a kind of network test shown in Figure 5 also comprises by the synch command step of each process synchronously, described synch command can be the WAIT order, wherein, the syntactic structure of WAIT order can for:
WAIT?object1/handle1?object2/handle2....
Wherein, object represents a certain equipment under test dummy unit, as: object; Handle represents a certain process handle.
Two functions of the main realization of described WAIT order: first kind is that all processes of waiting for a certain device object all finish, and moves current script then; Second kind is that certain process of waiting for a certain device object finishes, and moves current script then.
When process transfer WAIT object/handle, the step that system carries out comprises as shown in Figure 8:
Step S801 judges that the parameter of WAIT order is object (object) or process handle (handle), if object, execution in step S802 then, otherwise described parameter is a process handle, then execution in step S805;
Step S802 obtains the sub-interpreter process that has generated of its correspondence according to described object;
Step S803 checks whether described sub-interpreter process is moved, if, execution in step S804, otherwise, execution in step S806;
Step S804 after the test script operation of waiting for described sub-interpreter process finishes, directly enters step S806;
Step S805 after the process operation of waiting for described process handle correspondence finishes, enters step S806;
Step S806 moves the test script of described sub-interpreter process.
Synch command among this embodiment, we are only with the WAIT name, and for those of ordinary skills, its name and concrete syntax structure can be easy to associate also has other replacement schemes, is not limited to this.
The method of a kind of network test of the foregoing description is to adopt the ITCL language to carry out writing of test script, certainly be not limited thereto, can utilize other OO interpretative code to write test script equally, and can be stored in the computer read/write memory medium, be convenient to the engineering test personnel and use, to realize that the many equipment of network are carried out concurrent testing.
In sum, the method and system of a kind of network test that the embodiment of the invention provides are by generating a corresponding sub-interpreter at each equipment under test, many equipment under tests just have a plurality of sub-interpreters, all sub-interpreter parallel running scripts come all equipment under tests are tested simultaneously, for the configuration that walks abreast of many equipment under tests, look content for script efficient, allocative efficiency can improve average about 30%; If calculate with m platform equipment under test, every device initialize needs n second, can reduce 70%m * n second during executed in parallel; Behind EOT, parallel configuration of removing equipment under test makes overall efficiency improve 10% simultaneously.
Above disclosed is a kind of preferred embodiment of the present invention only, can not limit the present invention's interest field certainly with this, and therefore the equivalent variations of doing according to claim of the present invention still belongs to the scope that the present invention is contained.
Claims (10)
1, a kind of method of network test is characterized in that, this method comprises at least:
The operation test script generates corresponding sub-interpreter process at each equipment under test;
The sub-interpreter process of parallel running is tested described equipment under test.
2, the method for claim 1 is characterized in that, describedly generates corresponding sub-interpreter process at each equipment under test and specifically may further comprise the steps:
Generate corresponding sub-interpreter at each equipment under test;
Respectively the test script of the context of main interpreter process and described each equipment under test correspondence is copied in the sub-interpreter of this equipment under test correspondence to generate corresponding sub-interpreter process.
3, method as claimed in claim 1 or 2 is characterized in that, the sub-interpreter process of described parallel running is tested described equipment under test and is specially, and moves sub-interpreter process by the executed in parallel order, the test script of each equipment under test correspondence of executed in parallel.
4, method as claimed in claim 3 is characterized in that, describedly moves sub-interpreter process by the executed in parallel order, and the test script of each equipment under test correspondence of executed in parallel specifically comprises:
Global variable corresponding with described sub-interpreter in the described main interpreter is copied in each sub-interpreter the described test script of operation in described each sub-interpreter process respectively;
Operation result is backfilling in the main interpreter process.
5, method as claimed in claim 3 is characterized in that, described method also comprises by shared variable order shared variable between a plurality of processes.
6, method as claimed in claim 3 is characterized in that, described method also comprises by synchronous each process of synch command.
7, a kind of network test system is characterized in that, this system comprises at least: main interpreter, at least one equipment under test, the sub-interpreter corresponding with each described equipment under test, wherein,
Main interpreter is used to move test script, generates corresponding sub-interpreter process at each described equipment under test;
Sub-interpreter is used to move described sub-interpreter process, tests the equipment under test of this sub-interpreter correspondence.
8, as right 7 described systems, it is characterized in that described system also comprises:
The script memory cell, storage is used for the test script of network test.
9, system as claimed in claim 8 is characterized in that, described main interpreter comprises:
Initialization unit is used for generating corresponding equipment under test dummy unit at each equipment under test;
Sub-interpreter generation unit is used for generating corresponding sub-interpreter according to each described equipment under test dummy unit;
The context copied cells is used for duplicating respectively the sub-interpreter of the test script of the context of main interpreter process and described each equipment under test correspondence to this equipment under test correspondence.
10, system as claimed in claim 9 is characterized in that, described sub-interpreter comprises:
The context receiving element is used to receive the context and the equipment under test corresponding test script corresponding with this sub-interpreter of described main interpreter process;
Script operation unit is used to move described test script;
The operation result feedback unit is used for the operation result of described sub-interpreter is backfilling into described main interpreter.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200710026833 CN101013977A (en) | 2007-02-08 | 2007-02-08 | Network testing method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200710026833 CN101013977A (en) | 2007-02-08 | 2007-02-08 | Network testing method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN101013977A true CN101013977A (en) | 2007-08-08 |
Family
ID=38701273
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 200710026833 Pending CN101013977A (en) | 2007-02-08 | 2007-02-08 | Network testing method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101013977A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103235758A (en) * | 2013-05-14 | 2013-08-07 | 盛科网络(苏州)有限公司 | Test platform method and device for achieving concurrent test scripts |
CN104660465A (en) * | 2015-01-30 | 2015-05-27 | 深圳市极致汇仪科技有限公司 | Multi-DUT parallel test method and system |
CN108255694A (en) * | 2016-12-28 | 2018-07-06 | 比亚迪股份有限公司 | Test method and system based on interpreter |
CN109840205A (en) * | 2018-12-20 | 2019-06-04 | 平安科技(深圳)有限公司 | Applied program testing method, device, readable storage medium storing program for executing and terminal device |
-
2007
- 2007-02-08 CN CN 200710026833 patent/CN101013977A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103235758A (en) * | 2013-05-14 | 2013-08-07 | 盛科网络(苏州)有限公司 | Test platform method and device for achieving concurrent test scripts |
CN104660465A (en) * | 2015-01-30 | 2015-05-27 | 深圳市极致汇仪科技有限公司 | Multi-DUT parallel test method and system |
CN104660465B (en) * | 2015-01-30 | 2018-04-24 | 深圳市极致汇仪科技有限公司 | A kind of more DUT parallel test methods and system |
CN108255694A (en) * | 2016-12-28 | 2018-07-06 | 比亚迪股份有限公司 | Test method and system based on interpreter |
CN109840205A (en) * | 2018-12-20 | 2019-06-04 | 平安科技(深圳)有限公司 | Applied program testing method, device, readable storage medium storing program for executing and terminal device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101227350B (en) | System for parallel executing automatization test based on priority level scheduling and method thereof | |
CN105808428B (en) | A method of unified performance test is carried out to distributed file system | |
CN103218402B (en) | General database data structure and data mover system and method thereof | |
CN101908015B (en) | Device and method for creating test case based on components | |
CN103092751B (en) | Web application performance test system based on customer behavior model in cloud environment | |
CN104965757A (en) | Virtual machine live migration method, virtual machine migration management apparatus, and virtual machine live migration system | |
CN101226502B (en) | Automatization test method and system | |
Benoit et al. | The PEPS software tool | |
JP6387182B2 (en) | Information processing method, apparatus, and computer storage medium | |
CN101464922A (en) | Computer architecture scheme parallel simulation optimization method based on cluster system | |
CN103118073B (en) | Virtual machine data persistence storage system and method in cloud environment | |
CN104699613B (en) | A kind of spacecraft-testing demand automatic creation system and its method | |
CN101308471A (en) | Method and device for data restoration | |
CN110071822A (en) | A kind of test device and test method for 5G core-network infrastructure | |
CN102486749A (en) | Method and system for data driving test | |
CN110532182A (en) | A kind of automated testing method and device of virtual platform | |
CN102968339A (en) | System and method for realizing complicated event handling based on cloud computing architecture | |
CN101013977A (en) | Network testing method and system | |
CN106201865A (en) | A kind of application programming interface API method of testing, device and terminal unit | |
CN100428153C (en) | Method and device for generating test script | |
CN117215910A (en) | Interface test frame generation method, test method, electronic device and storage medium | |
CN107480056A (en) | A kind of method for testing software and device | |
Rodrigo et al. | Characterizing the spatio-temporal qubit traffic of a quantum intranet aiming at modular quantum computer architectures | |
CN103019931A (en) | Method and device for detecting and treating Asn.1 interfaces | |
CN110221867A (en) | Pulse I/O function cartoon letters drive system and method under a kind of XP system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Open date: 20070808 |