CN105893252B - A kind of automated testing method and device - Google Patents

A kind of automated testing method and device Download PDF

Info

Publication number
CN105893252B
CN105893252B CN201610187060.8A CN201610187060A CN105893252B CN 105893252 B CN105893252 B CN 105893252B CN 201610187060 A CN201610187060 A CN 201610187060A CN 105893252 B CN105893252 B CN 105893252B
Authority
CN
China
Prior art keywords
dut
lock
unlock
notice
target
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
CN201610187060.8A
Other languages
Chinese (zh)
Other versions
CN105893252A (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.)
New H3C Technologies Co Ltd
Original Assignee
New 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 New H3C Technologies Co Ltd filed Critical New 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 present invention provides a kind of automated testing method and device, this method include:Test command is sent to target DUT by control channel, so that target DUT executes local test script, and blocks the control channel between target DUT and execution machine;Each data channel is monitored;Judge whether to receive the state lock notification that at least two target DUT are sent from data channel, the state lock notification is used to inform the execution of the corresponding target DUT pause test script of execution machine;If so, unlock notice is sent to target DUT by corresponding data channel, so that target DUT continues to execute test script;Obtain the operation result for executing the test script completed.The efficiency of network equipment automatic test can be improved using the embodiment of the present invention.

Description

A kind of automated testing method and device
Technical field
The present invention relates to network communication technology field more particularly to a kind of automated testing methods and device.
Background technique
The automated test frame of the current network equipment by each network equipment of execution machine centralized control operation, i.e., by Execution machine serially executes all test scripts, and test command is successively handed down to DUT (Device Under Test is tested Try equipment).
However, in order to meet the needs of extensive automatic test, being devices under not with the expansion of automation size Disconnected to increase, the implementation that all test scripts serially execute on execution machine will increase a large amount of waiting time, such as hold For row machine when executing test script, the pending machines such as DUT needs issue test command;Execution machine to DUT issue test command it Afterwards, it needs that DUT is waited to return the result, greatly reduces 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 execution efficiency in the prior art Low problem.
According to a first aspect of the embodiments of the present invention, a kind of automated testing method is provided, applied in test macro Execution machine, the test macro include at least two target equipment under test DUT, are established between the execution machine and each target DUT There are control channel and data channel, the method includes:
Test command is sent to target DUT by control channel, so that target DUT executes local test script, and is hindered Fill in the control channel between target DUT and execution machine;
Each data channel is monitored;
Judge whether to receive the state lock notification that at least two target DUT are sent from data channel, the shape State lock notification is used to inform the execution of the corresponding target DUT pause test script of execution machine;
If so, unlock notice is sent to target DUT by corresponding data channel, so that target DUT continues to execute survey Training sheet;
Obtain the operation result for executing the test script completed.
According to a second aspect of the embodiments of the present invention, a kind of automated testing method is provided, applied in test macro Target is devices under DUT, and the test macro includes execution machine and at least two target DUT, the execution machine and Establishing between each target DUT has control channel and data channel, the method includes
When receiving the test command of execution machine transmission by control channel, local test script is executed, and block Itself control channel between execution machine;
When needing to suspend the execution of test script, state lock notification is sent to the execution machine by data channel, The state lock notification is used to inform the execution of the corresponding target DUT pause test script of execution machine;
When receiving the unlock notice that the execution machine is sent by data channel, test script is continued to execute;
When test script, which executes, to be completed, test script operation result is reported.
According to a third aspect of the embodiments of the present invention, a kind of automatic test device is provided, applied in test macro Execution machine, the test macro include at least two target equipment under test DUT, are established between the execution machine and each target DUT There are control channel and data channel, described device includes:
Transmission unit, for sending test command to target DUT by control channel, so that target DUT executes local Test script, and block the control channel between target DUT and execution machine;
Monitoring unit, for monitoring each data channel;
Judging unit, the status lock for judging whether to receive at least two target DUT transmission from data channel Fixed notice, the state lock notification are used to inform the execution of the corresponding target DUT pause test script of execution machine;
The transmission unit is judged as YES if being also used to the judging unit, by corresponding data channel to target DUT sends unlock notice, so that target DUT continues to execute test script;
Acquiring unit, for obtaining the operation result for executing the test script completed.
According to a fourth aspect of the embodiments of the present invention, a kind of automatic test device is provided, applied in test macro Target is devices under DUT, and the test macro includes execution machine and at least two target DUT, the execution machine and Establishing between each target DUT has control channel and data channel, and described device includes:
Receiving unit, for receiving the test command that execution machine is sent by control channel;
Execution unit, for when the receiving unit by control channel receive execution machine transmission test command when, Local test script is executed, and blocks itself control channel between execution machine;
Transmission unit, for being sent to the execution machine by data channel when needing to suspend the execution of test script State lock notification, the state lock notification are used to inform the execution of the corresponding target DUT pause test script of execution machine;
The execution unit is also used to receive the solution that the execution machine is sent by data channel when the receiving unit When lock notice, test script is continued to execute;
The transmission unit is also used to report test script operation result when test script executes completion.
Using the embodiment of the present invention, target DUT executes test script during executing test script, when needing to suspend When, state lock notification is sent to the machine of execution by data channel, to guarantee the accuracy of global operation result inspection, Jin Ershi Show distributed execution of the test script in equipment, improves the efficiency of network equipment automatic test.
Detailed description of the invention
Fig. 1 is a kind of network architecture schematic diagram of automatic test provided in an embodiment of the present invention;
Fig. 2 is a kind of flow diagram of automated testing method provided in an embodiment of the present invention;
Fig. 3 is the flow diagram of another automated testing method provided in an embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of automatic test device provided in an embodiment of the present invention;
Fig. 5 is the structural schematic diagram of another automatic test device provided in an embodiment of the present invention;
Fig. 6 is a kind of structural schematic diagram of automatic test device provided in an embodiment of the present invention.
Specific embodiment
Technical solution in embodiment in order to enable those skilled in the art to better understand the present invention, and make of the invention real The above objects, features, and advantages for applying example can be more obvious and easy to understand, with reference to the accompanying drawing to technical side in the embodiment of the present invention Case is described in further detail.
It referring to Figure 1, is a kind of network architecture schematic diagram of automatic test provided in an embodiment of the present invention, such as Fig. 1 institute Show, which may include execution machine and at least two target DUT.Wherein, each target DUT is used as and divides The Client (client), built-in TCL of cloth TCL (Tool Command Language, Tool Command Language) automation framework Interpreter can locally execute TCL script and TCL order;The Server program of TCL, control are given in operation on execution machine The operation of Client.Wherein, execution machine may include PC (Personal Computer, personal computer) or server etc..
In the embodiment of the present invention, executing can distinguish between machine and target DUT (i.e. TCL Server and TCL Client) Establish data channel and control channel;Execution machine can send TCL to target DUT by the control channel between target DUT Order so that target DUT executes local test script, and blocks the control channel between target DUT and execution machine;Execution machine Control command can also be sent to Client by control channel, control the operating status of Client.Wherein, data channel can be with It is FTP (File Transfer Protocol, File Transfer Protocol)/TFTP (Trivial File Transfer Protocol, Simple File Transfer Protocol) communication channel.
Based on the network architecture shown in FIG. 1, the embodiment of the invention provides a kind of automated testing method, which is surveyed Method for testing can be applied to distributed network equipment automatization test system, refer to Fig. 2, be provided in an embodiment of the present invention one The flow diagram of kind automated testing method, wherein this method can be applied to the execution machine in the network architecture shown in Fig. 1, As shown in Fig. 2, this method may comprise steps of:
Step 201 sends TCL order to target DUT by control channel, so that target DUT executes local test foot This, and block the control channel between target DUT and execution machine.
In the embodiment of the present invention, in order to reduce the waiting time during automatic testization, holding for automatic test is improved Partial test script (test script as being used for configuration distributing) can be issued on target DUT in advance and execute by line efficiency.
For example, the configuration that needs can be issued, is write as interface function as unit of function, and will be connect as unit of module Different test scripts is written in mouth function, and is stored in the storage medium of target DUT.
It should be noted that in embodiments of the present invention, it is specific for the test script that needs execute on execution machine It executes process and corresponding result check process may refer to the associated description in existing automatic test scheme, the present invention is real Applying example, details are not described herein.For example, QoS (Quality of Service, service quality) test script, need test equipment to DUT sends data traffic, and therefore, it is necessary to execute on execution machine.
In the embodiment of the present invention, TCL can be sent to target DUT by the control channel between target DUT by executing machine Order executes local test script to start target DUT.
After target DUT receives the TCL order of execution machine transmission, local test script can be executed, and block target Control channel between DUT and execution machine.
Step 202 monitors each data channel.
Step 203 judges whether that the state locking that above-mentioned at least two target DUT are sent is received from data channel leads to Know, which is used to inform the execution of the corresponding target DUT pause test script of execution machine.If so, going to step Rapid 204;Otherwise, step 202 is gone to.
In the embodiment of the present invention, it is contemplated that during distributed network equipment automatic test is realized, the operation to test script As a result inspection may include the inspection of local runtime result and global operation result inspection.Wherein, the inspection of local runtime result It looks into, is the inspection to configuration result or operating status on DUT local significance, for example whether issuing of configuring be correct, it is local Whether power supply, fan, temperature, port status are correct etc., and other equipment in the inspection and networking of local runtime result are not closed Sequence problem is not present in system.And the inspection of global operation result, refer to comprehensive inspection to entire group net operation result, for example, Two OSPF (Open Shortest Path First, the open type shortest paths being devices under between (such as DUT1 and DUT2) Preferentially) neighborhood is tested, and to check the full state of OSPF on DUT1, is then needed after the completion of DUT2 is configured, ability It is checked, otherwise result is exactly mistake, that is to say, that when a DUT does the inspection of global operation result, need really The configuration for recognizing other relevant devices (including DUT or executing machine) has met expection.Therefore, it is automated in distributed network equipment In test (test script is distributed executes) implementation, when inspection on a DUT global operation result, need It is synchronous an operating status to be carried out with relevant device in networking.
In order to achieve the above object, in embodiments of the present invention, if desired target DUT is carried out when executing test script Global operation result inspection, then target DUT can suspend the execution of test script, and send shape to the machine of execution by data channel State lock notification, the state lock notification are used to inform the execution of the corresponding target DUT pause test script of execution machine, that is, accuse Know that execution machine sends the execution of the target DUT pause test script of the state lock notification, waits other equipment.
For example, preset field can be arranged in the test script for being handed down to target DUT, which be can be set After the field for needing to carry out global operation result inspection, target DUT is during executing local test script, if executing To the preset field, then state lock notification can be sent to the machine of execution by data channel, to inform that execution machine itself suspends The execution of test script, to realize that the operating status between multiple target DUT is synchronous.
Wherein, multiple target DUT involved in global operation result inspection are required to send state to execution machine and lock to lead to Know, the state lock notification that multiple target DUT is sent includes that an active lock notice and at least one passive locking are logical Know;Same overall situation operation result checks that needing in corresponding state lock notification includes identical notice mark, notice mark Correspond to the state lock notification of same global operation result inspection for executing machine identification, and can be in active lock notice Carry the target DUT in need for sending passive lock notification mark.
Correspondingly, after execution machine sends test command to target DUT, each data channel can be monitored, with inspection It surveys and whether there is state lock notification.When execution machine receives the state lock notification of target DUT transmission from data channel, hold Row machine may further determine whether the state lock notification that above-mentioned at least two target DUT transmission is received from data channel, Whether the test equipment that i.e. judgement is related to global operation result inspection completes state synchronized.If so, determination needs to notify mesh Mark DUT unlocks state, continues to execute test script;Otherwise, continue to monitor data channel.
As an alternative embodiment, in embodiments of the present invention, monitoring each data channel, can wrap It includes:
When from data receiver to passive lock notification, then global lock number and the machine in the passive lock notification are recorded DUT number;
When receiving active lock notice from data channel, then records the overall situation in active lock notice and number, originally Machine DUT number and DUT list.
Correspondingly, judge whether to receive the state lock notification that at least two target DUT are sent from data channel, Specially:
It is numbered according to the DUT list and the global lock, judges whether that receiving at least two target DUT sends State lock notification.
In this embodiment, state lock notification can be divided into active lock notice and passive lock notification, execute machine It can determine that state lock notification is active lock notification or passive lock notification according to the lock type in state lock notification;Its In, active lock notice at least may include global lock number, lock type, the machine DUT number and DUT list;Passive locking is logical Know and at least may include global lock number and the machine DUT number etc..
Wherein, global lock number can be used for identifying a certain global operation result, in the implementation procedure of a test script In, state locking may be repeatedly carried out, the corresponding global lock number of state locking each time, such as the neighbours of OSPF are closed System is a global operation result;The machine DUT numbers the DUT equipment for identifying transmission state lock notification;DUT list can be with Machine mark (or identify for Server) is numbered or executed including DUT, for identifying involved in same global operation result it Its DUT equipment executes machine.
It optionally, can also include lock type in state lock notification, lock type may include active lock or passive lock, use In identification-state lock notification be active lock notification or passive lock notification.
In this embodiment, when execution machine receives state lock notification, the machine of execution can be locked according to the state Lock type in notice determines that the state lock notification is active lock notification or passive lock notification.
When execution machine receives passive lock notification, global lock number and the sheet in the passive lock notification can recorde Machine DUT number;When execution machine receive active lock notice when, can recorde the active lock notice in global lock number, The machine DUT number and DUT list.
Correspondingly, executing machine can be numbered and DUT list with the global lock of self record, judge whether to receive it is above-mentioned extremely The lock notification that few two target DUT are sent.
In the embodiment of the present invention, sent if the machine judgement of execution does not receive above-mentioned at least two target DUT from data channel State lock notification (as do not received active lock notice, not receiving partly or entirely passive lock notification or actively lock Fixed notice and passive lock notification are to receive), then executing machine can continue to monitor data channel.
As an example it is assumed that active lock notice in successively include global lock number, lock type, the machine DUT number and DUT list;It successively include global lock number, lock type, the machine DUT number in passive lock notification;Wherein, between different field By "!" it is separator, actively locking corresponding lock type is 0, and passively locking corresponding lock type is 1, passive locking DUT list Member is separated with " ", then includes " 1 in the content of announcement of the state lock notification received when execution machine!0!1!When 3.4 ", hold Row machine can be confirmed that the state lock notification is active lock notification, and global lock number is " 1 ", sends setting for active lock notice It is standby to need to send passive lock notification for DUT1, DUT3 and DUT4, in turn, execution machine can decide whether to have received DUT3 and (content of announcement is respectively " 1 to the passive lock notification that DUT4 is sent!1!3!3 " and " 1!1!4!4 "), and when having received, Carry out the processing that unlocks.
It should be noted that in embodiments of the present invention, if after the machine of execution receives active lock notice, not default When receiving the passive lock notification that certain target DUT is sent in DUT list in the time (the first preset time), executing machine can be to Target DUT sends passive lock-request message, so that after target DUT receives the passive lock-request message, pause test The execution of script, and reply passive lock notification.
Step 204 sends unlock notice to target DUT by corresponding data channel, so that target DUT continues to execute survey Training sheet.
In the embodiment of the present invention, receive what above-mentioned at least two target DUT were sent when execution machine is determined from data channel When state lock notification, unlock notice can be sent to target DUT by corresponding data channel by executing machine, so as to receive this It is to pass through execution when unlocking the target DUT notified and continue to execute test script, such as sending unlock notice to a target DUT The data channel that machine and target DUT are established is sent.
As an alternative embodiment, being sent by corresponding data channel to target DUT in above-mentioned steps 203 Unlock notifies, may include:
According to active lock notify in the machine DUT number, it is logical that unlock to target DUT is sent by corresponding data channel Know, when so that target DUT receiving unlock notice, continues to execute test script;
After receiving the unlock acknowledgement notification of DUT transmission, according to the DUT list in the unlock acknowledgement notification, pass through Corresponding data channel sends unlock notice to target DUT, when so that target DUT receiving unlock notice, continues to execute Test.
In this embodiment, when execution machine needs to release the status lock timing of target DUT, the machine of execution can be according to reception To active lock notice in the machine DUT number (i.e. transmission active lock notice DUT number), pass through corresponding data Channel unlocks to target DUT and notifies;It wherein, may include global lock number, notification type mark and DUT in unlock notice List.
After DUT receives unlock notice, test script can be continued to execute, and send unlock acknowledgement notification to the machine of execution; Wherein, which may include global lock number, DUT list and notification type mark.
After execution machine receives the unlock acknowledgement notification of DUT transmission, according to the DUT list in the unlock acknowledgement notification, lead to It crosses corresponding data channel and sends unlock notice to target DUT, so that receiving target DUT continues to execute test script.
Preferably, in embodiments of the present invention, active lock notice, passive lock notification, unlock notice and unlock confirmation The form of notice is identical, that is, is " global lock number!(0 is active lock notification to notification type mark, and 1 is logical for passive locking Know, 2 be unlock notice, and 3 be unlock acknowledgement notification)!The machine number!Passive lock DUT list or passive lock DUT number ".
For example, still by taking examples cited in above-mentioned steps 203 as an example, execution machine receives the active lock of DUT1 transmission (content of announcement is " 1 to notice!0!1!3.4 " (first " 1 " be global lock number;" 0 " is notification type mark, shows the notice For active lock notification;It is identified for the machine DUT for second " 1 ", shows that active lock notice is sent by DUT1;" 3.4 " are DUT List, i.e. DUT3 and DUT4 need to send passive lock notification, similarly hereinafter)) and the passive lock notification that sends of DUT3 and DUT4 (content of announcement is respectively " 1!1!3!3 " (first " 1 " be global lock number;Second " 1 " is notification type mark, shows this Notice is passive lock notification;It is identified for the machine DUT for first " 3 ", shows that the passive lock notification is sent by DUT3;Second " 3 " show that DUT3 needs to send passive lock notification, similarly hereinafter) and " 1!1!4!4 ") after, executing machine can first be sent to DUT1 Unlock notice, content of announcement can be " 1!2!0!1 " (assuming that the notification type of unlock notice is identified as 2, executes the mark of machine For 0) (first " 1 " is global lock number;" 2 " are notification type mark, show the notice for unlock notice;" 0 " is execution machine Mark shows that unlock notice is sent by execution machine;Second " 1 " is unlock DUT mark, i.e. notice DUT1 unlocks, under Together), after DUT1 receives unlock notice, test script is continued to execute, and send unlock acknowledgement notification, notice to the machine of execution Content can be " 1!3!1!(first " 1 " is global lock volume to 3.4 " (assuming that the notification type of unlock acknowledgement notification is identified as 3) Number;" 3 " are notification type mark, show the notice for unlock acknowledgement notification;" 1 " is the machine DUT mark, shows that the unlock determines Notice is sent by DUT1;" 3,4 " be DUT list, i.e. DUT3 and DUT4 are passive locking DUT, similarly hereinafter);Execution machine receives After the unlock acknowledgement notification that DUT1 is sent, can sending passive locking unlock notice to DUT3 and DUT4 respectively, (content of announcement can To be respectively " 1!2!0!3 " and " 1!2!0!4 "), so that DUT3 and DUT4 continue to execute test script.Wherein, DUT3 and DUT4 After receiving passive locking unlock notice, can sending unlock acknowledgement notification to DUT3 and DUT4 respectively, (content of announcement can To be respectively " 1!2!3!3 " and " 1!2!4!4").
As an alternative embodiment, in embodiments of the present invention, unlock notice (including active lock unlock notice Or passive locking unlock notice) it can be the file that filename is content of announcement;
Step 205 obtains the operation result for executing the test script completed.
It, can be by the operation result of test script after target DUT has executed local test script in the embodiment of the present invention It is reported to execution machine;Alternatively, target DUT can send test script to execution machine and hold after having executed local test script Row completion notice;After the test script that execution machine receives target DUT transmission executes completion notice, available target DUT Test script operation result.
Based on the network architecture shown in FIG. 1, the embodiment of the invention provides another automated testing methods, refer to figure 3, for the flow diagram of another automated testing method provided in an embodiment of the present invention, wherein this method can be applied to Target DUT, as shown in figure 3, this method may comprise steps of:
Step 301, when by control channel receive execution machine transmission test command when, execute local test foot This, and block itself control channel between execution machine.
In the embodiment of the present invention, TCL can be sent to target DUT by the control channel between target DUT by executing machine Order executes local test script to start target DUT;When target DUT receives the TCL order, local survey can star The execution of training sheet, and block itself control channel between execution machine.It should be noted that target DUT described herein Only refer to general DUT, establishing between the DUT and execution machine has a data channel and control channel, target DUT this title not structure The limitation of pairs of DUT.
Step 302, when needing to suspend the execution of test script, by data channel to the execution machine send status lock Fixed notice, the state lock notification are used to inform the execution of the corresponding target DUT pause test script of execution machine.
In the embodiment of the present invention, if desired target DUT carries out global operation result inspection, then when executing test script Target DUT can suspend the execution of test script, and send state lock notification, the status lock to the machine of execution by data channel Fixed notice is for informing the execution of the corresponding target DUT pause test script of execution machine.
Wherein, multiple target DUT involved in global operation result inspection are required to send state to execution machine and lock to lead to Know, the state lock notification that multiple target DUT is sent may include an active lock notice and at least one passive lock Fixed notice, same overall situation operation result check that needing in corresponding multiple state lock notifications includes identical notice mark, should Notice mark corresponds to the state lock notification of same global operation result inspection for executing machine identification, and active lock notifies In can also carry the equipment in need for sending passive lock notification mark.
Specifically, the accuracy in order to guarantee global operation result inspection, can be checked in global operation result involved by Test script in preset field is set, when target DUT is during executing local test script, go to the predetermined word Duan Shi can send active lock notice or passive lock notification to the machine of execution according to the preset field
Wherein, in test script, actively lock or passive lock can be recycled by while is realized, when related DUT is gone to After while circulation, it can be unlocked and be notified with cycle detection, detect that unlock notice then exits circulation, realization unlocks;It is no Then, lock state is kept.
Wherein, execution machine receive the specific implementation after active lock notice or passive lock notification may refer to it is above-mentioned Associated description in step 203~step 204, details are not described herein for the embodiment of the present invention.
Step 303, when the unlock for receiving execution machine and being sent by data channel notifies, continue to execute test script.
In the embodiment of the present invention, when target DUT receives the unlock notice of execution machine transmission, can unlock state, Continue to execute test script.
As an alternative embodiment, when unlock notice be active lock unlock notice (when target DUT to execute machine When the state lock notification of transmission is active lock notification, the unlock notice that target DUT is received is properly termed as active lock Unlock notice) when, it receives after the unlock that execution machine is sent by data channel notifies, can also include:
To execute machine send unlock acknowledgement notification so that execute machine according to unlock acknowledgement notification in DUT list, by right The data channel answered sends passive lock unlock notice to target DUT.
In this embodiment, when unlock that target DUT is received notice is active lock unlock notice, i.e. the target When DUT is sends the target DUT that active lock notifies to the machine of execution, target DUT is notifying the state that unlocks according to unlock, And after continuing to execute test script, it is also necessary to send unlock acknowledgement notification to the machine of execution, can wrap in the unlock acknowledgement notification Include DUT list;, can be according to the DUT list after execution machine receives the unlock acknowledgement notification, it is passive to send to target DUT (when the state lock notification that target DUT is sent to the machine of execution is passive lock notification, target DUT connects locking unlock notice The unlock notice received is properly termed as passively locking unlock notice), to indicate that corresponding target DUT unlocks, continue to execute Test script.
Step 304, when test script execute complete when, report test script operation result.
It, can be by the operation result of test script after target DUT has executed local test script in the embodiment of the present invention It is reported to execution machine;Alternatively, target DUT can send test script to execution machine and hold after having executed local test script Row completion notice;After the test script that execution machine receives target DUT transmission executes completion notice, available target DUT Test script operation result.
It should be noted that in embodiments of the present invention, after DUT sends active lock notice to the machine of execution, if pre- If not receiving the unlock notice of execution machine transmission in the time (the second preset time), then can be sent actively to the machine of execution again Lock notification, wherein the notice format of the active lock notice of retransmission can be with the active lock notice sent before Format is identical;The processing strategie that execution machine receives active lock notice may refer to the associated description in above-described embodiment.
In addition, after DUT sends active lock notice or passive lock notification to the machine of execution, if in preset time (third Preset time, third preset time be greater than the second preset time) in do not receive unlock notice, then DUT can directly release lock Determine state, continues to execute test script.
For the technical solution for making those skilled in the art more fully understand that the embodiment of the present invention is supplied to, below to this hair Notice communication mechanism in bright embodiment is illustrated.
1, all start ftp server on target DUT and Server.
2, a kind of Tclsh (script interpreter) process of target DUT creates empty file on the disk of DUT, and filename is For the content of the Tclsh process notice of being sent, content of announcement field with "!" number notice notified for decollator, active lock Type identification indicates that the notification type mark of passive lock notification indicates that the notification type for unlocking notice identifies 2 tables with 1 with 0 Show, the notification type mark for unlocking acknowledgement notification is indicated with 3, the passive member for locking list " " number segmentation.
Such as the tclsh process of DUT1, to create a number is 1, active lock type, passive to lock DUT member Number be respectively 3,4 active lock notice, then should be created on disk one it is entitled:1!0!1!3.4 empty file.
3, circular document is sent to Server by ftp by the Tclsh process of DUT.
4, the notice for executing machine monitoring ftp server receives catalogue, and discovery has new circular document to be written, and reads filename After (obtaining content of announcement), circular document is copied under history notice catalogue, it is logical then to delete this in the case where notice receives catalogue Know file.
5, classification storage is carried out to notice after execution machine is notified, and according to the type of locking, does different processing:If What is received is active lock notice, then according to the global lock number and DUT list in notice, searches passive lock notification, such as Fruit can be found, then send unlock notice to notice source;If what is received is passive lock notification, is numbered and searched according to global lock It is notified with the presence or absence of corresponding active lock, waits corresponding active lock notice if it does not exist, then not being further processed, If finding corresponding active lock notice, according to active lock notify in DUT list, whether judge passive lock notification It all receives, if not provided, not also being further processed, waits next passive lock notification, otherwise send solution to notice source Lock notice.
6, unlock notice format is:Global lock number, lockType execute machine mark (0), unlock DUT number, decollator Still it is!, such as 1!0!1!3.4 this active lock notice, unlock notice are 1!2!0!1, directory creating is sent in notice File is 1!2!0!1 empty file is transferred to file by ftp the DUT1 equipment for sending active lock notice, then logical Know and deletes circular document after the circular document sent under catalogue copies notification history catalogue to.
7, the Tclsh process of DUT1 equipment reads unlock notice, exits global lock, continues to execute test script, concurrently Send unlock acknowledgement notification:1!3!1!3.4.
8, after Server receives unlock acknowledgement notification, unlock is sent to DUT3 and notifies 1!2!0!3, it is logical that unlock is sent to DUT3 Know 1!2!0!4.
9, after DUT3, DUT4 receive unlock notice, global lock is respectively exited, test script is continued to execute.
Can be seen that in embodiments of the present invention by the above process, target DUT during executing test script, When needing to suspend execution test script, state lock notification is sent to the machine of execution by data channel, to guarantee global run As a result the accuracy checked, and then distributed execution of the test script in equipment is realized, improve network equipment automation The efficiency of test.
Fig. 4 is referred to, provides a kind of structural schematic diagram of automatic test device for the embodiment of the present invention, wherein the dress The execution machine that can be applied in the network architecture shown in Fig. 1 is set, as shown in figure 4, the apparatus may include:
Transmission unit 410, for sending test command to target DUT by control channel, so that target DUT executes local Test script, and block the control channel between target DUT and execution machine;
Monitoring unit 420, for monitoring each data channel;
Judging unit 430, the state for judging whether to receive at least two target DUT transmission from data channel Lock notification, the state lock notification are used to inform the execution of the corresponding target DUT pause test script of execution machine;
The transmission unit 410 is judged as YES if being also used to the judging unit, by corresponding data channel to mesh It marks DUT and sends unlock notice, so that target DUT continues to execute test script;
Acquiring unit 440, for obtaining the operation result for executing the test script completed.
In an alternative embodiment, the monitoring unit 420 can be specifically used for working as from data channel receiving passive locking When notice, then the global lock number and the machine DUT number in the passive lock notification are recorded;When receiving master from data channel Dynamic lock notification, then record that overall situation in the active lock notice is numbered, the machine DUT is numbered and DUT list;
The judging unit 430 can be specifically used for being numbered according to the DUT list and the global lock, judge whether Receive the state lock notification that at least two target DUT are sent.
Please refer to fig. 5, Fig. 5 is the structural representation of another automatic test device provided in an embodiment of the present invention Figure, on the basis of the embodiment shown in fig. 4, in automatic test device shown in fig. 5, the transmission unit 410 may include:
First transmission sub-unit 411 passes through corresponding data for the machine DUT number in notifying according to active lock Channel sends unlock notice to target DUT, when so that target DUT receiving unlock notice, continues to execute test script;
Receiving subelement 412, for receiving the unlock acknowledgement notification of target DUT transmission;
Second transmission sub-unit 413, the unlock confirmation for receiving target DUT transmission when the receiving subelement are logical When knowing, according to the DUT list in the unlock acknowledgement notification, unlock notice is sent to target DUT by corresponding data channel, with When target DUT being made to receive unlock notice, test script is continued to execute.
In an alternative embodiment, the data channel is the channel File Transfer Protocol FTP or Simple File Transfer Protocol The channel TFTP, the state lock notification and unlock notice is using filenames as the file of content of announcement.
Fig. 6 is referred to, provides a kind of structural schematic diagram of automatic test device for the embodiment of the present invention, wherein the dress It sets and can be applied to target DUT, as shown in fig. 6, the apparatus may include:
Receiving unit 610, for receiving the test command that execution machine is sent by control channel;
Execution unit 620, for being ordered when the receiving unit 610 by the test that control channel receives the transmission of execution machine When enabling, local test script is executed, and blocks itself control channel between execution machine;
Transmission unit 630, for being sent out to the execution machine by data channel when needing to suspend the execution of test script State lock notification is sent, the state lock notification is used to inform holding for the corresponding target DUT pause test script of execution machine Row;
The execution unit 620 is also used to send out when the receiving unit 610 receives the execution machine by data channel When the unlock notice sent, test script is continued to execute;
The transmission unit 630 is also used to report test script operation result when test script executes completion.
In an alternative embodiment, the state lock notification is that passive lock notification or active lock notify, wherein described It is numbered in passive lock notification comprising global lock and the machine DUT is numbered, numbered in the active lock notice comprising global lock, this Machine DUT number and DUT list.
In an alternative embodiment, the transmission unit 630, can be also used for when the receiving unit 610 receive it is described When the active lock unlock notice that execution machine is sent by data channel, unlock acknowledgement notification is sent to the execution machine, so that The execution machine sends passive lock to target DUT according to DUT list in the unlock acknowledgement notification, by corresponding data channel Unlock notice.
In an alternative embodiment, the data channel is the channel File Transfer Protocol FTP or Simple File Transfer Protocol The channel TFTP, the state lock notification, unlock notice is using filenames as the file of content of announcement.
The function of each unit and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus Realization process, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual The purpose for needing to select some or all of the modules therein to realize the present invention program.Those of ordinary skill in the art are not paying Out in the case where creative work, it can understand and implement.
As seen from the above-described embodiment, target DUT executes test script when needing to suspend during executing test script When, state lock notification is sent to the machine of execution by data channel, to guarantee the accuracy of global operation result inspection, Jin Ershi Show distributed execution of the test script in equipment, improves the efficiency of network equipment automatic test.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present invention Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.

Claims (14)

1. a kind of automated testing method, applied to the execution machine in test macro, the test macro includes at least two mesh Mark is devices under DUT, and establishing between the execution machine and each target DUT has control channel and data channel, which is characterized in that The method includes:
Test command is sent to target DUT by control channel, so that target DUT executes local test script, and blocks mesh Mark the control channel between DUT and execution machine;
Each data channel is monitored;
Judge whether to receive the state lock notification that at least two target DUT are sent from data channel, the status lock Fixed notice is for informing the execution of the corresponding target DUT pause test script of execution machine;
If so, unlock notice is sent to target DUT by corresponding data channel, so that target DUT continues to execute test foot This;
Obtain the operation result for executing the test script completed.
2. the method according to claim 1, wherein described monitor each data channel, including:
When receiving passive lock notification from data channel, then global lock number and the sheet in the passive lock notification are recorded Machine DUT number;
When receiving active lock notice from data channel, then global lock number, the machine in the active lock notice are recorded DUT number and DUT list;
It is described to judge whether to receive the state lock notification that at least two target DUT are sent from data channel, specially:
It is numbered according to the DUT list and the global lock, judges whether to receive the shape that at least two target DUT are sent State lock notification.
3. according to the method described in claim 2, it is characterized in that, described sent by corresponding data channel to target DUT Unlock notice, including:
According to active lock notify in the machine DUT number, by corresponding data channel to target DUT send unlock notice, When so that target DUT receiving unlock notice, test script is continued to execute;
After receiving the unlock acknowledgement notification of target DUT transmission, according to the DUT list in the unlock acknowledgement notification, pass through Corresponding data channel sends unlock notice to target DUT, when so that target DUT receiving unlock notice, continues to execute Test script.
4. the method according to claim 1, wherein the data channel be the channel File Transfer Protocol FTP or The channel Simple File Transfer Protocol TFTP, the state lock notification and unlock notice is using filenames as content of announcement File.
5. a kind of automated testing method is devices under DUT applied to the target in test macro, the test macro includes Execution machine and at least two target DUT, establishing between the execution machine and each target DUT has control channel and data logical Road, which is characterized in that the method includes:
When receiving the test command of execution machine transmission by control channel, local test script is executed, and block itself With the control channel between execution machine;
When needing to suspend the execution of test script, state lock notification is sent to the execution machine by data channel, it is described State lock notification is used to inform the execution of the corresponding target DUT pause test script of execution machine;
When receiving the unlock notice that the execution machine is sent by data channel, test script is continued to execute;
When test script, which executes, to be completed, test script operation result is reported.
6. according to the method described in claim 5, it is characterized in that, the state lock notification is passive lock notification or active Lock notification, wherein include global lock number and the machine DUT number, the active lock notice in the passive lock notification In comprising global lock number, the machine DUT number and DUT list.
7. according to the method described in claim 5, it is characterized in that, when the unlock notice be active lock unlock notice when, It is described receive the unlock notice that the execution machine is sent by data channel after, further include:
Unlock acknowledgement notification is sent to the execution machine, so that the execution machine is arranged according to the DUT in the unlock acknowledgement notification Table sends unlock notice to target DUT by corresponding data channel.
8. a kind of automatic test device, applied to the execution machine in test macro, the test macro includes at least two mesh Mark is devices under DUT, and establishing between target DUT described in the execution machine and Ge Tai has control channel and data channel, special Sign is that described device includes:
Transmission unit, for sending test command to target DUT by control channel, so that target DUT executes local test Script, and block the control channel between target DUT and execution machine;
Monitoring unit, for monitoring each data channel;
Judging unit, for judging whether that receiving the state locking that at least two target DUT are sent from data channel leads to Know, the state lock notification is used to inform the execution of the corresponding target DUT pause test script of execution machine;
The transmission unit is judged as YES if being also used to the judging unit, is sent out by corresponding data channel to target DUT Unlock is sent to notify, so that target DUT continues to execute test script;
Acquiring unit, for obtaining the operation result for executing the test script completed.
9. device according to claim 8, which is characterized in that
The monitoring unit, specifically for when receiving passive lock notification from data channel, then recording the passive locking Global lock number and the machine DUT number in notice;When receiving active lock notice from data channel, then the active is recorded The overall situation in lock notification is numbered, the machine DUT is numbered and DUT list;
The judging unit is specifically used for being numbered according to the DUT list and the global lock, judge whether to receive it is described extremely The state lock notification that few two target DUT are sent.
10. device according to claim 9, which is characterized in that the transmission unit includes:
First transmission sub-unit, for the machine DUT number in being notified according to active lock, by corresponding data channel to mesh It marks DUT and sends unlock notice, when so that target DUT receiving unlock notice, continue to execute test script;
Receiving subelement, for receiving the unlock acknowledgement notification of target DUT transmission;
Second transmission sub-unit, when for receiving the unlock acknowledgement notification of target DUT transmission when the receiving subelement, root According to the DUT list in the unlock acknowledgement notification, unlock notice is sent to target DUT by corresponding data channel, so that the mesh When mark DUT receives unlock notice, test script is continued to execute.
11. device according to claim 8, which is characterized in that the data channel be the channel File Transfer Protocol FTP or The channel Simple File Transfer Protocol TFTP, the state lock notification and unlock notice is using filenames as content of announcement File.
12. a kind of automatic test device is devices under DUT, the test macro packet applied to the target in test macro Execution machine and at least two target DUT are included, establishing between the execution machine and each target DUT has control channel and data Channel, which is characterized in that described device includes:
Receiving unit, for receiving the test command that execution machine is sent by control channel;
Execution unit, for executing when the receiving unit receives the test command of execution machine transmission by control channel Local test script, and block itself control channel between execution machine;
Transmission unit, for sending state to the execution machine by data channel when needing to suspend the execution of test script Lock notification, the state lock notification are used to inform the execution of the corresponding target DUT pause test script of execution machine;
The execution unit is also used to lead to when the receiving unit receives the execution machine by the unlock that data channel is sent When knowing, test script is continued to execute;
The transmission unit is also used to report test script operation result when test script executes completion.
13. device according to claim 12, which is characterized in that the state lock notification is passive lock notification or master Dynamic lock notification, wherein comprising global lock number and the machine DUT number in the passive lock notification, the active lock is logical Include global lock number, the machine DUT number and DUT list in knowing.
14. device according to claim 12, which is characterized in that
The transmission unit is also used to lock when the receiving unit receives the execution machine by the active that data channel is sent When fixed unlock notice, unlock acknowledgement notification is sent to the execution machine, so that the execution machine is according to the unlock acknowledgement notification In DUT list, passive lock unlock notice is sent to target DUT by corresponding data channel.
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 CN105893252A (en) 2016-08-24
CN105893252B true 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)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106789260B (en) * 2016-12-26 2020-11-20 中国银联股份有限公司 System and method for high availability drilling of network devices
CN109151021B (en) * 2018-08-21 2021-05-25 郑州云海信息技术有限公司 Distributed storage system file lock characteristic testing method and device
CN110943886B (en) * 2019-11-29 2021-11-02 新华三技术有限公司 Performance data transmission method and device
CN111737145B (en) * 2020-07-21 2020-12-22 北京志翔科技股份有限公司 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 (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019928A (en) * 2011-09-27 2013-04-03 北京新媒传信科技有限公司 Automatic testing method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0309056D0 (en) * 2003-04-22 2003-05-28 Transitive Technologies Ltd Block translation optimizations for program code conversion

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019928A (en) * 2011-09-27 2013-04-03 北京新媒传信科技有限公司 Automatic testing method and system

Also Published As

Publication number Publication date
CN105893252A (en) 2016-08-24

Similar Documents

Publication Publication Date Title
CN105893252B (en) A kind of automated testing method and device
CN110311831B (en) Container cloud-based system resource monitoring method and related equipment
CN104978261B (en) The test method of application program, apparatus and system
EP3382939A1 (en) Troubleshooting method, apparatus, and system based on network function virtualization
CN102724356B (en) The information synchronization method and device of access device
CN104239476A (en) Method, device and system for synchronizing databases
CN107659434A (en) A kind of automatic test approach of Devices to test, apparatus and system
CN103138988B (en) Positioning treatment method and positioning treatment device of network faults
CN107943572B (en) Data migration method, device, computer equipment and storage medium
CN111800354A (en) Message processing method and device, message processing equipment and storage medium
CN107870948A (en) Method for scheduling task and device
CN109428740B (en) Method and device for recovering equipment failure
CN101539877A (en) Embedded device testing system and testing method thereof
CN103259688A (en) Failure diagnosis method and device of distributed storage system
CN105897507A (en) Node equipment state detection method and node equipment state detection device
CN110399171A (en) A kind of hard disk management method, system and associated component
CN113835844A (en) Management method and device of container cluster and cloud computing platform
CN109299116B (en) Data synchronization method, device, equipment and readable storage medium
CN105391601A (en) Network management equipment performance testing method and system
CN104683486A (en) Method and device for processing synchronous messages in distributed system and distributed system
CN102664755A (en) Control channel fault determining method and device
CN104182348A (en) Software test method and device
CN106612213B (en) Equipment testing method and device
CN109951518A (en) A kind of off-line data synchronous method and device
CN102158374B (en) Bandwidth speed limiting testing method and testing device

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
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.

GR01 Patent grant
GR01 Patent grant