CN109428783B - Network equipment testing method and device - Google Patents

Network equipment testing method and device Download PDF

Info

Publication number
CN109428783B
CN109428783B CN201710765255.0A CN201710765255A CN109428783B CN 109428783 B CN109428783 B CN 109428783B CN 201710765255 A CN201710765255 A CN 201710765255A CN 109428783 B CN109428783 B CN 109428783B
Authority
CN
China
Prior art keywords
port
network equipment
configuration
network device
combination
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
CN201710765255.0A
Other languages
Chinese (zh)
Other versions
CN109428783A (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.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication Technology 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 Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN201710765255.0A priority Critical patent/CN109428783B/en
Publication of CN109428783A publication Critical patent/CN109428783A/en
Application granted granted Critical
Publication of CN109428783B publication Critical patent/CN109428783B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a network equipment testing method and a network equipment testing device, which are applied to testing terminals respectively communicating with first network equipment and second network equipment. The method comprises the following steps: acquiring a configuration file, wherein the configuration file comprises a plurality of port configuration combinations, and each port configuration combination comprises configuration parameters respectively applied to first network equipment and second network equipment; respectively sending the configuration parameters in the port configuration combination to the first network equipment and the second network equipment, so that the first network equipment and the second network equipment carry out communication negotiation according to the received configuration parameters; and aiming at each sent port configuration combination, acquiring and recording an actual negotiation result of the communication negotiation between the first network equipment and the second network equipment by adopting the port configuration combination. Therefore, the automatic test can be performed on the port negotiation function of the network equipment, and the test efficiency is improved.

Description

Network equipment testing method and device
Technical Field
The invention relates to the technical field of equipment testing, in particular to a network equipment testing method and device.
Background
Ports of network devices (e.g., switches, routers, etc.) can properly negotiate for communication only if the communication rate and duplex mode configuration are appropriate. Thus, network device manufacturers typically need to test the port negotiation function of the produced network devices. In the prior art, two network devices are interconnected, different rates and duplex modes are manually configured on the ports of the two interconnected network devices, and then the test results are observed and recorded.
However, the existing network device port types are many, and when two network devices (e.g., switches) are interconnected, the port configuration combinations to be tested will further increase. The manual mode is adopted for testing, so that the efficiency is low, the error is easy to occur, and the reliability of a test result cannot be ensured.
Disclosure of Invention
In order to overcome the above-mentioned deficiencies in the prior art, an object of the present invention is to provide a method and an apparatus for testing a network device, so as to perform an automatic test on a port negotiation function of the network device.
In order to achieve the above object, an embodiment of the present invention provides a network device testing method, which is applied to a testing terminal that communicates with a first network device and a second network device, respectively, where the method includes:
acquiring a configuration file, wherein the configuration file comprises a plurality of port configuration combinations, each port configuration combination comprises configuration parameters respectively applied to a first network device and a second network device, and the configuration parameters comprise port communication rate and a port duplex mode;
respectively sending the configuration parameters in the port configuration combination to the first network equipment and the second network equipment, so that the first network equipment and the second network equipment carry out communication negotiation according to the received configuration parameters;
and aiming at each sent port configuration combination, acquiring and recording an actual negotiation result of the communication negotiation between the first network equipment and the second network equipment by adopting the port configuration combination.
The embodiment of the invention also provides a network equipment testing device, which is applied to a testing terminal respectively communicating with the first network equipment and the second network equipment, and comprises:
an obtaining module, configured to configure a file, where the configuration file includes a plurality of port configuration combinations, and each port configuration combination includes configuration parameters respectively applied to a first network device and a second network device, where the configuration parameters include a port communication rate and a port duplex mode;
the test module is used for respectively sending the configuration parameters in the port configuration combination to the first network equipment and the second network equipment so that the first network equipment and the second network equipment carry out communication negotiation according to the received configuration parameters;
and the recording module is used for acquiring and recording an actual negotiation result of the communication negotiation between the first network equipment and the second network equipment by adopting the port configuration combination aiming at each sent port configuration combination.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a network equipment testing method and a device, which are used for storing a plurality of port configuration combinations in a configuration file form in a testing terminal which is respectively communicated with a first network equipment and a second network equipment. The test terminal automatically sends the configuration parameters in the port configuration combination to the first network device and the second network device respectively, so that the first network device and the second network device carry out communication negotiation, and the automatic test of the port negotiation function of the network device is realized. And aiming at each sent port configuration combination, the test terminal acquires and records an actual negotiation result of communication negotiation between the first network equipment and the second network equipment based on the port configuration combination. Therefore, the testing efficiency can be improved, and the accuracy and the reliability of the recorded testing result can be ensured.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is an interaction diagram of a test terminal, a first network device, and a second network device according to an embodiment of the present invention;
fig. 2 is a schematic block diagram of a test terminal according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a network device testing method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating the sub-steps of step S120 shown in FIG. 3;
fig. 5 is a functional block diagram of a network device testing apparatus according to an embodiment of the present invention.
Icon: 100-a test terminal; 110-network device test equipment; 111-an acquisition module; 112-a test module; 1121-type read submodule; 1122-configuring a selection submodule; 1123-configuring the submodule; 113-a recording module; 120-a memory; 130-a processor; 140-a communication unit; 200-a first network device; 300-a second network device.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Referring to fig. 1, fig. 1 is an interaction diagram of a test terminal 100, a first network device 200, and a second network device 300 according to a preferred embodiment of the invention.
The test terminal 100 may be any PC (personal computer), server or other user terminal, and the first network device 200 and the second network device 300 may be switches, routers or other devices having ethernet ports. In addition, one of the first network Device 200 and the second network Device 300 is a Device Under Test (DUT), and the other is a Standard Test Device (STD), which is also called an auxiliary Test Device.
In this embodiment, the test terminal 100 may communicate with the first network device 200 and the second network device 300 through a network, respectively, and the first network device 200 and the second network device 300 are interconnected through an ethernet port.
Referring to fig. 2, fig. 2 is a block diagram illustrating a test terminal 100 according to an embodiment of the invention. The test terminal 100 includes a network device test apparatus 110, a memory 120, a processor 130, and a communication unit 140.
The elements of the memory 120, the processor 130 and the communication unit 140 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The network device testing apparatus 110 may be stored in the memory 120 in the form of software, firmware or script files or be fixed in an Operating System (OS) of the test terminal 100.
The processor 130 is configured to execute an executable module stored in the memory 120, such as a software functional module or a computer program included in the network device testing apparatus 110. The communication unit 140 is used for establishing a communication connection between the test terminal 100 and external devices (e.g., the first network device 200 and the second network device 300).
In this embodiment, the first network device 200 and the second network device 300 have at least one group of interconnected ports, and each group of interconnected ports includes one ethernet port of the first network device 200 and one ethernet port of the second network device 300. The network device testing method and apparatus provided in this embodiment test a group of interconnected ports as a unit, and according to actual requirements, one, two or more groups of interconnected ports can be tested simultaneously.
Fig. 3 is a flowchart illustrating a network device testing method according to an embodiment of the present invention, where the network device testing method is applied to the testing terminal 100 shown in fig. 2. The specific process and steps shown in fig. 3 will be described in detail below.
Step S110, a configuration file is obtained, where the configuration file includes a plurality of port configuration combinations, and each port configuration combination includes configuration parameters respectively applied to the first network device 200 and the second network device 300, where the configuration parameters include a port communication rate and a port duplex mode.
In the present embodiment, each port configuration combination includes configuration parameters applied to the first network device 200 and configuration parameters applied to the second network device 300. The configuration parameters applied to the first network device 200 refer to the configuration parameters sent to the first network device 200 during testing, and the configuration parameters applied to the second network device 300 refer to the configuration parameters sent to the second network device 300 during testing.
The network device testing method provided by the embodiment of the invention can be stored in the testing terminal 100 in advance in the form of the testing script, and when the testing is required, the testing terminal 100 can execute the testing script so as to perform parameter configuration and testing on the network device to be tested.
Optionally, the configuration file may be stored in the test terminal 100 in advance, where a plurality of configuration parameters required for testing the port negotiation function of the network device are recorded in the configuration file, and each configuration parameter includes a port communication rate and a port duplex mode. The port communication rate refers to a communication rate of an ethernet port, for example, 100M, 1000M, and the like; the port duplex mode refers to a duplex mode of an ethernet port, such as full duplex (fullbduplex), half duplex (HalfDuplex), and the like.
The configuration parameters can be combined to form the port configuration combinations, and the combination mode comprises two combinations or self-combination. For example, assuming that two configuration parameters, 100M/Full and 1000M/Full, are recorded in the configuration file, these two configuration parameters may be combined to form a plurality of port configuration combinations as shown in the following table, where each row represents one port configuration combination.
DUT STD
100M/Full 100M/Full
100M/Full 1000M/Full
1000M/Full 1000M/Full
1000M/Full 100M/Full
Step S120, sending the configuration parameters in the port configuration combination to the first network device 200 and the second network device 300, respectively, so that the first network device 200 and the second network device 300 perform communication negotiation according to the received configuration parameters.
In this embodiment, sending the configuration parameters in the port configuration combination to the first network device 200 and the second network device 300 respectively means that the test terminal 100 configures the interconnected ports in the first network device 200 and the second network device 300 according to the configuration parameters in the port configuration combination, so that the interconnected ports perform communication negotiation based on the configuration.
Taking the tested object as a group of interconnected ports as an example, assuming that the port a of the first network device 200 is interconnected with the port B of the second network device 300, for each port configuration combination to be sent, the test terminal 100 configures the port a according to the configuration parameters applied to the first network device 200 in the port configuration combination, configures the port B according to the configuration parameters applied to the second network device 300 in the port configuration combination, and makes the port a and the port B perform communication negotiation based on the port configuration combination.
The configuration file may record management IP addresses and login information of the first network device 200 and the second network device 300, and in implementation, the test terminal 100 may remotely log in and control the first network device 200 and the second network device 300 through the management IP addresses and the login information. The remote login of the test terminal 100 may be implemented in various manners, for example, in manners such as a Telnet protocol and an SSH protocol. After the test terminal 100 logs in the first network device 200 and the second network device 300, parameter configuration is performed for each port configuration combination to be sent.
Optionally, in this embodiment, the port configuration combination sent by the test terminal 100 to the first network device 200 and the second network device 300 may have multiple options.
As an embodiment, the test terminal 100 may directly send all configuration port combinations formed by combining a plurality of configuration parameters recorded in a configuration file to the first network device 200 and the second network device 300 in sequence for corresponding configuration and test.
As another embodiment, the test terminal 100 may also determine a port configuration combination to be tested in the plurality of port configuration combinations according to the types of ethernet ports interconnected by the first network device 200 and the second network device 300, and then send the port configuration combination to be tested to the first network device 200 and the second network device 300 for corresponding test.
In this case, as shown in fig. 4, the step S120 may include three substeps, step S121, step S122, and step S123.
Step S121, respectively reading the port types of the first network device 200 and the second network device 300.
The port type refers to a type of an ethernet port, and the type is generally characterized by a maximum communication rate and a transmission medium of the ethernet port. Wherein, the communication rate of the ethernet port is usually expressed in a rate capability level, for example, 10M, 100M, 1000M, 10000M, etc.; the transmission medium includes a network cable, an optical fiber, and the like, wherein a port using the network cable as the transmission medium is referred to as an electrical port, and a port using the optical fiber as the transmission medium is referred to as an optical port.
Assuming that a certain ethernet port is a 1000M electrical port, 1000M means the maximum communication rate of the ethernet port, that is, the ethernet port can support communication rates of multiple capability levels, such as 1000M, 100M, 10M, and the like; the electrical port is used to characterize the transmission medium of the ethernet port.
In practical applications, different types of ethernet ports support different communication rates and different duplex modes, for example, an ethernet port generally supports a full-duplex mode and a half-duplex mode, and an ethernet optical port generally supports a full-duplex mode.
The inventor finds that, when any one of the first network device 200 and the second network device 300 is configured according to the configuration parameters that are not supported by the port to be tested, where the first network device 200 and the second network device 300 are interconnected, cannot be negotiated. For example, assuming that the first network device 200 is interconnected with the 1000M electrical port of the second network device 300 through the 100M electrical port, and the 100M electrical port and the 1000M electrical port are both configured according to 1000M/fullbilplex, the 100M electrical port and the 1000M electrical port may eventually fail to negotiate because the 100M electrical port does not support the 1000M communication rate.
Considering that the possibility of configuration based on the configuration parameters not supported by the port is low in practical application, before the test, the port configuration combination to be tested for the test can be determined according to the port type of the port to be tested.
And step S122, selecting at least one port from the plurality of port configuration combinations as a port configuration combination to be tested according to the port type.
In this embodiment, the configuration file may record configuration parameters supported by different port types. In implementation, the test terminal 100 may select, from the plurality of configuration parameters recorded in the configuration file, a configuration parameter supported by the port type of the first network device 200 to form the first set of configuration parameters, and select a configuration parameter supported by the port type of the second network device 300 to form the second set of configuration parameters. The first set of configuration parameters is configuration parameters applied to the first network device 200, and the second set of configuration parameters is configuration parameters applied to the second network device 300.
And aiming at each configuration parameter in the first group of configuration parameters, combining the configuration parameter with each configuration parameter in the second group of configuration parameters to form a port configuration combination to be tested. And finally determining the number of the configuration combinations of the ports to be tested to be different according to the difference of the number of the configuration parameters in the first group of configuration parameters and the second group of configuration parameters.
The inventor finds that, for the first network device 200 and the second network device 300 interconnected through the ethernet port, if the port communication rate configured by one of the ports to be tested exceeds the port maximum communication rate supported by the port to be tested of the opposite device, the port interconnected by the first network device 200 and the second network device 300 cannot negotiate successfully.
For example, assume that the first network device 200 communicates with port B of the second network device 300 through port a, which is assumed to be 100M electrical port and port B is assumed to be 1000M electrical port. If the port communication rate configured by port B exceeds the maximum communication rate (e.g., 1000M) of port a, the two cannot perform communication negotiation.
Thus, alternatively, the step S122 may be implemented by:
determining the maximum communication rates of the ports of the first network device 200 and the second network device 300 according to the port types of the first network device 200 and the second network device 300;
selecting a port configuration combination, of which the port communication rate in the configuration parameters is not greater than the port maximum communication rate of the first network device 200 and not greater than the port maximum communication rate of the second network device 300, as the port configuration combination to be tested.
The port maximum communication rate of the first network device 200 refers to a maximum communication rate of a port to be tested of the first network device 200, and the port maximum communication rate of the second network device 300 refers to a maximum communication rate of a port to be tested of the second network device 300.
By the design, unnecessary port configuration combinations can be eliminated, the testing workload is reduced, and the testing time is further reduced.
Step S123, sending the configuration parameters in the port configuration combination to be tested to the first network device 200 and the second network device 300, respectively.
After determining the configuration combination of the ports to be tested, for each configuration combination of the ports to be tested, the test terminal 100 configures and tests the corresponding ports to be tested of the first network device 200 and the second network device 300 according to the configuration parameters in the configuration combination of the ports to be tested.
Step S130, acquiring and recording an actual negotiation result of the first network device 200 and the second network device 300 performing communication negotiation with the port configuration combination for each sent port configuration combination.
For each group of interconnected ports to be tested, the test terminal 100 records an actual negotiation result after the group of interconnected ports performs communication negotiation based on each port configuration combination to be tested. Therefore, the tester can judge whether the group of interconnected ports can carry out correct communication negotiation according to the actual negotiation result.
As an embodiment, the test terminal 100 may write the recorded actual negotiation result into a result file and output the result file. Optionally, each group of interconnected ports corresponds to one result file. Therefore, the actual negotiation result can be called and read by the tester more conveniently.
Optionally, in this embodiment, step S130 may include the following steps:
and acquiring and recording the port communication rate, the port duplex mode and the port state after the first network device 200 and the second network device 300 perform communication negotiation by using the port configuration combination for each sent port configuration combination.
In this embodiment, for two ports performing communication negotiation, the actual negotiation result may include port communication rate, port duplex mode, port state, port connectivity, and the like of the two ports after the negotiation is completed. When the two ports negotiate to reach an agreed communication rate and duplex mode, the negotiation is successful, otherwise the negotiation fails. The port states comprise DOWN and UP, when the negotiation between the two ports is successful, the port states of the two ports are both UP, otherwise, the port states are DOWN. When the port status of a port is UP, it indicates that the port is connected.
However, in practical applications, there may be a situation where the port status is incorrect, and in order to ensure the accuracy of the test result, the port status may be further detected through the connectivity of the port.
Thus, optionally, the step S130 may further include the steps of:
for each port configuration combination sent, port connectivity after the first network device 200 and the second network device 300 perform communication negotiation using the port configuration combination is detected and recorded.
As an embodiment, the test terminal 100 may open three-layer interfaces of ethernet ports interconnected with the first network device 200 and the second network device 300, and configure corresponding IP addresses for the interconnected ethernet ports, respectively, so that the port connectivity of the first network device 200 and the second network device 300 may be detected through a PING instruction.
For example, assuming that port a of the first network device 200 is interconnected with port B of the second network device 300, the IP address of port a may be configured to be 1.1.1.1 and the IP address of port B may be configured to be 1.1.1.2. The test terminal 100 may send the instruction of pingg 1.1.1.2 to the first network device 200, send the instruction of pingg 1.1.1.1 to the second network device 300, and read the PING instruction execution result, that is, the actual port connectivity of the first network device 200 and the second network device 300 may be obtained.
Optionally, the configuration file may further include an expected negotiation result of each port configuration combination. Correspondingly, the network device testing method may further include the steps of:
for each port configuration combination sent, comparing the actual negotiation result and the expected negotiation result of the communication negotiation performed by the first network device 200 and the second network device 300 using the port configuration combination, and obtaining a test result.
In this embodiment, for each port configuration combination that is sent, if the actual negotiation result of the communication negotiation performed by the first network device 200 and the second network device 300 using the port configuration combination is the same as the expected negotiation result, it indicates that the test is passed, that is, the negotiation function of the current port group to be tested is correct; if the two port groups are different, the test is not passed, that is, the negotiation function of the currently tested port group is wrong.
Optionally, for two ports performing communication negotiation, the expected negotiation result includes an expected communication rate, an expected duplex mode, an expected port state, an expected connectivity, and the like after the two ports perform communication negotiation based on the corresponding port configuration combination. Accordingly, when comparing the actual negotiation result with the expected negotiation result, the actual negotiation result of each port should be compared with the expected negotiation result, and the actual negotiation result should be compared with the corresponding parameter in the expected negotiation result. When each item is matched, the actual negotiation result is determined to be the same as the expected negotiation result, otherwise, the actual negotiation result is different.
Optionally, a comparison result between the actual negotiation result and the expected negotiation result, that is, the test result may also be written into the result file together with the actual negotiation result.
Through the design, on one hand, the efficiency of port testing can be improved, and the testing can be quickly and accurately carried out under the condition that the port configuration combinations are very many; on the other hand, the accuracy of test result recording can be ensured. In addition, in the test process, a tester does not need to observe the test result in real time, and only needs to check the finally recorded actual negotiation result or test result, so that the test method is very convenient and fast for the tester.
As shown in fig. 5, an embodiment of the invention further provides a network device testing apparatus 110, which is applied to the testing terminal 100 shown in fig. 2. The network device testing apparatus 110 includes an obtaining module 111, a testing module 112, and a recording module 113.
The obtaining module 111 is configured to obtain a configuration file, where the configuration file includes a plurality of port configuration combinations, and each port configuration combination includes configuration parameters respectively applied to the first network device 200 and the second network device 300, where the configuration parameters include a port communication rate and a port duplex mode.
In this embodiment, the description of the obtaining module 111 may specifically refer to the detailed description of step S110 shown in fig. 3, that is, the step S110 may be executed by the obtaining module 111.
The test module 112 is configured to send the configuration parameters in the port configuration combination to the first network device 200 and the second network device 300, respectively, so that the first network device 200 and the second network device 300 perform communication negotiation according to the received configuration parameters.
In this embodiment, the description of the testing module 112 may specifically refer to the detailed description of the step S120 shown in fig. 3, that is, the step S120 may be executed by the testing module 112.
Optionally, the test module 112 may include a type reading sub-module 1121, a configuration selecting sub-module 1122, and a configuration sub-module 1123.
The type reading sub-module 1121 is configured to read port types of the first network device 200 and the second network device 300, respectively.
In this embodiment, the description of the type reading sub-module 1121 may specifically refer to the detailed description of step S121 shown in fig. 4, that is, the step S121 may be executed by the type reading sub-module 1121.
The configuration selecting sub-module 1122 is configured to select at least one port configuration combination from the plurality of port configuration combinations as a port configuration combination to be tested according to the port type.
In the present embodiment, the description of the configuration selecting sub-module 1122 may specifically refer to the detailed description of step S122 shown in fig. 4, that is, the step S122 may be performed by the configuration selecting sub-module 1122.
Optionally, in this embodiment, the selecting module 1122 selects at least one port configuration combination from the plurality of port configuration combinations as a configuration combination of a port to be tested according to the port type, and the selecting module may include:
determining the maximum communication rates of the ports of the first network device 200 and the second network device 300 according to the port types of the first network device 200 and the second network device 300;
selecting a port configuration combination, of which the port communication rate in the configuration parameters is not greater than the port maximum communication rate of the first network device 200 and not greater than the port maximum communication rate of the second network device 300, as the port configuration combination to be tested.
The configuration submodule 1123 is configured to send the configuration parameters in the port configuration combination to be tested to the first network device 200 and the second network device 300, respectively.
In this embodiment, the description of the configuration submodule 1123 may specifically refer to the detailed description of step S123 shown in fig. 4, that is, step S123 may be executed by the configuration submodule 1123. The recording module 113 is configured to obtain and record an actual negotiation result of the communication negotiation performed by the first network device 200 and the second network device 300 using the port configuration combination for each sent port configuration combination.
In this embodiment, the description of the recording module 113 may specifically refer to the detailed description of step S130 shown in fig. 3, that is, step S130 may be executed by the recording module 113.
Optionally, the configuration file further includes an expected negotiation result of each port configuration combination, and the network device testing apparatus 110 may further include a comparison module.
The comparing module is configured to compare, for each port configuration combination that is sent, an actual negotiation result and an expected negotiation result of the communication negotiation performed by the first network device 200 and the second network device 300 using the port configuration combination, and obtain a test result.
In summary, the network device testing method and apparatus provided in the embodiments of the present invention store a plurality of port configuration combinations in the form of configuration files in the testing terminal 100 that communicates with the first network device 200 and the second network device 300, respectively. The test terminal 100 automatically sends the configuration parameters in the port configuration combination to the first network device 200 and the second network device 300, respectively, so that the first network device 200 and the second network device 300 perform communication negotiation, thereby implementing automatic testing of the port negotiation function of the network devices. For each port configuration combination sent, the test terminal 100 obtains and records an actual negotiation result of the communication negotiation between the first network device 200 and the second network device 300 based on the port configuration combination. Therefore, the testing efficiency can be improved, and the accuracy and the reliability of the recorded testing result can be ensured.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (6)

1. A network equipment testing method is applied to a testing terminal which is respectively communicated with a first network equipment and a second network equipment, and is characterized by comprising the following steps:
acquiring a configuration file, wherein the configuration file comprises a plurality of port configuration combinations, each port configuration combination comprises configuration parameters respectively applied to a first network device and a second network device, and the configuration parameters comprise port communication rate and a port duplex mode;
respectively sending the configuration parameters in the port configuration combination to the first network equipment and the second network equipment, so that the first network equipment and the second network equipment carry out communication negotiation according to the received configuration parameters;
aiming at each sent port configuration combination, acquiring and recording an actual negotiation result of the communication negotiation between the first network equipment and the second network equipment by adopting the port configuration combination,
wherein the step of sending the configuration parameters in the port configuration combination to the first network device and the second network device respectively comprises:
respectively reading the port types of the first network equipment and the second network equipment;
respectively determining the maximum communication rates of the ports of the first network equipment and the second network equipment according to the port types;
selecting a port configuration combination with a port communication rate not greater than the maximum port communication rate of the first network equipment and not greater than the maximum port communication rate of the second network equipment in the configuration parameters as a port configuration combination to be tested;
and respectively sending the configuration parameters in the port configuration combination to be tested to the first network equipment and the second network equipment.
2. The method according to claim 1, wherein the step of obtaining and recording an actual negotiation result of the communication negotiation between the first network device and the second network device for each port configuration combination sent by the first network device and the second network device for the port configuration combination comprises:
and acquiring and recording the port communication rate, the port duplex mode and the port state after the first network equipment and the second network equipment adopt the port configuration combination to carry out communication negotiation aiming at each sent port configuration combination.
3. The method according to claim 2, wherein the step of obtaining and recording an actual negotiation result of the communication negotiation between the first network device and the second network device using the port configuration combination for each transmitted port configuration combination further comprises:
and detecting and recording the port connectivity of the first network equipment and the second network equipment after the communication negotiation is carried out by adopting the port configuration combination aiming at each sent port configuration combination.
4. The method according to any one of claims 1 to 3, wherein the configuration file further includes an expected negotiation result for each port configuration combination; the method further comprises the following steps:
and aiming at each sent port configuration combination, comparing the actual negotiation result and the expected negotiation result of the communication negotiation performed by the first network equipment and the second network equipment by adopting the port configuration combination to obtain a test result.
5. A network equipment testing device is characterized in that the device is applied to a testing terminal which is respectively communicated with a first network equipment and a second network equipment, and the device comprises:
an obtaining module, configured to obtain a configuration file, where the configuration file includes a plurality of port configuration combinations, and each port configuration combination includes configuration parameters respectively applied to a first network device and a second network device, where the configuration parameters include a port communication rate and a port duplex mode;
the test module is used for respectively sending the configuration parameters in the port configuration combination to the first network equipment and the second network equipment so that the first network equipment and the second network equipment carry out communication negotiation according to the received configuration parameters;
a recording module, configured to obtain and record an actual negotiation result of the communication negotiation between the first network device and the second network device using the port configuration combination for each sent port configuration combination,
wherein the test module comprises:
the type reading submodule is used for respectively reading the port types of the first network equipment and the second network equipment;
a configuration selection submodule, configured to determine, according to the port types, port maximum communication rates of the first network device and the second network device, respectively; selecting a port configuration combination with a port communication rate not greater than the maximum port communication rate of the first network equipment and not greater than the maximum port communication rate of the second network equipment in the configuration parameters as a port configuration combination to be tested;
and the configuration submodule is used for respectively sending the configuration parameters in the port configuration combination to be tested to the first network equipment and the second network equipment.
6. The apparatus according to claim 5, wherein the configuration file further comprises an expected negotiation result for each port configuration combination; the device further comprises:
and the comparison module is used for comparing the actual negotiation result and the expected negotiation result of the communication negotiation performed by the first network equipment and the second network equipment by adopting the port configuration combination aiming at each sent port configuration combination to obtain a test result.
CN201710765255.0A 2017-08-30 2017-08-30 Network equipment testing method and device Active CN109428783B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710765255.0A CN109428783B (en) 2017-08-30 2017-08-30 Network equipment testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710765255.0A CN109428783B (en) 2017-08-30 2017-08-30 Network equipment testing method and device

Publications (2)

Publication Number Publication Date
CN109428783A CN109428783A (en) 2019-03-05
CN109428783B true CN109428783B (en) 2022-02-25

Family

ID=65502169

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710765255.0A Active CN109428783B (en) 2017-08-30 2017-08-30 Network equipment testing method and device

Country Status (1)

Country Link
CN (1) CN109428783B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111130924A (en) * 2019-11-30 2020-05-08 苏州浪潮智能科技有限公司 Test method, test device and test equipment for Ethernet port of equipment
CN111404845A (en) * 2020-03-12 2020-07-10 深圳市吉祥腾达科技有限公司 Method and device for testing network port rate negotiation function
CN111953521A (en) * 2020-07-17 2020-11-17 烽火通信科技股份有限公司 SerDes port configuration method, system and readable storage medium
CN113507349B (en) * 2021-09-10 2021-12-10 苏州裕太微电子有限公司 Photoelectric matching method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1722677A (en) * 2004-11-02 2006-01-18 杭州华为三康技术有限公司 Method of initial configuration for network equipment
CN101640898A (en) * 2009-08-20 2010-02-03 华为技术有限公司 Detection method, detection device, detection system and base station
CN101783708A (en) * 2010-01-21 2010-07-21 哈尔滨工业大学 Wireless parallel test system and test method based on ZigBee
CN103139012A (en) * 2012-12-03 2013-06-05 深圳市共进电子股份有限公司 Ethernet port test method and network devices
CN103812726A (en) * 2014-01-26 2014-05-21 烽火通信科技股份有限公司 Automated testing method and device for data communication equipment
CN106100935A (en) * 2016-08-06 2016-11-09 顺德职业技术学院 Charging equipment of electric automobile communication protocol consistency test device and method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1722677A (en) * 2004-11-02 2006-01-18 杭州华为三康技术有限公司 Method of initial configuration for network equipment
CN101640898A (en) * 2009-08-20 2010-02-03 华为技术有限公司 Detection method, detection device, detection system and base station
CN101783708A (en) * 2010-01-21 2010-07-21 哈尔滨工业大学 Wireless parallel test system and test method based on ZigBee
CN103139012A (en) * 2012-12-03 2013-06-05 深圳市共进电子股份有限公司 Ethernet port test method and network devices
CN103812726A (en) * 2014-01-26 2014-05-21 烽火通信科技股份有限公司 Automated testing method and device for data communication equipment
CN106100935A (en) * 2016-08-06 2016-11-09 顺德职业技术学院 Charging equipment of electric automobile communication protocol consistency test device and method

Also Published As

Publication number Publication date
CN109428783A (en) 2019-03-05

Similar Documents

Publication Publication Date Title
CN109428783B (en) Network equipment testing method and device
CN110896366B (en) Network card function testing method and device of multi-network card equipment and storage medium
CN103401726A (en) Network path detecting method, device and system
CN112653600A (en) Network card performance testing method and device based on USB network card and electronic equipment
US9077448B2 (en) Read optical power link service for link health diagnostics
CN108897647B (en) Test system, test method and device
CN106776346B (en) Test method and device of CCMTS (China center testing System) equipment
CN110347539B (en) Test method, device, system, computing device and medium applied to server
CN109873728A (en) A kind of terminal test method, device and storage medium
WO2016082543A1 (en) Device testing method and testing device
CN111404779A (en) Method, device and system for testing role switching of router nodes
CN111416882A (en) BMC IP setting method and device, electronic equipment and system
CN108738059B (en) WIFI module testing method and device
CN109471763B (en) Method, device, equipment and system for grabbing trace of NVME (network video management entity) hard disk
CN114338493A (en) NCSI test method, system, device and storage medium based on network protocol stack
CN110855518B (en) Method and system for automatically adapting test host
CN101800672A (en) Equipment detection method and equipment
CN112866061A (en) NCSI (network control information system) testing method, device, equipment and medium of onboard network port
CN111341379B (en) Method and equipment for testing storage device
CN116225804A (en) PCIe link detection method, system, equipment and storage medium
CN114006822B (en) Method and device for judging link between switch and server
CN115391202A (en) Multi-control cluster race performance testing method, device, terminal and storage medium
CN115002736A (en) Low-power-consumption Bluetooth test method, device, system, test equipment and storage medium
CN114448915A (en) Link fault diagnosis method and device, electronic equipment and readable storage medium
CN114338464A (en) Fault diagnosis method, device, equipment and computer readable storage 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
GR01 Patent grant
GR01 Patent grant