WO2017028574A1 - 一种路由器测试方法和测试装置 - Google Patents

一种路由器测试方法和测试装置 Download PDF

Info

Publication number
WO2017028574A1
WO2017028574A1 PCT/CN2016/082655 CN2016082655W WO2017028574A1 WO 2017028574 A1 WO2017028574 A1 WO 2017028574A1 CN 2016082655 W CN2016082655 W CN 2016082655W WO 2017028574 A1 WO2017028574 A1 WO 2017028574A1
Authority
WO
WIPO (PCT)
Prior art keywords
router
executable file
test
subfile
tested
Prior art date
Application number
PCT/CN2016/082655
Other languages
English (en)
French (fr)
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 WO2017028574A1 publication Critical patent/WO2017028574A1/zh

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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks

Definitions

  • the present application relates to, but is not limited to, the field of communications, and in particular, to a router testing method and testing device.
  • a router In the field of communication, a router is responsible for connecting multiple networks or network segments. It can "translate" data information between different networks or network segments, so it is very important that the router can work normally in the communication network. In order to ensure the normal operation of the router, it needs to be tested.
  • the test of the router adopts the manual test method, but the manual test may have problems such as cumbersome tasks, large workload, low test efficiency, inconsistent test results due to different testers, and high labor costs.
  • the main technical problem to be solved by the embodiments of the present invention is to provide a router test method and a test device, which solves the problems of cumbersome tasks, large workload, low test efficiency, easy test error, and high cost of the related manual test router. .
  • a router automatic test method including:
  • the test device obtains an executable file for testing.
  • the test device loads the executable file onto the router to be tested.
  • the test device starts the executable file on the router to be tested.
  • the test device obtains the running result of the executable file.
  • the test device determines whether the execution of the executable file is successful according to the running result; when it is determined that the executable file is successfully executed, determining that the router is normal; when determining that the executable file is unsuccessful, determining the router malfunction.
  • the obtaining, by the testing device, the executable file comprises: the testing device receiving the executable file preset by the user, or acquiring the executable file from a version machine that generates the executable file.
  • the testing device loads the executable file onto the router to be tested
  • the test device updates the old executable file on the router to be tested into the executable file.
  • the running result includes a running log record of the executable file.
  • the running result of the test device acquiring the executable file includes:
  • the executable file includes a target protocol test subfile and/or a target program test subfile.
  • the method further includes: after the testing device determines, according to the running result, whether the execution of the executable file is successful, saving and/or displaying the determination result.
  • a test device comprising:
  • Execute the file acquisition module set to get the executable file for testing.
  • Loading the module set to load the executable file onto the router to be tested.
  • the startup module is configured to start the executable file on the router to be tested.
  • the result obtaining module is set to obtain a running result of the executable file.
  • a processing module configured to determine whether the execution of the executable file is successful according to the running result; determining that the router is normal when determining that the executable file is executed successfully; determining that the executable file is unsuccessful when determining that the executable file is unsuccessful The router is faulty.
  • the execution file obtaining module includes: a receiving submodule configured to receive an executable file preset by the user; and/or an obtaining submodule configured to obtain the executable file from a version machine that generates the executable file .
  • loading, by the loading module, the executable file on the to-be-tested router includes: updating an old executable file on the to-be-tested router to the executable file.
  • the running result includes a running log record of the executable file.
  • the result obtaining module includes a log obtaining submodule, and the log obtaining submodule is configured to obtain the running log record from the to-be-tested router.
  • the receiving submodule includes a first protocol test subfile obtaining submodule and/or a first program testing subfile obtaining submodule.
  • the obtaining submodule includes a second test subfile obtaining submodule and/or a second program testing subfile obtaining submodule.
  • the executable file includes a target protocol test subfile and/or a target program test subfile.
  • the first protocol test subfile obtaining submodule is configured to obtain a target protocol test subfile.
  • the first program test subfile obtaining submodule is set to acquire a target program test subfile.
  • the second protocol test subfile obtaining submodule is configured to obtain a target protocol test subfile.
  • the second program test subfile obtaining submodule is set to acquire a target program test subfile.
  • the testing device further includes: a saving module and/or a display module; the saving module is configured to save a determination result of the processing module; and the display module is configured to determine the processing module The results are displayed.
  • a terminal comprising a router test device as described above.
  • a computer readable storage medium storing computer executable instructions that, when executed by a processor, implement the router test method.
  • the beneficial effects of the embodiment of the present invention are: the router testing method and the testing device provided by the embodiment of the present invention, the executable file for testing can be obtained by the testing device and loaded onto the router to be tested, and the testing device starts on the router to be tested. Executing a file, obtaining a running result of the executable file, determining whether the execution of the executable file is successful according to the running result, determining that the router is normal when determining that the executable file is successfully executed; and determining that the executable file is not executed Upon success, the router is determined to be faulty; automatic testing of the router is completed.
  • the method for obtaining, loading, starting, and obtaining and executing the execution file of the execution of the router in the embodiment of the present invention can be automatically completed by the testing device, and does not require manual participation, thereby reducing the manpower invested in the router test.
  • the labor cost is reduced, and the above test process is automatically completed by the test device, and the manual operation is simpler, the test efficiency and the accuracy of the test can be guaranteed and improved.
  • FIG. 1 is a schematic flowchart of a router automatic testing method according to Embodiment 1 of the present invention
  • FIG. 2 is a schematic structural diagram of a testing apparatus according to Embodiment 2 of the present invention.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • the embodiment provides an automated test method for the router, and the method of the related manual test has the advantages of the test cost, the low test efficiency, and the good test accuracy.
  • the method is shown in FIG. 1 and includes step S102. -S105:
  • the test device acquires an executable file for testing.
  • test device loads the executable file onto the router to be tested.
  • test device starts an executable file on the router to be tested.
  • test device obtains a running result of the executable file.
  • the testing device determines whether the execution of the executable file is successful according to the running result. When it is determined that the executable file is successfully executed, determining that the router is normal; when determining that the executable file is unsuccessful, determining that the router is faulty.
  • the manner in which the test device obtains the executable file in the above S101 may be flexibly set according to the requirements of the application scenario.
  • one or more of the following acquisition modes may be adopted:
  • Method 1 The test device directly receives the executable file preset by the user; that is, the user can directly input the corresponding executable file on the test device, and the executable file can be flexibly customized by the user according to his own needs, for example, the user can Customize your own needs for what you need to test and what you want to achieve;
  • the test device can also obtain the executable file from the version machine for generating the executable file; it should be understood that the version machine in this embodiment can automatically complete the generation of the executable file according to the preset rules.
  • Real-time generation of executable files can be performed according to corresponding instruction rules input by the user in real time.
  • test device acquires the executable file in any manner, and the format of the executable file may be customized according to the format supported by the router to be tested, or the test device obtains the format version that is not supported by the router to be tested.
  • the format conversion is performed, and the format version that is not supported by the router to be tested is converted into the format version supported by the router to be tested.
  • the manner in which the S102 test device loads the executable file on the router to be tested may be: the testing device updates the old executable file on the router to be tested to the latest acquired executable file in S101.
  • the update process includes, but is not limited to, the test device first deleting the old executable file on the router and then copying the new executable file to the router. It should be understood that when the latest acquired executable file is loaded on the router, the old executable file on the router may not be deleted, as long as the router can recognize and run the latest version of the executable while running. Line files are fine.
  • the manner in which the S103 test device starts the executable file in the router to be tested may be initiated by the test device remotely, or the local startup on the router may be completed by adding a corresponding startup script to the executable file.
  • the S104 test device obtains the running result of the executable file on the router to be tested, it may be obtained during the execution of the executable file, or may be uniformly acquired after the execution of the executable file is completed.
  • the running result obtained by the testing device in this embodiment may include an operation log record of the executable file running on the router to be tested.
  • the content that is, the test content
  • the content recorded in the running log record corresponds to the test content in the executable file.
  • the executable file in this embodiment may include a target protocol test subfile and/or a target program test subfile, and the corresponding running log record includes various records and/or target program running results that reflect the running result of the target protocol.
  • the target protocol in this embodiment refers to various protocols to be tested, such as TCP/IP protocol, FTP protocol, TTP protocol, MPPP protocol, and the like; the target program in this embodiment refers to various applications to be tested.
  • the corresponding running log records include but are not limited to: slot number, channel number, maximum packet length, and checksum.
  • test file can be analyzed according to the content included in the running log record, and the function and performance status of the router to be tested can be determined.
  • the embodiment may save and/or display, save and/or display the result of the execution of the executable file being successful or failed after obtaining the determination result in the above S105. It can be done on the test unit or on an external display.
  • the judgment result may be notified to the person in charge through a communication system (such as a mail system or a short message system) built in the test device.
  • a communication system such as a mail system or a short message system
  • the above embodiment provides an automated test method for implementing a router.
  • the acquisition, loading, startup, and acquisition and execution of the execution result are automatically completed by the test device, thereby reducing the manpower invested in the router test and reducing the labor. Cost; automatic completion of the above test process by the test device is relatively simpler than manual operation, and the test efficiency is improved;
  • the analysis process is completed by the test device, which avoids the inconsistency of test results caused by different testers during manual test, so that the test accuracy and test quality are guaranteed and improved.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • a test apparatus 20 includes:
  • the execution file obtaining module 201 is configured to acquire an executable file for testing.
  • the load module 202 is configured to load the executable file onto the router to be tested.
  • the startup module 203 is configured to start the executable file on the router to be tested.
  • the result obtaining module 204 is configured to obtain a running result of the executable file.
  • the processing module 205 is configured to determine, according to the running result, whether the execution of the executable file is successful; when it is determined that the execution of the executable file is successful, determining that the router is normal; when determining that the execution of the executable file is unsuccessful, Determine that the router is faulty.
  • the manner in which the executable file obtaining module 201 obtains the executable file may be flexibly set according to the requirements of the application scenario. For example, one or more of the following acquisition modes may be adopted:
  • the execution file obtaining module 201 includes a receiving sub-module 2011, and the receiving sub-module 2011 is configured to directly receive an executable file preset by the user; that is, the user can input the corresponding executable file directly through the receiving sub-module 2011,
  • the execution file can be flexibly customized by the user according to his own needs. For example, the user can customize the content to be tested and the desired effect according to his own needs.
  • the execution file acquisition module 201 includes an acquisition sub-module 2012, which can obtain an executable file from a version machine for generating an executable file; it should be understood that the version machine in this embodiment can be based on The set rules automatically complete the execution of the executable file, and the real-time generation of the executable file can also be performed according to the corresponding instruction rules input by the user in real time.
  • the executable file obtaining module 201 obtains the executable file in any manner, and the format of the executable file may be customized according to the format supported by the router to be tested, or the test device acquires that the router to be tested does not support.
  • the format version is formatted, and the format version that is not supported by the router to be tested is converted to the format version supported by the router to be tested.
  • the loading module 202 is configured to update the old executable file on the router to be tested to the executable file newly acquired by the execution file obtaining module 201.
  • the update process includes, but is not limited to, the test device first deletes the old executable file on the router, and then copies the new executable file to On the router. It should be understood that when the latest acquired executable file is loaded on the router, the old executable file on the router may not be deleted, as long as the router can recognize and run the latest version of the executable program at runtime. The file is fine.
  • the result obtaining module 204 obtains the running result of the executable file on the router to be tested, the result may be obtained during the execution of the executable file, or may be uniformly acquired after the executable file is executed.
  • the running result obtained by the result obtaining module 204 in this embodiment may include the running log record of the executable file running on the router to be tested.
  • the content that is, the test content
  • the content recorded in the running log record corresponds to the test content in the executable file.
  • the executable file in this embodiment may include a target protocol test subfile and/or a target program test subfile, and the corresponding running log record includes various records and/or target program running results that reflect the running result of the target protocol.
  • the target protocol in this embodiment refers to various protocols to be tested, such as TCP/IP protocol, FTP protocol, TTP protocol, MPPP protocol, and the like; the target program in this embodiment refers to various applications to be tested.
  • the corresponding running log records include but are not limited to: slot number, channel number, maximum packet length, and checksum.
  • the receiving submodule 2011 includes a first protocol test subfile obtaining submodule 20111 and/or a first program test subfile obtaining submodule 20112; the first protocol testing subfile obtaining submodule 20111 is configured to obtain the foregoing target protocol test.
  • the first program test subfile obtaining submodule 20112 is configured to obtain the above target program test subfile; accordingly, the obtaining submodule 2012 includes the second test subfile obtaining submodule 20121 and/or the second program test subfile obtaining The sub-module 20122; the second protocol test sub-file obtaining sub-module 20121 is set to obtain the above-mentioned target protocol test sub-file; the second program test sub-file obtaining sub-module 20122 is set to obtain the above-mentioned target program test sub-file.
  • the processing module 205 may analyze the running status of the executable file on the router to be tested according to the content included in the running log record obtained by the result obtaining module 204, and further determine the function and performance status of the to-be-tested router.
  • the testing apparatus 20 of the embodiment further includes a saving module 206 configured to save information on whether the execution of the executable file is successful or not; and/or the display module 207 is set to be Whether the executable file execution succeeds or fails. The line is displayed.
  • the save and / or display can also be performed on an external display.
  • the testing device 20 of the embodiment further includes a communication module 208, configured to notify the responsible person of the judgment result obtained by the processing module 205, and the communication manner is set according to an actual application situation, such as a communication method using mail or short message. .
  • the foregoing embodiment provides a testing device, which automatically performs acquisition, loading, startup, and acquisition and analysis of execution results when testing a router, and does not require manual participation, thereby reducing manpower invested in router testing.
  • the labor cost is reduced; the test process is automatically completed, the manual operation is simpler, the test efficiency is improved; and since the analysis process is completed by the test device, the test results are inconsistent due to different testers during manual test. The problem is to ensure the test accuracy and test quality are guaranteed.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • This embodiment provides an application scenario as an example, and describes an embodiment of the present invention in detail.
  • the testing device in this embodiment can be disposed in a plurality of terminals, so that the terminal can implement the testing function of the router.
  • the test terminal adopts a Windows PC as an example.
  • the executable file in this embodiment may be generated by a special version machine, and in this embodiment, a Linux PC is used as the version machine, and the Windows PC is available from the Linux PC.
  • the executable file for the test is loaded onto the router to be tested.
  • the test device in the Windows PC in this embodiment can be implemented by using a corresponding software module. The following is an example of an automated process for testing a test router in a detailed process, which includes steps S301-S305:
  • S301 Windows PC runs the ssh plugin of the Jenkins software to log in to the Linux PC, then sends the svn updata command to the Linux PC to update the Linux PC, then logs into the makefile directory of the code, compiles the version, and obtains the executable executable. file.
  • S302 The Windows PC logs into the directory of the .bin file generated in the Linux PC, and calls the scp2.exe of Windows through jenkins to copy the .bin file in the Linux PC to the ftp directory of the Windows PC.
  • S303 The telnet plugin of the Jenkins software running on the Windows PC logs in to the router to be tested, that is, the Windows PC logs into the router to be tested through the telnet ip address to implement the control of the router to be tested.
  • S304 The Windows PC copies the .bin file copied from the Linux PC to the test by ftp. On the test router, replace the old executable file of the router to be tested.
  • S305 The Windows PC controls the router to be tested to restart, and ensures that the router to be tested uses the latest executable file.
  • the Windows PC obtains the running log record after the unit test function is executed from the router to be tested, and may be acquired during the execution of the unit test function, or may be uniformly acquired after the unit test function is executed.
  • S308 The Windows PC runs the analysis script through jenkins, analyzes the running log record after the unit test function is executed, and judges whether the unit test function is executed successfully or fails to execute, and then the execution result of the execution success or the execution failure is finally saved in the xml file. .
  • the above embodiment takes a specific application scenario as an example to specifically describe the automatic measurement process of the router.
  • the execution file is acquired, loaded, started, and the execution result is obtained and analyzed by the Jenkins software.
  • the Windows PC is completed without manual intervention, thus reducing the manpower invested in the router test, reducing the labor cost and improving the test efficiency; and since the judgment result is obtained by the Windows PC analysis run log record, the manual test is avoided.
  • the test results of different test results are inconsistent, so that the test accuracy and test quality are guaranteed and improved.
  • a computer readable storage medium storing computer executable instructions that, when executed by a processor, implement the router test method.
  • all or part of the steps of the foregoing embodiments may also be implemented by using an integrated circuit, and the steps may be separately fabricated into integrated circuit modules, or multiple modules thereof or The steps are made into a single integrated circuit module.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • the device/function module/functional unit in the above embodiment When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the method for obtaining, loading, starting, and obtaining and executing the execution file of the program when testing the router in the embodiment of the present invention can be automatically completed by the testing device, and does not require manual participation, thereby reducing the manpower invested in the router test and reducing Labor cost, and the above test process is automatically completed by the test device, and the manual operation is simpler, the test efficiency and the accuracy of the test can be guaranteed and improved.

Abstract

本申请公开了一种由器自动化测试方法和测试装置,可通过测试装置获取测试用的可执行文件,将该可执行文件加载到待测试路由器上,该测试装置启动待测试路由器上的可执行文件,获取可执行文件的运行结果,根据该运行结果判断可执行文件执行是否成功,当判定所述可执行文件执行成功时,确定所述路由器正常;当判定所述可执行文件执行不成功时,确定所述路由器故障。

Description

一种路由器测试方法和测试装置 技术领域
本申请涉及但不限于通信领域,尤其涉及一种路由器测试方法和测试装置。
背景技术
在通信领域,路由器承担着连接多个网络或网段的功能,它能将不同网络或网段之间的数据信息进行“翻译”,所以路由器是否能正常工作在通信网络中是十分重要的。为了保证路由器的正常工作,需要对其进行测试。
目前,对路由器的测试采用的是人工测试的方法,但人工测试时会存在任务繁琐、工作量大、测试效率低下和因测试人员不同而导致的测试结果不一致以及人工成本高等问题。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本发明实施例要解决的主要技术问题是,提供一种路由器测试方法和测试装置,解决相关人工测试路由器存在的任务繁琐、工作量大、测试效率低、测试结果易出现错误以及成本高的问题。
一种路由器自动化测试方法,包括:
测试装置获取测试用的可执行文件。
测试装置将所述可执行文件加载到待测试路由器上。
测试装置启动所述待测试路由器上的所述可执行文件。
测试装置获取所述可执行文件的运行结果。
测试装置根据所述运行结果判断所述可执行文件执行是否成功;当判定所述可执行文件执行成功时,确定所述路由器正常;当判定所述可执行文件执行不成功时,确定所述路由器故障。
可选地,所述测试装置获取可执行文件包括:所述测试装置接收用户预置的可执行文件,或从生成可执行文件的版本机上获取所述可执行文件。
可选地,所述测试装置将所述可执行文件加载到所述待测试路由器上包 括:所述测试装置将所述待测试路由器上旧的可执行文件更新为所述可执行文件。
可选地,所述运行结果包括所述可执行文件的运行日志记录。
所述测试装置获取所述可执行文件的运行结果包括:
从所述待测试路由器获取所述运行日志记录。
可选地,所述可执行文件包括目标协议测试子文件和/或目标程序测试子文件。
可选地,所述方法还包括:在所述测试装置根据所述运行结果判断出所述可执行文件执行是否成功后,将判断结果进行保存和/或显示。
一种测试装置,包括:
执行文件获取模块,设置为获取测试用的可执行文件。
加载模块,设置为将所述可执行文件加载到待测试路由器上。
启动模块,设置为启动所述待测试路由器上的所述可执行文件。
结果获取模块,设置为获取所述可执行文件的运行结果。
处理模块,设置为根据所述运行结果判断所述可执行文件执行是否成功;当判定所述可执行文件执行成功时,确定所述路由器正常;当判定所述可执行文件执行不成功时,确定所述路由器故障。
可选地,所述执行文件获取模块包括:接收子模块,设置为接收用户预置的可执行文件;和/或获取子模块,设置为从生成可执行文件的版本机上获取所述可执行文件。
可选地,所述加载模块将所述可执行文件加载到所述待测试路由器上包括:将所述待测试路由器上旧的可执行文件更新为所述可执行文件。
可选地,所述运行结果包括所述可执行文件的运行日志记录。
所述结果获取模块包括日志获取子模块,所述日志获取子模块设置为从所述待测试路由器获取所述运行日志记录。
可选地,所述接收子模块包括第一协议测试子文件获取子模块和/或第一程序测试子文件获取子模块。
所述获取子模块包括第二测试子文件获取子模块和/或第二程序测试子文件获取子模块。
所述可执行文件包括目标协议测试子文件和/或目标程序测试子文件。
所述第一协议测试子文件获取子模块设置为获取目标协议测试子文件。
所述第一程序测试子文件获取子模块设置为获取目标程序测试子文件。
所述第二协议测试子文件获取子模块设置为获取目标协议测试子文件。
所述第二程序测试子文件获取子模块设置为获取目标程序测试子文件。
可选地,所述测试装置还包括:保存模块和/或显示模块;所述保存模块设置为对所述处理模块的判断结果进行保存;所述显示模块,设置为对所述处理模块的判断结果进行显示。
一种终端,包括如上所述的路由器测试装置。
一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现所述的路由器测试方法。
本发明实施例的有益效果是:本发明实施例提供的路由器测试方法和测试装置,可通过测试装置获取测试用的可执行文件并加载到待测试路由器上,该测试装置启动待测试路由器上的可执行文件,获取可执行文件的运行结果,根据该运行结果判断可执行文件执行是否成功,当判定所述可执行文件执行成功时,确定所述路由器正常;当判定所述可执行文件执行不成功时,确定所述路由器故障;完成对路由器的自动测试。可见,本发明实施例方案对路由器进行测试时执行文件的获取、加载、启动以及执行结果的获取和分析都可通过测试装置自动完成,并不需要人工参与,因此可以减少路由器测试所投入的人力,降低人工成本,且通过测试装置自动完成上述测试过程相对人工操作更为简单、测试效率以及测试的准确度都能得到保证和提高。
附图概述
图1为本发明实施例一提供的路由器自动化测试方法流程示意图;
图2为本发明实施例二提供的测试装置结构示意图。
本发明的实施方式
下文中将参考附图并结合实施例进行详细描述。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
实施例一:
本实施例提供一种可实现对路由器完成自动化测试方法,其相对相关人工测试的方式具有测试成本,低测试效率高,测试准确性好的优点,该方法请参见图1所示,包括步骤S102-S105:
S101:测试装置获取测试用的可执行文件。
S102:测试装置将可执行文件加载到待测试路由器上。
S103:测试装置启动待测试路由器上的可执行文件。
S104:测试装置获取可执行文件的运行结果。
S105:测试装置根据运行结果判断可执行文件执行是否成功;当判定所述可执行文件执行成功时,确定所述路由器正常;当判定所述可执行文件执行不成功时,确定所述路由器故障。
可选地,上述S101中测试装置获取可执行文件的方式可根据应用场景的需求灵活设定,比如:可以采用以下获取方式中的一种或多种:
方式一:测试装置直接接收用户预置的可执行文件;也即用户可直接在测试装置上输入相应的可执行文件,该可执行文件可由用户根据自身需求进行灵活的自定义,例如用户可根据自己的需求对所需要测试的内容以及所要求达到的效果等进行自定义;
方式二:测试装置还可从用于生成可执行文件的版本机上获取可执行文件;应当理解的是,本实施例中的版本机可以根据预设好的规则自动完成可执行文件的生成,也可以根据用户实时输入的相应指令规则进行可执行文件的实时生成。
应当理解的是,测试装置不管采用何种方式获取可执行文件,该可执行文件的格式可以根据待测试路由器所支持的格式进行定制,或者由测试装置获取到该待测试路由器不支持的格式版本时进行格式转换,将该待测试路由器不支持的格式版本转换为该待测试路由器支持的格式版本。
可选地,上述S102测试装置将可执行文件加载到待测试路由器上的方式可选为:测试装置将待测试路由器上旧的可执行文件更新为S101中最新获取的可执行文件。更新的过程包括但不限于测试装置先删除路由器上旧的可执行文件,然后将新的可执行文件拷贝到路由器上。应当理解的是,在路由器上加载最新获取的可执行文件时,对于该路由器上旧的可执行文件也可不对其进行删除,只要能保证该路由器运行时能识别并正常运行最新版本的可执 行文件即可。
可选地,上述S103测试装置启动待测试路由器中的可执行文件的方式可以采用由测试装置远程启动的方式,也可以采用在可执行文件中加入相应的启动脚本完成在路由器上的本地启动。
可选地,上述S104测试装置获取待测试路由器上可执行文件的运行结果时,其可以在该可执行文件执行过程中获取,也可以在该可执行文件执行完成后再统一获取。
本实施例中测试装置所获取的运行结果可包含该可执行文件在待测试路由器上运行的运行日志记录。正如前面所述,本实施例中的可执行文件包含的内容(也即测试内容)可根据用户需求自定义,运行日志记录中所记录的内容则与该可执行文件中的测试内容相对应。例如,本实施例中的可执行文件可包含目标协议测试子文件和/或目标程序测试子文件,对应的运行日志记录中则包含体现目标协议运行结果的各种记录和/或目标程序运行结果的各种记录。本实施例中的目标协议是指待测的各种协议,例如TCP/IP协议、FTP协议、TTP协议、MPPP协议等等;本实施例中的目标程序是指待测的各种应用程序。对应的运行日志记录包括但不限于:槽位号、信道号、最大数据包长度、校验和。
上述S105中测试装置获取到运行日志记录后,即可根据该运行日志记录中包含的内容分析出可执行文件在待测试路由器上的运行情况,进而可以判断该待测试路由器的功能和性能状况。
为了便于用户查看或者后续进行积累分析等,本实施例在上述S105获得判断结果后,还可将可执行文件执行是成功还是失败的判断结果进行保存和/或显示,保存和/或显示的过程可以在测试装置上进行,也可以在外部显示器上进行。
可选地,测试装置得到判断结果后还可以通过内设在测试装置上的通信系统(如邮件系统或短信系统)将判断结果通知给负责人。
上述实施例提供了实现路由器自动化测试方法,将对路由器进行测试时执行文件的获取、加载、启动以及执行结果的获取和分析都通过测试装置自动完成,因此减少路由器测试时投入的人力,降低人工成本;通过测试装置自动完成上述测试过程相对人工操作更为简单,测试效率得到了提高;且由 于分析过程是由测试装置完成,避免了人工测试时由于测试人员不同导致的测试结果不一致的问题,使测试准确度和测试质量都得到保证和提高。
实施例二:
如图2,为本发明另一实施例提供的测试装置20包括:
执行文件获取模块201,设置为获取测试用的可执行文件。
加载模块202,设置为将所述可执行文件加载到待测试路由器上。
启动模块203,设置为启动所述待测试路由器上的所述可执行文件。
结果获取模块204,设置为获取所述可执行文件的运行结果。
处理模块205,设置为根据所述运行结果判断所述可执行文件执行是否成功;当判定所述可执行文件执行成功时,确定所述路由器正常;当判定所述可执行文件执行不成功时,确定所述路由器故障。
可选地,执行文件获取模块201获取可执行文件的方式可根据应用场景的需求灵活设定,比如:可以采用以下获取方式中的一种或多种:
方式一:执行文件获取模块201包括接收子模块2011,该接收子模块2011设置为直接接收用户预置的可执行文件;也即用户可直接通过接收子模块2011输入相应的可执行文件,该可执行文件可由用户根据自身需求进行灵活的自定义,例如用户可根据自己的需求对所需要测试的内容以及所要求达到的效果等进行自定义。
方式二:执行文件获取模块201包括获取子模块2012,该获取子模块2012可以从用于生成可执行文件的版本机上获取可执行文件;应当理解的是,本实施例中的版本机可以根据预设好的规则自动完成可执行文件的生成,也可以根据用户实时输入的相应指令规则进行可执行文件的实时生成。
应当理解的是,执行文件获取模块201不管采用何种方式获取可执行文件,该可执行文件的格式可以根据待测试路由器所支持的格式进行定制,或者由测试装置获取到该待测试路由器不支持的格式版本时进行格式转换,将该待测试路由器不支持的格式版本转换为该待测试路由器支持的格式版本。
可选地,上述加载模块202设置为将待测试路由器上旧的可执行文件更新为执行文件获取模块201最新获取的可执行文件。更新的过程包括但不限于测试装置先删除路由器上旧的可执行文件,然后将新的可执行文件拷贝到 路由器上。应当理解的是,在路由器上加载最新获取的可执行文件时,对于该路由器上旧的可执行文件也可不对其进行删除,只要能保证该路由器运行时能识别并正常运行最新版本的可执行文件即可。
可选地,结果获取模块204获取待测试路由器上可执行文件的运行结果时,可以在该可执行文件执行过程中获取,也可以在该可执行文件执行完成后再统一获取。
该本实施例中结果获取模块204所获取的运行结果可包含该可执行文件在待测试路由器上运行的运行日志记录。正如前面所述,本实施例中的可执行文件包含的内容(也即测试内容)可根据用户需求自定义,运行日志记录中所记录的内容则与该可执行文件中的测试内容相对应。例如,本实施例中的可执行文件可包含目标协议测试子文件和/或目标程序测试子文件,对应的运行日志记录中则包含体现目标协议运行结果的各种记录和/或目标程序运行结果的各种记录。本实施例中的目标协议是指待测的各种协议,例如TCP/IP协议、FTP协议、TTP协议、MPPP协议等等;本实施例中的目标程序是指待测的各种应用程序。对应的运行日志记录包括但不限于:槽位号、信道号、最大数据包长度、校验和。
可选地,接收子模块2011包括第一协议测试子文件获取子模块20111和/或第一程序测试子文件获取子模块20112;第一协议测试子文件获取子模块20111设置为获取上述目标协议测试子文件;第一程序测试子文件获取子模块20112设置为获取上述目标程序测试子文件;相应地,获取子模块2012包括第二测试子文件获取子模块20121和/或第二程序测试子文件获取子模块20122;第二协议测试子文件获取子模块20121设置为获取上述目标协议测试子文件;第二程序测试子文件获取子模块20122设置为获取上述目标程序测试子文件。
可选地,处理模块205可根据结果获取模块204获取的运行日志记录中包含的内容分析出可执行文件在待测试路由器上的运行情况,进而可以判断该待测试路由器的功能和性能状况。
为了便于用户查看或者后续进行积累分析等,本实施例的测试装置20还包括保存模块206,设置为对可执行文件执行是成功还是失败的信息进行保存;和/或显示模块207,设置为对可执行文件执行是成功还是失败的信息进 行显示。当然保存和/或显示也可以在外部显示器上进行。
可选地,本实施例的测试装置20还包括通信模块208,设置为将处理模块205得到的判断结果通知给负责人,通信方式是可以根据实际应用情况设置,比如采用邮件或短信的通信方式。
上述实施例提供了测试装置,由该测试装置自动完成对路由器进行测试时执行文件的获取、加载、启动以及执行结果的获取和分析,并不需要人工参与,因此减少路由器测试时投入的人力,降低人工成本;通过测试装置自动完成对测试过程相对人工操作更为简单,测试效率得到了提高;且由于分析过程是由测试装置完成,避免了人工测试时由于测试人员不同导致的测试结果不一致的问题,使测试准确度和测试质量都得到保证和提高。
实施例三:
本实施例提供一种应用场景为例,对本发明实施例进行详细的示例说明。
本实施例中的测试装置可设置于多种终端中,使得该终端可以实现路由器的测试功能。本实施例以测试终端采用Windows PC为例进行说明,本实施例中的可执行文件可由专门的版本机生成,且在本实施例中以Linux PC作为该版本机,Windows PC可从Linux PC上获取测试用的可执行文件加载到待测试路由器上。本实施例中Windows PC中的测试装置可以采用相应的软件模块实现。下面以一个详细流程对待测试路由器的自动化测过过程为例进行说明,该过程包括步骤S301-S305:
S301:Windows PC运行jenkins软件的ssh插件登录到Linux PC上,然后向Linux PC发送svn updata命令让Linux PC进行代码更新,然后登陆到代码的makefile目录下,进行版本编译,得到待测的可执行文件.
S302:Windows PC登录到在Linux PC中生成的可执行文件即.bin文件的目录下,通过jenkins调用Windows的scp2.exe,把Linux PC中的.bin文件拷贝到Windows PC的ftp目录中。
S303:Windows PC运行jenkins软件的telnet插件登录到待测试路由器上,即Windows PC通过telnet ip地址的方式登陆待测试路由器来实现对待测试路由器的控制。
S304:Windows PC通过ftp把从Linux PC拷贝的.bin文件再拷贝到待测 试路由器上,更换待测试路由器的旧的可执行文件。
S305:Windows PC控制待测试路由器重启,确保待测试路由器使用的是最新的可执行文件。
S306:Windows PC通过jenkins软件调用待测试路由器上新的可执行文件里的单元测试函数,进行自动化测试。
S307:Windows PC从待测试路由器上获取单元测试函数执行后的运行日志记录,可以在该单元测试函数执行过程中获取,也可以待该单元测试函数执行完成后再统一获取。
S308:Windows PC通过jenkins运行分析脚本,分析单元测试函数执行后的运行日志记录,从而判断单元测试函数是执行成功还是执行失败,然后将执行成功还是执行失败的判断结果最后保存结果到xml文件中。
S309:Windows PC通过执行cmd命令copy,把xml文件拷贝到显示判断结果的看板的目录下,显示判断结果。
S310:Windows PC通过邮件或短信将判断结果通知给相应的负责人。
上述实施例以具体的应用场景为例对路由器的自动化测过过程做了具体的说明,对路由器进行测试时执行文件的获取、加载、启动以及执行结果的获取和分析都是由装载了jenkins软件的Windows PC完成的,不需要人工参与,因此减少路由器测试时投入的人力,降低人工成本,提高了测试效率;且由于判断结果是由Windows PC分析运行日志记录得到的,避免了人工测试时由于测试人员不同导致的测试结果不一致的问题,使测试准确度和测试质量都得到保证和提高。
一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现所述的路由器测试方法。
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或 步骤制作成单个集成电路模块来实现。
上述实施例中的装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。
上述实施例中的装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。
工业实用性
本发明实施例方案对路由器进行测试时执行文件的获取、加载、启动以及执行结果的获取和分析都可通过测试装置自动完成,并不需要人工参与,因此可以减少路由器测试所投入的人力,降低人工成本,且通过测试装置自动完成上述测试过程相对人工操作更为简单、测试效率以及测试的准确度都能得到保证和提高。

Claims (14)

  1. 一种路由器测试方法,包括:
    测试装置获取测试用的可执行文件;
    所述测试装置将所述可执行文件加载到待测试路由器上;
    所述测试装置启动所述待测试路由器上的所述可执行文件;
    所述测试装置获取所述可执行文件的运行结果;
    所述测试装置根据所述运行结果判断所述可执行文件执行是否成功;当判定所述可执行文件执行成功时,确定所述路由器正常;当判定所述可执行文件执行不成功时,确定所述路由器故障。
  2. 如权利要求1所述的路由器测试方法,其中,所述测试装置获取可执行文件包括:所述测试装置接收用户预置的可执行文件,或从生成可执行文件的版本机上获取所述可执行文件。
  3. 如权利要求1所述的路由器测试方法,其中,所述测试装置将所述可执行文件加载到所述待测试路由器上包括:所述测试装置将所述待测试路由器上旧的可执行文件更新为所述可执行文件。
  4. 如权利要求1-3任一项所述的路由器测试方法,其中,所述运行结果包括所述可执行文件的运行日志记录;
    所述测试装置获取所述可执行文件的运行结果包括:
    从所述待测试路由器获取所述运行日志记录。
  5. 如权利要求1-3任一项所述路由器测试的方法,其中,所述可执行文件包括目标协议测试子文件和/或目标程序测试子文件。
  6. 如权利要求1-3任一项所述的路由器测试方法,所述方法还包括:在所述测试装置根据所述运行结果判断出所述可执行文件执行是否成功后,将判断结果进行保存和/或显示。
  7. 一种路由器测试装置,包括:
    执行文件获取模块,设置为获取测试用的可执行文件;
    加载模块,设置为将所述可执行文件加载到待测试路由器上;
    启动模块,设置为启动所述待测试路由器上的所述可执行文件;
    结果获取模块,设置为获取所述可执行文件的运行结果;
    处理模块,设置为根据所述运行结果判断所述可执行文件执行是否成功; 当判定所述可执行文件执行成功时,确定所述路由器正常;当判定所述可执行文件执行不成功时,确定所述路由器故障。
  8. 如权利要求7所述的路由器测试装置,其中,所述执行文件获取模块包括:接收子模块,设置为接收用户预置的可执行文件;和/或获取子模块,设置为从生成可执行文件的版本机上获取可执行文件。
  9. 如权利要求7所述的路由器测试装置,其中,所述加载模块将所述可执行文件加载到所述待测试路由器上包括:将所述待测试路由器上旧的可执行文件更新为所述可执行文件。
  10. 如权利要求7或8所述的路由器测试装置,其中,
    所述运行结果包括所述可执行文件的运行日志记录;
    所述结果获取模块包括日志获取子模块;所述日志获取子模块设置为从所述待测试路由器获取所述运行日志记录。
  11. 如权利要求8所述的路由器测试装置,其中,
    所述接收子模块包括第一协议测试子文件获取子模块和/或第一程序测试子文件获取子模块;
    所述获取子模块包括第二测试子文件获取子模块和/或第二程序测试子文件获取子模块;
    所述可执行文件包括目标协议测试子文件和/或目标程序测试子文件;
    所述第一协议测试子文件获取子模块设置为获取目标协议测试子文件;
    所述第一程序测试子文件获取子模块设置为获取目标程序测试子文件;
    所述第二协议测试子文件获取子模块设置为获取目标协议测试子文件;
    所述第二程序测试子文件获取子模块设置为获取目标程序测试子文件。
  12. 如权利要求7或8或11所述路由器测试装置,所述装置还包括:保存模块和/或显示模块;所述保存模块设置为对所述处理模块的判断结果进行保存;所述显示模块,设置为对所述处理模块的判断结果进行显示。
  13. 一种终端,包括如权利要求7-11任一项所述的路由器测试装置。
  14. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现如权利要求1至6任意一项所述的路由器测试方法。
PCT/CN2016/082655 2015-08-17 2016-05-19 一种路由器测试方法和测试装置 WO2017028574A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510505386.6A CN106452937A (zh) 2015-08-17 2015-08-17 路由器自动化测试方法和测试装置
CN201510505386.6 2015-08-17

Publications (1)

Publication Number Publication Date
WO2017028574A1 true WO2017028574A1 (zh) 2017-02-23

Family

ID=58051093

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/082655 WO2017028574A1 (zh) 2015-08-17 2016-05-19 一种路由器测试方法和测试装置

Country Status (2)

Country Link
CN (1) CN106452937A (zh)
WO (1) WO2017028574A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108111425A (zh) * 2018-02-24 2018-06-01 上海康斐信息技术有限公司 一种路由器防刷机的方法及系统
CN110032481A (zh) * 2019-03-21 2019-07-19 杭州涂鸦信息技术有限公司 一种无线产品测试方法、无线产品测试系统及电子设备
CN114143166A (zh) * 2021-11-12 2022-03-04 锐捷网络股份有限公司 电子设备拷机测试监控方法、装置、电子设备及存储介质
CN114553685A (zh) * 2022-02-24 2022-05-27 深圳市吉祥腾达科技有限公司 一种测试路由器宽带接入的方法

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107276817B (zh) * 2017-07-04 2021-06-04 台州市吉吉知识产权运营有限公司 一种测试上网模式自动检测功能是否正常的方法及系统
CN107967436A (zh) * 2017-11-06 2018-04-27 深圳市吉祥腾达科技有限公司 一种路由器产品生产客制化信息的自动化检测方法与系统
CN108429654A (zh) * 2018-02-26 2018-08-21 上海康斐信息技术有限公司 一种便于路由器进行功能检测的方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6058493A (en) * 1997-04-15 2000-05-02 Sun Microsystems, Inc. Logging and reproduction of automated test operations for computing systems
CN1731748A (zh) * 2005-07-29 2006-02-08 杭州华为三康技术有限公司 测试系统及方法
CN1755643A (zh) * 2004-09-27 2006-04-05 华为技术有限公司 一种软件测试的方法
CN101150463A (zh) * 2007-11-14 2008-03-26 华为技术有限公司 测试方法和系统
CN103631704A (zh) * 2012-08-23 2014-03-12 上海斐讯数据通信技术有限公司 通信设备的自动化测试系统及方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6058493A (en) * 1997-04-15 2000-05-02 Sun Microsystems, Inc. Logging and reproduction of automated test operations for computing systems
CN1755643A (zh) * 2004-09-27 2006-04-05 华为技术有限公司 一种软件测试的方法
CN1731748A (zh) * 2005-07-29 2006-02-08 杭州华为三康技术有限公司 测试系统及方法
CN101150463A (zh) * 2007-11-14 2008-03-26 华为技术有限公司 测试方法和系统
CN103631704A (zh) * 2012-08-23 2014-03-12 上海斐讯数据通信技术有限公司 通信设备的自动化测试系统及方法

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108111425A (zh) * 2018-02-24 2018-06-01 上海康斐信息技术有限公司 一种路由器防刷机的方法及系统
CN110032481A (zh) * 2019-03-21 2019-07-19 杭州涂鸦信息技术有限公司 一种无线产品测试方法、无线产品测试系统及电子设备
CN110032481B (zh) * 2019-03-21 2023-08-18 杭州涂鸦信息技术有限公司 一种无线产品测试方法、无线产品测试系统及电子设备
CN114143166A (zh) * 2021-11-12 2022-03-04 锐捷网络股份有限公司 电子设备拷机测试监控方法、装置、电子设备及存储介质
CN114553685A (zh) * 2022-02-24 2022-05-27 深圳市吉祥腾达科技有限公司 一种测试路由器宽带接入的方法
CN114553685B (zh) * 2022-02-24 2024-04-05 东莞市锐易电子科技有限公司 一种测试路由器宽带接入的方法

Also Published As

Publication number Publication date
CN106452937A (zh) 2017-02-22

Similar Documents

Publication Publication Date Title
WO2017028574A1 (zh) 一种路由器测试方法和测试装置
US9021443B1 (en) Test automation API for host devices
EP3115902B1 (en) Framework for automated testing of mobile apps
CN111159049B (zh) 接口自动化测试方法及系统
US9575830B2 (en) Run-time error repairing method, device and system
WO2017067441A1 (zh) 一种应用的测试方法、装置、系统以及非暂时性机器可读存储介质
CN108920250B (zh) 应用程序容器化的方法及装置
WO2016177124A1 (zh) 一种实现持续集成测试的方法及装置
CN107302476B (zh) 一种测试异步交互系统的自动化测试方法与系统
US11636016B2 (en) Cloud simulation and validation system
CN111309636B (zh) 机器人自动化测试系统、方法、构建服务器及存储介质
WO2015043407A1 (en) Method, system, and apparatus for online service inspection
CN112953983A (zh) Sftp传输方法及装置
CN115422048A (zh) 链路稳定性测试方法、装置、计算机设备和存储介质
CN112214227A (zh) 一种边缘服务器镜像定制化及部署系统和方法
US8150947B2 (en) Techniques for performing operating system installation on a headless device
CN110198222B (zh) 一种配电自动化终端即插即用测试方法及测试主站
CN106776310B (zh) 一种调试方法及调试装置
WO2016131294A1 (zh) 版本升级处理方法及装置
CN113721957B (zh) 对嵌入式设备固件部署升级的自动测试方法、装置和系统
WO2017096889A1 (zh) 系统升降级的方法和装置
CN114780316A (zh) 一种内存测试方法、装置和系统
CN115878448A (zh) 数据库测试方法、分布式数据库、存储介质
CN113220569A (zh) 一种基于多进程的iOS兼容性自动化测试方法与装置
CN112433938A (zh) 移动端应用测试的方法和装置

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: 16836439

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: 16836439

Country of ref document: EP

Kind code of ref document: A1