Embodiment
Automatically test can be made up of dissimilar testing procedures, comprises the step of not using tested instrument, as the configuration equipment under test; The step that also comprises the use test instrument sends test data as tester to equipment under test and carries out test operation or catch the data that equipment under test sends and carry out test operation.Automatic test approach provided by the invention, the step of use test instrument is independent, adopt independent test module to control equipment under test; Simultaneously for tester can be shared between different equipment under tests, the present invention has introduced an auxiliary equipment, can realize being connected of tester and equipment under test to be tested by it.
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
Fig. 1 is the flow chart of automatic test approach embodiment one of the present invention.As shown in Figure 1, comprising:
Step 1, be respectively each equipment under test according to configuration file and distribute a test module, and load configuration information in each test module respectively; Described preset configuration file comprises: the relevant information of equipment under test.
When test product is networking products, test product is carried out automatic test be networking products are carried out automatic test.In actual test process, can use a kind of explanation type script Tool Command Language (Tool Command Language, abbreviation TCL) writes the control automatic test cases, by on the script executing server, moving automatic test script, come operational testing instrument, auxiliary equipment and equipment under test, comprise port switching on the auxiliary equipment etc.Described automatic test cases is meant under certain environment, equipment under test is carried out the set of sequence of operations for implementing once test, comprise the configuration equipment under test, tester is set, tester sends test data or tester to equipment under test and catches data that equipment under test sends etc., and each operation obtained measured result and expected results relatively, and return test result, export the process of test record and test report at last.
When moving the automatic test function by the script executing server, begin follow-up equipment disposition and test operation, at first according to the relevant information of the equipment under test in the configuration file, the identification information that comprises equipment under test, know that this time which testing equipment test need be these equipment under test allocation for test modules, load configuration information in these test modules then to, configuration information comprises but is not limited to the test case that needs are carried out, product test index and test result storing directory etc.The relevant information of equipment under test can also include but not limited to following information except the identification information that comprises equipment under test, as the model of equipment under test, version number etc.
Step 2, test module are configured according to the equipment under test of described configuration information to this test module correspondence, and finish message to main test module transmission configuration after configuration is finished.
Step 3, main test module are provided with tester.Comprise and inform tester need be tested which function point of which equipment under test.
Step 4, main test module are selected the port of corresponding equipment under test on auxiliary equipment.Tester and equipment under test carry out exchanges data by this port of selecting, carry out follow-up test process.
Step 5, tester are tested corresponding equipment under test by described port under the control of main test module, and test post are sent to the test module of this equipment under test correspondence.
Step 6, test module are handled the test result that obtains this equipment under test to test post.As comprising the test result storing directory in the configuration information that loads in the test module, then index can be deposited or set up to this test result according to this test result storing directory.
Step 3 among this embodiment is not limited to order shown in Figure 1 with the execution sequence of step 4, main test module is selected the port of corresponding equipment under test in can first execution in step 4 on auxiliary equipment, the step that main test module is provided with tester in the execution in step 3 also can two steps be carried out simultaneously again.
This embodiment, by introduce auxiliary equipment realized many equipment under tests simultaneously with the separate unit tester between be connected, realized that by introducing test module and main test module the separate unit tester can test many equipment under tests; In addition because many testing equipments are only used a tester, with existing tester and equipment under test one to one method of testing compare, improved the resource utilization of tester.
Fig. 2 implements two flow chart for automatic test approach of the present invention.As shown in Figure 2, the difference of this embodiment and embodiment one is, test module sends configuration to main test module and also comprises before finishing message after configuration is finished: confirm the step that configuration that equipment under test is carried out is whether correct.As shown in Figure 2, this embodiment comprises:
Step 1, be respectively each equipment under test according to configuration file and distribute a test module, and load configuration information in each test module respectively; Described preset configuration file comprises: the relevant information of equipment under test.
Step 21, test module are configured according to the equipment under test of described configuration information to this test module correspondence.
Whether the configuration that step 22, judgement are carried out equipment under test is correct, if correct, then execution in step 23, otherwise execution in step 21.
Step 23, test module send configuration to main test module and finish message.
Step 3, main test module are provided with tester.Comprise and inform tester need be tested which function point of which equipment under test.
Step 4, main test module are selected the port of corresponding equipment under test and described port information are issued tester on auxiliary equipment.Tester and equipment under test carry out exchanges data by this port of selecting, carry out follow-up test process.
Step 5, tester are tested corresponding equipment under test by described port under the control of main test module, and test post are sent to the test module of this equipment under test correspondence.
Step 6, test module are handled the test result that obtains this equipment under test to test post.As comprising the test result storing directory in the configuration information that loads in the test module, then index can be deposited or set up to this test result according to this test result storing directory.
This embodiment in carrying out the initial configuration process of test module, by the correctness of further checking initial configuration, has guaranteed the accuracy that subsequent operation is carried out.
Among the above embodiment, when tester is tested this equipment under test by described port, and by main test module test post is sent to test module simultaneously or also comprise afterwards or before: test module is deleted the configuration of this equipment under test.Receive the test post of equipment under test when test module after, delete in the test module configuration this moment about equipment under test, carry out the operation of next test case to vacate resource, be about to this test module and distribute to the next equipment under test that needs test, carrying out follow-up configuration information loads, and equipment under test is configured, the port on the auxiliary equipment is chosen and test operation.
What above embodiment one and embodiment two described is the process that a certain equipment under test is tested automatically.Below by automatic test approach embodiment three to five, with to three equipment under test A, B, C test automatically and are automatic test approach of the present invention to be described example.
Fig. 3 implements three flow chart for automatic test approach of the present invention.As shown in Figure 3, comprising:
Step 000, obtain configuration file; Specified in the configuration file equipment under test A, equipment under test B and equipment under test C test.
Step 100, be equipment under test allocation for test module according to configuration file.Described configuration file comprises: the relevant information of equipment under test, as having specified in the configuration file among this embodiment equipment under test A, equipment under test B and equipment under test C test.And the described configuration file of load configuration information comprises in test module: the relevant information of equipment under test.Be specially respectively when being applied to each equipment under test:
Step 110, distribute first test module for equipment under test A.
Step 120, distribute second test module for equipment under test B.
Step 130, distribute the 3rd test module for equipment under test C.
Step 200, load configuration information in test module respectively.Configuration information comprises but is not limited to the test case that needs are carried out, product test index and test result storing directory etc.Be specially respectively when being applied to each equipment under test:
Step 210, in the first test module load configuration information.
Step 220, in the second test module load configuration information.
Step 230, in the 3rd test module load configuration information.
Step 300, test module are configured equipment under test according to described configuration information, and after configuration is finished, finish message to main test module transmission configuration, send the function point to be measured of this equipment under test and the method for testing that changes function point correspondence to be measured to main test module simultaneously.Be specially respectively when being applied to each equipment under test:
Step 310, first test module are configured equipment under test A according to described configuration information, and after configuration is finished, finish message to main test module transmission configuration, send the function point to be measured of equipment under test A and the method for testing that changes function point correspondence to be measured to main test module simultaneously.
Step 320, second test module are configured equipment under test B according to described configuration information, and after configuration is finished, finish message to main test module transmission configuration, send the function point to be measured of equipment under test B and the method for testing that changes function point correspondence to be measured to main test module simultaneously.
Step 330, the 3rd test module are configured equipment under test C according to described configuration information, and after configuration is finished, finish message to main test module transmission configuration, send the function point to be measured of equipment under test C and the method for testing that changes function point correspondence to be measured to main test module simultaneously.
Main test module can be provided with tester at equipment under test respectively after having received that single test module receives that message is finished in the equipment under test configuration of the correspondence of transmission; Also can be after receiving that message is finished in configuration that all test modules return, main test module unification is provided with tester to all equipment under tests.Among this embodiment, main test module is provided with tester at equipment under test respectively after having received that single test module receives that message is finished in the equipment under test configuration of the correspondence of transmission.
Step 400, main test module are provided with tester.Be specially respectively when being applied to each equipment under test:
Step 410, main test module are provided with tester at equipment under test A, inform that tester need be to the function point of equipment under test A test and the method for testing of employing.
Step 420, main test module are provided with tester at equipment under test B, inform that tester need be to the function point of equipment under test B test and the method for testing of employing.
Step 430, main test module are provided with tester at equipment under test C, inform that tester need be to the function point of equipment under test C test and the method for testing of employing.
Step 500, main test module are selected the port of equipment under test on auxiliary equipment.Tester and equipment under test carry out exchanges data by this port of selecting, carry out follow-up test process.Be specially respectively when being applied to each equipment under test:
Step 510, main test module are selected the port of equipment under test A on auxiliary equipment.
Step 520, main test module are selected the port of equipment under test B on auxiliary equipment.
Step 530, main test module are selected the port of equipment under test C on auxiliary equipment.
Step 600, tester are tested this equipment under test by described port under the control of main test module.Be specially respectively when being applied to each equipment under test:
Step 610, the tester port by equipment under test A under the control of main test module is tested this equipment under test A;
Step 620, the tester port by equipment under test B under the control of main test module is tested this equipment under test B;
Step 630, the tester port by equipment under test C under the control of main test module is tested this equipment under test C;
Step 700, test post is sent to test module after equipment under test test finished.Be specially respectively when being applied to each equipment under test:
Step 710, test post is sent to first test module after equipment under test A test finished.
Step 720, test post is sent to second test module after equipment under test B test finished.
Step 730, test post is sent to the 3rd test module after equipment under test C test finished.
Step 800, test module are handled the test result that obtains this equipment under test to test post.Be specially respectively when being applied to each equipment under test:
Step 810, first test module are handled the test result that obtains equipment under test A to test post.
Step 820, second test module are handled the test result that obtains equipment under test B to test post.
Step 830, the 3rd test module are handled the test result that obtains equipment under test C to test post.
Step 900, test module are deleted the configuration of this equipment under test.Be specially respectively when being applied to each equipment under test:
The configuration that step 910, first test module are deleted this equipment under test A.
The configuration that step 920, second test module are deleted this equipment under test B.
The configuration that step 930, the 3rd test module are deleted this equipment under test C.
This embodiment is an example so that three equipment under tests are tested, illustrated when tester or equipment under test are ready for sending data, judge at first which port is this piece of data will send to, then by selecting the port connection on the auxiliary equipment that data are sent to corresponding port.Can realize that by this method a plurality of equipment under tests share a tester.Main test module is after the message of having received the configuration successful that certain single test module returns, at equipment under test tester is provided with respectively, because the independence of each test module, the step that each test module subtest instrument is tested each equipment under test is also separate.On tester, repeatedly be provided with, respectively equipment under test tested, realized " test respectively repeatedly is set ".
This embodiment is an example so that three equipment under tests are tested, illustrated when tester or equipment under test are ready for sending data, judge at first which port is this piece of data will send to, then by selecting the port connection on the auxiliary equipment that data are sent to corresponding port.Can realize that by this method a plurality of equipment under tests share a tester, in actual test process, in the time need carrying out the test of identical function point to different equipment under tests, because the present invention has independently gone out the relevant testing procedure of tester, only need on the test module of this equipment under test correspondence, load test case at this identical function point, on tester, once be provided with, can realize simultaneously a plurality of equipment under tests being carried out the test of identical function point, thereby realize tester " repeatedly test once is set "; In addition, because the independence of each test module, the step that each test module subtest instrument is tested each equipment under test is also separate, therefore on tester, once be provided with, can realize simultaneously the equipment under test that is assigned test module all being tested, thereby " whole tests once are set " of having realized tester.
Fig. 4 is the flow chart of automatic test approach embodiment four of the present invention.The difference of this embodiment and automatic test approach embodiment three is, among this embodiment, main test module is after having received that message is finished in configuration that all test modules return, and is unified again to all equipment under tests being provided with tester and selecting all equipment under test corresponding port on auxiliary equipment.As shown in Figure 4, step 400, the step 500 among the last embodiment is in this embodiment:
Step 401, main test module are after having received that message is finished in configuration that all test modules return, and be unified to all equipment under tests are provided with tester.Comprise and inform which method of testing tester need to which function point of equipment under test A, equipment under test B, equipment under test C adopt test.
Step 501, main test module are selected all equipment under test corresponding port on auxiliary equipment.
This embodiment, main test module is after the message of having received the configuration successful that all test modules return, unification is provided with tester, because the independence of each test module, the step that each test module subtest instrument is tested each equipment under test is also separate, therefore on tester, once be provided with, can realize simultaneously the equipment under test that is assigned test module all being tested, thereby " whole tests once are set " of having realized tester.
Fig. 5 is the flow chart of automatic test approach embodiment five of the present invention.The difference of this embodiment and automatic test approach embodiment four is, among this embodiment, main test module is after having received that message is finished in configuration that all test modules return, tester is also comprised before being configured: main test module is analyzed the function point to be measured of all equipment under tests and the method for testing of function point correspondence to be measured again, unifies to be provided with to having the equipment under test that identical function point to be measured and function point to be measured have a same test method in tester.As shown in Figure 5, the step 401 among the last embodiment is in this embodiment:
Step 402, main test module are after having received that message is finished in configuration that all test modules return, analyze the function point to be measured of all equipment under tests and the method for testing of function point correspondence to be measured, in tester, unify to be provided with having the equipment under test that identical function point to be measured and function point to be measured have a same test method.Identical as the function point to be measured of equipment under test A, equipment under test B and method of testing that function point to be measured adopts is identical, main test module is informed tester, when this function point of equipment under test A, equipment under test B is tested, can adopt the method for synchronism detection.This step, also can the function point to be measured of all equipment under tests and the method for testing of this function point correspondence to be measured be sent to tester for main test module, tester is analyzed the function point to be measured of all equipment under tests and the method for testing of function point correspondence to be measured, unifies to be provided with to having the equipment under test that identical function point to be measured and function point to be measured have a same test method in tester.
Simultaneously, at tester equipment under test is carried out in the test process, because the function point to be measured of equipment under test A and equipment under test B is identical and method of testing function point employing to be measured is identical, step 610 and step 620 among the last embodiment, in this embodiment, as shown in Figure 5, keeping independently also keeping simultaneously synchronized relation.
This embodiment has provided a kind of in actual test process, a kind of method of testing in the time need carrying out the test of identical function point to different equipment under tests.In tester, unify to be provided with to having the equipment under test that identical function point to be measured and function point to be measured have a same test method, can realize simultaneously a plurality of equipment under tests being carried out the test of identical function point, thereby realize tester " repeatedly test once is set "; In addition, because the independence of each test module, the step that each test module subtest instrument is tested each equipment under test is also separate, therefore on tester, once be provided with, can realize simultaneously the equipment under test that is assigned test module all being tested, thereby " whole tests once are set " of having realized tester.
Above embodiment also supports to add dynamically and remove the situation of equipment under test, if in test process, there is new equipment under test need add test process, perhaps existing equipment under test withdraws from test process, the information that only need revise equipment under test in configuration file gets final product, as increase or withdraw from the equipment under test of appointment in configuration file.When each test process begins to carry out, check at first whether the equipment under test that needs to carry out test increases or withdraw from, if change, then newly-increased or finish corresponding test module, newly-increased equipment under test is tested or stopped the equipment under test that withdraws from is tested.
Above embodiment, because each test module belongs to a script executing server, after each test module receives the content measurement that main test module sends, handle content measurement, after obtaining test result, test result can be stored in the test record storing directory of initial configuration of test module and go, in this manner, just the test record and the test report of each equipment under test that automatic test can be obtained are associated, help the unified management of test record and test report and gather, and need not additionally to increase the process that a test record gathers, thereby the otherness of conveniently carrying out between each test product compares again.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of program command, aforesaid program can be stored in the computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
Fig. 6 is the structural representation of Auto-Test System embodiment one of the present invention.As shown in Figure 6, comprising: script executing server 1000, tester 2000, auxiliary equipment 3000 and one or more equipment under test 4000; Tester 2000 is connected with equipment under test 4000 by auxiliary equipment 3000, and script executing server 1000 is connected with tester 2000, auxiliary equipment 3000 and equipment under test 4000 respectively.
Script executing server 1000 is used for being respectively each equipment under test 4000 according to the preset configuration file and distributes a test module 1100, and in test module 1100 load configuration information; Described test module 1100 is used for according to described configuration information equipment under test 4000 being configured.
Script executing server 1000 also comprises main test module 1200, is used to be provided with tester, and after message is finished in the configuration that receives equipment under test, selects the port 3100 of equipment under test 4000 on auxiliary equipment 3000.
Auxiliary equipment 3000 is used to provide the port that connects equipment under test.There are one or more physical ports that are used to connect equipment under test on the auxiliary equipment.When tester or equipment under test were ready for sending data, main test module judged at first which port is this piece of data will send to, and by selecting port on the auxiliary equipment to connect data was sent to corresponding port then.Can realize that by this method a plurality of equipment under tests share a tester.Auxiliary equipment does not change the data content that transmits between tester and the equipment under test, only is responsible for forwarding the data to corresponding ports.Auxiliary equipment can be the logical support port division of a Daepori and the switch of data penetration transmission, also can be other products of supporting this function.
Tester 2000, be used for testing by 3100 pairs of these equipment under tests of described port, and test post is sent to test module 1100 by main test module 1200, and handle by 1100 pairs of test posts of test module, obtain the test result of this equipment under test 4000.
Fig. 7 is the structural representation of Auto-Test System embodiment two of the present invention.As shown in Figure 7, the Auto-Test System among this embodiment is on the basis of a last embodiment, and script executing server 1000 also comprises: configuration file is provided with module 1300: be used to be provided with configuration file or revise configuration file.Script executing server 1000 can also cooperate the interpolation of dynamic execution equipment under test and shift out operation, if in test process, there is new equipment under test need add test process, perhaps existing equipment under test withdraws from test process, the information that only need revise equipment under test in configuration file gets final product, as increase or withdraw from the equipment under test of appointment in configuration file.When each test process begins to carry out, check at first whether the equipment under test that needs to carry out test in the configuration file increases or withdraw from, if change, then newly-increased or finish corresponding test module, newly-increased equipment under test is tested or stopped the equipment under test that withdraws from is tested.
Test module 1100 can also comprise judge module 1101, be used for sending configuration to main test module 1200 after finishing and confirming that the configuration that equipment under test is carried out is correct before finishing message in that equipment under test 4000 is configured, be used for also judging whether tester is tested the test post that the back produces to equipment under test correct.In carrying out the initial configuration process of test module,, guaranteed the accuracy that subsequent operation is carried out by verifying the correctness of initial configuration further.
Test module 1100 can also comprise removing module 1102, is used for after the test post that receives main test module 120 transmissions the configuration of deleting equipment under test 4000 in this test module 1100.Receive the test post of equipment under test when test module after, this moment by in the removing module deletion test module about the configuration of equipment under test, carry out the operation of next test case to vacate resource, be about to this test module and distribute to the next equipment under test that needs test, carrying out follow-up configuration information loads, and equipment under test is configured, the port on the auxiliary equipment is chosen and test operation.
Among the embodiment of above-mentioned Auto-Test System, because single automatic test platform can be tested many equipment under tests, the minimizing of automatic test platform quantity makes the input of automatic test project on the test execution personnel also reduce accordingly, therefore save human cost, shortened the product test cycle simultaneously; In addition because the minimizing of automatic test platform quantity, help the unified management of test record and test report and gather, and need not additionally to increase again the process that a test record gathers, the otherness of conveniently carrying out between each test product compares, and has saved the time of wasting because of switching and resource coordination between the different automation platforms.
When tester or equipment under test are ready for sending data, judge at first which port is this piece of data will send to, by selecting port on the auxiliary equipment to connect data are sent to corresponding port then.Can realize that by this method a plurality of equipment under tests share a tester, realize " test respectively repeatedly is set " of tester, the purpose of " repeatedly test once is set " or " whole tests once are set ".
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.