CN101252469B - Multi-net elements automated testing method - Google Patents

Multi-net elements automated testing method Download PDF

Info

Publication number
CN101252469B
CN101252469B CN2008100662073A CN200810066207A CN101252469B CN 101252469 B CN101252469 B CN 101252469B CN 2008100662073 A CN2008100662073 A CN 2008100662073A CN 200810066207 A CN200810066207 A CN 200810066207A CN 101252469 B CN101252469 B CN 101252469B
Authority
CN
China
Prior art keywords
order
script
steps
network element
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.)
Active
Application number
CN2008100662073A
Other languages
Chinese (zh)
Other versions
CN101252469A (en
Inventor
祁婷
吴桂云
邓巨峰
张平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN2008100662073A priority Critical patent/CN101252469B/en
Publication of CN101252469A publication Critical patent/CN101252469A/en
Application granted granted Critical
Publication of CN101252469B publication Critical patent/CN101252469B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses an automatic testing method with multi-network units. The automatic testing method comprises the following steps: A1. general commanding source language is defined according to the test content, a commanding format template is defined according to the type or the edition of the network unit, and a commanding adaptive script is designed, wherein the commanding source language is only included in the commanding adaptive script used for realizing the testing logic; the commanding parameter value required by the current test is obtained through; A2. the commanding adaptivescript is transferred, the replacement from the commanding source language to the specific configuration command is performed; A3, the network unit is logged in the long-distance way, the configuration command is transmitted, and whether the configuration command on the network unit is successfully executed is judged, and then the long-distance login is quit; and if the execution is successful, the test is performed according to the test content, therefore, the script is caused to have high versatility and easy maintenance, the working capacity of transplanting the automatic testing script isreduced, the efficiency of developing the script is enhanced; and the strong association relation between the quantity of the automatic testing script and the normative in the researching and developing process is eliminated.

Description

A kind of multi-net elements automatization testing method
Technical field
The present invention relates to the communication apparatus field tests, in particular multi-net elements automatization testing method.
Background technology
In the communication apparatus field tests, need carry out functional test, performance test, robustness and stability test etc. to equipment (being network element).The no matter test of which kind of type all needs to build the validity of test environment, configuration network element, validation test content; Wherein, can build test environment, carry out the validity of validation test content by tester or ancillary equipment by demand.
Prior art adopts the mode of following two kinds of configuration network elements usually: adopt command line mode or graphic user interface mode; Wherein, adopting the graphic user interface mode is the webmaster maintenance terminal.Because the exploitation of webmaster maintenance terminal often lags behind the network element exploitation, so command line mode uses more extensive in the network element test.The automation that realizes the network element test must comprise the automation of configuration section, yet causes realizing in the different network elements command format and the different style of identical function owing to the difference of NE type.
At above characteristics, there are two kinds to realize the configuration section automated method at present: one, to write different automatic test scripts at different network elements; Two, the configuration section script is separated with main script, write different configuration section scripts, in main script, call corresponding configuration section script according to NE type for dissimilar network elements.
But existing method has the following disadvantages:
1, there is one-to-one relationship between script and network element, configuration section especially, this part script does not have any versatility.
2, any change takes place in the network element commands row, even order line word capital and small letter changes, all needs to revise the configuration section script, and script is difficult in maintenance, and workload is big.
When 3, having the newtype network element to test,, still need the configuration section of existing automatized script is revised one by one and could be used even the partial function of new network element is identical with old network element and this partial function has been realized automation.Script is transplanted difficulty, and automation development efficiency is low.
4, because the standardization difference of R﹠D process, may occur between the order line of similar network element different editions slight variation being arranged, it is corresponding one by one with version to make configuration section in the automatic test script have to, thereby causes the script quantity of automatic test to be increased sharply and set up strong incidence relation with the R﹠D process standardization.
Therefore, prior art needs to improve.
Summary of the invention
Technical problem to be solved by this invention is how to avoid having one-to-one relationship between script and network element, and avoid configuration section in the automatic test script and version problem one to one, when the network element commands row changes, need not to revise the configuration section script, thereby improve test script versatility, maintainability, portability.
Technical scheme of the present invention is as follows:
A kind of multi-net elements automatization testing method, it may further comprise the steps: A1, according to the general order primitive of content measurement definition, according to NE type or network element version definition command format module, and the adaptive script of design order; Wherein, the adaptive script of described order be input as order primitive, command format template file and command parameter value, be output as the configuration order of on network element, moving; And, in the adaptive script of described order, be used for realizing that the adaptive main script of order of test logic only comprises order primitive; A2, obtain, call the adaptive script of described order, carry out of the replacement of order primitive to the concrete configuration order when the required command parameter value of Pretesting; A3, be remotely logged into network element, send configuration order, and judge that whether the configuration order on the network element runs succeeded, and withdraws from Telnet; Run succeeded and then carry out test according to content measurement.
Described multi-net elements automatization testing method wherein, in the steps A 1, to a certain definite content measurement, after defining general order primitive, for described command format template file and the adaptive main script of described order, all adopts same order primitive.
Described multi-net elements automatization testing method, wherein, in the steps A 1, during according to NE type or network element version definition command format module, described command format template comprises at least one command format, is used to set up the corresponding relation between the configuration order of order primitive and network element; Described command format comprises at least one general order primitive and at least one configuration order.
Described multi-net elements automatization testing method, wherein, described configuration order comprises command description and command parameter.
Described multi-net elements automatization testing method, wherein, before steps A 2 after the steps A 1, also carry out following steps: the user adopts edit tool that described command format template is edited and revised.
Described multi-net elements automatization testing method wherein, before the steps A 2, is also carried out following steps: A20, is built corresponding test environment according to the test needs.
Described multi-net elements automatization testing method, wherein, steps A 20 specifically may further comprise the steps: according to the test needs, be connected by physical interface network interface, employing both-way communication mode between PC and the network element.
Described multi-net elements automatization testing method, wherein, steps A 3 specifically may further comprise the steps: A31, PC are remotely logged into network element, send configuration order; A32, PC receive the execution result of the configuration order on the network element, judge whether configuration order runs succeeded, and are then to carry out A33, otherwise carry out A34; A33, PC withdraw from the network element of Telnet, carry out test according to content measurement; A34, PC directly withdraw from Telnet, record test crash information.
Described multi-net elements automatization testing method, wherein, steps A 33 is also carried out following steps: logging test results.
Described multi-net elements automatization testing method, wherein, steps A 33 specifically may further comprise the steps: withdraw from the network element of Telnet, be connected to tester or external equipment, carry out test according to content measurement.
Adopt such scheme, the present invention to use general primitive (primitive) itself and order adaptive script, so automatic test script, especially configuration section script, no longer and have one-to-one relationship between network element, thereby make script have high universalizable; When the network element commands row changes, only influence the command format template file, and do not influence automatic test script itself, thereby make script have ease for maintenance.Script can not need be revised and is directly used in new network element, the command format template file is edited and is revised by edit tool commonly used easily, greatly reduce the transplanting workload of automatic test script, saved human resources, improved test automation script development efficiency; Eliminated the strong incidence relation of automatic test script quantity and R﹠D process standardization simultaneously.
Description of drawings
Fig. 1 is the automatic test flow chart of the inventive method;
Fig. 2 is the running environment schematic diagram of the inventive method;
Fig. 3 is the command format template file structural representation of the inventive method;
Fig. 4 is the basic function schematic diagram of the adaptive script of order of the inventive method.
Embodiment
Below in conjunction with the drawings and specific embodiments, the present invention is described in detail.
Aim of the present invention is the deficiency at above-described existing method, proposes a kind of multi-net elements automatization testing method based on the order encapsulation, makes it can realize using unified script that many network elements are configured.Core point of the present invention is the order encapsulation, comprise: definition command primitive, definition command format module, the adaptive script of design order, by order is encapsulated, realize using unified script that many network elements are configured automation, reach and improve automatic test script versatility, enhancing script maintainability, the purpose that script is transplanted workload, improved test automation script development efficiency that reduces.
Therefore, as shown in Figure 1, the invention provides a kind of multi-net elements automatization testing method based on the order encapsulation, it may further comprise the steps.
A1, according to the general order primitive of content measurement definition, according to NE type or network element version definition command format module, and the adaptive script of design order.
Wherein, define general order primitive, i.e. configuration order set of keywords, primitive itself is only relevant with content measurement; During the definition command format module, this template file is corresponding with NE type or network element version, can be by edit tool commonly used, as notepad the text edit tool of windows system etc., edit easily and revise, thereby reduced the transplanting workload of automatic test script.
More particularly, the specific implementation method of the definition generic command primitive that the present invention relates to is: all script developers and network element tester, especially refering in particular to needs to use automatic test script to carry out the personnel of network element test, the function point of Ce Shi function point or network element support is arranged unified title to function point as required; Can be with following form but be not limited only to following form agreement primitive, as: the primitive of creating VLAN is that the primitive of AddVlan, deletion VLAN is DelVlan.
Ding Yi primitive is only relevant with content measurement by the way, and irrelevant with NE type, is general therefore.Described general, its implication is that the present invention has following constraint to order primitive: for certain specific function point, the order primitive that uses in the order primitive of definition, the order primitive in the command format template file, the main script must be consistent.
Generally speaking, to a certain definite content measurement, after defining general order primitive,, all adopt same order primitive for described command format template file and the adaptive main script of described order.By adopting general order primitive, improved the test script versatility.
And for example, after steps A 1, also carry out following steps: the user adopts edit tool that described command format template is edited and revised.Like this, the user is update command format module easily just, thereby has unified to have one-to-one relationship between script and network element, has increased the versatility of script.
For example, during according to NE type or network element version definition command format module, described command format template comprises at least one command format, is used to set up the corresponding relation between the configuration order of order primitive and network element; Described command format comprises at least one general order primitive and at least one configuration order.Wherein, described configuration order can comprise command description and command parameter.
As shown in Figure 3, be the command format template file structural representation that the present invention needs, the effect of command format template file is the one-to-one relationship between the actual disposition order of setting up on order primitive and the network element.The delegation of command format template file comprises order primitive and configuration order, and configuration order is divided into command description and command parameter two parts again.The command format template file can adopt following form, but is not limited to following form, as:
The command format template file of MSAG_5200_V2.0.2
AddVlan{vlan?add@vlanlist@}
DelVlan{vlan?del@vlanlist@}
……
The command format template file of DSL_8000_V3.0
AddVlan{add-vlan@vlanlist@}
DelVlan{no?add-vlan@vlanlist@}
……
Wherein, content in the brace of closelying follow behind order primitive (braces) is concrete network element configuration order, because the difference of NE type or version, the configuration order that identical order primitive meeting is corresponding different also is kept in the different command format template files.
Like this, when the change of network element commands row, only influence the command format template file, and do not influence automatic test script itself, thereby make script have good ease for maintenance.
The adaptive script of described order be input as order primitive, command format template file and command parameter value, be output as the configuration order of on network element, moving; Thereby realized automatic replacement from order primitive to the concrete configuration order.
As shown in Figure 4, it is the basic function schematic diagram of the adaptive script of order that the present invention relates to, the adaptive script of order that design realizes, must possess following basic function: promptly can be according to order primitive, command format template file, command parameter value, by above-mentioned 3 key elements, just obtain the concrete configuration order that can on network element, move and with it as output.
And, in the adaptive script of described order, be used for realizing that the adaptive main script of order of test logic only comprises order primitive, do not comprise configuration order etc.That is to say that the main script of the realization test logic that relates among the present invention is realizing that the configuration feature part should only comprise order primitive, can adopt following form but be not limited only to following form:
set?vlanid″4096″
set?CmdFile″AG_5200_V202.CMD″
set?cmd[GetCommand?AddVlan$CmdFile$vlanid]
telnetSendCmd″$cmd″
……
Owing in the main script of realizing test logic, only comprised order primitive, and primitive itself and the adaptive script of order are general, therefore automatic test script, especially configuration section script no longer and have one-to-one relationship between network element, thereby make script have high universalizable.
A2, obtain, call the adaptive script of described order, carry out of the replacement of order primitive to the concrete configuration order when the required command parameter value of Pretesting.
And, before steps A 2, can also carry out following steps: A20, build corresponding test environment according to the test needs.For example, as shown in Figure 2, steps A 20 specifically can may further comprise the steps: according to the test needs, be connected by physical interface network interface, employing both-way communication mode between PC and the network element (NE).
The enforcement of above-mentioned example needs network environment as shown in Figure 2, relate to two kinds of network equipments of PC and network element, connect by physical interface network interface such as RJ45, communication between these two equipment is two-way, go up the remote control software of installing by PC, login network element, transmitting order to lower levels are given network element and are returned the network element commands execution result.
A3, be remotely logged into network element, send configuration order, and judge that whether the configuration order on the network element runs succeeded, and withdraws from Telnet; Run succeeded and then carry out test according to content measurement.
For example, steps A 3 specifically can may further comprise the steps:
A31, PC are remotely logged into network element, send configuration order;
The execution result of the configuration order on A32, the reception network element judges whether configuration order runs succeeded, and is then to carry out A33, otherwise carries out A34;
A33, withdraw from the network element of Telnet, carry out test according to content measurement; For example, steps A 33 specifically may further comprise the steps: withdraw from the network element of Telnet, be connected to tester or external equipment, carry out test according to content measurement.
After carrying out test, can also carry out following steps: logging test results.
A34, directly withdraw from Telnet, record test crash information.
Enumerate a complete embodiment below again, the inventive method is specifically described.Use automatic test script flow process of the present invention as shown in Figure 1.
1, corresponding test environment need be built by test, network environment as shown in Figure 2 need be comprised;
2, from data file, obtain and this time test required parameter value;
3, the adaptive script of call instruction is realized the conversion from order primitive to the network element concrete configuration.Ordering adaptive script is a general script and NE type and version independent connection relation.Order being input as of adaptive script: the command parameter value that obtains in order primitive, command format template file and the step 2 is output as: can on network element, move the concrete configuration order.
4, be remotely logged into network element, issue the configuration order that step 3 obtains, carry out next step operation according to the execution result of configuration order on the network element.
5, if the configuration order on the network element runs succeeded, then withdraw from Telnet earlier, carry out test according to content measurement then, generally need the support of tester or ancillary equipment here.Carry out the back logging test results, the automatic test script flow process finishes.
6, if the configuration order on the network element is carried out failure, then directly withdraw from Telnet, write down test crash information then, the automatic test script flow process finishes.
In sum, technical scheme of the present invention has following beneficial effect:
Use general primitive itself and the adaptive script of order, so automatic test script, especially configuration section script no longer and have one-to-one relationship between network element, thereby make script have high universalizable; When the network element commands row changes, only influence the command format template file, and do not influence automatic test script itself, thereby make script have ease for maintenance.
When this function that has identical functions and an old network element when newtype network element and old network element has realized automatic test, only comprised order primitive, so script can not need be revised and is directly used in new network element owing to comprise the main script of test logic.Be mainly the change of order line by the change of new network element introducing, as long as it is just passable therefore to redefine a command format template file corresponding with new network element, because the command format template file can be edited and revise by edit tool commonly used easily, greatly reduce the transplanting workload of automatic test script, saved human resources.
And, no longer comprise and NE type or the close configuration section script of version relationship owing to only comprise order primitive in the main script, eliminated the strong incidence relation of automatic test script quantity and R﹠D process standardization.
Should be understood that, for those of ordinary skills, can be improved according to the above description or conversion, and all these improvement and conversion all should belong to the protection range of claims of the present invention.

Claims (10)

1. multi-net elements automatization testing method, it may further comprise the steps:
A is according to the general order primitive of content measurement definition, and according to NE type or network element version definition command format module, and adaptive script is ordered in design; Wherein, the adaptive script of described order be input as order primitive, command format template file and command parameter value, be output as the configuration order of on network element, moving; And, in the adaptive script of described order, be used for realizing that the adaptive main script of order of test logic only comprises order primitive;
A2, obtain, call the adaptive script of described order, carry out of the replacement of order primitive to the concrete configuration order when the required command parameter value of Pretesting;
A3, be remotely logged into network element, send configuration order, and judge that whether the configuration order on the network element runs succeeded, and withdraws from Telnet; Run succeeded and then carry out test according to content measurement.
2. multi-net elements automatization testing method according to claim 1 is characterized in that, in the steps A 1, to a certain definite content measurement, after defining general order primitive,, all adopt same order primitive for described command format template file and the adaptive main script of described order.
3. multi-net elements automatization testing method according to claim 1, it is characterized in that, in the steps A 1, during according to NE type or network element version definition command format module, described command format template comprises at least one command format, is used to set up the corresponding relation between the configuration order of order primitive and network element; Described command format comprises at least one general order primitive and at least one configuration order.
4. multi-net elements automatization testing method according to claim 3 is characterized in that described configuration order comprises command description and command parameter.
5. multi-net elements automatization testing method according to claim 1 is characterized in that, before steps A 2 after the steps A 1, also carry out following steps: the user adopts edit tool that described command format template is edited and revised.
6. multi-net elements automatization testing method according to claim 1 is characterized in that, before the steps A 2, also carries out following steps: A20, builds corresponding test environment according to the test needs.
7. multi-net elements automatization testing method according to claim 6 is characterized in that, steps A 20 specifically may further comprise the steps: according to the test needs, be connected by physical interface network interface, employing both-way communication mode between PC and the network element.
8. multi-net elements automatization testing method according to claim 1 is characterized in that, steps A 3 specifically may further comprise the steps:
A31, PC are remotely logged into network element, send configuration order;
A32, PC receive the execution result of the configuration order on the network element, judge whether configuration order runs succeeded, and are then to carry out A33, otherwise carry out A34;
A33, PC withdraw from the network element of Telnet, carry out test according to content measurement;
A34, PC directly withdraw from Telnet, record test crash information.
9. multi-net elements automatization testing method according to claim 8 is characterized in that steps A 33 is also carried out following steps: logging test results.
10. multi-net elements automatization testing method according to claim 8 is characterized in that, steps A 33 specifically may further comprise the steps: withdraw from the network element of Telnet, be connected to tester or external equipment, carry out test according to content measurement.
CN2008100662073A 2008-03-24 2008-03-24 Multi-net elements automated testing method Active CN101252469B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008100662073A CN101252469B (en) 2008-03-24 2008-03-24 Multi-net elements automated testing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008100662073A CN101252469B (en) 2008-03-24 2008-03-24 Multi-net elements automated testing method

Publications (2)

Publication Number Publication Date
CN101252469A CN101252469A (en) 2008-08-27
CN101252469B true CN101252469B (en) 2010-07-14

Family

ID=39955665

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008100662073A Active CN101252469B (en) 2008-03-24 2008-03-24 Multi-net elements automated testing method

Country Status (1)

Country Link
CN (1) CN101252469B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102375103B (en) * 2010-08-27 2015-07-29 富泰华工业(深圳)有限公司 Electronic product test device and method
CN104331360A (en) * 2013-07-23 2015-02-04 上海斐讯数据通信技术有限公司 Automatic testing platform
CN105141481B (en) * 2015-09-21 2018-05-29 烽火通信科技股份有限公司 A kind of automated testing method and system of NE management unit
CN105791018B (en) * 2016-03-11 2019-02-15 中国联合网络通信集团有限公司 A kind of NFV network element configuration method and system
CN106789260B (en) * 2016-12-26 2020-11-20 中国银联股份有限公司 System and method for high availability drilling of network devices
CN108874649B (en) * 2017-05-08 2021-08-17 中兴通讯股份有限公司 Method and device for generating automatic test script and computer equipment thereof
CN109756385A (en) * 2017-11-07 2019-05-14 中兴通讯股份有限公司 A kind of test method, device, computer equipment and readable storage medium storing program for executing
CN109726127B (en) * 2018-12-28 2019-07-23 四川新网银行股份有限公司 A kind of automatic extending method based on single set test environment
CN112311572B (en) * 2019-07-30 2023-04-28 中国移动通信集团广东有限公司 Network element testing method and device and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1705306A (en) * 2004-06-03 2005-12-07 华为技术有限公司 A protocol automatic adapting method and apparatus
CN101026511A (en) * 2007-03-27 2007-08-29 华为技术有限公司 Measuring method, system and its configuration method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1705306A (en) * 2004-06-03 2005-12-07 华为技术有限公司 A protocol automatic adapting method and apparatus
CN101026511A (en) * 2007-03-27 2007-08-29 华为技术有限公司 Measuring method, system and its configuration method and system

Also Published As

Publication number Publication date
CN101252469A (en) 2008-08-27

Similar Documents

Publication Publication Date Title
CN101252469B (en) Multi-net elements automated testing method
CN101150463B (en) Testing method and system
CN108366067B (en) System and method for testing consistency of universal service protocol of power system
CN100544292C (en) A kind of method of BAS Broadband Access Server automatic test
CN103812726A (en) Automated testing method and device for data communication equipment
CN106371847B (en) CPCI bus RS422 communication driving method and system under Windows xp system
CN104079653A (en) Smart home control method and system based on B/S framework
CN102306122A (en) Automated testing method and equipment
CN103744784A (en) Method and system for automatically testing mobile phone applications
CN111526052B (en) Network element instruction management method, device, network equipment and storage medium
CN103927256A (en) Method for controlling multiple Android devices
CN106412064A (en) Remote upgrade method of power utilization information acquisition terminal
CN101901267A (en) Method and device for managing configuration files
CN106502713A (en) A kind of method for upgrading software and system
CN107329738A (en) Component update method and device
CN110677322B (en) Python language-based industrial control safety equipment automatic test system and method
CN108055142B (en) Automatic interface configuration method and system for vCPE (virtual customer premise equipment)
CN103095882A (en) Automated testing method and automated testing system for intelligent mobile terminal external field
CN100535860C (en) Equipment software upgrade automatic realizing system and method
CN102158374B (en) Bandwidth speed limiting testing method and testing device
CN103064676A (en) Method for controlling components in open service gateways
CN115291892A (en) Method and system for deploying micro service based on Ansible
CN110662214B (en) Communication equipment station opening method and device
CN111045689B (en) Operation platform automatic installation and deployment system
CN110765009A (en) Automatic AI voice software testing framework of carrying out

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant