WO2018006702A1 - Abnormality processing method, apparatus and system in automation test - Google Patents

Abnormality processing method, apparatus and system in automation test Download PDF

Info

Publication number
WO2018006702A1
WO2018006702A1 PCT/CN2017/088937 CN2017088937W WO2018006702A1 WO 2018006702 A1 WO2018006702 A1 WO 2018006702A1 CN 2017088937 W CN2017088937 W CN 2017088937W WO 2018006702 A1 WO2018006702 A1 WO 2018006702A1
Authority
WO
WIPO (PCT)
Prior art keywords
device under
under test
test
configuration command
original state
Prior art date
Application number
PCT/CN2017/088937
Other languages
French (fr)
Chinese (zh)
Inventor
郇昌波
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2018006702A1 publication Critical patent/WO2018006702A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Definitions

  • the present disclosure relates to the field of automated testing, for example, to an anomaly processing method, apparatus, and system in an automated test.
  • Automated testing has gradually penetrated into many aspects of software testing and has irreplaceable advantages. Automated testing uses simple scripts to achieve a large number of repetitive operations, which can reduce test time to a certain extent, save test manpower, and test results are accurate. Freeing test human resources through automated testing enables testers to focus on manual testing, improve test efficiency, shorten product development cycles, and increase R&D efficiency.
  • TCP Transmission Control Protocol
  • a method, device and system for exception processing in an automated test which avoids an abnormal interruption of a TCP connection between an automated test system and a device under test in the related art, causes the running script to fail, and may even affect subsequent automation Test the phenomenon.
  • An exception handling method in automated testing including:
  • the device under test After the device is reconnected, the device under test is restored to the original state, and the configuration command to be executed is sent to the device under test.
  • the determining, according to the abnormal interruption condition, that the device under test returns to a preset original The configuration commands that need to be executed by the device under test after the status include:
  • Determining, by the device under test, the original state that was restored to the last time before the abnormal interrupt occurs, and determining that the configuration command that the device under test needs to execute after the device is restored to the original state is the configuration command.
  • the determining, according to the abnormal interruption, that the device under test needs to be executed after the device under test returns to a preset original state includes:
  • the method includes:
  • the method includes:
  • a configuration command sent to the device under test according to the test script is recorded.
  • An anomaly processing device for automated testing comprising:
  • Determining a module in the process of performing an automatic test on a device under test according to a test script, if an abnormal interruption occurs in a connection with the device under test, determining that the device under test is restored according to the abnormal interruption a configuration command that the device under test needs to execute after the preset original state;
  • control module After the control module is configured to reconnect with the device under test, the device is controlled to be restored to the original state, and the configuration command to be executed is sent to the device under test.
  • the determining module includes:
  • a first determining unit configured to determine that the device under test is last before an abnormal interruption occurs The original state is restored to the next time, and the configuration command that the device under test needs to execute after the device is restored to the original state is determined.
  • the determining module includes:
  • the first determining unit is configured to determine, according to the configuration command that the delivery fails, a configuration command that the device under test needs to perform after the device under test returns to the original state.
  • the device further includes:
  • the recording module is configured to record a configuration command sent to the device under test according to the test script during an automated test of a device under test according to a test script.
  • An automated test system comprising: an exception handling device in any of the above automated tests.
  • a computer readable storage medium storing computer executable instructions arranged to perform the above method.
  • An automated test system that includes:
  • At least one processor At least one processor
  • the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the method described above.
  • the device under test in the process of automatically testing a device under test according to a test script, if the connection with the device under test is abnormally interrupted, the device under test is determined according to the abnormal interruption. After the device is restored to the original state, the device to be tested needs to be executed. After the device is reconnected, the device under test is restored to the original state, and the configuration command to be executed is sent to the device under test. After reconnecting with the device under test, the control device is restored to the preset original state, and the configuration command after the determined original state is executed, the interrupted configuration command can be quickly restored, so that the subsequent automated test can be smoothly performed.
  • 1 is a flow chart of a method for exception handling in an automated test in an embodiment
  • FIG. 2 is a schematic structural diagram of an apparatus for abnormal processing in an automated test in an embodiment
  • FIG. 3 is a schematic diagram showing the hardware structure of an automated test system in an embodiment.
  • the system fails to send a configuration command to the device when the connection between the system (automated test system) and the device (the device under test) is abnormally interrupted.
  • the configuration command that is not sent to the device fails.
  • Configuration command After the system reconnects to the abnormally interrupted device, if the device continues to execute the failed configuration command, the configuration mode of the current test device may not match the configuration command delivered by the system. The configuration command fails. The subsequent automatic test fails. . Therefore, restoring the configuration mode of the currently tested device can cause the device to continue the automated test after an abnormal interruption.
  • the device after the system is reconnected with the device by default, the device can be restored to the original state, and the configuration command after the original state is executed, so that the device continues to perform automatic testing to ensure automation. Test the continuity of the device configuration.
  • the abnormal processing method of the automated test in this embodiment includes the following steps.
  • step 101 in the process of testing a device under test according to a test script, if an abnormal interruption occurs in the connection with the device under test, it is determined that the device under test is restored to the preset according to the abnormal interruption.
  • the original state may be the state of the device (the device under test) customized in advance through the automated test platform.
  • the original state may be set as the initial state after the device is reconnected with the system or the state in which the device enters the basic configuration mode after reconnecting with the system. .
  • the automated testing process may include multiple sets of different configuration commands, and the tested device may restore the original state after executing a complete set of configuration commands.
  • the device under test After the device is reconnected with the device under test, the device under test is restored to the original state, and the configuration command to be executed is sent to the device under test.
  • the device can execute the configuration command issued by the system after the original state, and the device executes the configuration command that fails, and can continue to perform the automatic test to ensure the continuity of the automated test.
  • the automated test platform can have the ability to restore the original state, which can easily control the tested device to return to the original state.
  • the method for automatically testing the abnormality protection of the embodiment can restore the preset original state by the control device after reconnecting with the device, and execute the configuration command after the original state, and execute the interrupt configuration command, so that the subsequent automation
  • the test can be carried out smoothly, avoiding the failure of the test script, ensuring the continuity of the automated test and improving the fault tolerance of the system.
  • After the system is reconnected with the device it can be re-tested without the initial configuration command in the automated test, saving the time for restoring the configuration, improving the efficiency of the automated test, and solving the related technology between the automated test system and the device under test.
  • the script that is being executed fails to run, and may even affect the subsequent automated test execution.
  • the foregoing step 101 includes:
  • Determining the original state that the device under test is restored to before the abnormal interruption, and determining that the configuration command that the device under test needs to execute after the last restoration to the original state is the configuration command.
  • the device can be reconnected with the device, and the device can execute a set of configuration commands before the abnormal interrupt occurs, and the interrupted service is resumed. And relative to the process of reconfiguring from the very beginning of automated testing, It saves time in restoring configuration and improves the efficiency of automated testing.
  • step 101 above includes:
  • the system fails to send the configuration command to the device.
  • the configuration command is the configuration command that fails to be delivered.
  • the system sends a configuration command to abort.
  • the configuration command that fails to be sent can determine the original state that the device is restored to before the abnormal interrupt occurs. After the device is restored to the original state, the configuration command to be executed is determined to be reconnected with the device under test. The configuration commands that the device under test needs to execute.
  • the method further includes:
  • the system can monitor the connection between the automated test system and the device under test in real time, and perform exception handling in case of abnormal interruption. Obtain the configuration command that fails to be sent in the test script.
  • the system can accurately determine the configuration commands that need to be executed after the device under test returns to the original state to determine the configuration commands to be executed by the device after the interrupt occurs to ensure the continuity of the automated test.
  • connection with the device under test is abnormally interrupted
  • the device under test that has an abnormal interruption can also be obtained, and the device under test can be accurately found and the connection with the device under test can be restored.
  • the method further includes:
  • a configuration command sent to the device under test according to the test script is recorded.
  • the data is supported by the configuration command sent to the device by the test script to obtain the configuration command that fails to be delivered and the configuration command that needs to be executed after the device is restored to the original state.
  • the automation test is guaranteed to proceed smoothly.
  • the preset original state is the global configuration (Config) state of the device, which may be a state in which the system executes a configuration terminal (confgure terminal) command after connecting the device.
  • Config global configuration
  • a series of configurations can be performed on the device under test, including interface configuration, device loopback address loopback configuration, and intermediate system to intermediate system (ISIS) protocol configuration.
  • ISIS intermediate system to intermediate system
  • Redistribute isis-1-2) Redistribute ISIS routes.
  • connection to the device under test is abnormally interrupted when the ISIS protocol is configured.
  • the system cannot send a configuration command to the device under test and the configuration command is aborted.
  • the configuration command that the system obtains fails to be redistribute isis-1-2, and obtains the device under test that has an abnormal interrupt.
  • the original state of the last recovery is retrieved before the abnormal interrupt is retrieved in the storage database, and the configuration commands to be executed after the original state are sequentially acquired.
  • the retrieved configuration command to be restored to the original state is to enter the Border Gateway Protocol (BGP) configuration mode, enter the IPv6 protocol family mode, and then execute the redistribute isis-1-2 command. Redistribute ISIS routes.
  • Border Gateway Protocol BGP
  • the device under test is restored to the global configuration Config state, and the configuration command to be executed after the original state is restored is sent to the device under test, so that the device under test enters.
  • the IPv6 protocol family mode is entered.
  • the redistribute isis-1-2 command is used to re-issue the ISIS route.
  • the automated test can be performed to ensure the continuity of the automated test.
  • the method of the embodiment after the control device returns to the global configuration state, can execute only the configuration command for configuring the ISIS protocol, saving the configuration time and improving the efficiency of the automatic test. .
  • the method for abnormal processing in the automatic test of the embodiment is restored to a preset original state by the control device after reconnecting with the device, and the configuration command after the original state is executed, so that the subsequent automatic test can be smoothly performed. This is done to avoid the failure of the test script to run, to ensure the continuity of the automated test, and to improve the system's fault tolerance.
  • the test may not be re-tested from the initial configuration command, which saves the time for restoring the configuration, improves the efficiency of the automated test, and solves the problem between the automated test system and the device under test in the related art.
  • An abnormal interruption in the TCP connection causes the running script to fail, and even affects the subsequent automated test execution.
  • the embodiment provides an apparatus for abnormal processing in an automated test, comprising: a determining module and a control module.
  • the determining module is configured to determine, in the process of testing a device under test according to a test script, if the connection with the device under test is abnormally interrupted, determining that the device under test is restored to the preset original state according to the abnormal interruption.
  • control module After the control module is configured to reconnect with the device under test, the device under test is controlled to return to the original state, and the configuration command to be executed is sent to the device under test.
  • the apparatus for abnormal processing in the automatic test of the embodiment is restored to a preset original state by the control device after being reconnected with the device, and the configuration command after the original state is executed, so that the subsequent automatic test can be smoothly performed to avoid The test script failed to run, ensuring the continuity of automated testing and improving the system's fault tolerance.
  • the method does not need to re-test from the initial configuration command after reconnecting with the device, which saves the time for restoring the configuration, improves the efficiency of the automated test, and solves the problem between the automated test system and the device under test in the related art.
  • An abnormal interruption in the TCP connection causes the running script to fail, and even affects the subsequent automated test execution.
  • the determining module includes: a first determining unit.
  • the first determining unit is configured to determine an original state that the device under test is restored to before the abnormal interrupt occurs, and determine that the device under test is restored after being restored to the original state for the last time.
  • the determining module includes: an obtaining unit and a second determining unit.
  • the configuration command that fails to be delivered in the test script is obtained.
  • the second determining unit is configured to determine, according to the configuration command that the delivery fails, a configuration command that needs to be executed by the device under test after the device under test returns to the original state.
  • the device further includes: a detection module and an acquisition module.
  • the detection module is configured to detect whether an abnormal interruption has occurred in connection with the device under test.
  • the obtaining module is configured to acquire a configuration command that fails to be delivered in the test script when an abnormality occurs in the connection with the device under test.
  • the device further includes: a recording module.
  • the recording module is configured to record a configuration command issued to the device under test according to the test script during an automated test of a device under test according to a test script.
  • the device for abnormal processing in the automatic test of the embodiment is restored to a preset original state by the control device after being reconnected with the device, and the device under test executes the configuration command after the original state, so that the subsequent automatic test can be smoothly performed. It avoids the failure of the test script to run, ensures the continuity of the automated test, and improves the system's fault tolerance. In this method, after reconnecting with the device, it is not necessary to re-test from the initial configuration command, which improves the efficiency of the automated test, and solves the abnormal interruption of the TCP connection between the automated test system and the device under test in the related art. The script being executed failed to run, and even affected the issue of subsequent automated test execution.
  • the abnormality processing device in the automated test is a device corresponding to the abnormality processing method in the above-described automated test, wherein all the implementations in the above method embodiments are applicable to the embodiment of the device.
  • the abnormality processing device in the automated test of the above embodiment can be applied to an automated test system.
  • the embodiment provides an automated test system comprising: an exception handling device in an automated test as described in the above embodiments.
  • the implementation embodiments of the exception handling device in the above automated test are all applicable to the embodiment of the automated test system.
  • the embodiment provides a computer readable storage medium storing computer executable instructions.
  • the computer executable instructions are arranged to perform the method of any of the above embodiments.
  • the automated test system includes:
  • At least one processor 30, which is exemplified by a processor 30 in FIG. 3; a memory 31; and a communication interface 32 and a bus 33.
  • the processor 30, the memory 31 and the communication interface 32 can complete communication with each other via the bus 33.
  • Communication interface 32 can transmit data.
  • the processor 30 can call the logic instructions in the memory 31 to perform the methods in the above embodiments.
  • logic instructions in the memory 31 described above may be implemented in the form of a software functional unit and sold or used as a stand-alone product, and may be stored in a computer readable storage medium.
  • the memory 31 is a computer readable storage medium and can be used to store software programs, computer executable programs, and program instructions or modules corresponding to the methods in the above embodiments.
  • the processor 30 executes the functional application and the data processing by executing a software program, an instruction or a module stored in the memory 31, that is, the method in the above embodiment is implemented.
  • the memory 31 may include a storage program area and an storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to usage of the terminal device, and the like. Further, the memory 31 may include a high speed random access memory, and may also include a nonvolatile memory.
  • the above technical solution may be embodied in the form of a software product stored in a storage medium, including one or more instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to execute All or part of the steps of the method described in the above embodiments.
  • the foregoing storage medium may be a non-transitory storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
  • the method, device and system for abnormal processing in automated testing improve the efficiency of automated testing, ensure the continuity of automated testing, and improve the fault tolerance of the system.

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)
  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

An abnormality protection method, apparatus and system in an automation test. The method comprises: during the process of testing a device to be tested according to a test script, if a connection with the device to be tested is abnormally interrupted, according to the interruption situation, determining a configuration command needing to be executed after the device to be tested recovers to a pre-set original state; and after the device to be tested is re-connected, controlling the device to be tested so that same recovers to the original state and issuing the configuration command needing to be executed to the device to be tested.

Description

自动化测试中的异常处理方法、装置及系统Exception handling method, device and system in automated testing 技术领域Technical field
本公开涉及自动化测试领域,例如涉及一种自动化测试中的异常处理方法、装置及系统。The present disclosure relates to the field of automated testing, for example, to an anomaly processing method, apparatus, and system in an automated test.
背景技术Background technique
自动化测试已经逐渐深入到软件测试的多个方面,有着不可替代的优势。自动化测试使用简单的脚本,实现大量重复的操作,可以在一定程度上缩短测试时间,节约测试人力,而且测试结果准确。通过自动化测试释放测试人力资源,能够让测试人员专注于手工测试部分,提高测试的效率,缩短了产品开发的周期,提高了研发效率。Automated testing has gradually penetrated into many aspects of software testing and has irreplaceable advantages. Automated testing uses simple scripts to achieve a large number of repetitive operations, which can reduce test time to a certain extent, save test manpower, and test results are accurate. Freeing test human resources through automated testing enables testers to focus on manual testing, improve test efficiency, shorten product development cycles, and increase R&D efficiency.
但是在自动化测试过程中,因被测试设备的性能、测试环境的稳定性以及其他不稳定因素,自动化测试系统与被测试设备之间的传输控制协议TCP(Transmission Control Protocol,TCP)连接可能发生异常中断。此类情况不仅导致正在执行的脚本运行失败,甚至可能影响后续的自动化测试。However, during the automated test process, the transmission control protocol TCP (Transmission Control Protocol (TCP) connection between the automated test system and the device under test may be abnormal due to the performance of the device under test, the stability of the test environment, and other unstable factors. Interrupted. Such a situation not only causes the running script to fail, but may even affect subsequent automated tests.
发明内容Summary of the invention
一种自动化测试中的异常处理的方法、装置及系统,避免相关技术中自动化测试系统与被测试设备之间的TCP连接发生异常中断时,导致正在执行的脚本运行失败,甚至可能影响后续的自动化测试现象。A method, device and system for exception processing in an automated test, which avoids an abnormal interruption of a TCP connection between an automated test system and a device under test in the related art, causes the running script to fail, and may even affect subsequent automation Test the phenomenon.
一种自动化测试中的异常处理方法,包括:An exception handling method in automated testing, including:
在根据一测试脚本对一被测试设备进行自动化测试的过程中,若与被测试设备之间的连接发生异常中断,则根据所述异常中断,确定所述被测试设备恢复到预设的原始状态之后所述被测试设备需要执行的配置命令;以及In the process of performing an automated test on a device under test according to a test script, if the connection with the device under test is abnormally interrupted, determining, according to the abnormal interruption, that the device under test returns to a preset original state. The configuration command that the device under test needs to execute;
与所述被测试设备重新连接后,控制所述被测试设备恢复到所述原始状态,并向所述被测试设备下发所述需要执行的配置命令。After the device is reconnected, the device under test is restored to the original state, and the configuration command to be executed is sent to the device under test.
可选的,所述根据异常中断情况,确定所述被测试设备恢复到预设的原始 状态之后所述被测试设备需要执行的配置命令包括:Optionally, the determining, according to the abnormal interruption condition, that the device under test returns to a preset original The configuration commands that need to be executed by the device under test after the status include:
确定所述被测试设备在发生异常中断之前,最后一次恢复到的原始状态,并确定所述被测试设备在最后一次恢复到原始状态之后所述被测试设备需要执行的配置命令为所述配置命令。Determining, by the device under test, the original state that was restored to the last time before the abnormal interrupt occurs, and determining that the configuration command that the device under test needs to execute after the device is restored to the original state is the configuration command. .
可选的,所述根据异常中断,确定所述被测试设备恢复到预设的原始状态之后所述被测试设备需要执行的配置命令包括:Optionally, the determining, according to the abnormal interruption, that the device under test needs to be executed after the device under test returns to a preset original state, includes:
与被测试设备之间的连接发生异常中断后,获取所述测试脚本中下发失败的配置命令;以及After the connection with the device under test is abnormally interrupted, obtaining a configuration command that fails to be delivered in the test script;
根据所述下发失败的配置命令,确定所述被测试设备恢复到原始状态之后所述被测试设备需要执行的配置命令。Determining, according to the configuration command that fails to be delivered, a configuration command that the device under test needs to perform after the device under test returns to the original state.
可选的,在根据一测试脚本对一被测试设备进行自动化测试的过程中,所述方法包括:Optionally, in the process of automatically testing a device under test according to a test script, the method includes:
检测与所述被测试设备的连接是否发生异常中断;以及Detecting whether a connection to the device under test is abnormally interrupted;
在与所述被测试设备之间的连接发生异常中断时,获取所述测试脚本中下发失败的配置命令。When the connection with the device under test is abnormally interrupted, a configuration command that fails to be delivered in the test script is obtained.
可选的,所述在根据一测试脚本对一被测试设备进行测试的过程中,所述方法包括:Optionally, in the process of testing a device under test according to a test script, the method includes:
记录根据所述测试脚本向所述被测试设备下发的配置命令。A configuration command sent to the device under test according to the test script is recorded.
一种自动化测试的异常处理装置,包括:An anomaly processing device for automated testing, comprising:
确定模块,设置为在根据一测试脚本对一被测试设备进行自动化测试的过程中,若与被测试设备之间的连接发生异常中断,则根据所述异常中断,确定所述被测试设备恢复到预设的原始状态之后所述被测试设备需要执行的配置命令;以及Determining a module, in the process of performing an automatic test on a device under test according to a test script, if an abnormal interruption occurs in a connection with the device under test, determining that the device under test is restored according to the abnormal interruption a configuration command that the device under test needs to execute after the preset original state;
控制模块,设置为与所述被测试设备重新连接后,控制所述被测试设备恢复到所述原始状态,并向所述被测试设备下发所述需要执行的配置命令。After the control module is configured to reconnect with the device under test, the device is controlled to be restored to the original state, and the configuration command to be executed is sent to the device under test.
可选的,所述确定模块包括:Optionally, the determining module includes:
第一确定单元,设置为确定所述被测试设备在发生异常中断之前,最后一 次恢复到的原始状态,并确定所述被测试设备在最后一次恢复到原始状态之后所述被测试设备需要执行的配置命令。a first determining unit, configured to determine that the device under test is last before an abnormal interruption occurs The original state is restored to the next time, and the configuration command that the device under test needs to execute after the device is restored to the original state is determined.
可选的,所述确定模块包括:Optionally, the determining module includes:
获取单元,设置为与被测试设备之间的连接发生异常中断后,获取所述测试脚本中下发失败的配置命令;以及Obtaining a configuration command that is sent in the test script after the connection to the device under test is abnormally interrupted;
第一确定单元,设置为根据所述下发失败的配置命令,确定所述被测试设备恢复到原始状态之后所述被测试设备需要执行的配置命令。The first determining unit is configured to determine, according to the configuration command that the delivery fails, a configuration command that the device under test needs to perform after the device under test returns to the original state.
可选的,所述的装置,还包括:Optionally, the device further includes:
记录模块,设置为在根据一测试脚本对一被测试设备进行自动化测试的过程中,记录根据所述测试脚本向所述被测试设备下发的配置命令。The recording module is configured to record a configuration command sent to the device under test according to the test script during an automated test of a device under test according to a test script.
一种自动化测试系统,包括:上述任一项自动化测试中的异常处理装置。An automated test system comprising: an exception handling device in any of the above automated tests.
一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为执行上述方法。A computer readable storage medium storing computer executable instructions arranged to perform the above method.
一种自动化测试系统,包括:An automated test system that includes:
至少一个处理器;以及At least one processor;
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器执行上述的方法。The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the method described above.
上述的自动化测试中异常处理的方法中,在根据一测试脚本对一被测试设备进行自动化测试的过程中,若与被测试设备之间的连接发生异常中断,则根据异常中断,确定被测试设备恢复到预设的原始状态之后被测试设备需要执行的配置命令;与被测试设备重新连接后,控制被测试设备恢复到原始状态,并向被测试设备下发需要执行的配置命令。在与被测设备重新连接后通过控制设备恢复到预先设定的原始状态,并执行确定好的此次原始状态之后的配置命令,可快速恢复中断的配置命令,从而使得后续自动化测试能够顺利进行,避免了测试脚本的运行失败,保证了自动化测试的连续性,提高了系统容错能力。该方法中,在与设备重新连接后,不需要从最初的配置命令开始重新测试,节约了恢复配置的时间,提高了自动化测试的效率。上述技术方案解决了相关技术 中自动化测试系统与被测试设备之间的TCP连接发生异常中断导致正在执行的脚本运行失败,甚至会影响后续的自动化测试执行的问题。In the above method for handling exceptions in an automated test, in the process of automatically testing a device under test according to a test script, if the connection with the device under test is abnormally interrupted, the device under test is determined according to the abnormal interruption. After the device is restored to the original state, the device to be tested needs to be executed. After the device is reconnected, the device under test is restored to the original state, and the configuration command to be executed is sent to the device under test. After reconnecting with the device under test, the control device is restored to the preset original state, and the configuration command after the determined original state is executed, the interrupted configuration command can be quickly restored, so that the subsequent automated test can be smoothly performed. It avoids the failure of the test script to run, ensures the continuity of the automated test, and improves the system's fault tolerance. In this method, after reconnecting with the device, it is not necessary to re-test from the initial configuration command, which saves the time for restoring the configuration and improves the efficiency of the automated test. The above technical solution solves related technologies An abnormal interruption in the TCP connection between the automated test system and the device under test causes the running script to fail, and may even affect the subsequent automated test execution.
附图说明DRAWINGS
图1为一实施例中自动化测试中的异常处理的方法流程图;1 is a flow chart of a method for exception handling in an automated test in an embodiment;
图2为一实施例中自动化测试中的异常处理的装置的结构示意图;以及2 is a schematic structural diagram of an apparatus for abnormal processing in an automated test in an embodiment;
图3是一实施例中的自动化测试系统的硬件结构示意图。3 is a schematic diagram showing the hardware structure of an automated test system in an embodiment.
具体实施方式detailed description
为使技术方案更加清楚,下面将结合附图及实施例对技术方案进行详细描述。In order to make the technical solutions clearer, the technical solutions will be described in detail below with reference to the accompanying drawings and embodiments.
在自动化测试正常进行中,系统(自动化测试系统)与设备(被测试设备)之间的连接发生异常中断时,系统无法向设备下发配置命令,此时,未发送至设备的配置命令即失败的配置命令。系统重新连接异常中断的设备后,如果设备继续执行失败的配置命令,可能存在当前被测试设备的配置模式和系统下发的配置命令不匹配的情况,设备执行配置命令失败,导致后续自动化测试失败。因此,恢复当前被测试设备的配置模式,可以使得设备在异常中断后继续进行自动化测试。The system fails to send a configuration command to the device when the connection between the system (automated test system) and the device (the device under test) is abnormally interrupted. In this case, the configuration command that is not sent to the device fails. Configuration command. After the system reconnects to the abnormally interrupted device, if the device continues to execute the failed configuration command, the configuration mode of the current test device may not match the configuration command delivered by the system. The configuration command fails. The subsequent automatic test fails. . Therefore, restoring the configuration mode of the currently tested device can cause the device to continue the automated test after an abnormal interruption.
本实施例的方法中,通过预设原始状态,系统与设备重新连接后,可以将设备恢复到该原始状态,并执行此次原始状态之后的配置命令,使得设备继续执行自动化测试,保证了自动化测试对设备配置的连续性。In the method of the embodiment, after the system is reconnected with the device by default, the device can be restored to the original state, and the configuration command after the original state is executed, so that the device continues to perform automatic testing to ensure automation. Test the continuity of the device configuration.
如图1所示,本实施例中自动化测试的异常处理方法,包括以下步骤。As shown in FIG. 1, the abnormal processing method of the automated test in this embodiment includes the following steps.
在步骤101中,在根据一测试脚本对一被测试设备进行测试的过程中,若与被测试设备之间的连接发生异常中断,则根据异常中断,确定所述被测试设备恢复到预设的原始状态之后被测设备需要执行的配置命令。In step 101, in the process of testing a device under test according to a test script, if an abnormal interruption occurs in the connection with the device under test, it is determined that the device under test is restored to the preset according to the abnormal interruption. The configuration command that the device under test needs to execute after the original state.
原始状态可以为预先通过自动化测试平台自定义的设备(被测试设备)的状态,如原始状态可设定为设备与系统重新连接后的初始状态或设备与系统重新连接后进入基本配置模式的状态。 The original state may be the state of the device (the device under test) customized in advance through the automated test platform. For example, the original state may be set as the initial state after the device is reconnected with the system or the state in which the device enters the basic configuration mode after reconnecting with the system. .
其中,自动化测试过程可以包括多组不同的配置命令,被测试设备每执行完一组完整的配置命令后可以恢复到该原始状态。The automated testing process may include multiple sets of different configuration commands, and the tested device may restore the original state after executing a complete set of configuration commands.
设备恢复到原始状态之后,确定被测设备需要执行的配置命令,可以是在设备发生异常中断之前,一次恢复到原始状态之后被测设备需要执行的配置命令,以保证设备在恢复原始状态后能够重新执行中断的配置命令,快速脱离异常中断。After the device is restored to the original state, it is determined that the configuration command to be executed by the device under test can be configured before the device is restored to the original state. Re-execute the interrupted configuration command to quickly break away from the abort.
在步骤102中,与所述被测试设备重新连接后,控制所述被测试设备恢复到所述原始状态,并向所述被测试设备下发所述需要执行的配置命令。After the device is reconnected with the device under test, the device under test is restored to the original state, and the configuration command to be executed is sent to the device under test.
控制被测试设备恢复到原始状态之后,设备可以执行此次原始状态之后系统下发的配置命令,设备执行失败的配置命令,可继续执行自动化测试,保证了自动化测试的连续性。After the device is controlled to return to the original state, the device can execute the configuration command issued by the system after the original state, and the device executes the configuration command that fails, and can continue to perform the automatic test to ensure the continuity of the automated test.
自动化测试平台可以具有恢复原始状态的功能,可方便地控制被测试设备恢复到原始状态。The automated test platform can have the ability to restore the original state, which can easily control the tested device to return to the original state.
本实施例的自动化测试异常保护的方法,在与设备重新连接后通过控制设备恢复到预先设定的原始状态,并执行此次原始状态之后的配置命令,可执行中断的配置命令,使得后续自动化测试能够顺利进行,避免了测试脚本的运行失败,保证了自动化测试的连续性,提高了系统容错能力。在系统与设备重新连接后,可以不从自动化测试中最初的配置命令开始重新测试,节约了恢复配置的时间,提高了自动化测试的效率,解决了相关技术中自动化测试系统与被测试设备之间的TCP连接发生异常中断时,导致正在执行的脚本运行失败,甚至可能影响后续的自动化测试执行的问题。The method for automatically testing the abnormality protection of the embodiment can restore the preset original state by the control device after reconnecting with the device, and execute the configuration command after the original state, and execute the interrupt configuration command, so that the subsequent automation The test can be carried out smoothly, avoiding the failure of the test script, ensuring the continuity of the automated test and improving the fault tolerance of the system. After the system is reconnected with the device, it can be re-tested without the initial configuration command in the automated test, saving the time for restoring the configuration, improving the efficiency of the automated test, and solving the related technology between the automated test system and the device under test. When an abnormal connection occurs in the TCP connection, the script that is being executed fails to run, and may even affect the subsequent automated test execution.
可选的,上述步骤101包括:Optionally, the foregoing step 101 includes:
确定所述被测试设备在异常中断之前,最后一次恢复到的原始状态,并确定所述被测试设备在最后一次恢复到原始状态之后需要执行的配置命令为所述配置命令。Determining the original state that the device under test is restored to before the abnormal interruption, and determining that the configuration command that the device under test needs to execute after the last restoration to the original state is the configuration command.
此时,通过确定设备在中断之前,最后一次恢复到的原始状态及之后需要执行的配置命令,使得系统与设备重连后设备可以执行发生异常中断前的一组配置命令,恢复中断的业务,且相对于从自动化测试的最开始重新配置的过程, 节省了恢复配置的时间,提高了自动化测试的效率。At this time, by determining the original state of the device before the interruption, and the configuration command that needs to be executed after the last time, the device can be reconnected with the device, and the device can execute a set of configuration commands before the abnormal interrupt occurs, and the interrupted service is resumed. And relative to the process of reconfiguring from the very beginning of automated testing, It saves time in restoring configuration and improves the efficiency of automated testing.
可选的,上述步骤101的步骤包括:Optionally, the steps of step 101 above include:
在与被测试设备之间的连接发生异常中断时,获取所述测试脚本中下发失败的配置命令。When the connection with the device under test is abnormally interrupted, a configuration command that fails to be delivered in the test script is obtained.
根据所述下发失败的配置命令,确定所述被测试设备恢复到原始状态之后需要执行的配置命令。Determining, according to the configuration command that fails to be delivered, a configuration command that needs to be executed after the device under test returns to the original state.
此时,在系统与设备之间的连接发生异常中断时,系统向设备下发配置命令失败,此时的配置命令即为下发失败的配置命令。系统下发配置命令中止。通过该下发失败的配置命令,可以确定发生异常中断之前,设备最后一次恢复到的原始状态,将设备恢复到原始状态之后需要执行的配置命令确定为与所述被测试设备重新连接后,所述被测试设备需要执行的配置命令。At this time, when the connection between the system and the device is abnormally interrupted, the system fails to send the configuration command to the device. The configuration command is the configuration command that fails to be delivered. The system sends a configuration command to abort. The configuration command that fails to be sent can determine the original state that the device is restored to before the abnormal interrupt occurs. After the device is restored to the original state, the configuration command to be executed is determined to be reconnected with the device under test. The configuration commands that the device under test needs to execute.
可选的,所述在根据一测试脚本对一被测试设备进行自动化测试的过程中,所述方法还包括:Optionally, in the process of performing an automated test on a device under test according to a test script, the method further includes:
检测与所述被测试设备的连接是否发生异常中断;以及Detecting whether a connection to the device under test is abnormally interrupted;
在与所述被测试设备之间的连接发生异常中断时,获取所述测试脚本中下发失败的配置命令。When the connection with the device under test is abnormally interrupted, a configuration command that fails to be delivered in the test script is obtained.
可实时监控自动化测试系统与被测试设备的连接是否正常,在发生异常中断时及时进行异常处理。获取测试脚本中下发失败的配置命令,系统能准确确定被测试设备恢复到原始状态之后需要执行的配置命令,以确定发生中断后设备要执行的配置命令,保证自动化测试的连续性。It can monitor the connection between the automated test system and the device under test in real time, and perform exception handling in case of abnormal interruption. Obtain the configuration command that fails to be sent in the test script. The system can accurately determine the configuration commands that need to be executed after the device under test returns to the original state to determine the configuration commands to be executed by the device after the interrupt occurs to ensure the continuity of the automated test.
在与被测试设备之间的连接发生异常中断时,还可获取发生异常中断的被测试设备,可以准确找到该被测试设备,并恢复与该被测试设备之间的连接。When the connection with the device under test is abnormally interrupted, the device under test that has an abnormal interruption can also be obtained, and the device under test can be accurately found and the connection with the device under test can be restored.
可选的,所述在根据一测试脚本对一被测试设备进行测试的过程中,所述方法还包括:Optionally, in the process of testing a device under test according to a test script, the method further includes:
记录根据所述测试脚本向所述被测试设备下发的配置命令。A configuration command sent to the device under test according to the test script is recorded.
通过记录测试脚本对设备下发的配置命令,为上述过程中获取下发失败的配置命令、确定设备恢复到原始状态之后需要执行的配置命令提供了数据支持, 保证了自动化测试的顺利进行。The data is supported by the configuration command sent to the device by the test script to obtain the configuration command that fails to be delivered and the configuration command that needs to be executed after the device is restored to the original state. The automation test is guaranteed to proceed smoothly.
可将测试脚本对设备下发的配置命令保存到存储数据库中,便于查找和调用。You can save the configuration commands sent by the test script to the storage database for easy searching and calling.
下面对本实施例的方法的一应用流程举例说明。An application flow of the method of this embodiment is illustrated below.
假定预设的原始状态为设备的全局配置(Config)状态,该状态可以是系统在连接设备后执行配置终端(confgure terminal)命令进入的状态。根据一测试脚本,可以对被测试设备进行一系列配置,包括接口(interface)相关配置、设备环回地址loopbackl配置以及中间系统到中间系统(Intermediate System to Intermediate System,ISIS)协议配置等。其中,进行ISIS协议配置时,可以先进入边界网关协议BGP(Border Gateway Protocol,)配置模式,再进入互联网协议版本6(Internet Protocol Version 6,IPv6)的协议族模式,然后执行路由重发布命令(redistribute isis-1-2)重发布ISIS路由。It is assumed that the preset original state is the global configuration (Config) state of the device, which may be a state in which the system executes a configuration terminal (confgure terminal) command after connecting the device. According to a test script, a series of configurations can be performed on the device under test, including interface configuration, device loopback address loopback configuration, and intermediate system to intermediate system (ISIS) protocol configuration. When configuring the ISIS protocol, you can enter the Border Gateway Protocol (BGP) configuration mode, enter the protocol family mode of Internet Protocol Version 6, IPv6, and then execute the route re-release command. Redistribute isis-1-2) Redistribute ISIS routes.
本实施例的方法中,在测试过程中,可以检测与被测试设备的连接是否发生异常中断,并将下发给被测试设备的配置命令记录在存储数据库中。In the method of the embodiment, during the test, whether the connection with the device under test is abnormally interrupted, and the configuration command sent to the device under test is recorded in the storage database.
假定进行ISIS协议配置时,检测到与被测试设备的连接发生异常中断,系统此时无法向被测试设备下发配置命令,下发配置命令中止。例如,系统获取的下发失败的配置命令为redistribute isis-1-2,并获取发生异常中断的被测试设备。Assume that the connection to the device under test is abnormally interrupted when the ISIS protocol is configured. The system cannot send a configuration command to the device under test and the configuration command is aborted. For example, the configuration command that the system obtains fails to be redistribute isis-1-2, and obtains the device under test that has an abnormal interrupt.
根据执行失败的配置命令redistribute isis-1-2,在存储数据库中检索异常中断之前,最后一次恢复的原始状态,并依次获取该原始状态后需要执行的配置命令。可选的,检索到的恢复到原始状态之后需要执行的配置命令为先进入边界网关协议(Border Gateway Protocol,BGP)配置模式,再进入IPv6协议族模式,然后执行命令redistribute isis-1-2进行重发布ISIS路由。According to the configuration command redistribute isis-1-2 that fails to execute, the original state of the last recovery is retrieved before the abnormal interrupt is retrieved in the storage database, and the configuration commands to be executed after the original state are sequentially acquired. Optionally, the retrieved configuration command to be restored to the original state is to enter the Border Gateway Protocol (BGP) configuration mode, enter the IPv6 protocol family mode, and then execute the redistribute isis-1-2 command. Redistribute ISIS routes.
可选的,与发生异常中断的被测试设备重新连接之后,控制被测试设备恢复到全局配置Config状态,将恢复到原始状态之后需要执行的配置命令下发给被测试设备,使被测试设备进入BGP配置模式,进入IPv6协议族模式,执行命令redistribute isis-1-2进行重发布ISIS路由,可继续执行自动化测试,保证了自动化测试的连续性。 Optionally, after reconnecting with the device under test that is abnormally interrupted, the device under test is restored to the global configuration Config state, and the configuration command to be executed after the original state is restored is sent to the device under test, so that the device under test enters. In the BGP configuration mode, the IPv6 protocol family mode is entered. The redistribute isis-1-2 command is used to re-issue the ISIS route. The automated test can be performed to ensure the continuity of the automated test.
相较于依次重新执行上述一系列相关配置,本实施例的方法,控制设备恢复到全局配置状态后,可以仅执行进行ISIS协议配置的配置命令,节约了配置的时间,提高了自动化测试的效率。Compared with sequentially performing the foregoing series of related configurations, the method of the embodiment, after the control device returns to the global configuration state, can execute only the configuration command for configuring the ISIS protocol, saving the configuration time and improving the efficiency of the automatic test. .
综上,本实施例的自动化测试中异常处理的方法,在与设备重新连接后通过控制设备恢复到预先设定的原始状态,并执行此次原始状态之后的配置命令,使得后续自动化测试能够顺利进行,避免了测试脚本的运行失败,保证了自动化测试的连续性,提高了系统容错能力。且该方法在与设备重新连接后,可以不从最初的配置命令开始重新测试,节约了恢复配置的时间,提高了自动化测试的效率,解决了相关技术中自动化测试系统与被测试设备之间的TCP连接发生异常中断导致正在执行的脚本运行失败,甚至影响后续的自动化测试执行的问题。In summary, the method for abnormal processing in the automatic test of the embodiment is restored to a preset original state by the control device after reconnecting with the device, and the configuration command after the original state is executed, so that the subsequent automatic test can be smoothly performed. This is done to avoid the failure of the test script to run, to ensure the continuity of the automated test, and to improve the system's fault tolerance. After the method is reconnected with the device, the test may not be re-tested from the initial configuration command, which saves the time for restoring the configuration, improves the efficiency of the automated test, and solves the problem between the automated test system and the device under test in the related art. An abnormal interruption in the TCP connection causes the running script to fail, and even affects the subsequent automated test execution.
如图2所示,本实施例提供一种自动化测试中异常处理的装置,包括:确定模块和控制模块。As shown in FIG. 2, the embodiment provides an apparatus for abnormal processing in an automated test, comprising: a determining module and a control module.
确定模块设置为在根据一测试脚本对一被测试设备进行测试的过程中,若与被测试设备之间的连接发生异常中断,则根据异常中断,确定所述被测试设备恢复到预设的原始状态之后被测试设备需要执行的配置命令。The determining module is configured to determine, in the process of testing a device under test according to a test script, if the connection with the device under test is abnormally interrupted, determining that the device under test is restored to the preset original state according to the abnormal interruption. The configuration command that the device under test needs to execute after the status.
控制模块设置为与所述被测试设备重新连接后,控制所述被测试设备恢复到所述原始状态,并向所述被测试设备下发所述需要执行的配置命令。After the control module is configured to reconnect with the device under test, the device under test is controlled to return to the original state, and the configuration command to be executed is sent to the device under test.
本实施例的自动化测试中异常处理的装置,在与设备重新连接后通过控制设备恢复到预先设定的原始状态,并执行此次原始状态之后的配置命令,使得后续自动化测试能够顺利进行,避免了测试脚本的运行失败,保证了自动化测试的连续性,提高了系统容错能力。且该方法在与设备重新连接后,不需要从最初的配置命令开始重新测试,节约了恢复配置的时间,提高了自动化测试的效率,解决了相关技术中自动化测试系统与被测试设备之间的TCP连接发生异常中断导致正在执行的脚本运行失败,甚至会影响后续的自动化测试执行的现象。The apparatus for abnormal processing in the automatic test of the embodiment is restored to a preset original state by the control device after being reconnected with the device, and the configuration command after the original state is executed, so that the subsequent automatic test can be smoothly performed to avoid The test script failed to run, ensuring the continuity of automated testing and improving the system's fault tolerance. Moreover, the method does not need to re-test from the initial configuration command after reconnecting with the device, which saves the time for restoring the configuration, improves the efficiency of the automated test, and solves the problem between the automated test system and the device under test in the related art. An abnormal interruption in the TCP connection causes the running script to fail, and even affects the subsequent automated test execution.
可选的,所述确定模块包括:第一确定单元。Optionally, the determining module includes: a first determining unit.
第一确定单元设置为确定所述被测试设备在发生异常中断之前,最后一次恢复到的原始状态,并确定所述被测试设备在最后一次恢复到原始状态之后被 测试设备需要执行的配置命令。The first determining unit is configured to determine an original state that the device under test is restored to before the abnormal interrupt occurs, and determine that the device under test is restored after being restored to the original state for the last time. The configuration commands that the test device needs to execute.
可选的,所述确定模块包括:获取单元和第二确定单元。Optionally, the determining module includes: an obtaining unit and a second determining unit.
获取单元设置为与被测试设备之间的连接发生异常中断后,获取所述测试脚本中下发失败的配置命令。After the acquisition unit is set to be abnormally interrupted with the connection between the device under test, the configuration command that fails to be delivered in the test script is obtained.
第二确定单元设置为根据所述下发失败的配置命令,确定所述被测试设备恢复到原始状态之后被测试设备需要执行的配置命令。The second determining unit is configured to determine, according to the configuration command that the delivery fails, a configuration command that needs to be executed by the device under test after the device under test returns to the original state.
可选的,所述装置还包括:检测模块和获取模块。Optionally, the device further includes: a detection module and an acquisition module.
检测模块设置为检测与所述被测试设备的连接是否发生异常中断。The detection module is configured to detect whether an abnormal interruption has occurred in connection with the device under test.
获取模块设置为在与所述被测试设备之间的连接发生异常中断时,获取所述测试脚本中下发失败的配置命令。The obtaining module is configured to acquire a configuration command that fails to be delivered in the test script when an abnormality occurs in the connection with the device under test.
可选的,所述装置还包括:记录模块。Optionally, the device further includes: a recording module.
记录模块设置为在根据一测试脚本对一被测试设备进行自动化测试的过程中,记录根据所述测试脚本向所述被测试设备下发的配置命令。The recording module is configured to record a configuration command issued to the device under test according to the test script during an automated test of a device under test according to a test script.
本实施例的自动化测试中异常处理的装置,在与设备重新连接后通过控制设备恢复到预先设定的原始状态,被测设备执行此次原始状态之后的配置命令,使得后续自动化测试能够顺利进行,避免了测试脚本的运行失败,保证了自动化测试的连续性,提高了系统容错能力。该方法中,在与设备重新连接后,不需要从最初的配置命令开始重新测试,提高了自动化测试的效率,解决了相关技术中自动化测试系统与被测试设备之间的TCP连接发生异常中断导致正在执行的脚本运行失败,甚至影响后续的自动化测试执行的问题。The device for abnormal processing in the automatic test of the embodiment is restored to a preset original state by the control device after being reconnected with the device, and the device under test executes the configuration command after the original state, so that the subsequent automatic test can be smoothly performed. It avoids the failure of the test script to run, ensures the continuity of the automated test, and improves the system's fault tolerance. In this method, after reconnecting with the device, it is not necessary to re-test from the initial configuration command, which improves the efficiency of the automated test, and solves the abnormal interruption of the TCP connection between the automated test system and the device under test in the related art. The script being executed failed to run, and even affected the issue of subsequent automated test execution.
该自动化测试中的异常处理装置是与上述自动化测试中的异常处理方法相对应的装置,其中上述方法实施例中所有实现方式均适用于该装置的实施例中。The abnormality processing device in the automated test is a device corresponding to the abnormality processing method in the above-described automated test, wherein all the implementations in the above method embodiments are applicable to the embodiment of the device.
上述实施例的自动化测试中的异常处理装置可应用于自动化测试系统。本实施例提供了一种自动化测试系统,包括:如上述实施例中所述的自动化测试中的异常处理装置。其中,上述自动化测试中的异常处理装置的所述实现实施例均适用于该自动化测试系统的实施例中。The abnormality processing device in the automated test of the above embodiment can be applied to an automated test system. The embodiment provides an automated test system comprising: an exception handling device in an automated test as described in the above embodiments. Wherein, the implementation embodiments of the exception handling device in the above automated test are all applicable to the embodiment of the automated test system.
本实施例提供了一种计算机可读存储介质,存储有计算机可执行指令,所 述计算机可执行指令设置为执行上述任一实施例中的方法。The embodiment provides a computer readable storage medium storing computer executable instructions. The computer executable instructions are arranged to perform the method of any of the above embodiments.
本实施例提供了自动化测试系统的硬件结构示意图。参见图3,该自动化测试系统包括:This embodiment provides a hardware structure diagram of an automated test system. Referring to Figure 3, the automated test system includes:
至少一个处理器(processor)30,图3中以一个处理器30为例;存储器(memory)31;还可以包括通信接口(Communications Interface)32和总线33。其中,处理器30、存储器31和通信接口32可以通过总线33完成相互间的通信。通信接口32可以传输数据。处理器30可以调用存储器31中的逻辑指令,以执行上述实施例中的方法。At least one processor 30, which is exemplified by a processor 30 in FIG. 3; a memory 31; and a communication interface 32 and a bus 33. The processor 30, the memory 31 and the communication interface 32 can complete communication with each other via the bus 33. Communication interface 32 can transmit data. The processor 30 can call the logic instructions in the memory 31 to perform the methods in the above embodiments.
此外,上述的存储器31中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。In addition, the logic instructions in the memory 31 described above may be implemented in the form of a software functional unit and sold or used as a stand-alone product, and may be stored in a computer readable storage medium.
存储器31作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序,如上述实施例中的方法对应的程序指令或模块。处理器30通过运行存储在存储器31中的软件程序、指令或模块,从而执行功能应用以及数据处理,即实现上述实施例中的方法。The memory 31 is a computer readable storage medium and can be used to store software programs, computer executable programs, and program instructions or modules corresponding to the methods in the above embodiments. The processor 30 executes the functional application and the data processing by executing a software program, an instruction or a module stored in the memory 31, that is, the method in the above embodiment is implemented.
存储器31可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端设备的使用所创建的数据等。此外,存储器31可以包括高速随机存取存储器,还可以包括非易失性存储器。The memory 31 may include a storage program area and an storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to usage of the terminal device, and the like. Further, the memory 31 may include a high speed random access memory, and may also include a nonvolatile memory.
以上技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括一个或多个指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行上述实施例所述方法的全部或部分步骤。而前述的存储介质可以是非暂态存储介质,包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等多种可以存储程序代码的介质,也可以是暂态存储介质。The above technical solution may be embodied in the form of a software product stored in a storage medium, including one or more instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to execute All or part of the steps of the method described in the above embodiments. The foregoing storage medium may be a non-transitory storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. A medium that can store program code, or a transitory storage medium.
工业实用性Industrial applicability
自动化测试中的异常处理的方法、装置及系统,提高了自动化测试的效率,保证了自动化测试的连续性,提高了系统容错能力。 The method, device and system for abnormal processing in automated testing improve the efficiency of automated testing, ensure the continuity of automated testing, and improve the fault tolerance of the system.

Claims (11)

  1. 一种自动化测试中的异常处理方法,包括:An exception handling method in automated testing, including:
    在根据一测试脚本对一被测试设备进行自动化测试的过程中,若与被测试设备之间的连接发生异常中断,则根据所述异常中断,确定所述被测试设备恢复到预设的原始状态之后所述被测试设备需要执行的配置命令;以及In the process of performing an automated test on a device under test according to a test script, if the connection with the device under test is abnormally interrupted, determining, according to the abnormal interruption, that the device under test returns to a preset original state. The configuration command that the device under test needs to execute;
    与所述被测试设备重新连接后,控制所述被测试设备恢复到所述原始状态,并向所述被测试设备下发所述需要执行的配置命令。After the device is reconnected, the device under test is restored to the original state, and the configuration command to be executed is sent to the device under test.
  2. 根据权利要求1所述的方法,其中,所述根据异常中断情况,确定所述被测试设备恢复到预设的原始状态之后所述被测试设备需要执行的配置命令包括:The method of claim 1, wherein the determining, according to the abnormal interruption condition, that the device under test needs to be executed after the device under test returns to a preset original state comprises:
    确定所述被测试设备在发生异常中断之前,最后一次恢复到的原始状态,并确定所述被测试设备在最后一次恢复到原始状态之后所述被测试设备需要执行的配置命令为所述配置命令。Determining, by the device under test, the original state that was restored to the last time before the abnormal interrupt occurs, and determining that the configuration command that the device under test needs to execute after the device is restored to the original state is the configuration command. .
  3. 根据权利要求1所述的方法,其中,所述根据异常中断,确定所述被测试设备恢复到预设的原始状态之后所述被测试设备需要执行的配置命令包括:The method of claim 1, wherein the determining, according to the abnormality interruption, that the device under test needs to be executed after the device under test returns to a preset original state comprises:
    与被测试设备之间的连接发生异常中断后,获取所述测试脚本中下发失败的配置命令;以及After the connection with the device under test is abnormally interrupted, obtaining a configuration command that fails to be delivered in the test script;
    根据所述下发失败的配置命令,确定所述被测试设备恢复到原始状态之后所述被测试设备需要执行的配置命令。Determining, according to the configuration command that fails to be delivered, a configuration command that the device under test needs to perform after the device under test returns to the original state.
  4. 根据权利要求3所述的方法,在根据一测试脚本对一被测试设备进行自动化测试的过程中,所述方法包括:The method according to claim 3, in the process of automatically testing a device under test according to a test script, the method comprising:
    检测与所述被测试设备的连接是否发生异常中断;以及Detecting whether a connection to the device under test is abnormally interrupted;
    在与所述被测试设备之间的连接发生异常中断时,获取所述测试脚本中下 发失败的配置命令。Obtaining the test script in the middle of an abnormal interruption in the connection with the device under test A failed configuration command.
  5. 根据权利要求1所述的方法,所述在根据一测试脚本对一被测试设备进行测试的过程中,所述方法包括:The method according to claim 1, wherein in the process of testing a device under test according to a test script, the method comprises:
    记录根据所述测试脚本向所述被测试设备下发的配置命令。A configuration command sent to the device under test according to the test script is recorded.
  6. 一种自动化测试的异常处理装置,包括:An anomaly processing device for automated testing, comprising:
    确定模块,设置为在根据一测试脚本对一被测试设备进行自动化测试的过程中,若与被测试设备之间的连接发生异常中断,则根据所述异常中断,确定所述被测试设备恢复到预设的原始状态之后所述被测试设备需要执行的配置命令;以及Determining a module, in the process of performing an automatic test on a device under test according to a test script, if an abnormal interruption occurs in a connection with the device under test, determining that the device under test is restored according to the abnormal interruption a configuration command that the device under test needs to execute after the preset original state;
    控制模块,设置为与所述被测试设备重新连接后,控制所述被测试设备恢复到所述原始状态,并向所述被测试设备下发所述需要执行的配置命令。After the control module is configured to reconnect with the device under test, the device is controlled to be restored to the original state, and the configuration command to be executed is sent to the device under test.
  7. 根据权利要求6所述的装置,其中,所述确定模块包括:The apparatus of claim 6 wherein said determining module comprises:
    第一确定单元,设置为确定所述被测试设备在发生异常中断之前,最后一次恢复到的原始状态,并确定所述被测试设备在最后一次恢复到原始状态之后所述被测试设备需要执行的配置命令。a first determining unit, configured to determine an original state that is restored to the device under test before the abnormal interrupt occurs, and determine that the device under test needs to be executed after the device is restored to the original state for the last time. Configuration commands.
  8. 根据权利要求6所述的装置,其中,所述确定模块包括:The apparatus of claim 6 wherein said determining module comprises:
    获取单元,设置为与被测试设备之间的连接发生异常中断后,获取所述测试脚本中下发失败的配置命令;以及Obtaining a configuration command that is sent in the test script after the connection to the device under test is abnormally interrupted;
    第一确定单元,设置为根据所述下发失败的配置命令,确定所述被测试设备恢复到原始状态之后所述被测试设备需要执行的配置命令。The first determining unit is configured to determine, according to the configuration command that the delivery fails, a configuration command that the device under test needs to perform after the device under test returns to the original state.
  9. 根据权利要求6所述的装置,还包括:The apparatus of claim 6 further comprising:
    记录模块,设置为在根据一测试脚本对一被测试设备进行自动化测试的过 程中,记录根据所述测试脚本向所述被测试设备下发的配置命令。Recording module, set to automate testing of a device under test according to a test script The configuration command sent to the device under test according to the test script is recorded.
  10. 一种自动化测试系统,包括:如权利要求6-9任一项所述的自动化测试中的异常处理装置。An automated test system comprising: an abnormality processing device in an automated test according to any one of claims 6-9.
  11. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为执行权利要求1-5中任一项的方法。 A computer readable storage medium storing computer executable instructions arranged to perform the method of any of claims 1-5.
PCT/CN2017/088937 2016-07-05 2017-06-19 Abnormality processing method, apparatus and system in automation test WO2018006702A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610520556.2 2016-07-05
CN201610520556.2A CN107577591A (en) 2016-07-05 2016-07-05 A kind of method, apparatus and system of automatic test abnormal protection

Publications (1)

Publication Number Publication Date
WO2018006702A1 true WO2018006702A1 (en) 2018-01-11

Family

ID=60901400

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/088937 WO2018006702A1 (en) 2016-07-05 2017-06-19 Abnormality processing method, apparatus and system in automation test

Country Status (2)

Country Link
CN (1) CN107577591A (en)
WO (1) WO2018006702A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382048A (en) * 2018-12-28 2020-07-07 北京奇虎科技有限公司 Method and device for managing mobile equipment on real machine testing platform
CN112951316A (en) * 2021-03-31 2021-06-11 东莞记忆存储科技有限公司 Solid state disk drive-and-retract D3hotState testing method and device and computer equipment
CN116991710A (en) * 2023-06-27 2023-11-03 珠海妙存科技有限公司 Automatic test method and system, electronic equipment and storage medium thereof

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110427220B (en) * 2019-06-17 2022-08-19 深圳绿米联创科技有限公司 Configuration method and device of device command, electronic device and storage medium
CN113971059A (en) * 2020-07-22 2022-01-25 北京奇虎科技有限公司 Method, device, equipment and storage medium for recovering equipment connection state
CN116541312B (en) * 2023-07-06 2023-09-22 广汽埃安新能源汽车股份有限公司 Continuous integration test method and system for automobile software
CN117009250A (en) * 2023-09-25 2023-11-07 麒麟软件有限公司 Automatic GRUB test method and system for Linux operating system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050165974A1 (en) * 2004-01-23 2005-07-28 Nec Corporation Computer apparatus and computer system
CN101226501A (en) * 2008-02-20 2008-07-23 福建星网锐捷网络有限公司 Method and device for monitoring test
CN101989225A (en) * 2009-07-29 2011-03-23 中兴通讯股份有限公司 Method and device for automated test based on breakpoint
CN103812726A (en) * 2014-01-26 2014-05-21 烽火通信科技股份有限公司 Automated testing method and device for data communication equipment
CN106326089A (en) * 2015-06-16 2017-01-11 中兴通讯股份有限公司 Automated testing method, device and system

Family Cites Families (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2776815B2 (en) * 1987-11-18 1998-07-16 株式会社日立製作所 Failure recovery method for multiprocessor system
US5185864A (en) * 1989-06-16 1993-02-09 International Business Machines Corporation Interrupt handling for a computing system with logical devices and interrupt reset
US5630049A (en) * 1994-11-30 1997-05-13 Digital Equipment Corporation Method and apparatus for testing software on a computer network
JP2000013469A (en) * 1998-06-24 2000-01-14 Sony Corp Device and method for recovering communication equipment
JP2002044185A (en) * 2000-07-31 2002-02-08 Matsushita Electric Ind Co Ltd Communication terminal and communication fault detection method
CN1369802A (en) * 2001-02-14 2002-09-18 英业达股份有限公司 Method for recording and automatically restoring flow state
US6757634B2 (en) * 2002-06-10 2004-06-29 Lsi Logic Corporation Methods and structure for maintaining state information to resume automated test processing after reset
US7612973B2 (en) * 2005-09-01 2009-11-03 Leviton Manufacturing Co., Inc. GFCI receptacle with single button for test-reset function
CN1851466B (en) * 2005-09-30 2011-04-20 华为技术有限公司 Method for improving anti-interference capability for automation test system
CN100353327C (en) * 2005-11-07 2007-12-05 华为技术有限公司 Method for realizing product automatic test by test environment composed of test set
CN101604271A (en) * 2008-06-13 2009-12-16 英业达股份有限公司 To testing system for notebook computer
CN101414935B (en) * 2008-07-09 2011-06-22 北京星网锐捷网络技术有限公司 Method and system for generating test case
CN101546279A (en) * 2009-05-14 2009-09-30 华为技术有限公司 Device, system and method for exception processing of embedded device
CN102184137A (en) * 2011-05-16 2011-09-14 浪潮集团山东通用软件有限公司 Unattended intelligent automatic regression testing method
CN102855174B (en) * 2011-06-28 2016-06-01 北京奇虎科技有限公司 The target program progress control method that can automatically recover in automatic test and device
AU2013243923A1 (en) * 2012-04-06 2014-10-30 Security First Corp. Systems and methods for securing and restoring virtual machines
CN102779094A (en) * 2012-08-21 2012-11-14 深圳中兴网信科技有限公司 Terminal and software exception test method
CN104516809B (en) * 2013-09-26 2018-01-05 方正宽带网络服务股份有限公司 A kind of automatization test system and method
CN104239208B (en) * 2014-09-19 2017-02-15 福建星海通信科技有限公司 Recovery method for exceptions during automation execution
CN104635722B (en) * 2014-12-15 2018-01-30 上海爱数信息技术股份有限公司 A kind of abnormal power-down simulating test device
CN104461897B (en) * 2014-12-18 2017-12-12 网易(杭州)网络有限公司 A kind of method and apparatus of Application testing
CN104951348B (en) * 2015-07-16 2018-12-11 广东欧珀移动通信有限公司 A kind of interruptable recovery upgrade method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050165974A1 (en) * 2004-01-23 2005-07-28 Nec Corporation Computer apparatus and computer system
CN101226501A (en) * 2008-02-20 2008-07-23 福建星网锐捷网络有限公司 Method and device for monitoring test
CN101989225A (en) * 2009-07-29 2011-03-23 中兴通讯股份有限公司 Method and device for automated test based on breakpoint
CN103812726A (en) * 2014-01-26 2014-05-21 烽火通信科技股份有限公司 Automated testing method and device for data communication equipment
CN106326089A (en) * 2015-06-16 2017-01-11 中兴通讯股份有限公司 Automated testing method, device and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382048A (en) * 2018-12-28 2020-07-07 北京奇虎科技有限公司 Method and device for managing mobile equipment on real machine testing platform
CN111382048B (en) * 2018-12-28 2023-10-20 三六零科技集团有限公司 Management method and device for mobile equipment on true machine test platform
CN112951316A (en) * 2021-03-31 2021-06-11 东莞记忆存储科技有限公司 Solid state disk drive-and-retract D3hotState testing method and device and computer equipment
CN116991710A (en) * 2023-06-27 2023-11-03 珠海妙存科技有限公司 Automatic test method and system, electronic equipment and storage medium thereof
CN116991710B (en) * 2023-06-27 2024-04-09 珠海妙存科技有限公司 Automatic test method and system, electronic equipment and storage medium thereof

Also Published As

Publication number Publication date
CN107577591A (en) 2018-01-12

Similar Documents

Publication Publication Date Title
WO2018006702A1 (en) Abnormality processing method, apparatus and system in automation test
CN109510742B (en) Server network card remote test method, device, terminal and storage medium
CN104572422A (en) Memory monitoring achievement method based on startup and shutdown of Linux system
CN103973858B (en) The Auto-Test System of mobile terminal
US20180322029A1 (en) Method and apparatus for automatic cross-system program debugging
WO2017012219A1 (en) Software test method, apparatus and system
CN103973515A (en) Network card stability testing method
CN105068900A (en) Test method for remote control server cold reboot
US8751868B2 (en) Control server and method for switching running of test programs stored in multiple storage mediums of test server
CN111949551A (en) Application program testing method, device, equipment and storage medium
CN111258591B (en) Program deployment task execution method, device, computer equipment and storage medium
WO2016082543A1 (en) Device testing method and testing device
US9612935B2 (en) Enhanced resiliency testing by enabling state level control for request
CN110990289B (en) Method and device for automatically submitting bug, electronic equipment and storage medium
US7882399B2 (en) Intelligent job functionality
CN109150587B (en) Maintenance method and device
WO2016201997A1 (en) Automatic testing method, device and system
CN110134558B (en) Method and device for detecting server
CN101706752B (en) Method and device for in-situ software error positioning
CN110633221B (en) Fuzzy test automation vulnerability positioning method
CN110413437B (en) Network namespace exception handling method, device and equipment and readable storage medium
CN107612786B (en) Method and system for testing router
CN116166536A (en) Test method, test device, electronic equipment and storage medium
CN106776182B (en) Method for automatically identifying work station and executing corresponding script
CN103064789B (en) A kind of automated testing method of software control

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17823514

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17823514

Country of ref document: EP

Kind code of ref document: A1