Port connectivity test method and system
By connecting the auxiliary testing device to the port of the device under test, sending and comparing the number of data packets, the problem of low efficiency in port connectivity testing of low-end switches without software is solved, and efficient and low-cost testing of multiple devices is achieved.
Patent Information
- Application Number
- CN202310890004.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-19
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-07-19
AI Technical Summary
In existing technologies, port connectivity testing of low-end switches without software is inefficient and costly, and it is impossible to test multiple ports at once, resulting in low efficiency in mass production testing.
The auxiliary testing device connects to the multiple test ports of the device under test one by one. The auxiliary testing device sends data packets, which are copied and forwarded by the device under test. The auxiliary testing device compares the number of data packets to determine connectivity and performs tests in combination with different forwarding modes and port rates.
It enables simultaneous testing of port connectivity for multiple devices under test, simplifying operations, improving testing efficiency, reducing costs, and supporting automated testing of various forwarding modes and port rates.
Smart Images

Figure CN119341942B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer network, in particular to a port connectivity test method and system. BACKGROUND
[0002] In a computer network, there are a large number of switches to realize the exchange of data messages between devices in the network, and among them there are low-end switches without software, which cannot configure virtual local area network (VLAN) through message interaction or serial port. Therefore, the port connectivity of such devices can usually be tested by the flow instrument flow method. However, in this way, the test instrument can provide fewer test ports, and when a single port of the device under test corresponds to multiple forwarding ports, it cannot be tested at one time, and the other end of the flow instrument cable needs to be frequently replaced to the corresponding test port, which is low in testing efficiency and high in testing cost. Therefore, the flow instrument flow method has been abandoned by the industry in mass production and testing scenarios due to its low efficiency and high cost. SUMMARY
[0003] The purpose of the present application includes, for example, to provide a port connectivity test method and system which can simultaneously complete the testing of multiple devices under test, and is simple to operate and high in testing efficiency.
[0004] Embodiments of the present application can be implemented as follows:
[0005] In a first aspect, the present application provides a port connectivity test method applied to a port connectivity test system including an auxiliary test device and a device under test, a plurality of auxiliary test ports of the auxiliary test device are connected one by one with a plurality of test ports of the device under test, and the method comprises:
[0006] The auxiliary test device sends data messages to at least one test port of the device under test connected with at least one auxiliary test port through the at least one auxiliary test port;
[0007] The device under test copies and forwards the data messages to other test ports through at least one test port receiving the data messages;
[0008] Each test port of the device under test returns the received data messages to the auxiliary test device;
[0009] The auxiliary test device compares the number of data messages received by each auxiliary test port with the number of data messages sent through the at least one auxiliary test port to determine whether the connectivity between the test ports of the device under test is normal.
[0010] In an optional embodiment, the device under test has a DIP switch for switching the forwarding mode of the device under test;
[0011] Before the step of sending the data packets by the auxiliary testing device to the at least one testing port of the device under test via the at least one auxiliary testing port connected to the at least one testing port of the device under test, the method further comprises:
[0012] The auxiliary testing device obtains the current forwarding mode determined by the current state of the DIP switch on the device under test;
[0013] The auxiliary testing device runs the test script corresponding to the current forwarding mode, and determines the testing port of the device under test for receiving the data packets according to the current forwarding mode;
[0014] The auxiliary testing device determines the at least one auxiliary testing port connected to the testing port of the device under test for receiving the data packets.
[0015] In an optional embodiment, the method further comprises:
[0016] In the case where the determination result is that the connectivity between the testing ports of the device under test is abnormal, the auxiliary testing device runs another test script corresponding to another forwarding mode of the device under test to perform the test under the other test script;
[0017] The auxiliary testing device determines whether the correspondence between the state of the DIP switch of the device under test and the forwarding mode of the device under test is incorrect based on the test result under the other test script.
[0018] In an optional embodiment, the step of determining whether the correspondence between the state of the DIP switch of the device under test and the forwarding mode of the device under test is incorrect based on the test result under the other test script comprises:
[0019] In the case where the auxiliary testing device determines that the connectivity between the testing ports of the device under test is abnormal after performing the test based on the other test script, the auxiliary testing device retains the determination result of the connectivity abnormality and determines that the correspondence between the state of the DIP switch of the device under test and the forwarding mode of the device under test is correct;
[0020] In the case where the auxiliary testing device determines that the connectivity between the testing ports of the device under test is normal after performing the test based on the other test script, the auxiliary testing device modifies the determination result to connectivity normal and determines that the correspondence between the state of the DIP switch of the device under test and the forwarding mode of the device under test is incorrect.
[0021] In an optional embodiment, the step of determining whether the connectivity between the to-be-tested ports of the to-be-tested device is normal by comparing the number of data packets received by each of the auxiliary testing ports and the number of data packets sent through each of the at least one auxiliary testing port comprises:
[0022] The auxiliary testing device determines the number of data packets received by each of the auxiliary testing ports and the number of data packets sent through each of the auxiliary testing ports, wherein the number of data packets sent through each of the auxiliary testing ports is equal.
[0023] When the number of data packets received by each of the auxiliary testing ports is equal to the number of data packets sent through each of the auxiliary testing ports, or when the number of data packets received by each of the auxiliary testing ports is a set multiple of the number of data packets sent through each of the auxiliary testing ports, the auxiliary testing device determines that the connectivity between the to-be-tested ports of the to-be-tested device is normal, wherein the set multiple is the number of ports of the auxiliary testing ports sending data packets.
[0024] In an optional embodiment, the method further comprises:
[0025] The auxiliary testing device obtains a cyclic redundancy check (CRC) record result of each of the auxiliary testing ports to determine whether a CRC error code is generated in the transmission process of the data packets received by the auxiliary testing ports and the number of CRC error codes generated in the case of generating a CRC error code.
[0026] In an optional embodiment, the step of copying and forwarding the data packets by the to-be-tested device through at least one to-be-tested port receiving the data packets to other to-be-tested ports comprises:
[0027] The to-be-tested device determines a port rate at which the auxiliary testing device sends the data packets;
[0028] The to-be-tested device copies and forwards the data packets at the port rate through at least one to-be-tested port receiving the data packets to other to-be-tested ports.
[0029] In a second aspect, the present application provides a port connectivity testing system, which comprises an auxiliary testing device and a to-be-tested device, a plurality of auxiliary testing ports of the auxiliary testing device are connected to a plurality of to-be-tested ports of the to-be-tested device one by one;
[0030] The auxiliary testing device is configured to send data packets to at least one to-be-tested port of the to-be-tested device connected to at least one auxiliary testing port of the auxiliary testing device through the at least one auxiliary testing port.
[0031] The to-be-tested device is configured to copy and forward the data packet to other to-be-tested ports through at least one to-be-tested port receiving the data packet.
[0032] The to-be-tested device is further configured to return the received data packet to the auxiliary testing device through each to-be-tested port.
[0033] The auxiliary testing device is further configured to compare the number of data packets received by each auxiliary testing port with the number of data packets sent through the at least one auxiliary testing port, to determine whether the connectivity between the to-be-tested ports of the to-be-tested device is normal.
[0034] In an optional embodiment, the to-be-tested device has a dial switch for switching the forwarding mode of the to-be-tested device.
[0035] The auxiliary testing device is further configured to obtain a current forwarding mode determined by the current state of the dial switch of the to-be-tested device, run a test script corresponding to the current forwarding mode, and determine a to-be-tested port of the to-be-tested device for receiving data packets according to the current forwarding mode.
[0036] The auxiliary testing device is further configured to determine at least one auxiliary testing port connected to the to-be-tested port of the to-be-tested device for receiving data packets.
[0037] In an optional embodiment, the auxiliary testing device is further configured to, in a case where the determination result is that the connectivity between the to-be-tested ports of the to-be-tested device is abnormal, run another test script corresponding to another forwarding mode of the to-be-tested device, to perform testing under the other test script.
[0038] The auxiliary testing device is further configured to determine, based on the test result under the other test script, whether the correspondence between the state of the dial switch of the to-be-tested device and the forwarding mode of the to-be-tested device is incorrect.
[0039] The beneficial effects of the embodiments of the present application include, for example:
[0040] The application provides a port connectivity test method and system. A plurality of auxiliary test ports of an auxiliary test device are connected with a plurality of to-be-tested ports of a to-be-tested device one by one, and the auxiliary test device sends data packets to the connected to-be-tested ports through at least one auxiliary test port. The to-be-tested device copies and forwards the data packets to other to-be-tested ports through the to-be-tested ports receiving the data packets. Each auxiliary test port of the auxiliary test device receives the data packets returned by each to-be-tested port connected with the auxiliary test port. The received data packets are compared with the number of sent data packets to determine whether the connectivity between the to-be-tested ports of the to-be-tested device is normal. The application adopts the combination of an auxiliary test device and a test mechanism to realize the test, can complete the test of a plurality of to-be-tested devices at one time, does not need to change the connection mode in the process, is simple to operate, can improve the test efficiency and reduce the test cost. BRIEF DESCRIPTION OF DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some of the embodiments of the application, and therefore should not be regarded as a limitation to the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.
[0042] Figure 1 The structural block diagram of the port connectivity test system provided by the embodiments of the application is shown in the figure.
[0043] Figure 2 The schematic diagram of the port connection between the to-be-tested device and the auxiliary test device provided by the embodiments of the application is shown in the figure.
[0044] Figure 3 The flowchart of the port connectivity test method provided by the embodiments of the application is shown in the figure.
[0045] Figure 4 The schematic diagram of the plurality of forwarding modes of the to-be-tested device provided by the embodiments of the application is shown in the figure.
[0046] Figure 5 The flowchart of the auxiliary test port determination method provided by the embodiments of the application is shown in the figure.
[0047] Figure 6 The other schematic diagram of the port connection between the to-be-tested device and the auxiliary test device provided by the embodiments of the application is shown in the figure.
[0048] Figure 7 The flowchart of the corresponding relationship detection method provided by the embodiments of the application is shown in the figure. DETAILED DESCRIPTION
[0049] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some but not all of the embodiments of the present application. The components of the embodiments of the present application described and shown in the drawings can be arranged and designed in various different configurations.
[0050] Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present application.
[0051] It should be noted that: similar reference numbers and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0052] In the description of the present application, it should be noted that the features in the embodiments of the present application can be combined with each other without conflict.
[0053] Please refer to Figure 1 The application scenario of the port connectivity test method provided by the embodiments of the present application is shown in the following figure, which includes a port connectivity test system composed of an auxiliary test device and a device under test. The device under test is a low-end switch without software, and the auxiliary test device can be a three-layer switch. The auxiliary test device can be one or more, and the device under test can be one or more. Multiple auxiliary test devices can be used to test the port connectivity of multiple devices under test, or one auxiliary test device can be used to test the port connectivity of one or more devices under test.
[0054] Specifically, the auxiliary test device can include multiple auxiliary test ports, and the device under test can include multiple test ports. When testing the port connectivity of multiple devices under test with one auxiliary test device, the total number of auxiliary test ports of the auxiliary test device is greater than or equal to the total number of test ports of the multiple devices under test.
[0055] The multiple auxiliary test ports of the auxiliary test device are respectively connected to the multiple test ports of the device under test. Here, one-to-one connection means that each test port of the device under test can have a connected auxiliary test port on the auxiliary test device, and in the case where the number of auxiliary test ports is greater than the number of test ports, there are auxiliary test ports on the auxiliary test device that are not connected to test ports.
[0056] Please refer to Figure 2For example, when there are k devices under test, each device under test has m ports to be tested, the number of auxiliary test ports of the auxiliary test device used can be n, where n is greater than or equal to k*m. As shown in Figure 2 for example, the ports 1 to m of the device under test 1 are connected to the auxiliary test ports 1 to m of the auxiliary test device in sequence, the ports 1 to m of the device under test 2 are connected to the auxiliary test ports m+1 to 2m of the auxiliary test device in sequence, and the ports 1 to m of the device under test k are connected to the auxiliary test ports km-m+1 to km of the auxiliary test device in sequence.
[0057] The embodiments of the present application also provide a port connectivity testing method, which can be applied to the port connectivity testing system to test the port connectivity of the device under test. As shown in Figure 3 the port connectivity testing method provided by the embodiments will be described in detail.
[0058] S11, the auxiliary test device sends data packets to at least one port under test of the device under test through at least one auxiliary test port.
[0059] S12, the device under test copies and forwards the data packets to other ports under test through at least one port under test receiving the data packets.
[0060] S13, each port under test of the device under test returns the received data packets to the auxiliary test device.
[0061] S14, the auxiliary test device compares the data packets received by each auxiliary test port with the number of data packets sent through at least one auxiliary test port to determine whether the connectivity between the ports under test of the device under test is normal.
[0062] In the embodiments, the device under test is connected to the auxiliary test device, and multiple auxiliary test ports of the auxiliary test device can be connected to multiple ports under test of the device under test in sequence. The number of auxiliary test ports of the auxiliary test device is greater than or equal to the number of ports under test of the device under test. When there are multiple devices under test, the number of ports under test of the device under test is the total number of ports under test of the multiple devices under test. When there are multiple auxiliary test devices, the number of auxiliary test ports of the auxiliary test device is the total number of auxiliary test ports of the multiple auxiliary test devices.
[0063] After the connection relationship between the auxiliary measurement device and the to-be-measured device is established, the auxiliary measurement device can send data packets to at least one to-be-measured port of the to-be-measured device through at least one auxiliary measurement port of the auxiliary measurement device. The auxiliary measurement port used to send data packets to the to-be-measured device can be determined according to the to-be-measured port of the to-be-measured device used to implement data packet replication and forwarding. That is, after the to-be-measured port of the to-be-measured device used for data packet replication and forwarding is determined, the auxiliary measurement port connected to the determined to-be-measured port can be used to send data packets to the determined to-be-measured port.
[0064] The to-be-measured port of the to-be-measured device used for data packet replication and forwarding can be at least one, that is, one or more (two or more in this application). Therefore, the number of auxiliary measurement ports used to send data packets to the to-be-measured device corresponds to at least one, that is, one or more.
[0065] The number of data packets sent by the auxiliary measurement device through each auxiliary measurement port can be set according to requirements, for example, the number can be four, five, etc. without limitation. In the case where the number of auxiliary measurement ports used to send data packets to the to-be-measured device is more than one, the number of data packets sent from each auxiliary measurement port can be equal to facilitate subsequent statistical analysis.
[0066] After the to-be-measured device receives data packets through the at least one to-be-measured port described above, the to-be-measured device will replicate and forward the received data packets to other to-be-measured ports. In the case where the connectivity between the to-be-measured ports is normal, the data packets will be successfully forwarded to other to-be-measured ports. In the case where the connectivity between the to-be-measured ports is abnormal, the data packets can not be transmitted to other to-be-measured ports.
[0067] In addition, the to-be-measured device can also feed back data packets to the auxiliary measurement device. Specifically, each to-be-measured port can return data packets to the auxiliary measurement device through the connected auxiliary measurement port. After receiving the data packets returned by the to-be-measured port connected thereto, each auxiliary measurement port can compare the number of data packets received by each auxiliary measurement port and the number of data packets sent by each auxiliary measurement port to determine whether the connectivity between the to-be-measured ports of the to-be-measured device is normal.
[0068] In the case where the connectivity between the to-be-measured ports of the to-be-measured device is normal, each to-be-measured port will successfully receive data packets. According to the setting of the forwarding mode inside the to-be-measured device, each to-be-measured port can receive one copy of the replicated and forwarded data packets, or multiple copies of the replicated and forwarded data packets. In the case where the connectivity between the to-be-measured ports of the to-be-measured device is abnormal, the to-be-measured port can not receive the replicated and forwarded data packets, or can only receive part of the replicated and forwarded data packets.
[0069] Therefore, each auxiliary test port can determine whether the connectivity between the test ports of the test device is normal according to the number of received data packets and the number of sent data packets after receiving the data packets sent by the connected test port. It should be understood that when the auxiliary test port does not receive the data packets sent by the connected test port, it can be understood that the number of received data packets by the auxiliary test port is 0, and it can be determined that the connectivity of the test port is abnormal.
[0070] The port connectivity test method provided in the embodiment can send data packets to the test ports of the test device through the auxiliary test ports of the auxiliary test device connected to the test device, receive the returned data packets of the test ports connected to each auxiliary test port, and compare the number of sent data packets and the number of received data packets to determine whether the connectivity between the test ports of the test device is normal. The scheme uses the combination of the auxiliary test device and the test mechanism to realize the test, can complete the test of multiple test devices at one time, does not need to change the connection mode in the process, is simple to operate, can improve the test efficiency and reduce the test cost.
[0071] In the embodiment, the forwarding mode inside the test device can include multiple modes, for example, as shown in Figure 4 Mode 1, the data packets sent by the auxiliary test device can be received through one test port A, and the data packets are copied and forwarded to other test ports B-H through the test port A. In addition, as shown in Figure 4 Mode 2, the data packets sent by the auxiliary test device can be received through two test ports A and B, and the test ports A and B copy and forward the received data packets to other test ports C-H. In addition, as shown in Figure 4 Mode 3, the data packets sent by the auxiliary test device can be received through two test ports A and B, and then the test port A copies and forwards the data packets to test ports C-E, and the test port B copies and forwards the data packets to test ports F-H.
[0072] It should be noted that the above three forwarding modes are only for illustration and do not limit the forwarding mode of the test device. For example, the test device can also receive the data packets sent by the auxiliary test device through three test ports and copy and forward them. In the actual test process, the corresponding test mechanism can be set based on the actual forwarding mode inside the test device.
[0073] The to-be-tested device has a code switch, and the code switch can be adjusted to switch the forwarding mode of the to-be-tested device. In the embodiment, when the to-be-tested device is tested by the auxiliary testing device, the to-be-tested device can be tested in various forwarding modes. In different forwarding modes, different to-be-tested ports of the to-be-tested device need to be sent with data packets, and the auxiliary testing ports used to send the data packets to the to-be-tested device are also different. Please refer to Figure 5 In the embodiment, before the auxiliary testing device sends the data packets to the at least one to-be-tested port of the to-be-tested device connected with the at least one auxiliary testing port, the at least one auxiliary testing port can be determined by the following method.
[0074] S21, the auxiliary testing device obtains the current forwarding mode determined by the current state of the code switch on the to-be-tested device.
[0075] S22, the auxiliary testing device runs the test script corresponding to the current forwarding mode, and determines the to-be-tested port of the to-be-tested device used to receive the data packets according to the current forwarding mode.
[0076] S23, the auxiliary testing device determines the at least one auxiliary testing port connected with the to-be-tested port of the to-be-tested device used to receive the data packets.
[0077] In the embodiment, the code switch on the to-be-tested device can switch the forwarding mode of the to-be-tested device to different modes when the code switch is in different states. For example, when the code switch is switched to a first forwarding mode, the code switch is switched to a second forwarding mode when the code switch is switched to another position.
[0078] When the test is performed, after the networking environment of the auxiliary testing device and the to-be-tested device is connected, the state of the code switch on the to-be-tested device can be determined first, and then the current forwarding mode of the to-be-tested device can be determined. It is assumed that the current forwarding mode of the to-be-tested device is a first forwarding mode.
[0079] The auxiliary testing device can be pre-loaded with multiple test scripts, and the multiple test scripts can correspond to multiple forwarding modes of the to-be-tested device. After the current forwarding mode of the to-be-tested device is determined, the test script corresponding to the current forwarding mode can be run. For example, the test script corresponding to the first forwarding mode can be run.
[0080] The auxiliary testing device can have a display device, and a pop-up box can be popped up through the display device. The test mode corresponding to the first forwarding mode can be input in the pop-up box, so that the test script of the test mode is run.
[0081] When the current forwarding mode of the to-be-tested device is determined, the to-be-tested port of the to-be-tested device currently used to receive the data packets can be determined. For example, in the first forwarding mode, the to-be-tested port of the to-be-tested device currently used to receive the data packets can be determined by Figure 4The to-be-tested port A in the to-be-tested device receives the data message sent by the auxiliary testing device.
[0082] Then, the auxiliary testing port on the auxiliary testing device connected with the to-be-tested port A can be determined. Under the execution logic of the test script, the processor of the auxiliary testing device will send data messages to the to-be-tested device through the determined auxiliary testing port, and execute the test process as described above.
[0083] After the test under one forwarding mode is executed, the dial switch on the to-be-tested device can be adjusted to switch to another forwarding mode and execute the test. In this way, the connectivity of the ports of the to-be-tested device under different forwarding modes can be tested in sequence.
[0084] For example, in combination with the description in Figure 4 and Figure 6 , when the auxiliary testing device is a three-layer switch with 48 ports, the to-be-tested devices include six, and each to-be-tested device has eight ports. The to-be-tested port of each to-be-tested device is as shown in Figure 4 , and each to-be-tested device has three forwarding modes as shown in Figure 4 . First, the to-be-tested port A of the to-be-tested device is connected to the auxiliary testing port 1 of the auxiliary testing device, the to-be-tested port B is connected to the auxiliary testing port 2, and so on, and the to-be-tested port H is connected to the auxiliary testing port 8. When six to-be-tested devices are tested at the same time, the connection is performed in sequence.
[0085] After the network environment as described above is constructed, first, the dial switch of all to-be-tested devices is dialed to position 1, that is, the forwarding mode of the to-be-tested device corresponds to the first forwarding mode. The test script corresponding to the first forwarding mode is run on the auxiliary testing device, for example, mode 1 can be input in the display pop-up box of the auxiliary testing device to trigger the execution of the corresponding test script. At this time, the auxiliary testing device will send data messages through the auxiliary testing ports 1, 9,..., 41, and then count the data messages received through the auxiliary testing ports 2 to 8, 10 to 16,..., 42 to 47. By comparing the data of the sent data messages and the number of received data messages, it can be determined whether the connectivity of each channel of the to-be-tested device under the first forwarding mode is normal, and the result of the test is displayed through the display pop-up box of the auxiliary testing device.
[0086] In addition, the dial switch of all to-be-tested devices can be dialed to position 2, that is, the forwarding mode of the to-be-tested device corresponds to the second forwarding mode. The test script corresponding to the second forwarding mode is run on the auxiliary testing device, for example, mode 2 can be input in the display pop-up box of the auxiliary testing device to trigger the execution of the corresponding test script. The auxiliary testing device sends data messages through the auxiliary testing ports 1, 2, 9, 10,..., 41, 42, and then counts the data messages received through the auxiliary testing ports 3 to 8, 11 to 16,..., 43 to 47. By comparing the number of received data messages and the number of sent data messages, it can be determined whether the connectivity of each channel of the to-be-tested device under the second forwarding mode is normal.
[0087] In addition, the DIP switches of all the devices under test can be set to position 3, i.e., the forwarding mode of the device under test corresponds to the third forwarding mode. The test script corresponding to the third forwarding mode is run on the auxiliary testing device. The auxiliary testing device sends data packets through auxiliary testing ports 1, 2, 9, 10…41, 42, and then receives data packets through auxiliary testing ports 3 to 8, 11 to 16…43 to 47. By comparing the number of sent data packets with the number of received data packets, it can be determined whether the connectivity between the channels of the device under test in the third forwarding mode is normal.
[0088] In this embodiment, the auxiliary testing device can also send data packets at different port rates when sending data packets to the device under test. Correspondingly, the device under test can copy and forward data packets in the following manner after receiving the data packets:
[0089] The device under test determines the port rate at which the auxiliary testing device sends data packets, and copies and forwards the data packets to other testing ports at the port rate through at least one testing port receiving the data packets.
[0090] In this embodiment, considering that different port rates have different effects on the copying and forwarding of data packets in the device under test, when the auxiliary testing device sends data packets to the device under test at multiple different port rates, the device under test can switch to the corresponding port rate through self-negotiation. In this way, the connectivity between the channels of the device under test in different port rates can be tested.
[0091] In this embodiment, after the auxiliary testing device receives the data packets fed back by the device under test, when determining whether the connectivity between the testing ports of the device under test is normal by comparing the number of data packets received by each auxiliary testing port with the number of data packets sent through each auxiliary testing port, it can be achieved in the following manner:
[0092] First, the auxiliary testing device determines the number of data packets received by each auxiliary testing port and the number of data packets sent through each auxiliary testing port in at least one auxiliary testing port, wherein the data of the data packets sent by each auxiliary testing port is equal. For example, if data packets are sent through two auxiliary testing ports, the number of data packets sent by the two auxiliary testing ports is the same.
[0093] When the number of data packets received by each auxiliary testing port is equal to the number of data packets sent through each auxiliary testing port, or when the number of data packets received by each auxiliary testing port is a set multiple of the number of data packets sent through each auxiliary testing port, it is determined that the connectivity between the testing ports of the device under test is normal, wherein the set multiple is the number of ports of the auxiliary testing ports sending data packets.
[0094] It should be noted that the above is a judgment mechanism for a single device under test, and when testing multiple devices under test, the above judgment mechanism can be used for each device under test.
[0095] For example, in the case where the device under test in the first forwarding mode in the device under test in the first forwarding mode, the auxiliary test device sends data packets through an auxiliary test port (for a device under test), and if the number of data packets received by each auxiliary test port is equal to the number of data packets sent, it is determined that the port connectivity of the device under test in the first forwarding mode is normal. However, if the number of data packets received by the auxiliary test port is not equal to the number of data packets sent, it is determined that the port connectivity of the device under test in the first forwarding mode is abnormal. Figure 4 For example, in the case where the device under test in the second forwarding mode in the device under test in the second forwarding mode, the auxiliary test device sends data packets through two auxiliary test ports (for a device under test), and if the number of data packets received by each auxiliary test port is twice the number of data packets sent by each auxiliary test port (i.e. the number of auxiliary test ports sending data packets), it is determined that the port connectivity of the device under test in the second forwarding mode is normal. If the number of data packets received by the auxiliary test port is not equal to twice the number of data packets sent, it is determined that the port connectivity of the device under test in the second forwarding mode is abnormal.
[0096] Figure 4 In this embodiment, the state of the dial switch has a corresponding relationship with the forwarding mode of the device under test, and the forwarding mode of the device under test determines the test script executed on the auxiliary test device. Therefore, if the corresponding relationship between the dial switch on the device under test and the forwarding mode is incorrect, the current forwarding mode determined based on the current state of the dial switch on the device under test is not the actual forwarding mode, and the test script executed on the auxiliary test device is not corresponding to the actual forwarding mode. In this case, the test result obtained cannot accurately reflect the actual situation of the port connectivity of the device under test.
[0097] Based on the above considerations, please refer to In this embodiment, a method for detecting whether the corresponding relationship between the dial switch and the forwarding mode of the device under test is incorrect can also be provided, which can be implemented in the following way:
[0098] Figure 7 S31, in the case where the auxiliary test device determines that the connectivity between the test ports of the device under test is abnormal, the auxiliary test device runs other test scripts corresponding to other forwarding modes of the device under test to perform testing under the other test scripts.
[0099] S31, in the case where the auxiliary test device determines that the connectivity between the test ports of the device under test is abnormal, the auxiliary test device runs other test scripts corresponding to other forwarding modes of the device under test to perform testing under the other test scripts.
[0100] S32, the auxiliary test device, based on the test results of other test scripts, determines whether there is an error in the correspondence between the state of the DIP switch of the device under test and the forwarding mode of the device under test.
[0101] As described above, during testing, a test script corresponding to the current forwarding mode of the device under test (DUT) is run on the auxiliary test device. The current forwarding mode of the DUT is determined based on the current state of the DIP switch. If the correspondence between the DIP switch state and the forwarding mode is incorrect, the determined current forwarding mode will not be the actual forwarding mode. If, after executing the test script corresponding to the current forwarding mode of the DUT, the result indicates abnormal connectivity between the ports under test, other test scripts corresponding to other forwarding modes of the DUT can be run, and tests can be performed under these other test scripts. These other test scripts can be any test script other than the one corresponding to the current forwarding mode.
[0102] Based on the judgment results obtained from other test scripts, the port connectivity of the device under test can be finally determined, and it can be determined whether the correspondence between the DIP switch and the forwarding mode is incorrect.
[0103] In this embodiment, as one possible implementation, the following method can be used to determine whether there is an error in the correspondence between the state of the DIP switch of the device under test and the forwarding mode of the device under test:
[0104] If the auxiliary testing device determines that the connectivity between the ports under test of the device under test is abnormal after testing based on other test scripts, it retains the determination result of the connectivity abnormality and determines that the correspondence between the DIP switch of the device under test and the forwarding mode of the device under test is correct.
[0105] For example, such as Figure 4 As shown, if the DIP switch of the device under test (DUT) is in position 1, it corresponds to the first forwarding mode of the DUT. After running the test script corresponding to the first forwarding mode on the auxiliary test device, the result indicates that the connectivity between the ports under test of the DUT is abnormal. A test script corresponding to the second forwarding mode can be run on the auxiliary test device. If the test results in an abnormal connectivity between the ports under test of the DUT, then a test script corresponding to the third forwarding mode can be run on the auxiliary test device. If the test results in an abnormal connectivity between the ports under test of the DUT, then it can be finally determined that the connectivity between the ports of the DUT is abnormal, and the correspondence between the DIP switch state and the forwarding mode is correct.
[0106] In addition, the auxiliary testing device modifies the determination result as normal connectivity in the case that the connectivity between the ports of the device under test is determined to be normal after the testing based on the other test scripts, and determines that the correspondence between the state of the DIP switch and the forwarding mode of the device under test is incorrect.
[0107] Likewise, based on the above, if the connectivity between the ports of the device under test is determined to be normal after the testing based on the test script corresponding to the second forwarding mode, or the connectivity between the ports is determined to be abnormal after the testing based on the test script corresponding to the second forwarding mode, but the connectivity between the ports is determined to be normal after the testing based on the test script corresponding to the third forwarding mode, the previously determined result of abnormal connectivity can be modified as the determination result of normal connectivity. In addition, it is determined that the correspondence between the state of the DIP switch and the forwarding mode is incorrect.
[0108] In the embodiment, based on the above testing mechanism, in the case of testing the connectivity of the ports of the device under test, a fast and effective identification method is provided to detect whether the welding is mixed up or not, so as to ensure the quality of the products and improve the production efficiency.
[0109] In the embodiment, in addition to judging whether the connectivity between the ports of the device under test is normal or not by comparing the number of sent and received data packets, it is also possible to monitor whether a Cyclic Redundancy Check (CRC) error code is generated in the process of sending and receiving packets. Based on this, the testing method provided by the embodiment can further include the following steps:
[0110] The auxiliary testing device obtains the Cyclic Redundancy Check (CRC) record result of each auxiliary testing port to determine whether a CRC error code is generated in the transmission process of the data packet received by the auxiliary testing port and the number of CRC error codes in the case that a CRC error code is generated.
[0111] In the embodiment, the test script running on the auxiliary testing device can have the function of counting the CRC record result of each auxiliary testing port. The CRC record result can indicate whether a CRC error code is generated in the transmission process of the data packet received by the auxiliary testing port.
[0112] The CRC record result can be recorded based on the number of data packets, for example, if the number of data packets is 5 and the CRC record result is 0, it indicates that no CRC error code is generated in the data packet during transmission, and for example, if the CRC record result is 2, it indicates that 2 data packets have generated CRC error codes during transmission.
[0113] In summary, the port connectivity test method provided in the embodiment connects the auxiliary test port of the auxiliary test device with the to-be-tested port of the to-be-tested device, executes the corresponding test script, sends data packets, and compares the number of received data packets with the number of sent data packets to test the connectivity between the to-be-tested ports of the to-be-tested device.
[0114] In addition, in the case where the to-be-tested device has multiple forwarding modes, the test script can be switched to complete the test in various forwarding modes. In addition, the test results in multiple test scripts can be combined to determine whether the correspondence between the status of the dial switch of the to-be-tested device and the forwarding mode is incorrect.
[0115] In addition, in the embodiment, the port connectivity of the to-be-tested device can be tested under multiple different port rates, and the CRC record result of the auxiliary test device port can be automatically queried by the test script to monitor whether a CRC error code is generated during the test.
[0116] In the test scheme provided in the embodiment, after the networking environment is built, the cable connection mode does not need to be frequently changed, and the port connectivity test under multiple forwarding modes and multiple port rates and the eeprom device welding correctness test can be automatically completed. The test scheme supports simultaneous testing of multiple to-be-tested devices, is simple to operate, and is helpful to improve production efficiency. The test based on the auxiliary test device and in combination with the test script has good scalability, and in the case where the devices need to be mass-produced, only the number of ports and the number of devices of the auxiliary test device need to be increased, without the need to increase expensive test instruments, thereby saving production cost.
[0117] Based on the same inventive concept, the embodiment of the present application provides a port connectivity test system, and the functions of each device in the port connectivity test system are as follows:
[0118] The auxiliary test device is configured to send data packets to at least one to-be-tested port of the to-be-tested device connected with at least one auxiliary test port through the at least one auxiliary test port;
[0119] The to-be-tested device is configured to copy and forward the data packets to other to-be-tested ports through the at least one to-be-tested port receiving the data packets;
[0120] The to-be-tested device is further configured to return the received data packets to the auxiliary test device through the to-be-tested ports.
[0121] The auxiliary testing device is further configured to compare the number of data packets received by each auxiliary testing port with the number of data packets sent through each auxiliary testing port to determine whether the connectivity between the testing ports of the testing device is normal.
[0122] The port connectivity testing system can achieve the technical effects of the port connectivity testing method in any of the above embodiments, and thus will not be described again.
[0123] In a possible implementation, the testing device has a dial switch for switching the forwarding mode of the testing device;
[0124] The auxiliary testing device is further configured to obtain a current forwarding mode determined by a current state of the dial switch of the testing device, run a test script corresponding to the current forwarding mode, and determine a testing port of the testing device for receiving data packets according to the current forwarding mode.
[0125] The auxiliary testing device is further configured to determine at least one auxiliary testing port connected to the testing port of the testing device for receiving data packets.
[0126] In a possible implementation, the auxiliary testing device is further configured to, in a case where the determination result is that the connectivity between the testing ports of the testing device is abnormal, run another test script corresponding to another forwarding mode of the testing device to perform testing under the other test script.
[0127] The auxiliary testing device is further configured to determine, based on the testing result under the other test script, whether the correspondence between the state of the dial switch of the testing device and the forwarding mode of the testing device is incorrect.
[0128] In a possible implementation, the auxiliary testing device is configured to, in a case where the connectivity between the testing ports of the testing device is determined to be abnormal after the testing based on the other test script, retain the determination result that the connectivity is abnormal, and determine that the correspondence between the state of the dial switch of the testing device and the forwarding mode of the testing device is correct.
[0129] The auxiliary testing device is further configured to, in a case where the connectivity between the testing ports of the testing device is determined to be normal after the testing based on the other test script, modify the determination result to normal connectivity, and determine that the correspondence between the state of the dial switch of the testing device and the forwarding mode of the testing device is incorrect.
[0130] In a possible implementation, the auxiliary testing device is configured to determine the number of data packets received by each auxiliary testing port and the number of data packets sent through each auxiliary testing port of the at least one auxiliary testing port, where the number of data packets sent through each auxiliary testing port is equal.
[0131] The auxiliary testing device is used to determine that the connectivity between the to-be-tested ports of the to-be-tested device is normal when the number of data packets received by each auxiliary testing port is equal to the number of data packets sent through each auxiliary testing port, or when the number of data packets received by each auxiliary testing port is a set multiple of the number of data packets sent through each auxiliary testing port, and the set multiple is the number of ports of the auxiliary testing port sending the data packets.
[0132] In a possible implementation, the auxiliary testing device is further used to obtain a cyclic redundancy check (CRC) record result of each auxiliary testing port, to determine whether a CRC error code is generated in the transmission process of the data packet received by the auxiliary testing port, and the number of CRC error codes in the case of generating the CRC error code.
[0133] In a possible implementation, the to-be-tested device is used to determine a port rate when the auxiliary testing device sends the data packet.
[0134] The to-be-tested device is further used to copy and forward the data packet to other to-be-tested ports at the port rate through at least one to-be-tested port receiving the data packet.
[0135] In summary, the port connectivity testing method and system provided by the embodiments of the present application are used to connect a plurality of auxiliary testing ports of an auxiliary testing device with a plurality of to-be-tested ports of a to-be-tested device one by one, and the auxiliary testing device sends a data packet to the connected to-be-tested port through at least one auxiliary testing port, and the to-be-tested device copies and forwards the data packet to other to-be-tested ports through the to-be-tested port receiving the data packet. Each auxiliary testing port of the auxiliary testing device receives the data packet returned by each to-be-tested port connected to the auxiliary testing port. The number of received data packets and the number of sent data packets are compared to determine whether the connectivity between the to-be-tested ports of the to-be-tested device is normal. The present application uses the combination of the auxiliary testing device and the testing mechanism to realize the testing, and the testing of a plurality of to-be-tested devices can be completed at one time, and the connection mode does not need to be changed in the process, the operation is simple, the testing efficiency can be improved, and the testing cost can be reduced.
[0136] The above merely provides specific implementation manners of the present application, but the protection scope of the present application is not limited thereto, any changes or replacements within the technical range disclosed by the present application can be easily thought by those skilled in the art, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for testing port connectivity, characterized in that, A port connectivity testing system including an auxiliary test device and a device under test (DUT), wherein multiple auxiliary test ports of the auxiliary test device are connected one-to-one with multiple DUT ports of the DUT, and the DUT has a DIP switch for switching the forwarding mode of the DUT, the method comprising: The auxiliary test device obtains the current forwarding mode determined by the current state of the DIP switch on the device under test; the auxiliary test device runs a test script corresponding to the current forwarding mode, and determines the test port in the device under test used to receive data packets according to the current forwarding mode; the auxiliary test device determines at least one auxiliary test port connected to the test port in the device under test used to receive data packets. The auxiliary testing device sends data packets to at least one test port of the device under test that is connected to the at least one auxiliary testing port through at least one auxiliary testing port. The device under test (DUT) copies and forwards the data packet to other DUT ports by receiving the data packet at least at one DUT port. Each of the ports under test of the device under test will return the received data packets to the auxiliary test device; The auxiliary testing device compares the number of data packets received by each of the auxiliary testing ports with the number of data packets sent through the at least one auxiliary testing port to determine whether the connectivity between the ports of the device under test is normal. If the auxiliary testing device determines that the connectivity between the ports under test of the device under test is abnormal, it runs other test scripts corresponding to other forwarding modes of the device under test to perform tests under the other test scripts. Based on the test results under the other test scripts, the auxiliary testing device determines whether there is an error in the correspondence between the state of the DIP switch of the device under test and the forwarding mode of the device under test.
2. The port connectivity testing method according to claim 1, characterized in that, The auxiliary testing device, based on the test results from the other test scripts, determines whether there is an error in the correspondence between the state of the DIP switch of the device under test and the forwarding mode of the device under test, including: If the auxiliary testing device determines that the connectivity between the ports under test of the device under test is abnormal after executing the test based on the other test scripts, it retains the determination result of the connectivity abnormality and determines that the correspondence between the state of the DIP switch of the device under test and the forwarding mode of the device under test is correct. If the auxiliary testing device determines that the connectivity between the ports under test of the device under test is normal after executing the test based on the other test scripts, it will modify the determination result to "connectivity is normal" and determine that the correspondence between the state of the DIP switch of the device under test and the forwarding mode of the device under test is incorrect.
3. The port connectivity testing method according to claim 1, characterized in that, The step of comparing the number of data packets received by each of the auxiliary testing ports and the number of data packets sent through at least one of the auxiliary testing ports to determine whether the connectivity between the ports of the device under test is normal includes: The auxiliary testing device determines the number of data packets received by each of the auxiliary testing ports, and the number of data packets sent through each of the at least one auxiliary testing port, wherein the number of data packets sent by each of the auxiliary testing ports is equal; The auxiliary testing device determines that the connectivity between the ports under test of the device under test is normal when the number of data packets received at each of the auxiliary testing ports is equal to the number of data packets sent through each of the auxiliary testing ports, or when the number of data packets received at each of the auxiliary testing ports is a set multiple of the number of data packets sent through each of the auxiliary testing ports. The set multiple is the number of auxiliary testing ports that send data packets.
4. The port connectivity testing method according to claim 1, characterized in that, The method further includes: The auxiliary testing device obtains the cyclic redundancy check (CRC) record results of each auxiliary testing port to determine whether the data packets received by the auxiliary testing port generate CRC error codes during transmission and the number of CRC error codes when they do.
5. The port connectivity testing method according to claim 1, characterized in that, The step of the device under test (DUT) copying and forwarding the data packet to other DUT ports upon receiving the data packet includes: The device under test determines the port rate at which the auxiliary testing device sends the data packet. The device under test (DUT) receives the data packet at at least one port under test, and then copies and forwards the data packet to other ports under test at the port rate.
6. A port connectivity testing system, characterized in that, The port connectivity testing system includes an auxiliary testing device and a device under test (DUT). Multiple auxiliary testing ports of the auxiliary testing device are connected to multiple DUT ports of the DUT. The DUT has a DIP switch for switching the forwarding mode of the DUT. The auxiliary testing device is used to send data packets to at least one test port of the device under test connected to the at least one auxiliary testing port through at least one auxiliary testing port; The device under test is configured to copy and forward the data packet to other ports under test through at least one port under test that receives the data packet; The device under test is also used to return the received data packets to the auxiliary test device through each of the ports under test; The auxiliary testing device is also used to compare the number of data packets received by each of the auxiliary testing ports with the number of data packets sent through the at least one auxiliary testing port, so as to determine whether the connectivity between the ports under test of the device under test is normal. The auxiliary testing device is also used to obtain the current forwarding mode determined by the current state of the DIP switch on the device under test, run the test script corresponding to the current forwarding mode, and determine the test port in the device under test used to receive data packets according to the current forwarding mode. The auxiliary testing device is further configured to determine at least one auxiliary testing port connected to the test port in the device under test used for receiving data packets; The auxiliary testing device is also used to run other test scripts corresponding to other forwarding modes of the device under test when the determination result is that the connectivity between the ports under test of the device under test is abnormal, so as to perform tests under the other test scripts; The auxiliary testing device is also used to determine, based on the test results under the other test scripts, whether there is an error in the correspondence between the state of the DIP switch of the device under test and the forwarding mode of the device under test.
Citation Information
Patent Citations
Method, device and system for testing switchboard connectivity
CN101296131A