CN107612786B - Method and system for testing router - Google Patents

Method and system for testing router Download PDF

Info

Publication number
CN107612786B
CN107612786B CN201711049335.2A CN201711049335A CN107612786B CN 107612786 B CN107612786 B CN 107612786B CN 201711049335 A CN201711049335 A CN 201711049335A CN 107612786 B CN107612786 B CN 107612786B
Authority
CN
China
Prior art keywords
router
test
disk
restarting
testing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711049335.2A
Other languages
Chinese (zh)
Other versions
CN107612786A (en
Inventor
李茂源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huzhou Yinglie Intellectual Property Operation Co ltd
Original Assignee
Taizhou Zhiao Communication Equipment Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Taizhou Zhiao Communication Equipment Co Ltd filed Critical Taizhou Zhiao Communication Equipment Co Ltd
Priority to CN201711049335.2A priority Critical patent/CN107612786B/en
Publication of CN107612786A publication Critical patent/CN107612786A/en
Application granted granted Critical
Publication of CN107612786B publication Critical patent/CN107612786B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a system for testing a router, which relate to the technical field of routers, and the method for testing the router comprises the following steps: s11, after the router is started, detecting whether the operation of the router has a problem or not; s12, when detecting that the operation of the router has problems, storing the information containing the problems to a test U disk, and ending the test; s13, when detecting that there is no problem in the operation of the router, detecting whether there is control information for restarting the router in the test U disk; s14, when control information of restarting the router exists in the test U disk, judging whether the restarting frequency of the router exceeds the preset frequency; s15, when the number of times of restarting the router does not exceed the preset number of times, restarting the router and returning to the step S11. The invention provides a method for testing a router through a USB flash disk, and the test system has a simple structure and is easy to implement.

Description

Method and system for testing router
Technical Field
The present invention relates to the field of router technologies, and in particular, to a method and a system for testing a router.
Background
As routers become more popular, the functions of the routers become more powerful and more intelligent. At present, a router not only has routing and internet access functions of a traditional router, but also has more intelligent service functions, such as offline downloading, data sharing and the like. These functions are usually realized by external USB storage devices on the router, so that the general intelligent router has the external USB storage function.
The router development stage and the commissioning stage both test the functions of the router, some of the test problems occur in each starting process, and some of the probabilistic problems occur only by restarting the router for many times. For such a probabilistic problem, the router needs to be repeatedly restarted to reproduce the problem and analyze the problem.
Since many routers that are not rigorously tested may experience various unpredictable problems after reboot, it is necessary to rigorously test the routers to solve these problems.
The existing problem of testing the repeatability is often completed by matching a computer with a relay, the computer is connected with a router through a serial port and a network cable, the computer controls the router to be started through the relay and issues certain commands to test the router through the serial port, a test log is stored at a computer end through the serial port, and then data is processed at the computer end.
The patent with publication number CN104901848A discloses an automatic testing system and method for the startup and shutdown of a router, which includes setting a lower power-on time limit, an upper power-on time limit, cycle times, waiting time and interval time; after the router is controlled to be powered on circularly and repeatedly, the router is controlled to be powered on and lasts for a certain time; detecting whether a gateway of a router is smoothly connected; if not, judging that the test fails, if so, setting the power-on time as the sum of the current power-on time and the interval time when the current power-on time is less than the upper limit of the power-on time, and repeating the test step; and when the current power-on time is larger than the upper limit of the power-on time, judging that the test is successful. The system tested by the method has a complex structure and higher requirements for testers. Further, the problems of the present invention cannot be solved.
Generally, in the prior art, a method for testing a router is complex, a large number of test devices are involved, requirements for test personnel are high, and implementation is easily limited by test conditions.
Disclosure of Invention
The method is mainly used for testing the problems possibly generated in the process of restarting the router for multiple times. In view of the above-mentioned deficiencies of the prior art, a method and system for testing a router are provided.
The method for testing the router comprises the following steps:
s11, after the router is started, detecting whether the operation of the router has a problem or not;
s12, when detecting that the operation of the router has problems, storing the information containing the problems to a test U disk, and ending the test;
s13, when detecting that there is no problem in the operation of the router, detecting whether there is control information for restarting the router in the test U disk;
s14, when control information of restarting the router exists in the test U disk, judging whether the restarting frequency of the router exceeds the preset frequency;
s15, when the number of times of restarting the router does not exceed the preset number of times, restarting the router and returning to the step S11.
Further, before detecting whether the control information for restarting the router exists in the test U disk, the method further includes:
detecting whether a test script for testing the function of the router exists in the U disk;
if yes, executing the test script to test whether the function of the router runs normally;
and when the function of the router is abnormal, storing the information containing the abnormality to the test U disk, and terminating the test.
Further, the executing the test script to test whether the function of the router is operating normally includes:
and executing the test script to test whether the wireless connection function of the router operates normally.
Further, after determining whether the number of times of restarting the router exceeds a preset number of times, the method further includes:
and when the restarting times of the router exceed the preset times, terminating the test.
Further, after executing the test script to test whether the function of the router is operating normally, the method further includes:
and after the test script is executed, storing a test result to the test U disk.
In another aspect, the system for testing a router includes:
the system comprises a problem detection module, a problem detection module and a problem detection module, wherein the problem detection module is used for detecting whether the operation of the router has a problem or not after the router is started;
the first information storage module is used for storing information containing problems to a test U disk and ending the test when the router is detected to have problems in operation;
the control information detection module is used for detecting whether control information for restarting the router exists in the test U disk or not when the router is detected to run without problems;
the judging module is used for judging whether the restarting frequency of the router exceeds the preset frequency or not when the control information of the restarting router exists in the test U disk;
and the router restarting module is used for restarting the router and executing the problem detection module when the restarting times of the router do not exceed the preset times.
Further, the system for testing a router further includes:
the test script detection module is used for detecting whether a test script for testing the router function exists in the U disk;
the function testing module is used for executing the testing script when the testing script exists in the U disk so as to test whether the function of the router runs normally or not;
and the second information storage module is used for storing the information containing the abnormity to the test U disk and terminating the test when the function of the router is abnormal in operation.
Further, the functional test module comprises:
and the function test submodule is used for executing the test script so as to test whether the wireless connection function of the router runs normally.
Further, the system for testing a router further includes:
and the test termination module is used for terminating the test when the restart times of the router exceed the preset times.
Further, the system for testing a router further includes:
and the test result storage module is used for storing the test result to the test USB flash disk after the test script is executed.
The invention provides a method for testing a router through a USB flash disk, and the test system has a simple structure and is easy to implement.
In addition, the method of the invention can conveniently test a large number of routers and can realize batch test.
Drawings
Fig. 1 is a flowchart of a method for testing a router according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for testing a router according to a second embodiment of the present invention;
fig. 3 is a block diagram of a system for testing a router according to a third embodiment of the present invention.
Detailed Description
The following are specific embodiments of the present invention and are further described with reference to the drawings, but the present invention is not limited to these embodiments.
It should also be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.
The system comprises a router to be tested and a USB flash disk to be tested, wherein the test system is positioned in the router, and the USB flash disk to be tested is used for storing test scripts and control information. And the router reads data from the test U disk to test the router.
The router to be tested is provided with a USB interface, and can read data in the USB flash disk through the USB interface.
Example one
The present embodiment provides a method for testing a router, a flowchart of which is shown in fig. 1, and the following is detailed with reference to the accompanying drawings:
step S101, after the router is started, whether the operation of the router has a problem is detected.
It should be noted that the router may have unpredictable problems after startup.
Further, the problems include software problems and hardware problems. The problem may cause the function of the router to be not realized or the router to be not operated normally.
And step S102', when the router is detected to have a problem in operation, storing the information containing the problem to a test U disk, and ending the test.
And when detecting that the router has a problem in operation, storing the information containing the problem to a test U disk, and ending the test.
The information should include as much information about the problem as possible so that the tester can learn more about the problem.
Step S102, when it is detected that no problem exists in the operation of the router, whether control information for restarting the router exists in the test U disk is detected.
The control information of the router to be tested is stored in the test U disk, and the router can read the control information in the test U disk and execute related operation according to the control information.
And when no problem in the operation of the router is detected, detecting whether control information for restarting the router is stored in the U disk.
Step S103, when control information for restarting the router exists in the test U disk, whether the restarting frequency of the router exceeds a preset frequency is judged.
Generally, in order to detect a problem occurring during a plurality of reboots of a router, the router needs to be rebooted a plurality of times to record whether the router under test has a problem.
Further, an upper limit of the number of restarts is set. And when the restarting times of the router reach the preset times, stopping testing.
The preset times can be stored in the test U disk, and the router under test can read the preset times of restart from the test U disk; e.g., 50, 100, etc
Furthermore, due to many unforeseen problems at ordinary times, it may occur after a number of restarts of the router. The present invention can be used to find such problems.
And step S104, when the times of restarting the router do not exceed the preset times, restarting the router, and returning to the step S101.
And when the restarting times of the router do not exceed the preset times, restarting the router, and returning to the step S101.
Through repeated reboots, to test for problems with the router.
The invention finds the problem by the repeated restart of the USB flash disk test router; the test structure is simple and easy to implement.
It should be understood that the steps described above are not in the exact order of execution and that all changes that can be envisioned and do not affect the implementation of the functions are intended to be within the scope of the invention.
Example two
The present embodiment provides a method for testing a router, a flowchart of which is shown in fig. 2, and the following is detailed with reference to the accompanying drawings:
step S201, after the router is started, detecting whether the operation of the router has a problem.
Step S202', when detecting that the operation of the router has a problem, storing the information containing the problem to a test U disk, and ending the test.
Step S202, detecting whether a test script for testing the router function exists in the U disk.
And when detecting that no problem exists in the operation of the router, detecting whether a test script for testing the function of the router exists in the test U disk.
Further, the test script may be used to test the functionality of the router.
Further, the functions include a wireless connection function. In addition, when the router is an intelligent router, the test script can be used for testing more functional modules; such as offline download, data sharing functions.
Step S203, when the test script exists in the U disk, executing the test script to test whether the function of the router runs normally.
The executing the test script comprises:
and reading the test script from the test U disk.
And executing the test script to test whether the function of the router runs normally.
The test script is used for testing the corresponding router function. After the router is restarted every time, the function of the router is tested to judge whether the function of the router operates normally.
Further, the test script is executed to test whether the wireless connection function of the router operates normally.
Further, after the test script is executed, a test result is saved to the test U disk.
And after each restart, storing a test result obtained by executing the test script to the USB flash disk. So that the tester can obtain the test result from the USB flash disk.
After the router is restarted each time, the router is tested to obtain a corresponding test result, so that whether each functional module is abnormal after the router is restarted each time is analyzed.
Step S204', when the function operation of the router is abnormal, the information containing the abnormality is stored to the test U disk, and the test is terminated.
And when the function of the router is abnormal, storing the information corresponding to the abnormality to the U disk, and terminating the test.
The tester can analyze the anomalies by the information containing the anomalies to obtain valuable analysis results.
Step S204, when detecting that no problem exists in the operation of the router, detecting whether control information for restarting the router exists in the test U disk;
step S205, when control information for restarting the router exists in the test U disk, judging whether the restarting frequency of the router exceeds a preset frequency;
step S206, when the number of times of restarting the router does not exceed the preset number of times, restarting the router, and returning to step S201.
Further, after determining whether the number of times of restarting the router exceeds a preset number of times, the method further includes:
and when the restarting times of the router exceed the preset times, terminating the test.
It should be understood that the steps described above are not in the exact order of execution and that all changes that can be envisioned and do not affect the implementation of the functions are intended to be within the scope of the invention.
EXAMPLE III
The present embodiment provides a system for testing a router, a block diagram of which is shown in fig. 3, and the following details are provided in conjunction with the accompanying drawings:
the system for testing the router comprises:
the problem detection module 310 is configured to detect whether a problem exists in operation of a router after the router is started;
a first information storage module 350, configured to, when it is detected that there is a problem in operation of the router, store information including the problem to a test usb disk, and end the test;
a control information detection module 320, configured to detect whether there is control information for restarting the router in the test U disk when it is detected that there is no problem with operation of the router;
a judging module 330, configured to, when there is control information for restarting a router in the test usb disk, judge whether a number of times that the router is restarted exceeds a preset number of times;
the router restarting module 340 is configured to restart the router and execute the problem detecting module when the number of times of restarting the router does not exceed a preset number of times.
Further, the system for testing a router further includes:
the test script detection module is used for detecting whether a test script for testing the router function exists in the U disk;
the function testing module is used for executing the testing script when the testing script exists in the U disk so as to test whether the function of the router runs normally or not;
and the second information storage module is used for storing the information containing the abnormity to the test U disk and terminating the test when the function of the router is abnormal in operation.
Further, the functional test module comprises:
and the function test submodule is used for executing the test script so as to test whether the wireless connection function of the router runs normally.
Further, the system for testing a router further includes:
and the test termination module is used for terminating the test when the restart times of the router exceed the preset times.
Further, the system for testing a router further includes:
and the test result storage module is used for storing the test result to the test USB flash disk after the test script is executed.
Since the system for testing a router provided in this embodiment is applied to the methods provided in the first and second embodiments, the relevant contents have been already detailed in the embodiments of the methods, and are not repeated here, refer to the foregoing embodiments of the methods.
In the embodiments provided in this application, it should be understood that the methods and systems described are illustrative and that variations may be made in the actual implementation by adaptation.
In addition, specific names of the functional units or modules are only used for distinguishing one functional unit from another, and are not used for the protection scope of the present invention.
The specific embodiments described herein are merely illustrative of the spirit of the invention. Various modifications or additions may be made to the described embodiments or alternatives may be employed by those skilled in the art without departing from the spirit or ambit of the invention as defined in the appended claims.

Claims (6)

1. A method of testing a router, comprising:
s11, after the router is started, detecting whether the operation of the router has a problem or not;
s12, when detecting that the operation of the router has problems, storing the information containing the problems to a test U disk, and ending the test;
s13, when detecting that there is no problem in the operation of the router, detecting whether there is control information for restarting the router in the test U disk;
s14, when control information of restarting the router exists in the test U disk, judging whether the restarting frequency of the router exceeds the preset frequency;
s15, when the number of times of restarting the router does not exceed the preset number of times, restarting the router and returning to the step S11;
before detecting whether control information for restarting a router exists in the test U disk, the method further comprises the following steps:
detecting whether a test script for testing the router function exists in the test U disk;
if yes, executing the test script to test whether the function of the router runs normally;
when the function of the router is abnormal, storing the information containing the abnormality to the test U disk, and terminating the test;
the executing the test script to test whether the function of the router is normally operated comprises:
and executing the test script to test whether the wireless connection function of the router operates normally.
2. The method of claim 1, further comprising, after determining whether the number of times the router is restarted exceeds a preset number of times:
and when the restarting times of the router exceed the preset times, terminating the test.
3. The method for testing a router according to claim 1 or 2, wherein after executing the test script to test whether the function of the router is functioning normally, further comprising:
and after the test script is executed, storing a test result to the test U disk.
4. A system for testing a router, comprising:
the system comprises a problem detection module, a problem detection module and a problem detection module, wherein the problem detection module is used for detecting whether the operation of the router has a problem or not after the router is started;
the first information storage module is used for storing information containing problems to a test U disk and ending the test when the router is detected to have problems in operation;
the control information detection module is used for detecting whether control information for restarting the router exists in the test U disk or not when the router is detected to run without problems;
the judging module is used for judging whether the restarting frequency of the router exceeds the preset frequency or not when the control information of the restarting router exists in the test U disk;
the router restarting module is used for restarting the router and executing the problem detection module when the restarting times of the router do not exceed the preset times;
the test script detection module is used for detecting whether a test script for testing the router function exists in the test U disk;
the function testing module is used for executing the testing script when the testing script exists in the testing U disk so as to test whether the function of the router runs normally or not;
the second information storage module is used for storing the information containing the abnormity to the test U disk and terminating the test when the function operation of the router is abnormal;
the functional test module comprises:
and the function test submodule is used for executing the test script so as to test whether the wireless connection function of the router runs normally.
5. The system for testing a router of claim 4, further comprising:
and the test termination module is used for terminating the test when the restart times of the router exceed the preset times.
6. The system for testing a router of claim 4 or 5, further comprising:
and the test result storage module is used for storing the test result to the test USB flash disk after the test script is executed.
CN201711049335.2A 2017-10-31 2017-10-31 Method and system for testing router Active CN107612786B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711049335.2A CN107612786B (en) 2017-10-31 2017-10-31 Method and system for testing router

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711049335.2A CN107612786B (en) 2017-10-31 2017-10-31 Method and system for testing router

Publications (2)

Publication Number Publication Date
CN107612786A CN107612786A (en) 2018-01-19
CN107612786B true CN107612786B (en) 2020-12-22

Family

ID=61083962

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711049335.2A Active CN107612786B (en) 2017-10-31 2017-10-31 Method and system for testing router

Country Status (1)

Country Link
CN (1) CN107612786B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108429654A (en) * 2018-02-26 2018-08-21 上海康斐信息技术有限公司 A kind of method and system carrying out Function detection convenient for router
CN109739127B (en) * 2018-12-28 2021-02-26 广东九联科技股份有限公司 Intelligent program-controlled information capturing method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101399824A (en) * 2007-09-29 2009-04-01 华为技术有限公司 Method, system and router realizing elegant restart of route information protocol
CN101739325A (en) * 2009-12-04 2010-06-16 北京星网锐捷网络技术有限公司 Device and method for testing hot plugging of interface
CN103475592A (en) * 2013-08-27 2013-12-25 上海斐讯数据通信技术有限公司 System and method for supporting hot plugging of 3G (3rd Generation) network card
CN104734979A (en) * 2015-04-07 2015-06-24 北京极科极客科技有限公司 Control method for storage device externally connected with router
CN105007230A (en) * 2015-08-11 2015-10-28 上海斐讯数据通信技术有限公司 System and method for testing multiple wireless routers
CN105302726A (en) * 2015-11-13 2016-02-03 浪潮电子信息产业股份有限公司 Test method and device
CN106375111A (en) * 2016-08-25 2017-02-01 珠海迈科智能科技股份有限公司 Network fault automatic correcting method and system of intelligent gateway
US9594621B1 (en) * 2014-12-30 2017-03-14 Juniper Networks, Inc. Online network device diagnostic monitoring and fault recovery system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060271695A1 (en) * 2005-05-16 2006-11-30 Electronics Line 3000 Ltd. System for remote secured operation, monitoring and control of security and other types of events
US20090319531A1 (en) * 2008-06-20 2009-12-24 Bong Jun Ko Method and Apparatus for Detecting Devices Having Implementation Characteristics Different from Documented Characteristics

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101399824A (en) * 2007-09-29 2009-04-01 华为技术有限公司 Method, system and router realizing elegant restart of route information protocol
CN101739325A (en) * 2009-12-04 2010-06-16 北京星网锐捷网络技术有限公司 Device and method for testing hot plugging of interface
CN103475592A (en) * 2013-08-27 2013-12-25 上海斐讯数据通信技术有限公司 System and method for supporting hot plugging of 3G (3rd Generation) network card
US9594621B1 (en) * 2014-12-30 2017-03-14 Juniper Networks, Inc. Online network device diagnostic monitoring and fault recovery system
CN104734979A (en) * 2015-04-07 2015-06-24 北京极科极客科技有限公司 Control method for storage device externally connected with router
CN105007230A (en) * 2015-08-11 2015-10-28 上海斐讯数据通信技术有限公司 System and method for testing multiple wireless routers
CN105302726A (en) * 2015-11-13 2016-02-03 浪潮电子信息产业股份有限公司 Test method and device
CN106375111A (en) * 2016-08-25 2017-02-01 珠海迈科智能科技股份有限公司 Network fault automatic correcting method and system of intelligent gateway

Also Published As

Publication number Publication date
CN107612786A (en) 2018-01-19

Similar Documents

Publication Publication Date Title
CN103973858B (en) The Auto-Test System of mobile terminal
CN105302722B (en) CTS automatic testing method and device
CN105068900A (en) Test method for remote control server cold reboot
WO2018006702A1 (en) Abnormality processing method, apparatus and system in automation test
CN113504932B (en) Firmware data updating method and device
CN107612786B (en) Method and system for testing router
CN106407054B (en) BMC automatic test system and method
CN106874196B (en) Automatic test exception handling method and automatic test system
CN111399862A (en) Batch installation method and device of Windows missing driver and computer equipment
CN111309602A (en) Software testing method, device and system
CN114510381A (en) Fault injection method, device, equipment and storage medium
CN112269697B (en) Equipment storage performance testing method, system and related device
CN116303099B (en) Cross-platform rapid deployment method, device, medium and equipment for automatic test environment
CN110990289B (en) Method and device for automatically submitting bug, electronic equipment and storage medium
CN109446008B (en) Fault reason detection method, fault reason detection device and terminal equipment
CN111078476B (en) Network card drive firmware stability test method, system, terminal and storage medium
CN112363734A (en) Method and device for adopting local library during Android application installation
CN116049011A (en) Deployment method and device of test environment, electronic equipment and storage medium
US9317273B2 (en) Information processing apparatus and information processing method
CN111666200A (en) Testing method and terminal for time consumption of cold start of PC software
CN105426304A (en) Control method and device of restart test
CN115604307A (en) Processing method and device for upgrading log, terminal equipment and computer medium
CN115454856A (en) Multi-application security detection method, device, medium and electronic equipment
CN114880244A (en) Application testing method and device, storage medium and electronic equipment
CN113742186A (en) Server performance test method, system, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20201109

Address after: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Hangzhou Jiji Intellectual Property Operation Co.,Ltd.

Address before: 201616 Shanghai city Songjiang District Sixian Road No. 3666

Applicant before: Phicomm (Shanghai) Co.,Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201203

Address after: Room 703, building 3, Yangguang Chuncheng, Lubei street, Luqiao District, Taizhou City, Zhejiang Province

Applicant after: Taizhou zhiao communication equipment Co.,Ltd.

Address before: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: Hangzhou Jiji Intellectual Property Operation Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230104

Address after: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee after: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Address before: Room 703, building 3, Yangguang Chuncheng, Lubei street, Luqiao District, Taizhou City, Zhejiang Province

Patentee before: Taizhou zhiao communication equipment Co.,Ltd.

TR01 Transfer of patent right