CN104579780A - Method and device for simulating network link outage - Google Patents
Method and device for simulating network link outage Download PDFInfo
- Publication number
- CN104579780A CN104579780A CN201510011557.XA CN201510011557A CN104579780A CN 104579780 A CN104579780 A CN 104579780A CN 201510011557 A CN201510011557 A CN 201510011557A CN 104579780 A CN104579780 A CN 104579780A
- Authority
- CN
- China
- Prior art keywords
- network interface
- interface card
- suspension
- network
- order
- 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.)
- Pending
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a method and device for simulating network link outage. The network link outage can be conveniently simulated, and the testing efficiency is improved. The method includes the steps of storing configuration files, wherein the network card hardware identification, the network link outage simulating time duration, the length of each network link outage cycle within the network link outage simulating time duration and the interval of every two adjacent network link outage cycles are recorded in the configuration files; judging whether network link outage simulation needs to be conducted on a current network card or not, and if yes, alternately executing a network card forbidding command and a network card starting command on the network card within the network link outage simulating time duration according to the content recorded in the configuration files, wherein after the network card forbidding command is executed, the network card starting command is executed one network link outage cycle later, and then the network card forbidding command is executed one interval between every two adjacent network link outage cycles later.
Description
Technical field
The present invention relates to field of computer technology, the method and apparatus of particularly a kind of analog network suspension.
Background technology
The maintenance work of server all has operation maintenance personnel to utilize network remote to manage, and needs the robustness of test event or system interface in some cases, for this reason, will make server cannot accesses network within a period of time, and carry out the labile state of analog network.Current usual way manually pulls out netting twine by personnel, or manual operation carrys out forbidden networks connection in the man-machine interface of computer.When needs recover network connection, then plug netting twine by personnel, or in the man-machine interface of computer, network connection is enabled in manual operation.This mode bothers very much, has a strong impact on testing efficiency.
Summary of the invention
In view of this, the invention provides a kind of method and apparatus of analog network suspension, can analog network suspension easily, improve testing efficiency.
For achieving the above object, according to an aspect of the present invention, a kind of method of analog network suspension is provided.
The method of analog network suspension of the present invention comprises: preserve configuration file, records the single suspension Cycle Length in network interface card hardware identifier, suspension simulation duration, suspension simulation duration and adjacent suspension period distances in this configuration file; Judge that current network interface card is the need of carrying out suspension simulation, if, then according to the content of this configuration file record, in suspension simulation duration, alternately forbidding network interface card order is performed to this network interface card and enable network interface card order, wherein, after performing the order of forbidding network interface card, perform after the time of described single suspension Cycle Length and enable network interface card order, then after described adjacent suspension period distances, perform the order of forbidding network interface card.
Alternatively, before judging whether current network interface card is the network interface card recorded in configuration file, also comprise: determine all devices that local computer exists, from these equipment, search network interface card.
According to a further aspect in the invention, a kind of device of analog network suspension is provided.
The device of analog network suspension of the present invention comprises: preserve module, for preserving configuration file, records the single suspension Cycle Length in network interface card hardware identifier, suspension simulation duration, suspension simulation duration and adjacent suspension period distances in this configuration file; Judge module, for judging that current network interface card is the need of carrying out suspension simulation; Executive Module, for when the judged result of described judge module is for being, according to the content of described configuration file record, in suspension simulation duration, alternately forbidding network interface card order is performed to this network interface card and enable network interface card order, wherein, after performing the order of forbidding network interface card, perform after the time of described single suspension Cycle Length and enable network interface card order, then after described adjacent suspension period distances, perform the order of forbidding network interface card.
Alternatively, also comprise determination module, for judging that at described judge module current network interface card is the need of before carrying out suspension simulation, determines all devices that local computer exists; Described Executive Module also searches network interface card in the equipment determined from described determination module.
According to technical scheme of the present invention, perform instruction according to configuration file, enable network interface card replace open and close by instruction, thus realize analog network off and on.This mode without the need to manually plug netting twine or manually opened, close network and connect, can analog network suspension easily, improve testing efficiency.In addition because be control network interface card by instruction, thus can realize manual operation the interrupted test environment of the network of inaccessiable upper frequency.
Accompanying drawing explanation
Accompanying drawing is used for understanding the present invention better, does not form inappropriate limitation of the present invention.Wherein:
Fig. 1 is the schematic diagram of the basic step of the method for analog network suspension according to the embodiment of the present invention;
Fig. 2 is the schematic diagram of a kind of idiographic flow of analog network suspension according to the embodiment of the present invention;
Fig. 3 is the schematic diagram of the main modular of the device of analog network suspension according to the embodiment of the present invention.
Embodiment
Below in conjunction with accompanying drawing, one exemplary embodiment of the present invention is explained, comprising the various details of the embodiment of the present invention to help understanding, they should be thought it is only exemplary.Therefore, those of ordinary skill in the art will be appreciated that, can make various change and amendment, and can not deviate from scope and spirit of the present invention to the embodiments described herein.Equally, for clarity and conciseness, the description to known function and structure is eliminated in following description.
In the present embodiment, adopt the instruction automatically performed to carry out analog network suspension, alternately perform the instruction of closing network interface card and starting network interface card, thus the interruption state of analog network.Fig. 1 is the schematic diagram of the basic step of the method for analog network suspension according to the embodiment of the present invention.As shown in Figure 1, the method mainly comprises following step S11 to step S13.
Step S11: preserve configuration file.The main contents of configuration file comprise single suspension Cycle Length in network interface card hardware identifier, suspension simulation duration, suspension simulation duration and adjacent suspension period distances.The time started of suspension simulation can be set in addition.Such as arrange every day 20:00 to start to carry out suspension simulation.
Step S12: judge that current network interface card is the need of carrying out suspension simulation.Specifically judge when judging whether network interface card is the network interface card recorded in configuration file; If set the time started of suspension simulation, also to judge currently whether arrive this time.Inactive one or more network interface card can be carried out as required, when each network interface card in known local computer, can verify whether these network interface cards are the network interface card recorded in configuration file one by one.In addition, all devices in local computer can be listed by instruction, therefrom search network interface card wherein, the judgement in finally carry out this step again according to the device name of network interface card again.If current network interface card is the network interface card recorded in configuration file, input step S13, otherwise judges next network interface card, namely return this step.
Step S13: according to the content of this configuration file record, alternately performs forbidding network interface card order to this network interface card and enables network interface card order in suspension simulation duration.In this step, after performing the order of forbidding network interface card, perform after the time of single suspension Cycle Length and enable network interface card order, then after adjacent suspension period distances, perform the order of forbidding network interface card.So just achieve network off and on.
Said method can be realized by an automated network switch service, and the flow process of service can be the schematic diagram of a kind of idiographic flow of analog network suspension according to the embodiment of the present invention with reference to figure 2, Fig. 2.As shown in Figure 2, step S21 belongs to finger daemon to step S25, and step S26 to step S28 is executive process.Finger daemon coordinates the operation of whole automated network switch service, and it is a dos process, is responsible for initiation parameter and calls executive process.Executive process performs the task of switch card operation particularly, is a dos process, wherein performs the order of switch network interface card.
After flow process starts, reading configuration file information (step S21), then according to the configuration file checking current time (step S22) whether arriving current network interface card suspension simulation, if so, then enters executive process.In executive process, first close network interface card (step S26), then enter and perform dormancy (step S27), in the process performing dormancy, from configuration file, read parameter, then perform dormancy instruction, sleep time is single suspension Cycle Length; Dormancy terminates rear startup network interface card (step S28), then finger daemon is got back to, judge whether suspension simulation terminates (step S24), namely judge whether executive process (namely first time performs step S26) reaches the suspension simulation duration in configuration file to current duration from first time, if, illustrate that suspension simulation terminates, need to make network interface card recover normal to connect, now judge network card status (step S25), if network interface card is closed condition, then enlighten network interface card, otherwise directly terminate whole flow process.The judged result of step S22 if NO, then enters and guards dormancy (step S23), and sleep time is adjacent suspension period distances.
Fig. 3 is the schematic diagram of the main modular of the device of analog network suspension according to the embodiment of the present invention.As shown in Figure 3, the device 30 of analog network suspension mainly comprises preservation module 31, judge module 32 and Executive Module 33.
Preserving module 31 for preserving configuration file, in this configuration file, recording the single suspension Cycle Length in network interface card hardware identifier, suspension simulation duration, suspension simulation duration and adjacent suspension period distances; Judge module 32 is for judging that current network interface card is the need of carrying out suspension simulation; Executive Module 33 is for when the judged result of judge module 32 is for being, according to the content of configuration file record, in suspension simulation duration, alternately forbidding network interface card order is performed to this network interface card and enable network interface card order, wherein, after performing the order of forbidding network interface card, perform after the time of single suspension Cycle Length and enable network interface card order, then after adjacent suspension period distances, perform the order of forbidding network interface card.
The device 30 of analog network suspension can also comprise determination module (not shown), for judging that at judge module 32 current network interface card is the need of before carrying out suspension simulation, determines all devices that local computer exists; And Executive Module 33 also searches network interface card in the equipment determined from this determination module.
According to the technical scheme of the embodiment of the present invention, perform instruction according to configuration file, enable network interface card replace open and close by instruction, thus realize analog network off and on.This mode without the need to manually plug netting twine or manually opened, close network and connect, can analog network suspension easily, improve testing efficiency.In addition because be control network interface card by instruction, thus can realize manual operation the interrupted test environment of the network of inaccessiable upper frequency.Control command for network interface card can adopt the stereotyped command of operating system, such as, DevCon series of instructions in dos operating system.
Below describe general principle of the present invention in conjunction with specific embodiments, in apparatus and method of the present invention, obviously, each parts or each step can decompose and/or reconfigure.These decompose and/or reconfigure and should be considered as equivalents of the present invention.Further, the step performing above-mentioned series of processes can order naturally following the instructions perform in chronological order, but does not need necessarily to perform according to time sequencing.Some step can walk abreast or perform independently of one another.
Above-mentioned embodiment, does not form limiting the scope of the invention.It is to be understood that depend on designing requirement and other factors, various amendment, combination, sub-portfolio can be there is and substitute in those skilled in the art.Any amendment done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within scope.
Claims (4)
1. a method for analog network suspension, is characterized in that, comprising:
Preserve configuration file, in this configuration file, record the single suspension Cycle Length in network interface card hardware identifier, suspension simulation duration, suspension simulation duration and adjacent suspension period distances;
Judge that current network interface card is the need of carrying out suspension simulation, if, then according to the content of this configuration file record, in suspension simulation duration, alternately forbidding network interface card order is performed to this network interface card and enable network interface card order, wherein, after performing the order of forbidding network interface card, perform after the time of described single suspension Cycle Length and enable network interface card order, then after described adjacent suspension period distances, perform the order of forbidding network interface card.
2. method according to claim 1, is characterized in that, judges that current network interface card is the need of before carrying out suspension simulation, also comprises: determine all devices that local computer exists, from these equipment, searches network interface card.
3. a device for analog network suspension, is characterized in that, comprising:
Preserving module, for preserving configuration file, in this configuration file, recording the single suspension Cycle Length in network interface card hardware identifier, suspension simulation duration, suspension simulation duration and adjacent suspension period distances;
Judge module, for judging that current network interface card is the need of carrying out suspension simulation;
Executive Module, for when the judged result of described judge module is for being, according to the content of described configuration file record, in suspension simulation duration, alternately forbidding network interface card order is performed to this network interface card and enable network interface card order, wherein, after performing the order of forbidding network interface card, perform after the time of described single suspension Cycle Length and enable network interface card order, then after described adjacent suspension period distances, perform the order of forbidding network interface card.
4. device according to claim 3, is characterized in that,
Also comprise determination module, for judging that at described judge module current network interface card is the need of before carrying out suspension simulation, determines all devices that local computer exists;
Described Executive Module also searches network interface card in the equipment determined from described determination module.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510011557.XA CN104579780A (en) | 2015-01-09 | 2015-01-09 | Method and device for simulating network link outage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510011557.XA CN104579780A (en) | 2015-01-09 | 2015-01-09 | Method and device for simulating network link outage |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104579780A true CN104579780A (en) | 2015-04-29 |
Family
ID=53095045
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510011557.XA Pending CN104579780A (en) | 2015-01-09 | 2015-01-09 | Method and device for simulating network link outage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104579780A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105847018A (en) * | 2016-05-19 | 2016-08-10 | 浪潮电子信息产业股份有限公司 | Automatic network adapter repeated disabling and enabling realizing method |
CN109324965A (en) * | 2018-09-18 | 2019-02-12 | 郑州云海信息技术有限公司 | A kind of automated testing method that monitoring flock causes client to be collapsed |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040153714A1 (en) * | 2001-01-19 | 2004-08-05 | Kjellberg Rikard M. | Method and apparatus for providing error tolerance in a network environment |
CN1960376A (en) * | 2005-10-31 | 2007-05-09 | 国际商业机器公司 | Automated network blocking method and system |
CN101668322A (en) * | 2009-09-17 | 2010-03-10 | 深圳华为通信技术有限公司 | Network switching method of terminal and terminal equipment |
CN101868049A (en) * | 2010-06-03 | 2010-10-20 | 华为终端有限公司 | Communication methods for host and wireless Internet access module and host communication module |
-
2015
- 2015-01-09 CN CN201510011557.XA patent/CN104579780A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040153714A1 (en) * | 2001-01-19 | 2004-08-05 | Kjellberg Rikard M. | Method and apparatus for providing error tolerance in a network environment |
CN1960376A (en) * | 2005-10-31 | 2007-05-09 | 国际商业机器公司 | Automated network blocking method and system |
CN101668322A (en) * | 2009-09-17 | 2010-03-10 | 深圳华为通信技术有限公司 | Network switching method of terminal and terminal equipment |
CN101868049A (en) * | 2010-06-03 | 2010-10-20 | 华为终端有限公司 | Communication methods for host and wireless Internet access module and host communication module |
Non-Patent Citations (1)
Title |
---|
李文超: "网吧"零点断网"自动控制策略—以华为接入交换机S3xxx系列为例", 《网络安全技术与应用》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105847018A (en) * | 2016-05-19 | 2016-08-10 | 浪潮电子信息产业股份有限公司 | Automatic network adapter repeated disabling and enabling realizing method |
CN109324965A (en) * | 2018-09-18 | 2019-02-12 | 郑州云海信息技术有限公司 | A kind of automated testing method that monitoring flock causes client to be collapsed |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105095062B (en) | Applied program testing method and system | |
EP3297214A1 (en) | Systems and methods for automated determination of network device transiting data attributes | |
CN106033393B (en) | A kind of applied program testing method and system and mobile terminal | |
CN106681913A (en) | Application not responding positioning system and method | |
CN102799508A (en) | Automatic test system and method | |
CN106156355B (en) | Log processing method and device | |
CN103530225B (en) | Automatization's compiler test method and realize automatization's compiler test platform of the method | |
CN106708700B (en) | A kind of O&M monitoring method and device applied to server-side | |
CN109509021A (en) | Abnormality recognition method, device, server and the storage medium of Behavior-based control track | |
CN103812726A (en) | Automated testing method and device for data communication equipment | |
CN107807877A (en) | A kind of method and apparatus of code performance test | |
CN107239457A (en) | Data archiving method and device | |
CN111756575A (en) | Performance analysis method and device of storage server and electronic equipment | |
CN106330599B (en) | Android application program network flow multithreading acquisition system and method | |
CN104794049A (en) | Application program test method and device | |
CN104572446A (en) | Automatic testing method and automatic testing system | |
CN104965776B (en) | Mobile terminal checks the method and system of daily record in recovery mode | |
CN103455313B (en) | Method and device for associating input information with output information of detected system | |
CN104731701A (en) | Test system and method and device for executing test tasks | |
CN102495798A (en) | Automated regression testing method and system | |
CN104778118A (en) | Improvement method for automatic testing technology | |
CN106482299B (en) | Machine set system data backup device, method and the air-conditioner set with the device | |
US20160352573A1 (en) | Method and System for Detecting Network Upgrades | |
CN102541737B (en) | Reliability test defect injection and control method of embedded software | |
CN109324918A (en) | Processing method and processing device, terminal and the storage medium of application exception |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20150429 |
|
RJ01 | Rejection of invention patent application after publication |