CN105893252A - Automatic testing method and device - Google Patents

Automatic testing method and device Download PDF

Info

Publication number
CN105893252A
CN105893252A CN201610187060.8A CN201610187060A CN105893252A CN 105893252 A CN105893252 A CN 105893252A CN 201610187060 A CN201610187060 A CN 201610187060A CN 105893252 A CN105893252 A CN 105893252A
Authority
CN
China
Prior art keywords
dut
lock
notice
target
data channel
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.)
Granted
Application number
CN201610187060.8A
Other languages
Chinese (zh)
Other versions
CN105893252B (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.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201610187060.8A priority Critical patent/CN105893252B/en
Publication of CN105893252A publication Critical patent/CN105893252A/en
Application granted granted Critical
Publication of CN105893252B publication Critical patent/CN105893252B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Maintenance And Management Of Digital Transmission (AREA)

Abstract

The invention provides an automatic testing method and device. The method comprises the steps that test instructions are sent to target DUTs through control channels so as to enable the target DUTs to execute a local testing script, and control channels between the target DUTs and execution machines is blocked; the data channels are monitored; whether to receive status locking notifications sent by the at least two target DUTs from the data channels or not is judged, and the status locking notifications are used for informing the target DUTs corresponding to the execution machines to stop execution of the testing script; if yes, unlocking notifications are sent to the target DUTs through the corresponding data channels so as to enable the DUTs to continuously execute the testing script; the operation result of the executed testing script is obtained. By applying the automatic testing method and device, the automatic testing efficiency of network equipment can be improved.

Description

A kind of automated testing method and device
Technical field
The present invention relates to network communication technology field, particularly relate to a kind of automated testing method and device.
Background technology
The automated test frame of the current network equipment is by the fortune performing machine each network equipment of centralized Control OK, i.e. by performing the machine serial all of test script of execution, and test command is handed down to successively DUT (Device Under Test, be devices under).
But, along with the expansion of automation size, in order to meet the demand of extensive automatic test, quilt Test equipment is continuously increased, and all of test script implementation that all serial performs on execution machine can increase Adding the substantial amounts of waiting time, as performed machine when performing test script, DUT such as needs to issue at the pending machine Test command;Execution machine, after DUT issues test command, needs to wait that DUT returns result etc., Greatly reduce the execution efficiency of automatic test.
Summary of the invention
The present invention provides a kind of automated testing method and device, to solve automatic test in prior art The problem that execution efficiency is low.
First aspect according to embodiments of the present invention, it is provided that a kind of automated testing method, is applied to test Execution machine in system, described test system includes at least two target equipment under test DUT, described execution Setting up between machine and each target DUT and have control passage and data channel, described method includes:
Test command is sent to target DUT, so that target DUT performs local survey by controlling passage Training originally, and blocks the control passage between target DUT and execution machine;
Each data channel is monitored;
Judge whether from data channel receive described in the state locking that sends of at least two targets DUT logical Knowing, described state lock notification is for informing that corresponding target DUT of execution machine suspends test script Perform;
The most then send unblock notice by corresponding data channel to target DUT, so that target DUT Continue executing with test script;
Obtain the operation result of the test script performed.
Second aspect according to embodiments of the present invention, it is provided that a kind of automated testing method, is applied to test Target in system is devices under DUT, and described test system includes described in execution machine and at least two Target DUT, sets up between described execution machine and each target DUT and has control passage and data channel, institute The method of stating includes
When the test command sent to execution machine by control channel reception, perform local test script, And block the control passage between self and execution machine;
When needing the execution suspending test script, send status lock by data channel to described execution machine Fixed notice, described state lock notification is for informing the target DUT time-out test foot that execution machine is corresponding This execution;
When receiving the unblock notice that described execution machine is sent by data channel, continue executing with test foot This;
When test script has performed, report test script operation result.
The third aspect according to embodiments of the present invention, it is provided that a kind of automatic test device, is applied to test Execution machine in system, described test system includes at least two target equipment under test DUT, described execution Setting up between machine and each target DUT and have control passage and data channel, described device includes:
Transmitting element, for sending test command by control passage to target DUT, so that target DUT Perform local test script, and block the control passage between target DUT and execution machine;
Monitoring unit, for monitoring each data channel;
Judging unit, be used for judging whether from data channel receive described at least two targets DUT send out The state lock notification sent, described state lock notification is for informing target DUT that execution machine is corresponding Suspend the execution of test script;
Described transmitting element, is judged as YES if being additionally operable to described judging unit, then led to by corresponding data Road sends to target DUT and unlocks notice, so that target DUT continues executing with test script;
Acquiring unit, for obtaining the operation result of the test script performed.
Fourth aspect according to embodiments of the present invention, it is provided that a kind of automatic test device, is applied to test Target in system is devices under DUT, and described test system includes described in execution machine and at least two Target DUT, sets up between described execution machine and each target DUT and has control passage and data channel, institute State device to include:
Receive unit, for performing the test command of machine transmission by controlling channel reception;
Performance element, for when described reception unit is by controlling the test that channel reception sends to execution machine During order, perform local test script, and block the control passage between self and execution machine;
Transmitting element, for when needing the execution suspending test script, holding to described by data channel Row machine sends state lock notification, and described state lock notification is for informing the target that execution machine is corresponding DUT suspends the execution of test script;
Described performance element, is additionally operable to pass through data channel when described reception unit receives described execution machine During the unblock notice sent, continue executing with test script;
Described transmitting element, is additionally operable to, when test script has performed, report test script operation result.
The application embodiment of the present invention, target DUT is during performing test script, when needs suspend When performing test script, send state lock notification by data channel to the machine of execution, to ensure overall situation fortune The accuracy that row result checks, and then achieve the test script distributed execution on equipment, improve The efficiency of network equipment automatic test.
Accompanying drawing explanation
Fig. 1 is the network architecture schematic diagram of a kind of automatic test that the embodiment of the present invention provides;
Fig. 2 is the schematic flow sheet of a kind of automated testing method that the embodiment of the present invention provides;
Fig. 3 is the schematic flow sheet of the another kind of automated testing method that the embodiment of the present invention provides;
Fig. 4 is the structural representation of a kind of automatic test device that the embodiment of the present invention provides;
Fig. 5 is the structural representation of the another kind of automatic test device that the embodiment of the present invention provides;
Fig. 6 is the structural representation of a kind of automatic test device that the embodiment of the present invention provides.
Detailed description of the invention
For the technical scheme making those skilled in the art be more fully understood that in the embodiment of the present invention, and make The above-mentioned purpose of the embodiment of the present invention, feature and advantage can become apparent from understandable, the most right In the embodiment of the present invention, technical scheme is described in further detail.
Refer to Fig. 1, the network architecture schematic diagram of a kind of automatic test provided for the embodiment of the present invention, As it is shown in figure 1, this network architecture schematic diagram can include execution machine and at least two target DUT.Its In, each target DUT is all as Distributed T CL (Tool Command Language, tool command Language) Client (client) of automatization's framework, built-in TCL interpreter, TCL can be locally executed Script and TCL order;Run the Server program giving TCL on execution machine, control the fortune of Client OK.Wherein, execution machine can include PC (Personal Computer, personal computer) or server Deng.
In the embodiment of the present invention, perform machine and target DUT (i.e. TCL Server and TCL Client) it Between can set up respectively data channel and control passage;Between execution machine can be by target DUT Control passage and send TCL order to target DUT, so that target DUT performs local test script, And block the control passage between target DUT and execution machine;Execution machine can also by control passage to Client transmitting control commands, controls the running status of Client.Wherein, data channel can be FTP (File Transfer Protocol, file transfer protocol (FTP))/TFTP (Trivial File Transfer Protocol, TFTP) communication channel.
Based on the network architecture shown in Fig. 1, embodiments provide a kind of automated testing method, This automated testing method can apply to distributed network equipment automatization test system, refers to Fig. 2, For the schematic flow sheet of a kind of automated testing method that the embodiment of the present invention provides, wherein, the method can With the execution machine being applied in the network architecture shown in Fig. 1, as in figure 2 it is shown, the method can include following Step:
Step 201, by control passage to target DUT send TCL order so that target DUT is held The test script that row is local, and block the control passage between target DUT and execution machine.
In the embodiment of the present invention, in order to reduce the waiting time during automatic testization, raising automatization The execution efficiency of test, can be in advance by partial test script (test script as configuration distributing) It is issued in target DUT perform.
For example, it is possible to the configuration that needs are issued, in units of function, write as interface function, and with module For unit, interface function write different test scripts, and leave in the storage medium of target DUT.
It should be noted that in embodiments of the present invention, for needing the test foot performed on execution machine This, its result check process specifically performing flow process and correspondence may refer to existing automatic test scheme In associated description, the embodiment of the present invention does not repeats them here.Such as, QoS (Quality of Service, Service quality) test script, need test instrunment to send data traffic to DUT, accordingly, it would be desirable to Perform on execution machine.
In the embodiment of the present invention, the machine of execution can be by the control passage between target DUT to target DUT sends TCL order, the test script local to start the execution of target DUT.
After target DUT receives the TCL order that execution machine sends, the test script of this locality can be performed, And block the control passage between target DUT and execution machine.
Step 202, each data channel is monitored.
Step 203, judge whether to receive, from data channel, the shape that above-mentioned at least two targets DUT send State lock notification, this state lock notification is for informing the target DUT time-out test that execution machine is corresponding The execution of script.If so, step 204 is gone to;Otherwise, step 202 is gone to.
In the embodiment of the present invention, it is contemplated that during distributed network equipment automatic test realizes, to test foot The inspection of this operation result can include that local runtime result checks and overall situation operation result inspection.Its In, the inspection of local runtime result, is to the configuration result on DUT local significance or running status Checking, issuing of such as configuring is the most correct, and whether the power supply of this locality, fan, temperature, port status Correct etc., it doesn't matter for the inspection of local runtime result and the miscellaneous equipment in networking, there is not sequential and asks Topic.And the inspection of overall situation operation result, refer to the comprehensive of whole group net operation result is checked, such as, Two OSPF being devices under between (such as DUT1 and DUT2) (Open Shortest Path First, Ospf) neighborhood test, to check the FULL of OSPF on DUT1 State, then need after DUT2 has configured, and just can check, otherwise result mistake, The when of it is to say, DUT does the inspection of overall situation operation result, need to confirm that other relevant set The configuration of standby (including DUT or execution machine) has met expection.Therefore, at distributed network equipment In automatic test (test script is distributed execution) implementation, the overall situation is transported by a DUT The when that row result checking, need and in networking, relevant device carries out a running status synchronization.
In order to achieve the above object, in embodiments of the present invention, target DUT perform test script time, If desired carry out overall situation operation result inspection, then target DUT can suspend the execution of test script, and Sending state lock notification by data channel to the machine of execution, this state lock notification is used for informing execution machine Corresponding target DUT suspends the execution of test script, i.e. informs that execution machine sends the locking of this state logical Target DUT known suspends the execution of test script, waits other equipment.
For example, it is possible to arrange preset field in the test script be handed down to target DUT, this predetermined word Section can be arranged on after needing to carry out the field that overall situation operation result checks, target DUT is performing basis During the test script on ground, if going to this preset field, then can be by data channel to execution Machine sends state lock notification, to inform that execution machine self suspends the execution of test script, thus realizes many Running status between individual target DUT synchronizes.
Wherein, the overall situation multiple targets DUT involved by operation result inspection are required to send to execution machine State lock notification, the state locking notification package that the plurality of target DUT sends includes an active lock and leads to Know and at least one passive lock notification;Same overall situation operation result checks corresponding state lock notification Middle needs includes identical notice mark, and this notice mark is used for performing machine identification corresponding to same overall situation fortune The state lock notification that row result checks, and active lock notice can also carry and be there is a need to send The mark of target DUT of passive lock notification.
Correspondingly, each data channel, after target DUT sends test command, can be entered by the machine that performs Row is monitored, to detect whether existence lock notification.When execution machine receives target from data channel During the state lock notification that DUT sends, execution machine may further determine whether to receive from data channel The state lock notification that above-mentioned at least two targets DUT send, i.e. judges to relate to overall situation operation result inspection Whether the test equipment looked into completes state synchronized.If, it is determined that need to notify that target DUT releases Lock-out state, continues executing with test script;Otherwise, continue data channel is monitored.
As the optional embodiment of one, in embodiments of the present invention, each data channel is monitored, May include that
When from data receiver to passive lock notification, then record the global lock in this passive lock notification and compile Number and the machine DUT number;
When receiving active lock notice from data channel, then record the overall institute in this active lock notice Numbering, the machine DUT numbering and DUT list.
Correspondingly, it may be judged whether from data channel receive described in the shape that sends of at least two targets DUT State lock notification, particularly as follows:
Number according to described DUT list and described global lock, it may be judged whether described in receiving at least two The state lock notification that target DUT sends.
In this embodiment, state lock notification can be divided into active lock notice and passive lock notification, According to the lock type in state lock notification, execution machine can determine that state lock notification is active lock notice Or passive lock notification;Wherein, active lock notice at least can comprise global lock numbering, lock type, The machine DUT numbering and DUT list;Passive lock notification at least can comprise global lock numbering and the machine DUT numbering etc..
Wherein, global lock numbering may be used for identifying a certain overall situation operation result, at a test script During execution, may repeatedly carry out state locking, the corresponding global lock of state locking each time Numbering, the neighborhood of such as OSPF is an overall operation result;The machine DUT numbering is used for identifying The DUT equipment of transmission state lock notification;DUT list can include DUT numbering or execution machine mark (or referred to as Server mark), sets for identifying the same overall situation other DUT involved by operation result Standby or the machine of execution.
Alternatively, state lock notification can also include locking type, lock type can include actively locking or Passive lock, is active lock notice or passive lock notification for identification-state lock notification.
In this embodiment, when execution machine receives state lock notification, the machine of execution can be according to this Lock type in state lock notification determines that this state lock notification is active lock notice or passively locks logical Know.
When execution machine receives passive lock notification, the global lock in this passive lock notification can be recorded Numbering and the machine DUT are numbered;When execution machine receives active lock notice, this active can be recorded Global lock numbering, the machine DUT numbering and DUT list in lock notification.
Correspondingly, perform machine to number and DUT list with the global lock of self record, it may be judged whether Receive the lock notification that above-mentioned at least two targets DUT send.
In the embodiment of the present invention, if execution machine judges not receive above-mentioned at least two targets from data channel The state lock notification that DUT sends is not (as received active lock notice, not receiving partly or entirely Passive lock notification or active lock notice and passive lock notification are and receive), then performing machine can To continue data channel is monitored.
As an example it is assumed that active lock notice includes global lock numbering, lock type, the machine DUT successively Numbering and DUT list;Passive lock notification includes global lock numbering, lock type, the machine successively DUT numbers;Wherein, pass through between different field "!" it is separator, the lock type that actively lock is corresponding Being 0, the lock type that passive lock is corresponding is 1, and the member of passive locking DUT list separates with ". ", then The content of announcement of the state lock notification received when execution machine includes " 1!0!1!3.4 ", time, hold Row machine can confirm that this state lock notification is active lock notice, and global lock numbered " 1 " sends main The equipment of dynamic lock notification is that DUT1, DUT3 and DUT4 need to send passive lock notification, and then, Execution machine can decide whether that the passive lock notification having been received by DUT3 and DUT4 transmission is (in notice Hold and be respectively " 1!1!3!3 " and " 1!1!4!4 "), and when all having been received by, solve Except locking processing.
It should be noted that in embodiments of the present invention, if after execution machine receives active lock notice, In Preset Time (the first Preset Time), do not receive the quilt that in DUT list, certain target DUT sends During dynamic lock notification, perform machine and can send passive lock-request message to this target DUT, so that should After target DUT receives this passive lock-request message, suspend the execution of test script, and reply passively Lock notification.
Step 204, sent to target DUT by corresponding data channel and unlock notice, so that target DUT continues executing with test script.
In the embodiment of the present invention, receive above-mentioned at least two targets when execution machine determines from data channel During the state lock notification that DUT sends, the machine of execution can be by corresponding data channel to target DUT Send and unlock notice, so that target DUT receiving this unblock notice continues executing with test script, example When unlocking notice as sent to target DUT, set up with this target DUT by execution machine Data channel sends.
As the optional embodiment of one, in above-mentioned steps 203, by corresponding data channel to mesh Mark DUT sends and unlocks notice, may include that
The machine DUT numbering in notifying according to active lock, by corresponding data channel to target DUT Send and unlock notice, during so that this target DUT receives this unblock notice, continue executing with test script;
After receiving the unblock acknowledgement notification that this DUT sends, according to the DUT in this unblock acknowledgement notification List, sends unblock notice by corresponding data channel to target DUT, so that this target DUT connects When receiving this unblock notice, continue executing with test.
In this embodiment, when execution machine needs to release the status lock timing of target DUT, machine is performed (active lock notice can be i.e. sent according to the machine DUT numbering in the active lock notice received The numbering of DUT), unlock notice by corresponding data channel to target DUT;Wherein, this solution Lock notice can include global lock numbering, notification type mark and DUT list.
After DUT receives unblock notice, test script can be continued executing with, and send unblock to the machine of execution Acknowledgement notification;Wherein, this unblock acknowledgement notification can include global lock numbering, DUT list and notice Type identification.
After execution machine receives the unblock acknowledgement notification that DUT sends, according in this unblock acknowledgement notification DUT list, sends unblock notice by corresponding data channel to target DUT, so that receiving this Target DUT continues executing with test script.
Preferably, in embodiments of the present invention, active lock notice, passive lock notification, unlock notice Identical with the form unlocking acknowledgement notification, i.e. it is " global lock numbering!(0 is main to notification type mark Dynamic lock notification, 1 is passive lock notification, and 2 for unlocking notice, and 3 for unlocking acknowledgement notification)!The machine Numbering!The DUT list of passive lock or passive lock DUT numbering ".
For example, still in above-mentioned steps 203 as a example by examples cited, execution machine receives DUT1 and sends out (content of announcement is " 1 to the active lock notice sent!0!1!3.4 " (first " 1 " is that global lock is compiled Number;" 0 " is notification type mark, shows that this notice is active lock notice;Second " 1 " is this Machine DUT identifies, and shows that this active lock notice is sent by DUT1;" 3.4 " are DUT list, i.e. DUT3 and DUT4 needs to send passive lock notification, lower with)), and DUT3 and DUT4 send out (content of announcement is respectively " 1 to the passive lock notification sent!1!3!3 " (first " 1 " is global lock Numbering;Second " 1 " is notification type mark, shows that this notice is passive lock notification;First " 3 " Identify for the machine DUT, show that this passive lock notification is sent by DUT3;Second " 3 " show DUT3 needs to send passive lock notification, lower same) and " 1!1!4!4 ", after), the machine of execution can Unlocking notice first to send to DUT1, its content of announcement can be " 1!2!0!1 " (assume to solve The notification type of lock notice is designated 2, and perform machine is designated 0) (first " 1 " is that global lock is compiled Number;" 2 " are notification type mark, show that this notice is for unlocking notice;" 0 " is execution machine mark, Show that this unblock notice is sent by execution machine;Second " 1 ", for unlocking DUT mark, i.e. notifies DUT1 Unlock, lower with), after DUT1 receives this unblock notice, continue executing with test script, and to Execution machine sends and unlocks acknowledgement notification, and its content of announcement can be " 1!3!1!3.4 " (assume to unlock The notification type of acknowledgement notification is designated 3) (first " 1 " is global lock numbering;" 3 " are notice Type identification, shows that this notice is for unlocking acknowledgement notification;" 1 " is the machine DUT mark, shows this solution Lock determines that notice is sent by DUT1;" 3,4 " are that DUT list, i.e. DUT3 and DUT4 are Passively lock DUT, lower same);After execution machine receives the unblock acknowledgement notification that DUT1 sends, permissible (content of announcement can be respectively " 1 to send passive locking unblock notice to DUT3 and DUT4 respectively!2! 0!3 " and " 1!2!0!4 "), so that DUT3 and DUT4 continues executing with test script.Wherein, DUT3 and DUT4, can be respectively to DUT3 and DUT4 after receiving passive locking and unlocking notice (content of announcement can be respectively " 1 to send unblock acknowledgement notification!2!3!3 " and " 1!2!4!4”).
As the optional embodiment of one, in embodiments of the present invention, unlock notice (to include actively locking Fixed unlock notice or passive locking unlocks notice) can be filename be the file of content of announcement;
The operation result of the test script that step 205, acquisition have performed.
In the embodiment of the present invention, after target DUT has performed the test script of this locality, can will test foot This operation result reports execution machine;Or, target DUT can perform the test foot of this locality After Ben, send test script to the machine of execution and perform completion notice;Execution machine receives target DUT and sends Test script perform after completion notice, the test script operation result of this target DUT can be obtained.
Based on the network architecture shown in Fig. 1, embodiments provide another kind of automated testing method, Refer to Fig. 3, the schematic flow sheet of another kind of automated testing method provided for the embodiment of the present invention, Wherein, the method can apply to target DUT, as it is shown on figure 3, the method may comprise steps of:
Step 301, when by control channel reception send to execution machine test command time, perform this locality Test script, and block the control passage between self and execution machine.
In the embodiment of the present invention, the machine of execution can be by the control passage between target DUT to target DUT sends TCL order, the test script local to start the execution of target DUT;Target DUT connects When receiving this TCL order, the execution of local test script can be started, and block self and execution machine it Between control passage.It should be noted that target DUT described herein only refers to general DUT, should Set up between DUT and execution machine and have data channel and control passage, target DUT this title not structure The restriction of DUT in pairs.
Step 302, when need suspend test script execution time, by data channel to described execution machine Transmission state lock notification, this state lock notification is temporary for informing corresponding target DUT of execution machine Stop the execution of test script.
In the embodiment of the present invention, target DUT, when performing test script, if desired carries out overall situation operation Result checks, then target DUT can suspend the execution of test script, and by data channel to execution Machine sends state lock notification, and this state lock notification is for informing target DUT that execution machine is corresponding Suspend the execution of test script.
Wherein, the overall situation multiple targets DUT involved by operation result inspection are required to send to execution machine State lock notification, the state lock notification that the plurality of target DUT sends can include an actively lock Fixed notice and at least one passive lock notification, same overall situation operation result checks corresponding multiple states Needing in lock notification to include identical notice mark, this notice mark is used for performing machine identification corresponding to same The state lock notification that one overall situation operation result checks, and active lock notice can also carry all Need to send the mark of the equipment of passive lock notification.
Concrete, in order to ensure the accuracy that overall situation operation result checks, can be in overall situation operation result inspection Look in involved test script and preset field is set, when target DUT is performing local test script During, when going to this preset field, actively lock can be sent according to this preset field to the machine of execution Fixed notice or passive lock notification
Wherein, in test script, actively lock or passive lock can be realized by while circulation, work as phase After pass DUT goes to this while circulation, notice can be unlocked with cycle detection, detect that unblock notifies then Exit circulation, it is achieved unlock;Otherwise, lock-out state is kept.
Wherein, implementing after execution machine receives active lock notice or passive lock notification is permissible Seeing the associated description in above-mentioned steps 203~step 204, the embodiment of the present invention does not repeats them here.
Step 303, when receiving the unblock notice that execution machine is sent by data channel, continue executing with Test script.
In the embodiment of the present invention, when target DUT receives the unblock notice that execution machine sends, can solve Except lock-out state, continue executing with test script.
As the optional embodiment of one, (work as target when unlocking notice for active lock unblock notice DUT to the state lock notification that execution machine sends be active lock notice time, this target DUT receives Unblock notice be properly termed as active lock unlock notice) time, receive execution machine and sent out by data channel After the unblock notice sent, it is also possible to including:
Send to the machine of execution and unlock acknowledgement notification, so that the machine of execution is according to the DUT unlocked in acknowledgement notification List, sends passive lock by corresponding data channel to target DUT and unlocks notice.
In this embodiment, the unblock notice received when target DUT unlocks notice for active lock Time, i.e. this target DUT is when execution machine sends target DUT of active lock notice, this target DUT is after unlocking state according to unlocking notice, and continuing executing with test script, in addition it is also necessary to holding Row machine sends and unlocks acknowledgement notification, can include DUT list in this unblock acknowledgement notification;Execution machine connects After receiving this unblock acknowledgement notification, passive lock can be sent according to this DUT list to target DUT Surely unlock notice (when target DUT to the state lock notification that execution machine sends be passive lock notification time, The unblock notice that this target DUT receives is properly termed as passively locking unblock notice), to indicate correspondence Target DUT unlock, continue executing with test script.
Step 304, when test script has performed, report test script operation result.
In the embodiment of the present invention, after target DUT has performed the test script of this locality, can will test foot This operation result reports execution machine;Or, target DUT can perform the test foot of this locality After Ben, send test script to the machine of execution and perform completion notice;Execution machine receives target DUT and sends Test script perform after completion notice, the test script operation result of this target DUT can be obtained.
It should be noted that in embodiments of the present invention, DUT sends active lock to execution machine and notifies it After, if not receiving the unblock notice that execution machine sends in Preset Time (the second Preset Time), then Again active lock notice, wherein, leading to of the active lock notice resend can be sent to the machine of execution Know that form can be identical with the form of the active lock notice sent before;Execution machine receives this active lock The strategy that processes of fixed notice may refer to the associated description in above-described embodiment.
Additionally, DUT is after the machine of execution sends active lock notice or passive lock notification, if presetting Unblock is not received logical in time (the 3rd Preset Time, the 3rd Preset Time is more than the second Preset Time) Know, then DUT can directly unlock state, continues executing with test script.
In order to make those skilled in the art be more fully understood that the technical scheme that the embodiment of the present invention is supplied to, under Notice communication mechanism in the embodiment of the present invention is illustrated.
1, in target DUT and Server, ftp server is all started.
2, Tclsh (a kind of script interpreter) process of target DUT creates sky on the disk of DUT File, filename is the content of Tclsh process notice to be sent, content of announcement field with "!” Number being decollator, the notification type mark of active lock notice represents with 0, the notice of passive lock notification Type identification represents with 1, and the notification type mark unlocking notice represents with 2, unlocks the logical of acknowledgement notification Knowing that type identification represents with 3, the member of passive locking list is split with ". " number.
The tclsh process of such as DUT1, will create one numbered 1, active lock type, passively Locking DUT member's numbering is respectively the active lock notice of 3,4, then should create one on disk Entitled: 1!0!1!The empty file of 3.4.
3, the Tclsh process of DUT is sent to Server by ftp circular document.
4, the notice performing machine monitoring ftp server receives catalogue, is found to have the write of new circular document, reads After taking filename (acquisition content of announcement), circular document is copied under history notice catalogue, then exists Notice receives and deletes this circular document under catalogue.
5, after execution machine is notified, notice is carried out classification storage, and according to the type of locking, does difference Process: if receive be active lock notice, then according to notice in global lock numbering and DUT List, searches passive lock notification, if can find, then sends to notice source and unlocks notice;If receiving To be passive lock notification, then search whether to there is corresponding active lock notice according to global lock numbering, Corresponding active lock notice is waited, if finding correspondence if it does not exist, then be not further processed Active lock notifies, then the DUT list in notifying according to active lock, it is judged that passive lock notification is No all receive, if it did not, be not further processed, wait next passive lock notification, no Then send to notice source and unlock notice.
6, unlocking notice form is: global lock is numbered, lockType, performs machine mark (0), unlocks DUT numbers, and decollator is still!, such as 1!0!1!3.4 this active lock notices, solve Lock notice is 1!2!0!1, sending directory creating file in notice is 1!2!0!The empty file of 1, By ftp, file is transferred to send the DUT1 equipment of active lock notice, then notice is sent mesh Circular document under Lu deletes circular document after copying notification history catalogue to.
7, the Tclsh process of DUT1 equipment reads unblock notice, exits global lock, continues executing with survey Training originally, and sends unblock acknowledgement notification: 1!3!1!3.4.
8, after Server receives unblock acknowledgement notification, send unblock to DUT3 and notify 1!2!0!3, Send unblock to DUT3 and notify 1!2!0!4.
9, after DUT3, DUT4 receive unblock notice, each exit global lock, continue executing with test Script.
By above flow process it can be seen that in embodiments of the present invention, target DUT is performing test foot During Ben, when needs suspend execution test script, send state by data channel to the machine of execution Lock notification, to ensure the accuracy that overall situation operation result checks, and then achieves test script at equipment On distributed execution, improve the efficiency of network equipment automatic test.
Refer to Fig. 4, the structural representation of a kind of automatic test device be provided for the embodiment of the present invention, Wherein, this device can apply to the execution machine in the network architecture shown in Fig. 1, as shown in Figure 4, this dress Put and may include that
Transmitting element 410, for sending test command by control passage to target DUT, so that target DUT performs local test script, and blocks the control passage between target DUT and execution machine;
Monitoring unit 420, for monitoring each data channel;
Judging unit 430, be used for judging whether from data channel receive described at least two targets DUT The state lock notification sent, described state lock notification is for informing target DUT that execution machine is corresponding Suspend the execution of test script;
Described transmitting element 410, is judged as YES if being additionally operable to described judging unit, then by corresponding number Unblock notice is sent to target DUT, so that target DUT continues executing with test script according to passage;
Acquiring unit 440, for obtaining the operation result of the test script performed.
In an alternative embodiment, described monitoring unit 420, can be specifically for when receiving from data channel During to passive lock notification, then record the global lock numbering in described passive lock notification and the machine DUT Numbering;When from data channel receive active lock notice, then record described active lock notice in complete Office is numbered, the machine DUT is numbered and DUT list;
Described judging unit 430, can specifically for numbering according to described DUT list and described global lock, Judge whether the state lock notification that at least two targets DUT described in receiving send.
See also the another kind of automatic test device that Fig. 5, Fig. 5 provide for the embodiment of the present invention Structural representation, on the basis of embodiment illustrated in fig. 4, in the automatic test device shown in Fig. 5, Described transmitting element 410 may include that
First sends subelement 411, the machine DUT numbering in notifying according to active lock, passes through Corresponding data channel sends to target DUT and unlocks notice, so that this target DUT receives this unblock During notice, continue executing with test script;
Receive subelement 412, for receiving the unblock acknowledgement notification that this target DUT sends;
Second sends subelement 413, for receiving what this target DUT sent when described reception subelement When unlocking acknowledgement notification, according to the DUT list in this unblock acknowledgement notification, led to by corresponding data Road sends to target DUT and unlocks notice, during so that this target DUT receives this unblock notice, continues Perform test script.
In an alternative embodiment, described data channel is file transfer protocol (FTP) FTP passage or simple files biography Transmission protocol TFTP passage, described state lock notification and described unblock notice are as notice using filename The file of content.
Refer to Fig. 6, the structural representation of a kind of automatic test device be provided for the embodiment of the present invention, Wherein, this device can apply to target DUT, and as shown in Figure 6, this device may include that
Receive unit 610, for performing the test command of machine transmission by controlling channel reception;
Performance element 620, for sending out to execution machine by controlling channel reception when described reception unit 610 During the test command sent, perform local test script, and it is logical to block the control between self and execution machine Road;
Transmitting element 630, for when needing the execution suspending test script, by data channel to institute Stating execution machine and send state lock notification, described state lock notification is for informing the mesh that execution machine is corresponding Mark DUT suspends the execution of test script;
Described performance element 620, is additionally operable to pass through when described reception unit 610 receives described execution machine During the unblock notice that data channel sends, continue executing with test script;
Described transmitting element 630, is additionally operable to, when test script has performed, report test script to run Result.
In an alternative embodiment, described state lock notification is passive lock notification or active lock notice, Wherein, comprising global lock numbering and the machine DUT is numbered in described passive lock notification, described active is locked Fixed notice comprises global lock numbering, the machine DUT numbering and DUT list.
In an alternative embodiment, described transmitting element 630, it is also possible to for when described reception unit 610 When receiving the active lock unblock notice that described execution machine is sent by data channel, to described execution machine Send and unlock acknowledgement notification, so that described execution machine is according to DUT list in described unblock acknowledgement notification, Send passive lock by corresponding data channel to target DUT and unlock notice.
In an alternative embodiment, described data channel is file transfer protocol (FTP) FTP passage or simple files biography Transmission protocol TFTP passage, described state lock notification, described unblock notice are as notice using filename The file of content.
In said apparatus, the function of unit and the process that realizes of effect specifically refer in said method corresponding Step realize process, do not repeat them here.
For device embodiment, owing to it corresponds essentially to embodiment of the method, so relevant part ginseng See that the part of embodiment of the method illustrates.Device embodiment described above is only schematically, The wherein said unit illustrated as separating component can be or may not be physically separate, makees The parts shown for unit can be or may not be physical location, i.e. may be located at a place, Or can also be distributed on multiple NE.Can select according to the actual needs part therein or The whole module of person realizes the purpose of the present invention program.Those of ordinary skill in the art are not paying creativeness In the case of work, i.e. it is appreciated that and implements.
As seen from the above-described embodiment, target DUT is during performing test script, when needs suspend When performing test script, send state lock notification by data channel to the machine of execution, to ensure overall situation fortune The accuracy that row result checks, and then achieve the test script distributed execution on equipment, improve The efficiency of network equipment automatic test.
Those skilled in the art, after considering description and putting into practice invention disclosed herein, will readily occur to this Other embodiment of invention.The application is intended to any modification, purposes or the adaptability of the present invention Change, these modification, purposes or adaptations are followed the general principle of the present invention and include this Bright undocumented common knowledge in the art or conventional techniques means.Description and embodiments only by Being considered as exemplary, true scope and spirit of the invention are pointed out by claim below.
It should be appreciated that the invention is not limited in described above and illustrated in the accompanying drawings accurately Structure, and various modifications and changes can carried out without departing from the scope.The scope of the present invention is only by institute Attached claim limits.

Claims (14)

1. an automated testing method, the execution machine being applied in test system, described test system bag Including at least two target equipment under test DUT, setting up between described execution machine and each target DUT has control Passage and data channel, it is characterised in that described method includes:
Test command is sent to target DUT, so that target DUT performs local survey by controlling passage Training originally, and blocks the control passage between target DUT and execution machine;
Each data channel is monitored;
Judge whether from data channel receive described in the state locking that sends of at least two targets DUT logical Knowing, described state lock notification is for informing that corresponding target DUT of execution machine suspends test script Perform;
The most then send unblock notice by corresponding data channel to target DUT, so that target DUT Continue executing with test script;
Obtain the operation result of the test script performed.
Method the most according to claim 1, it is characterised in that described each data channel is supervised Listen, including:
When receiving passive lock notification from data channel, then record in described passive lock notification is complete Office's lock numbering and the machine DUT are numbered;
When receiving active lock notice from data channel, then record the overall situation in described active lock notice Lock numbering, the machine DUT numbering and DUT list;
Described judge whether from data channel receive described in the status lock that sends of at least two targets DUT Fixed notice, particularly as follows:
Number according to described DUT list and described global lock, it may be judged whether described in receiving at least two The state lock notification that target DUT sends.
Method the most according to claim 2, it is characterised in that described by corresponding data channel Send to target DUT and unlock notice, including:
The machine DUT numbering in notifying according to active lock, by corresponding data channel to target DUT Send and unlock notice, during so that this target DUT receives this unblock notice, continue executing with test script;
After receiving the unblock acknowledgement notification that this target DUT sends, according in this unblock acknowledgement notification DUT list, sent to target DUT by corresponding data channel and unlock notice, so that this target When DUT receives this unblock notice, continue executing with test script.
Method the most according to claim 1, it is characterised in that described data channel is file transmission Agreement FTP passage or TFTP TFTP passage, described state lock notification and described solution Lock notice for using filename as the file of content of announcement.
5. an automated testing method, the target being applied in test system is devices under DUT, Described test system includes execution machine and at least two described targets DUT, described execution machine and each target Set up between DUT and have control passage and data channel, it is characterised in that described method includes:
When the test command sent to execution machine by control channel reception, perform local test script, And block the control passage between self and execution machine;
When needing the execution suspending test script, send status lock by data channel to described execution machine Fixed notice, described state lock notification is for informing the target DUT time-out test foot that execution machine is corresponding This execution;
When receiving the unblock notice that described execution machine is sent by data channel, continue executing with test foot This;
When test script has performed, report test script operation result.
Method the most according to claim 5, it is characterised in that described state lock notification is passive Lock notification or active lock notice, wherein, comprise global lock and number and this in described passive lock notification Machine DUT numbers, and comprises global lock numbering, the machine DUT numbering and DUT in described active lock notice List.
Method the most according to claim 5, it is characterised in that when the described notice that unlocks is for actively lock Fixed when unlocking notice, described in receive the unblock notice that described execution machine is sent by data channel after, Also include:
Send to described execution machine and unlock acknowledgement notification, so that described execution machine confirms to lead to according to described unblock DUT list in knowing, sends unblock notice by corresponding data channel to target DUT.
8. an automatic test device, the execution machine being applied in test system, described test system bag Include at least two target equipment under test DUT, set up between target DUT described in described execution machine and Ge Tai There are control passage and data channel, it is characterised in that described device includes:
Transmitting element, for sending test command by control passage to target DUT, so that target DUT Perform local test script, and block the control passage between target DUT and execution machine;
Monitoring unit, for monitoring each data channel;
Judging unit, be used for judging whether from data channel receive described at least two targets DUT send out The state lock notification sent, described state lock notification is for informing target DUT that execution machine is corresponding Suspend the execution of test script;
Described transmitting element, is judged as YES if being additionally operable to described judging unit, then led to by corresponding data Road sends to target DUT and unlocks notice, so that target DUT continues executing with test script;
Acquiring unit, for obtaining the operation result of the test script performed.
Device the most according to claim 8, it is characterised in that
Described monitoring unit, specifically for when receiving passive lock notification from data channel, then record Global lock numbering and the machine DUT in described passive lock notification are numbered;When receiving from data channel Active lock notify, then record described active lock notice in the overall situation numbered, the machine DUT number With DUT list;
Described judging unit, specifically for numbering according to described DUT list and described global lock, it is judged that The state lock notification that at least two targets DUT described in whether receiving send.
Device the most according to claim 9, it is characterised in that described transmitting element includes:
First sends subelement, and the machine DUT numbering in notifying according to active lock, by right The data channel answered sends to target DUT and unlocks notice, so that this target DUT receives this unblock and leads to When knowing, continue executing with test script;
Receive subelement, for receiving the unblock acknowledgement notification that this target DUT sends;
Second sends subelement, for receiving, when described reception subelement, the solution that this target DUT sends During lock acknowledgement notification, according to the DUT list in this unblock acknowledgement notification, by corresponding data channel Send to target DUT and unlock notice, during so that this target DUT receives this unblock notice, continue to hold Row test script.
11. devices according to claim 8, it is characterised in that described data channel is that file passes Transmission protocol FTP passage or TFTP TFTP passage, described state lock notification and described Unlock notice for using filename as the file of content of announcement.
12. 1 kinds of automatic test devices, the target being applied in test system is devices under DUT, Described test system includes execution machine and at least two described targets DUT, described execution machine and each target Set up between DUT and have control passage and data channel, it is characterised in that described device includes:
Receive unit, for performing the test command of machine transmission by controlling channel reception;
Performance element, for when described reception unit is by controlling the test that channel reception sends to execution machine During order, perform local test script, and block the control passage between self and execution machine;
Transmitting element, for when needing the execution suspending test script, holding to described by data channel Row machine sends state lock notification, and described state lock notification is for informing the target that execution machine is corresponding DUT suspends the execution of test script;
Described performance element, is additionally operable to pass through data channel when described reception unit receives described execution machine During the unblock notice sent, continue executing with test script;
Described transmitting element, is additionally operable to, when test script has performed, report test script operation result.
13. devices according to claim 12, it is characterised in that described state lock notification is quilt Dynamic lock notification or active lock notice, wherein, described passive lock notification comprises global lock numbering and The machine DUT number, described active lock notice in comprise global lock numbering, the machine DUT numbering and DUT list.
14. devices according to claim 12, it is characterised in that
Described transmitting element, is additionally operable to pass through data channel when described reception unit receives described execution machine Send active lock unlock notice time, to described execution machine send unlock acknowledgement notification so that described in hold Row machine is according to the DUT list in described unblock acknowledgement notification, by corresponding data channel to target DUT Send passive lock and unlock notice.
CN201610187060.8A 2016-03-28 2016-03-28 A kind of automated testing method and device Active CN105893252B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610187060.8A CN105893252B (en) 2016-03-28 2016-03-28 A kind of automated testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610187060.8A CN105893252B (en) 2016-03-28 2016-03-28 A kind of automated testing method and device

Publications (2)

Publication Number Publication Date
CN105893252A true CN105893252A (en) 2016-08-24
CN105893252B CN105893252B (en) 2018-11-27

Family

ID=57013952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610187060.8A Active CN105893252B (en) 2016-03-28 2016-03-28 A kind of automated testing method and device

Country Status (1)

Country Link
CN (1) CN105893252B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106789260A (en) * 2016-12-26 2017-05-31 中国银联股份有限公司 System and method for carrying out High Availabitity rehearsal to the network equipment
CN109151021A (en) * 2018-08-21 2019-01-04 郑州云海信息技术有限公司 A kind of distributed memory system file lock characteristic test method and device
CN110943886A (en) * 2019-11-29 2020-03-31 新华三技术有限公司 Performance data transmission method and device
CN111737145A (en) * 2020-07-21 2020-10-02 北京志翔科技股份有限公司 Automatic testing method and device
CN113342652A (en) * 2021-06-02 2021-09-03 中国工商银行股份有限公司 Test data processing method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040255279A1 (en) * 2003-04-22 2004-12-16 Alasdair Rawsthorne Block translation optimizations for program code conversation
CN103019928A (en) * 2011-09-27 2013-04-03 北京新媒传信科技有限公司 Automatic testing method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040255279A1 (en) * 2003-04-22 2004-12-16 Alasdair Rawsthorne Block translation optimizations for program code conversation
CN103019928A (en) * 2011-09-27 2013-04-03 北京新媒传信科技有限公司 Automatic testing method and system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106789260A (en) * 2016-12-26 2017-05-31 中国银联股份有限公司 System and method for carrying out High Availabitity rehearsal to the network equipment
CN109151021A (en) * 2018-08-21 2019-01-04 郑州云海信息技术有限公司 A kind of distributed memory system file lock characteristic test method and device
CN109151021B (en) * 2018-08-21 2021-05-25 郑州云海信息技术有限公司 Distributed storage system file lock characteristic testing method and device
CN110943886A (en) * 2019-11-29 2020-03-31 新华三技术有限公司 Performance data transmission method and device
CN110943886B (en) * 2019-11-29 2021-11-02 新华三技术有限公司 Performance data transmission method and device
CN111737145A (en) * 2020-07-21 2020-10-02 北京志翔科技股份有限公司 Automatic testing method and device
CN113342652A (en) * 2021-06-02 2021-09-03 中国工商银行股份有限公司 Test data processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN105893252B (en) 2018-11-27

Similar Documents

Publication Publication Date Title
CN105893252A (en) Automatic testing method and device
CN106681924A (en) Software testing method and software testing system
CN107870948A (en) Method for scheduling task and device
CN104601668B (en) Data push method, device and system based on condition managing
CN107577591A (en) A kind of method, apparatus and system of automatic test abnormal protection
CN103761131B (en) A kind of many board part automatic update methods and system based on memory sharing
CN104615486B (en) For searching for the multi-task scheduling of Extension Software Platform and executing methods, devices and systems
CN107908511A (en) ACPI test methods, test machine and the system of a kind of network interface card
CN103516735A (en) Method and apparatus for upgrading network node
CN113835844A (en) Management method and device of container cluster and cloud computing platform
WO2016116013A1 (en) Software upgrade method and system
CN106230622A (en) A kind of cluster implementation method and device
CN111324365A (en) Method and equipment for upgrading super-converged system
CN111651350B (en) Test case processing method, device, equipment and computer readable storage medium
CN106802846A (en) A kind of remote test method, apparatus and system
CN114050989B (en) Distributed test execution method based on cloud computing technology
CN114090211A (en) Method and device for coordinating single-task master-slave program and related multi-server system
CN112506633B (en) Multi-machine redundancy system and processing method
CN105991687B (en) A kind of service management and device
CN116938779A (en) Automatic detection method, single board, electronic device and storage medium
CN107465762B (en) Testing method and system for distributed storage system
CN115640096A (en) Application management method and device based on kubernets and storage medium
CN107968718A (en) A kind of method, apparatus and equipment for confirming standby usage state
CN109408581B (en) Data exchange method, device, equipment and storage medium
CN112231217A (en) Method and device for implementing function test in copy mode

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant after: Xinhua three Technology Co., Ltd.

Address before: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant before: Huasan Communication Technology Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant