A kind of method of BAS Broadband Access Server automatic test
Technical field
The present invention relates to computer network communication field, be specifically related to a kind of method of BAS Broadband Access Server automatic test.
Background technology
Current, in the test of BAS Broadband Access Server, tester's general using is similar to the testing tool of the hyper terminal that windows operating system carries and tests.These testing tools are many based on control desk, and control desk links to each other with equipment by the com port or Telnet (Telnet) mode of computer, thereby the tester can make things convenient for to such an extent that in control desk equipment is operated.By these testing tools, the tester can carry out parameter configuration to equipment, and carries out the output of test result, at last the result is checked, analyzes and sums up.In addition, these testing tools also have script-editor, and the tester can use the TCL language to carry out scripted code and write, and reach the purpose that institute's measurement equipment is configured and tests by moving these scripts.
Because existing testing tool mainly is the general service desk software at most of communication network device exploitations, so can not carry out special system testing in conjunction with the product performance of BAS Broadband Access Server.So just exist the problem of following several respects:
(1) the great majority test to the carrying out of BAS Broadband Access Server all is to carry out on the basis that the user successfully inserts, so just need the tester to utilize multiple computers or tester to connect equipment under test and carry out customer call, on the basis of customer call success, carry out follow-up test again.Every functional test at BAS Broadband Access Server, need the tester manual repeat to computer or tester setting--〉wait for the user successfully reach the standard grade--〉carry out functional test--the checkout result, the operation repeatedly of these complexity had both been wasted manpower and had also been occupied a lot of other device resources.
(2) a large amount of test event needs the tester to carry out craft to carry out repeatedly, test result also needs the tester to rely on test experience at ordinary times to be judged, the result causes the test job inefficiency that becomes, and test result also probably because tester's self reason and to some extent difference cause test mass to be difficult to guarantee.Especially in regression test, can not guarantee the accurate repetition of the test case in the version test, increase tester's workload, also be difficult to guarantee the implementation coverage of each step of test case simultaneously.
(3) tester can't carry out uninterrupted test in 24 hours, and testing equipment is in idle state.And, cause the delay of test because test job heavy often can't be finished all test events at official hour, delayed the construction cycle of entire product.
In sum, the technical scheme of the automatic test of a kind of BAS Broadband Access Server of current needs.
Summary of the invention
Technical problem to be solved by this invention provides a kind of method of automatic test of BAS Broadband Access Server, in the system testing process, a visual interface and complete test script are provided, make things convenient for the tester that automatic test script is organized and managed, reduce numerous and diverse test operation of tester, simultaneously the tester improves the testing efficiency and the test mass of BAS Broadband Access Server effectively by controlled log recording function and statistical function as a result.
In order to address the above problem, the invention provides a kind of method of BAS Broadband Access Server automatic test, may further comprise the steps:
A, the operational factor of test macro global parameter and test script is set;
B, login equipment under test by the Telnet mode and carry out basic configuration operation;
C, determine transmitting-receiving bag sequential according to described test script;
D, establishment message also send;
E, receive message and carry out the field inspection, determine test result;
Wherein, stating test script writes according to the test result of prerequisite, execution in step and the expection of the characteristics of equipment under test and test case; Described test script also comprises protocol encoding and decoding and Driver Library, and the encoding and decoding interface to the test protocol message is provided; Described test script also comprises basic network agreement supporting layer, and the encoding and decoding interface to the underlying protocol message is provided, and comprises the Code And Decode operation to link layer, network layer message; Described test script also comprises public network access system basic-level support storehouse socket.dll, realizes the expansion of TCL order.
Further, described test script comprises one or more; Described test script moves now, perhaps with the time operation afterwards of plan form.
Further, after logining equipment under test and carry out basic configuration operation by the Telnet mode among the described step b, described test macro loads described protocol encoding and decoding and Driver Library by the invoke script control program.
Further, in the described steps d, the transmission of described message is undertaken by network interface.
Further, among the described step e, network interface is received message from equipment under test, and these messages are delivered to described protocol encoding and decoding and Driver Library, and test macro carries out the field inspection to these messages that receive, and determines test result.
Further, behind the described step e, also comprise:
F, described test macro are that sign is deposited respectively daily record and destination file that operation each time generates with time, and statistical function as a result is provided;
After g, each test script finish, remove the equipment under test configuration.
The present invention also provides a kind of method of BAS Broadband Access Server automatic test, is applied to point-to-point protocol and inserts test, may further comprise the steps:
Step 210, equipment under test and test parameter are configured;
Step 220, login equipment under test by the Telnet mode and carry out basic configuration operation;
Step 230, selection test script and operation;
Step 240, test macro generate corresponding running configuration file;
Step 250, read running configuration file and find the node corresponding, generate new operating file, create new process with selected test script;
Step 260, in new process operation TCL interpreter, and the invoke script control program reads operating file, controls the operation of all test scripts;
Step 270, test macro receive the message of equipment under test transmission and the message that receives are carried out the field inspection, determine whether test result meets the test case expected results;
Step 280, test macro are that sign is preserved daily record and destination file that each test script operation generates automatically with time, and the statistics of test result is provided;
After step 290, test script finish, the configuration of deletion equipment under test.
Further, in the described step 260, also comprise the transmission of the point-to-point protocol message of described test script, the operation of reception message function, the operation of the transmission of the point-to-point protocol message of described test script, reception message function is finished by the load libraries function; Described load libraries function comprises message encoding and decoding and Driver Library.
Compared with prior art, the advantage of the inventive method is as follows,
1, when increasing the test item of other new functions, more flexibly, convenient, the tester only need add the automatic test script of corresponding test case correspondence on test protocol encoding and decoding and driver module, do not need to write again basic network agreement support module and protocol encoding and decoding, driver module;
2, after script operation finishes, the tester by controlled log recording function and as a result statistical function can intuitively must check the process of each this execution of pacing training and total test result; Particularly for not testing the test item that passes through, these log records provide valuable information for tester's fault location occurrence cause.
3, this method reliability height can carry out simulation test from protocol hierarchy;
4, use this method, a main frame can be simulated a plurality of router devices, saves the frame resource, has improved the testing efficiency and the work quality of whole test job.
Description of drawings
Fig. 1 is the basic principle figure of automatic test of the BAS Broadband Access Server of the specific embodiment of the invention;
Fig. 2 is the process chart of automatic test of the BAS Broadband Access Server of the specific embodiment of the invention.
Fig. 3 is the flow chart that the PPP (point-to-point protocol) of the specific embodiment of the invention inserts test process.
Embodiment
Below in conjunction with accompanying drawing the specific embodiment of the invention is described further.
As shown in Figure 1, the method for the specific embodiment of the invention at first is provided with test macro global parameter and test script operational factor; The tester chooses test script; Test macro reloads protocol encoding and decoding and Driver Library by the invoke script control program, then by the bottom-layer network access system, by transmission and the reception of carrying out message between network interface and the equipment under test; Network interface is received message from equipment under test, these messages can be delivered to the protocol encoding and decoding module, and these messages that receive are carried out the field inspection, determines test result; The last test system is that sign is deposited respectively daily record and destination file that operation each time generates with time, and statistical function as a result is provided, and makes things convenient for the tester to analyze and observes.
Concrete steps are as follows,
A, test macro global parameter and test script operational factor are set;
Described test script comprises one or more; Described test script can move now, perhaps with the time operation afterwards of plan form.
Wait according to the test result of prerequisite, execution in step and the expection of the characteristics of equipment under test and test case and to carry out writing of test script, test script is the pairing automatic test script of test case.
Test script also comprises protocol encoding and decoding and Driver Library, and the encoding and decoding interface to the test protocol message is provided.
Test script also comprises basic network agreement supporting layer, and the encoding and decoding interface to the underlying protocol message is provided, as the Code And Decode operation to link layer, network layer message.
Test script also comprises public network access system (Winpcap) basic-level support storehouse socket.dll, can download from windows platform, realize a kind of expansion of very general script (TCL) order, mainly comprise: the management of message buffer, as application buffering area and buffer release district, buffering area is operated.
B, login equipment under test by the Telnet mode and carry out basic configuration operation;
Test macro reloads protocol encoding and decoding and Driver Library by the invoke script control program.
C, determine transmitting-receiving bag sequential according to test script;
D, establishment message also send;
Carry out the transmission of message by network interface.
E, receive message and carry out the field inspection, determine test result;
Network interface is received message from equipment under test, and these messages are delivered to protocol encoding and decoding and Driver Library, and test macro carries out the field inspection to these messages that receive, and determines test result.
F, test macro are that sign is deposited respectively daily record and destination file that operation each time generates with time, and statistical function as a result is provided;
Test macro is that sign is deposited respectively daily record and destination file that operation each time generates with time, and statistical function as a result is provided, and is convenient to the tester and analyzes and observe.
G, the Telnet that removes on the equipment under test dispose.
After each test script finishes, remove the equipment under test configuration, so that next carry out the operation of other test scripts.
As shown in Figure 2, the handling process of the specific embodiment of the invention, specific as follows:
Step 110, tester wait the setting with the script operational factor of filling in of carrying out global parameter according to the test result that will reach of prerequisite, execution in step and the expection of the characteristics of equipment under test and test case;
Step 120, tester choose the operation test script;
Step 130, the required running configuration file of test macro generating run test script;
Step 140, test macro invoke script control program;
Step 150, read global configuration file;
Step 160, the operation of receiving and dispatching bag by the load libraries function;
The load libraries function comprises message encoding and decoding and Driver Library.
Step 170, open daily record and destination file;
Step 180, read the execution test script of carrying out the tester successively after the running configuration file and being chosen;
Step 190, closing journal and destination file carry out the output of daily record and test result.
Inserting test process below in conjunction with PPP (point-to-point protocol) is described further the specific embodiment of the invention.
The computer expert of installation testing instrument crosses network interface and is connected with equipment under test, three network interfaces of general minimum needs, and one is used for Telnet to equipment under test, and equipment is carried out basic configuration, and one is used to send message, and another one is used to receive message.
Basic agreement coding, decoding, transmitting-receiving message function that the tester utilizes built-in function and bsp driver to provide, carrying out the low level development and the test script of PPP related protocol writes, the ppp protocol that writes is supported the storehouse and directly is put under the respective directories according to the test script that test case is write, just can be integrated in the automated test tool platform, system can load automatically.
As shown in Figure 3, concrete steps are as follows,
Step 210, equipment under test and test parameter are configured;
Step 220, login equipment under test by the Telnet mode and carry out basic configuration operation;
Step 230, tester select test script and operation;
Step 240, test macro generate corresponding running configuration file;
Step 250, read running configuration file and find the node corresponding, generate new operating file, create new process with selected test script;
Step 260, in new process, move TCL (a kind of general script) interpreter, and the invoke script control program reads operating file, control the operation of all test scripts;
The flow process of script control program control test script operation: the Telnet configure of the Telnet configure-group of the Telnet configuration-main script logic-script of the Telnet configuration-script of group self self.
The operation of the transmission of the PPP message of test script, reception message function is finished by load libraries function (comprising message encoding and decoding and Driver Library).
Test script is sent out the ping bag again by delay a period of time is set, and sets up with the time of giving the equipment under test abundance and transmits.
Step 270, test macro receive the message of equipment under test transmission and the message that receives are carried out the field inspection, determine whether test result meets the test case expected results;
Step 280, test macro are that sign is preserved daily record and destination file that each test script operation generates automatically with time, and the statistics of test result is provided;
After step 290, test script finish, the configuration of deletion equipment under test.
Next the configuration of deletion equipment under test so that carry out the operation of other test scripts.
From above example as can be seen, this method is the automation realization to each test case of BAS Broadband Access Server, is more suitable for being applied to return functional test.In the test job of reality, alleviate tester's burden, especially in regression test, can reduce tester's workload, improved operating efficiency and test mass.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with the people of this technology in the disclosed technical scope of the present invention; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of claim.