CN112118158A - Test method, test device, test equipment and storage medium of switch - Google Patents

Test method, test device, test equipment and storage medium of switch Download PDF

Info

Publication number
CN112118158A
CN112118158A CN202011008888.5A CN202011008888A CN112118158A CN 112118158 A CN112118158 A CN 112118158A CN 202011008888 A CN202011008888 A CN 202011008888A CN 112118158 A CN112118158 A CN 112118158A
Authority
CN
China
Prior art keywords
test
switch
network port
tested
link
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.)
Granted
Application number
CN202011008888.5A
Other languages
Chinese (zh)
Other versions
CN112118158B (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202011008888.5A priority Critical patent/CN112118158B/en
Publication of CN112118158A publication Critical patent/CN112118158A/en
Application granted granted Critical
Publication of CN112118158B publication Critical patent/CN112118158B/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
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/10Packet switching elements characterised by the switching fabric construction

Abstract

The invention discloses a test method of a switch, which comprises the steps of firstly, sequentially connecting each network port in a test group of a switch to be tested to obtain a test link corresponding to the test group, and enabling each network port; then based on the switching chip of the switch to be tested, sending a test data packet to the test link, and detecting the data transceiving performance of each network port in the test link; and determining the test result of the switch to be tested according to the data transceiving performance of each network port. The test data packet is sent to the network port of the switch to be tested through the switching chip of the switch to be tested, the data transceiving performance of each network port is tested, the performance of the domestic switch is tested, the complete production line of the domestic switch is facilitated, and the production scale of the domestic switch is enlarged. The invention also provides a testing device, testing equipment and a storage medium of the switch, and the testing device, the testing equipment and the storage medium have the beneficial effects.

Description

Test method, test device, test equipment and storage medium of switch
Technical Field
The present invention relates to the field of switch factory testing, and in particular, to a method, an apparatus, a device, and a storage medium for testing a switch.
Background
Nowadays, the localization of high-tech equipment is imperative. The switch, which is the most important ring of IT facilities, is also urgently required to be localized. The switch produced in the whole country means that main components such as a CPU, a switch chip and the like are designed and manufactured by domestic manufacturers, and the domestic manufacturers have independent intellectual property rights. For a long time, factory production line production tests of switches in China are basically executed according to the design standards of exchange chips of the company Botong, the technical dependence on the exchange chips is too strong, and a matching formed test scheme does not exist for the domestic exchange chips researched and developed in new promotion. The existing domestic switch chip mainly refers to a generic switch chip CTC8096, which specifically controls a network port through a SERializer/DESerializer (serdes), and executes an instruction to the network port to obtain a port state, a running rate, and the like.
How to test the domestic switch is a technical problem to be solved by technical personnel in the field.
Disclosure of Invention
The invention aims to provide a test method, a test device, test equipment and a storage medium of a switch, which are used for testing the performance of a domestic switch, are beneficial to complete the production line of the domestic switch and enlarge the production scale of the domestic switch.
In order to solve the above technical problem, the present invention provides a method for testing an exchange, comprising:
sequentially connecting each network port in a test group of a switch to be tested to obtain a test link corresponding to the test group and enabling each network port;
based on the switching chip of the switch to be tested, sending a test data packet to the test link, and detecting the data transceiving performance of each network port in the test link;
and determining the test result of the switch to be tested according to the data transceiving performance of each network port.
Optionally, the sequentially connecting each network port in the test group of the switch to be tested to obtain a test link corresponding to the test group, and enabling each network port specifically includes:
connecting two network ports in the test group into a group to obtain a test pair;
enabling each of the network ports;
and adding the adjacent network ports of the two adjacent test pairs into the same virtual local area network according to the connection sequence of the test pairs to obtain a test link corresponding to the test group.
Optionally, before the switching chip based on the switch to be tested sends a test data packet to the test link and detects the data transceiving performance of each network port in the test link, the method further includes:
judging whether each virtual local area network is successfully established;
if yes, entering the switching chip based on the switch to be tested, sending a test data packet to the test link, and detecting the data transceiving performance of each network port in the test link;
if not, outputting the abnormal information of the exchange chip and ending the test.
Optionally, the test data packet is specifically a unicast packet.
Optionally, the test data packet specifically includes a first test data packet and a second test data packet;
the sending of a test data packet to the test link and the detection of the data transceiving performance of each network port in the test link based on the switch chip of the switch to be tested specifically include:
based on the switching chip, after sending a first preset number of first test data packets to the head end of the test link, detecting the quantity of first messages received at the tail end of the test link;
based on the switching chip, after sending a second preset number of second test data packets to the tail end of the test link, detecting the quantity of second messages received at the head end of the test link;
correspondingly, the determining the test result of the switch to be tested according to the data transceiving performance of each network port specifically includes:
judging whether the quantity of the first messages is the first preset quantity and the quantity of the second messages is the second preset quantity;
if so, determining that the switch to be tested passes the test;
and if not, determining that the switch to be tested does not pass the test.
Optionally, the test data packet specifically includes a third test data packet and a fourth test data packet;
the sending of a test data packet to the test link and the detection of the data transceiving performance of each network port in the test link based on the switch chip of the switch to be tested specifically include:
based on the switch chip, after sending a third preset number of third test data packets to the head end of the test link, obtaining the number of third messages of each network port in the test link and the data transceiving type recorded by the third messages;
based on the switch chip, after a fourth preset number of fourth test data packets are sent to the tail end of the test link, the number of fourth messages of each network port in the test link and the data receiving and sending types recorded by the fourth messages are obtained;
correspondingly, the determining the test result of the switch to be tested according to the data transceiving performance of each network port specifically includes:
judging whether the first condition and the second condition are met simultaneously;
if so, determining that the switch to be tested passes the test;
if not, determining that the switch to be tested does not pass the test;
the first condition is that the number of the third packets is the third preset number, the data transceiving type of the third packets of the network port ordered as odd from the head end of the test link is receiving, and the data transceiving type of the third packets of the network port ordered as even from the head end of the test link is forwarding; the second condition is that the number of the fourth messages is the fourth preset number, the data transceiving type of the third message of the network port ordered as an odd number from the head end of the test link is forwarding, and the data transceiving type of the third message of the network port ordered as an even number from the head end of the test link is receiving.
Optionally, before the switching chip based on the switch to be tested sends a test data packet to the test link and detects the data transceiving performance of each network port in the test link, the method further includes:
judging whether each network port is in a working state and operates at a chip set frequency based on the switching chip;
if yes, entering the step of sending a first preset number of first data packets to the network port of the head end;
and if not, outputting a network port connection error prompt.
In order to solve the above technical problem, the present invention further provides a testing apparatus for a switch, including:
the connection unit is used for sequentially connecting each network port in a test group of the switch to be tested to obtain a test link corresponding to the test group and enable each network port;
the test unit is used for sending a test data packet to the test link based on the switching chip of the switch to be tested and detecting the data transceiving performance of each network port in the test link;
and the checking unit is used for determining the test result of the switch to be tested according to the data transceiving performance of each network port.
In order to solve the above technical problem, the present invention further provides a testing apparatus for a switch, including:
a memory for storing instructions, said instructions comprising the steps of any of the above described methods of testing a switch;
a processor to execute the instructions.
In order to solve the above technical problem, the present invention further provides a storage medium having a computer program stored thereon, wherein the computer program is configured to implement the steps of the method for testing a switch according to any one of the above items when executed by a processor.
The testing method of the switch provided by the invention comprises the following steps of firstly, sequentially connecting each network port in a testing group of the switch to be tested to obtain a testing link corresponding to the testing group, and enabling each network port; then based on the switching chip of the switch to be tested, sending a test data packet to the test link, and detecting the data transceiving performance of each network port in the test link; and determining the test result of the switch to be tested according to the data transceiving performance of each network port. The test data packet is sent to the network port of the switch to be tested through the switching chip of the switch to be tested, the data transceiving performance of each network port is tested, the performance of the domestic switch is tested, the complete production line of the domestic switch is facilitated, and the production scale of the domestic switch is enlarged.
The invention also provides a testing device, a testing device and a storage medium of the switch, which have the beneficial effects and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments or technical solutions of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
Fig. 1 is a flowchart of a testing method for a switch according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a testing apparatus of a switch according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a test device of a switch according to an embodiment of the present invention.
Detailed Description
The core of the invention is to provide a test method, a test device, test equipment and a storage medium of the switch, which are used for testing the performance of the domestic switch, are beneficial to complete the production line of the domestic switch and enlarge the production scale of the domestic switch.
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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
Fig. 1 is a flowchart of a method for testing a switch according to an embodiment of the present invention.
The switch to be tested mainly comprises a CPU, a switching chip and a network port. The switching chip adopted in the switch to be tested in the embodiment of the invention is a domestic switching chip (currently, only CTC8096 produced by department of the Ministry). On the basis, the switch to be tested can be a switch made in China, namely, main components such as a CPU (Central processing Unit) and a switching chip are designed and manufactured by domestic manufacturers. The CPU of the switch to be tested can adopt Loongson 2K1000, the CPU is connected with a switching chip (Shengke CTC8096) through a PCIe bus (PCIe multiplied by 2), and the switching chip is connected with a network port through a serializer/deserializer (serdes).
The embodiment of the invention can be connected with the CPU and the switching chip of the switch to be tested through one testing host, drive the CPU and the switching chip of the switch to be tested through the driving program, and acquire information through the CPUC of the switch to be tested to carry out detection.
Before testing, hardware information of the switch to be tested can be obtained through a driver; judging whether the exchange chip is CTC8096 according to the hardware information; if yes, go to the following step S101; if not, the test is ended. The specific procedure can be as follows:
int get_chip_hwinfo(ctc_chip_device_info_t*device_info)
{
ret=ctc_chip_get_property(0,CTC_CHIP_PROP_DEVICE_INFO,(void*)device_info);
return ret;
}
as shown in fig. 1, a method for testing a switch according to an embodiment of the present invention includes:
s101: and sequentially connecting each network port in the test group of the switch to be tested to obtain a test link corresponding to the test group and enable each network port.
The number of the network ports of the switch to be tested is usually an even number, and in order to facilitate the test of the data transceiving function of the network ports, the number of the network ports in each test group is ensured to be the even number when the test groups are divided. By connecting the network ports in a test group into a test link, data transceiving tests can be conveniently and respectively carried out from the two ends of the test link, whether each network port has the functions of receiving and forwarding data packets or not is confirmed, and packet loss is avoided. For convenience of testing, all network ports on the switch to be tested can be taken as a test group.
In a specific implementation, step S101 may include: connecting the network ports in the test group by taking two network ports as a group to obtain a test pair; enabling each network port; and adding the adjacent network ports of the two adjacent test pairs into the same virtual local area network according to the connection sequence of the test pairs to obtain a test link corresponding to the test group.
The network ports in the test group are connected by taking two network ports as a group to obtain a test pair, specifically, an optical cable connector (such as a 10G AOC cable) can be adopted to connect the upper and lower two network ports respectively according to the serial number of the network ports on the switch to be tested, namely, the network port 1 and the network port 2 on the switch to be tested are connected by the 10G AOC cable, and the network port 3 and the network port 4 on the switch to be tested are connected by the 10G AOC cable … … and so on.
Since the network ports of the domestic switch default to the power-down state, all the network ports need to be enabled to be powered on. Taking an example that the switch to be tested has 54 network ports in total, the specific procedure is as follows:
Figure BDA0002696904900000061
and further creating Virtual Local Area Networks (VLANs) which are in one-to-one correspondence with the test pairs, and adding two network ports in the test pairs into the corresponding virtual local area networks, aiming at enabling all the network ports to logically form a link. If the network port 1 and the network port 2 on the switch to be tested are connected by using 10G AOC cable, and the network port 3 and the network port 4 on the switch to be tested are connected by using 10G AOC cable … …, in this step, the network port 2 and the network port 3 are added into the first virtual local area network, the network port 4 and the network port 5 are added into the second virtual local area network … …, and so on. If the virtual local area network is not successfully created in the step, the switching chip is not normal in function, and maintenance analysis is needed. Before executing the next step (step S102), the method for testing a switch provided in the embodiment of the present invention may further include:
judging whether each virtual local area network is successfully established; if yes, go to step S102; if not, outputting the abnormal information of the exchange chip and ending the test.
Taking 54 network ports of the switch to be tested in total and taking all the network ports of the switch to be tested as a test group as an example, 27 virtual local area networks can be created, if the ID of the first virtual local area network is 10, the network port 2 and the network port 3 are added into the VLAN 10, the network port 4 and the network port 5 are added into the VLAN 11, … … is performed, and so on. Specific procedures are referenced below:
Figure BDA0002696904900000071
Figure BDA0002696904900000081
after the virtual local area network is created, to avoid performing an invalid test when the switch to be tested is in a fault state, before step S102, the method for testing the switch provided in the embodiment of the present invention may further include:
judging whether each network port is in a working state and operates at a chip set frequency based on the switching chip; if yes, entering a step of sending a first preset number of first data packets to a network port of the head end; and if not, outputting a network port connection error prompt.
Whether the virtual local area network is successfully set or not is judged through data interaction with the exchange chip, whether all network ports are in a working state (up) or not and whether all network ports are in a chip set frequency (such as 10G, 40G and 100G) or not is judged, and when any one of the network ports is not met, information of abnormal connection of the network ports is output, and a user is prompted to check the connection condition of each network port through an optical cable connector. And the user checks the optical cable connector with abnormal connection and re-executes the step of performing data interaction check connection with the exchange chip after the optical cable connector is connected and connected. If the user checks that all the optical cable connectors are normally connected, the fact that the switch to be tested has a fault is indicated, maintenance and analysis are needed, and the next testing is not needed.
S102: and based on the switching chip of the switch to be tested, sending a test data packet to the test link, and detecting the data transceiving performance of each network port in the test link.
In order to facilitate the comparison between the sending and receiving packets and the statistics of the number of the lost packets, the status register may be cleared before step S102. The type of the test data packet may be a unicast packet, a multicast packet, a broadcast packet, or the like.
And sending a test data packet to the test link through the CPU of the switch to be tested, and detecting the data transceiving performance of each network port in the test link. Preferably, the test data packet is sent from the head end or the tail end of the test link, and the packet sending and receiving comparison and the packet loss statistics and other analysis are performed by receiving the message from the other end, so as to obtain the data transceiving performance of each network port in the test link.
S103: and determining the test result of the switch to be tested according to the data transceiving performance of each network port.
If the number of the received messages is not equal to that of the forwarded messages or packet loss occurs, it indicates that the switch to be tested fails the test and needs to be maintained and analyzed; otherwise, the test is passed.
The switch testing method provided by the embodiment of the invention comprises the steps of firstly, sequentially connecting each network port in a testing group of a switch to be tested to obtain a testing link corresponding to the testing group, and enabling each network port; then based on the switching chip of the switch to be tested, sending a test data packet to the test link, and detecting the data transceiving performance of each network port in the test link; and determining the test result of the switch to be tested according to the data transceiving performance of each network port. The test data packet is sent to the network port of the switch to be tested through the switching chip of the switch to be tested, the data transceiving performance of each network port is tested, the performance of the domestic switch is tested, the complete production line of the domestic switch is facilitated, and the production scale of the domestic switch is enlarged.
In the above embodiments, the test data packet may be a unicast packet. On this basis, the test data packet specifically comprises a first test data packet and a second test data packet. In the method for testing a switch provided in the embodiment of the present invention, step S102: based on the switching chip of the switch to be tested, sending a test data packet to the test link, and detecting the data transceiving performance of each network port in the test link, specifically comprising:
based on the switching chip, after a first preset number of first test data packets are sent to the head end of the test link, detecting the quantity of first messages received at the tail end of the test link; and based on the switching chip, after sending a second preset number of second test data packets to the tail end of the test link, detecting the quantity of second messages received at the head end of the test link.
Accordingly, step S103: determining a test result of the switch to be tested according to the data transceiving performance of each network port, specifically comprising:
judging whether the quantity of the first messages is a first preset quantity and the quantity of the second messages is a second preset quantity; if so, determining that the switch to be tested passes the test; if not, determining that the switch to be tested does not pass the test.
In the specific implementation, taking 54 network ports of the switch to be tested in total and taking all the network ports of the switch to be tested as a test group as an example, a first preset number (for example, 2000000) of first test data packets may be sent to the network port 1 through the CPU of the switch to be tested, a first message of the network port 54 is obtained through the switch chip, and it is detected whether the number of the first message is 2000000, if so, the step passes the test, otherwise, it is determined that the switch to be tested does not pass the test.
And then, sending a second preset number (for example, 2000000) of second test data packets to the network port 54 through the CPU of the switch to be tested, acquiring a second message of the network port 1 through the switch chip, and detecting whether the number of the second message is 2000000, if so, the step passes the test, otherwise, determining that the switch to be tested does not pass the test.
The sequence of the two steps can also be reversed, and if both pass the test, the switch to be tested passes the test.
On the basis that the test data packet adopts the unicast packet, the test data packet specifically comprises a third test data packet and a fourth test data packet. In the method for testing a switch provided in the embodiment of the present invention, step S102: based on the switching chip of the switch to be tested, sending a test data packet to the test link, and detecting the data transceiving performance of each network port in the test link, specifically comprising:
based on the switching chip, after a third preset number of third test data packets are sent to the head end of the test link, the number of third messages of each network port in the test link and the data receiving and sending type recorded by the third messages are obtained; and based on the switching chip, after a fourth preset number of fourth test data packets are sent to the tail end of the test link, acquiring the number of fourth messages of each network port in the test link and the data receiving and sending type recorded by the fourth messages.
Accordingly, step S103: determining a test result of the switch to be tested according to the data transceiving performance of each network port, specifically comprising:
judging whether a first condition and a second condition are met simultaneously; if so, determining that the switch to be tested passes the test; if not, determining that the switch to be tested does not pass the test;
the first condition is that the number of the third messages is a third preset number, the data receiving and sending types of the third messages of the network ports which are sequenced from the head end of the self-test link to be odd numbers are receiving, and the data receiving and sending types of the third messages of the network ports which are sequenced from the head end of the self-test link to be even numbers are forwarding; the second condition is that the number of the fourth messages is a fourth preset number, the data receiving and sending type of the third messages of the network ports which are sequenced from the head end of the self-test link to be odd numbers is forwarding, and the data receiving and sending type of the third messages of the network ports which are sequenced from the head end of the self-test link to be even numbers is receiving.
In the specific implementation, taking 54 network ports of the switch to be tested in total and taking all network ports of the switch to be tested as a test group as an example, 2000000 first test data packets may be sent to the network port 1 through the CPU of the switch to be tested, the first packet of the network port 54 is obtained through the switch chip, and it is detected whether the number of the first packet is 2000000, and the data transceiving types of the odd ports (1, 3, 5 … …) are all received, and the data transceiving types of the even ports (2, 4, 6 … …) are all forwarded, if yes, the step passes the test, otherwise, the switch to be tested fails the test.
And then transmitting 2000000 second test data packets to the network port 54 through the CPU of the switch to be tested, acquiring a second message of the network port 1 through the switch chip, detecting whether the number of the second message is 2000000, wherein the data transceiving types of the odd ports (1, 3, 5 … …) are all forwarding, the data transceiving types of the even ports (2, 4, 6 … …) are all receiving, if yes, the step passes the test, otherwise, the switch to be tested is determined not to pass the test. Specific procedures are referenced below:
Figure BDA0002696904900000111
Figure BDA0002696904900000121
the data receiving and sending types of the network ports are detected on the basis of detecting the message quantity of each network port, so that the short circuit condition among certain network ports is effectively avoided. The sequence of the two steps can also be reversed, and if both pass the test, the switch to be tested passes the test.
On the basis of the above detailed description of the embodiments corresponding to the testing method of the switch, the invention also discloses a testing device, equipment and a storage medium of the switch corresponding to the method.
Fig. 2 is a schematic structural diagram of a testing apparatus of a switch according to an embodiment of the present invention.
As shown in fig. 2, a testing apparatus for a switch according to an embodiment of the present invention includes:
a connection unit 201, configured to sequentially connect each network port in a test group of a switch to be tested, obtain a test link corresponding to the test group, and enable each network port;
the test unit 202 is configured to send a test data packet to the test link based on a switch chip of the switch to be tested, and detect data transceiving performance of each network port in the test link;
the checking unit 203 is configured to determine a test result of the switch to be tested according to the data transceiving performance of each network port.
Since the embodiments of the apparatus portion and the method portion correspond to each other, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, which is not repeated here.
Fig. 3 is a schematic structural diagram of a test device of a switch according to an embodiment of the present invention.
As shown in fig. 3, the test equipment of the switch provided in the embodiment of the present invention includes:
a memory 310 for storing instructions, the instructions comprising the steps of the method for testing a switch according to any of the above embodiments;
a processor 320 for executing the instructions.
Processor 320 may include one or more processing cores, such as a 3-core processor, an 8-core processor, and so forth. The processor 320 may be implemented in at least one hardware form of a digital Signal processing (dsp), a Field-Programmable Gate Array (FPGA), a Programmable Logic Array (pla), or a digital Signal processing (dsp). The processor 320 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a central Processing unit (cpu); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 320 may be integrated with an image processor GPU (graphics Processing unit), which is responsible for rendering and drawing the content that the display screen needs to display. In some embodiments, processor 320 may also include an Artificial Intelligence (AI) (artificial intelligence) processor for processing computational operations related to machine learning.
Memory 310 may include one or more storage media, which may be non-transitory. Memory 310 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 310 is at least used for storing a computer program 311, wherein after the computer program 311 is loaded and executed by the processor 320, the relevant steps in the test method for a switch disclosed in any of the foregoing embodiments can be implemented. In addition, the resources stored by the memory 310 may also include an operating system 312, data 313, and the like, and the storage may be transient storage or persistent storage. The operating system 312 may be Windows, among others. Data 313 may include, but is not limited to, data involved in the above-described methods.
In some embodiments, the testing equipment of the switch may also include a display 330, a power supply 340, a communication interface 350, an input output interface 360, sensors 370, and a communication bus 380.
Those skilled in the art will appreciate that the architecture shown in fig. 3 does not constitute a limitation of the test equipment of the switch and may include more or fewer components than those shown.
The test equipment of the switch provided by the embodiment of the application comprises the memory and the processor, and when the processor executes the program stored in the memory, the test method of the switch can be realized, and the effect is the same as that of the test method of the switch.
It should be noted that the above-described embodiments of the apparatus and device are merely illustrative, for example, the division of modules is only one division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form. Modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and performs all or part of the steps of the methods according to the embodiments of the present invention, or all or part of the technical solution.
To this end, an embodiment of the present invention further provides a storage medium, where a computer program is stored, and when being executed by a processor, the computer program implements the steps of the testing method, such as the switch.
The storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory ROM (Read-Only Memory), a random Access Memory ram (random Access Memory), a magnetic disk, or an optical disk.
The storage medium provided in this embodiment contains a computer program that, when executed by a processor, can implement the steps of the method for testing a switch as described above, and the effect is the same as above.
The present invention provides a method, an apparatus, a device and a storage medium for testing an exchange. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device, the equipment and the storage medium disclosed by the embodiment correspond to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A method for testing a switch, comprising:
sequentially connecting each network port in a test group of a switch to be tested to obtain a test link corresponding to the test group and enabling each network port;
based on the switching chip of the switch to be tested, sending a test data packet to the test link, and detecting the data transceiving performance of each network port in the test link;
and determining the test result of the switch to be tested according to the data transceiving performance of each network port.
2. The method according to claim 1, wherein the sequentially connecting the network ports in the test group of the switch to be tested to obtain the test link corresponding to the test group and enable each of the network ports specifically comprises:
connecting two network ports in the test group into a group to obtain a test pair;
enabling each of the network ports;
and adding the adjacent network ports of the two adjacent test pairs into the same virtual local area network according to the connection sequence of the test pairs to obtain a test link corresponding to the test group.
3. The method according to claim 2, wherein before the switching chip based on the switch under test sends a test packet to the test link and detects the data transceiving performance of each network port in the test link, the method further comprises:
judging whether each virtual local area network is successfully established;
if yes, entering the switching chip based on the switch to be tested, sending a test data packet to the test link, and detecting the data transceiving performance of each network port in the test link;
if not, outputting the abnormal information of the exchange chip and ending the test.
4. The test method according to claim 1, wherein the test data packet is a unicast packet.
5. The method of claim 4, wherein the test data packet specifically includes a first test data packet and a second test data packet;
the sending of a test data packet to the test link and the detection of the data transceiving performance of each network port in the test link based on the switch chip of the switch to be tested specifically include:
based on the switching chip, after sending a first preset number of first test data packets to the head end of the test link, detecting the quantity of first messages received at the tail end of the test link;
based on the switching chip, after sending a second preset number of second test data packets to the tail end of the test link, detecting the quantity of second messages received at the head end of the test link;
correspondingly, the determining the test result of the switch to be tested according to the data transceiving performance of each network port specifically includes:
judging whether the quantity of the first messages is the first preset quantity and the quantity of the second messages is the second preset quantity;
if so, determining that the switch to be tested passes the test;
and if not, determining that the switch to be tested does not pass the test.
6. The method of claim 4, wherein the test packets specifically include a third test packet and a fourth test packet;
the sending of a test data packet to the test link and the detection of the data transceiving performance of each network port in the test link based on the switch chip of the switch to be tested specifically include:
based on the switch chip, after sending a third preset number of third test data packets to the head end of the test link, obtaining the number of third messages of each network port in the test link and the data transceiving type recorded by the third messages;
based on the switch chip, after a fourth preset number of fourth test data packets are sent to the tail end of the test link, the number of fourth messages of each network port in the test link and the data receiving and sending types recorded by the fourth messages are obtained;
correspondingly, the determining the test result of the switch to be tested according to the data transceiving performance of each network port specifically includes:
judging whether the first condition and the second condition are met simultaneously;
if so, determining that the switch to be tested passes the test;
if not, determining that the switch to be tested does not pass the test;
the first condition is that the number of the third packets is the third preset number, the data transceiving type of the third packets of the network port ordered as odd from the head end of the test link is receiving, and the data transceiving type of the third packets of the network port ordered as even from the head end of the test link is forwarding; the second condition is that the number of the fourth messages is the fourth preset number, the data transceiving type of the third message of the network port ordered as an odd number from the head end of the test link is forwarding, and the data transceiving type of the third message of the network port ordered as an even number from the head end of the test link is receiving.
7. The method according to claim 1, wherein before the switching chip based on the switch under test sends a test packet to the test link and detects the data transceiving performance of each network port in the test link, the method further comprises:
judging whether each network port is in a working state and operates at a chip set frequency based on the switching chip;
if yes, entering the step of sending a first preset number of first data packets to the network port of the head end;
and if not, outputting a network port connection error prompt.
8. A test apparatus for a switch, comprising:
the connection unit is used for sequentially connecting each network port in a test group of the switch to be tested to obtain a test link corresponding to the test group and enable each network port;
the test unit is used for sending a test data packet to the test link based on the switching chip of the switch to be tested and detecting the data transceiving performance of each network port in the test link;
and the checking unit is used for determining the test result of the switch to be tested according to the data transceiving performance of each network port.
9. A test apparatus for a switch, comprising:
a memory for storing instructions comprising the steps of a method of testing a switch according to any one of claims 1 to 7;
a processor to execute the instructions.
10. A storage medium having stored thereon a computer program, characterized in that the computer program, when being executed by a processor, carries out the steps of the method of testing a switch according to any one of claims 1 to 7.
CN202011008888.5A 2020-09-23 2020-09-23 Test method, test device, test equipment and storage medium of switch Active CN112118158B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011008888.5A CN112118158B (en) 2020-09-23 2020-09-23 Test method, test device, test equipment and storage medium of switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011008888.5A CN112118158B (en) 2020-09-23 2020-09-23 Test method, test device, test equipment and storage medium of switch

Publications (2)

Publication Number Publication Date
CN112118158A true CN112118158A (en) 2020-12-22
CN112118158B CN112118158B (en) 2022-11-08

Family

ID=73800232

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011008888.5A Active CN112118158B (en) 2020-09-23 2020-09-23 Test method, test device, test equipment and storage medium of switch

Country Status (1)

Country Link
CN (1) CN112118158B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113114523A (en) * 2021-03-04 2021-07-13 山东英信计算机技术有限公司 Method and system for testing rack-mounted network switch
CN113741280A (en) * 2021-09-03 2021-12-03 天津津航计算技术研究所 Intelligent management control device of homemade VPX framework
CN113872827A (en) * 2021-09-10 2021-12-31 苏州浪潮智能科技有限公司 Method and device for analyzing snakelike test failure of switch and storage medium
CN115297070A (en) * 2022-07-15 2022-11-04 中国航空无线电电子研究所 Multi-metadata-excited ARINC664 switch cache overflow test method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110493073A (en) * 2019-07-12 2019-11-22 苏州浪潮智能科技有限公司 A kind of test method and system of network switch port function
CN111092782A (en) * 2018-10-24 2020-05-01 迈普通信技术股份有限公司 Tested communication equipment, communication equipment port data forwarding test system and method
CN111314180A (en) * 2020-02-27 2020-06-19 深圳震有科技股份有限公司 Ethernet link test method, terminal and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111092782A (en) * 2018-10-24 2020-05-01 迈普通信技术股份有限公司 Tested communication equipment, communication equipment port data forwarding test system and method
CN110493073A (en) * 2019-07-12 2019-11-22 苏州浪潮智能科技有限公司 A kind of test method and system of network switch port function
CN111314180A (en) * 2020-02-27 2020-06-19 深圳震有科技股份有限公司 Ethernet link test method, terminal and storage medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113114523A (en) * 2021-03-04 2021-07-13 山东英信计算机技术有限公司 Method and system for testing rack-mounted network switch
CN113114523B (en) * 2021-03-04 2022-07-12 山东英信计算机技术有限公司 Method and system for testing rack-mounted network switch
CN113741280A (en) * 2021-09-03 2021-12-03 天津津航计算技术研究所 Intelligent management control device of homemade VPX framework
CN113872827A (en) * 2021-09-10 2021-12-31 苏州浪潮智能科技有限公司 Method and device for analyzing snakelike test failure of switch and storage medium
CN113872827B (en) * 2021-09-10 2023-03-24 苏州浪潮智能科技有限公司 Method and device for analyzing snakelike test failure of switch and storage medium
CN115297070A (en) * 2022-07-15 2022-11-04 中国航空无线电电子研究所 Multi-metadata-excited ARINC664 switch cache overflow test method
CN115297070B (en) * 2022-07-15 2024-02-27 中国航空无线电电子研究所 Multi-metadata-excited ARINC664 switch cache overflow test method

Also Published As

Publication number Publication date
CN112118158B (en) 2022-11-08

Similar Documents

Publication Publication Date Title
CN112118158B (en) Test method, test device, test equipment and storage medium of switch
US9135130B2 (en) Debugging method, chip, board, and system
CN103181133B (en) The server system that Based PC IE exchanges and reverse method and equipment
CN101296131B (en) Method, device and system for testing switchboard connectivity
JP4886601B2 (en) Apparatus and method for operating USB interface equipment
CN106909752B (en) Simulation system for testing external interface of high-speed railway computer interlocking system
CN105095037A (en) Wire card, backboard of wire card and wire card test method
CN115550291B (en) Switch reset system and method, storage medium, and electronic device
CN110535715B (en) Linux-based port state real-time detection method, circuit and switch
CN107294594A (en) A kind of passive optical network equipment, switching method and system
US8737419B2 (en) Network concentrator and method of controlling the same
CN113676380B (en) Switch port testing method, electronic equipment and system
CN114356671A (en) Board card debugging device, system and method
CN104468301B (en) A kind of Safety output method based on MVB communications
CN113377701A (en) Serial port control system based on complex programmable logic device CPLD and communication method thereof
CN109407574A (en) Output-controlling device and its method may be selected in a kind of multibus
CN202218247U (en) Switch fault detection system
CN104484260A (en) Simulation monitoring circuit based on GJB289 bus interface SoC (system on a chip)
CN114880266B (en) Fault processing method and device, computer equipment and storage medium
CN207135101U (en) A kind of passive optical network equipment and system
CN105553859A (en) System and method for enabling SFP modules to be adaptive to interfaces
US20230184831A1 (en) Server jtag component adaptive interconnection system and method
CN108562805A (en) A kind of interactive mode break-make electric test device, system and method
CN101561793B (en) Port expansion device and method for processing data by same
CN114615106A (en) Ring data processing system, method and network equipment

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