Link testing method and device, computer equipment and storage medium
By performing ping test and traffic test when the USB link is enabled, combined with network speed and bit error rate, the problem of low USB link test efficiency in the existing technology is solved, and fast and accurate link quality judgment is achieved.
Patent Information
- Application Number
- CN202411052753.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-10-11
AI Technical Summary
In the existing technology, the testing efficiency of the USB link is low. It requires restarting or powering off after the upgrade to determine whether the BMC/BIOS firmware has been successfully upgraded. This takes a long time and the testing efficiency is low.
When the USB link is enabled, conduct a ping test and conduct a traffic test through the preset tool after passing the test to obtain the network speed and packet loss rate or bit error rate. Combined with the network speed and bit error rate, whether it meets the preset conditions, Determine the normal status of the USB link.
It improves USB link testing efficiency, accurately determines link quality, enhances test coverage, and avoids long-term restarts or power outages.
Smart Images

Figure CN118764416A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a link testing method, device, computer equipment and storage medium. Background Art
[0002] With the continuous development of server technology, customers have higher and higher requirements for the quality of server boards. For example, the quality requirements for USB links on server boards are getting higher and higher. For the whole machine factory, the BMC / BIOS firmware of the server can be upgraded through the USB link under the baseboard management controller (BMC). For the client, the server status can be monitored or the server's operating system OS can be remotely logged in through the USB link. Therefore, it is very necessary to test the USB link under the BMC.
[0003] In the related art, the BMC / BIOS firmware is usually upgraded through a USB link, and the USB link is tested to see whether it is normal by checking whether the upgrade is successful. However, this method requires restarting or powering off after the upgrade to determine whether the BMC / BIOS firmware is successfully upgraded, which takes a long time and has a low efficiency in testing the USB link. Summary of the invention
[0004] In view of this, the present invention provides a link testing method, apparatus, computer equipment and storage medium to solve the problem of low testing efficiency of USB links.
[0005] In a first aspect, the present invention provides a link testing method, which is applied to a processor, wherein a USB virtual network card is provided on the processor, and the USB virtual network card is used to establish a USB link with a USB network card of a baseboard management controller BMC, the method comprising: when the USB link is enabled, performing a ping test on the USB link to determine whether the USB link passes the ping test; when the USB link passes the ping test, performing a traffic test on the USB link through a preset tool to obtain a network speed and test information of the USB link, the test information including a packet loss rate or a bit error rate of the traffic test; when the network speed is greater than a preset threshold and the packet loss rate or the bit error rate meets preset conditions, determining that the USB link is normal.
[0006] Based on the method provided in the first aspect above, a ping test can be performed on the USB link when the USB link is enabled, and when the USB link ping test is qualified, a traffic test can be performed on the USB link through a preset tool to obtain the network speed of the USB link and the packet loss rate or bit error rate of the traffic test. When the network speed is greater than a preset threshold and the packet loss rate or bit error rate meets the preset conditions, the USB link is determined to be normal.
[0007] When the USB link is enabled, the USB link is first ping-through tested to test whether the USB link is in an on state. Afterwards, if the USB link ping-through test is qualified, the USB link is flow tested through a preset tool to test whether the network speed of the USB link is greater than a preset threshold, and to test the packet loss and bit error during data transmission through the USB link. The quality of the USB link is determined by comprehensively considering whether the USB is in an on state, whether the network speed is greater than a preset threshold, and whether there are bit errors or packet loss, and then accurately determining that the USB link is normal, while improving the test efficiency of the USB link and the test coverage.
[0008] In an optional implementation, when the USB link is enabled, a ping test is performed on the USB link to determine whether the USB link passes the ping test, including: when the USB link is enabled, sending a ping command to the USB network card through the USB virtual network card, the ping command is used to perform N ping tests on the USB link, N ≥ 1 and is a positive integer; receiving response information from the USB network card, the response information includes the number of successful ping tests M, 0 ≤ M ≤ N and is a positive integer; when M is consistent with N, determining that the USB link ping test passes; when M is less than N, determining that the USB link has not been pinged and the USB link is abnormal.
[0009] Based on the above method, the number of successful ping tests and the number of ping tests sent can be compared to determine whether the USB link has passed the ping test, so as to facilitate further flow testing of the USB link.
[0010] In an optional implementation, the preset tool is a network performance testing tool. When the USB link ping test is qualified, the USB link is tested for traffic through the preset tool to obtain the network speed and test information of the USB link, including: when the USB link ping test is qualified, copying the network performance testing tool under its own operating system to the BMC, and the BMC starts the service process of the server end of the network performance testing tool; running the network performance testing tool under the operating system, and starting the service process of the client end of the network performance testing tool, so that the USB virtual network card and the USB network card can communicate wirelessly to complete the traffic test of the USB link, and obtain the network speed and test information.
[0011] Based on the above method, a network performance test tool can be used to perform a flow test on the USB link to obtain the network speed and test information of the USB link.
[0012] In an optional embodiment, when the network speed is greater than a preset threshold and the packet loss rate or the bit error rate meets preset conditions, the USB link is determined to be normal, including: when the network speed is greater than the preset threshold, querying the packet loss rate or the bit error rate of the USB link through the first command, the second command and the third command of the network configuration tool, the first command is used to query the bit error rate of the USB link when receiving data during the traffic test, the second command is used to query the bit error rate of the USB link when sending data during the traffic test, and the third command is used to query the packet loss rate of the USB link during the traffic test.
[0013] Alternatively, when the network speed is greater than a preset threshold, the packet loss rate or bit error rate of the USB link is queried through the preset command of the network card command line tool. The preset command is used to query the packet loss rate of the USB link during the traffic test, the bit error rate when receiving data during the traffic test, and the bit error rate when sending data during the traffic test.
[0014] When the packet loss rate of the USB link during the traffic test is 0, the bit error rate when receiving data during the traffic test is 0, and the bit error rate when sending data during the traffic test is 0, it is determined that the packet loss rate or bit error rate of the USB link meets the preset conditions and the USB link is normal.
[0015] Based on the above method, the packet loss rate of the USB link during the traffic test, the bit error rate when receiving data during the traffic test, and the bit error rate when sending data during the traffic test can be queried from the test information, and then based on the packet loss rate and bit error rate, it is determined that the USB link is normal.
[0016] In an optional implementation, the method further includes: determining that the USB link is abnormal when the network speed is less than or equal to a preset threshold, or when the packet loss rate or the bit error rate does not meet a preset condition.
[0017] Based on the above method, if the network speed is less than or equal to the preset threshold, or the packet loss rate or bit error rate does not meet the preset conditions, it can be determined that the USB link is abnormal.
[0018] In an optional embodiment, before the USB link is enabled, the method also includes: sending a fourth command to the BMC through a preset link, the fourth command being used to enable the USB interface function of the BMC; if return information is received from the BMC within a preset time period, a new USB virtual network card is added, and the USB link between the USB virtual network card and the USB network card is enabled, and the return information is used to indicate that the USB interface function is enabled successfully; if no return information is received within the preset time period, and the network card name of the operating system is in a preset format, it is determined that the USB link enabling has failed.
[0019] Based on the above method, the fourth command can be sent to the BMC through the preset link to enable the USB link between the USB virtual network card and the USB network card, so as to facilitate subsequent testing of the USB link.
[0020] In an optional implementation, before performing a ping test on the USB link, the method also includes: sending a fifth command to the BMC, the fifth command being used to obtain the IP address of the USB network card; receiving the IP address of the USB network card from the BMC; and setting the IP address of the USB virtual network card under the operating system to be in the same network segment as the IP address of the USB network card.
[0021] Based on the above method, the IP address of the USB virtual network card and the IP address of the USB network card can be set to the same network segment, so that the USB virtual network card and the USB network card can perform data transmission.
[0022] In a second aspect, the present invention provides a link testing device, which is provided with a USB virtual network card, which is used to establish a USB link with the USB network card of the baseboard management controller BMC. The device includes: a testing module, which is used to perform a ping test on the USB link when the USB link is enabled, and determine whether the USB link passes the ping test; the testing module is also used to perform a traffic test on the USB link through a preset tool when the USB link ping test passes, to obtain the network speed and test information of the USB link, the test information including the packet loss rate or bit error rate of the traffic test; a processing module is used to determine that the USB link is normal when the network speed is greater than a preset threshold and the packet loss rate or bit error rate meets preset conditions.
[0023] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the link testing method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0024] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the link testing method of the first aspect or any corresponding embodiment thereof.
[0025] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the link testing method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 is a schematic diagram of a related testing method 1 of an embodiment of the present invention;
[0028] Figure 2 is a schematic diagram of a related testing method 2 of an embodiment of the present invention;
[0029] Figure 3 is an architectural diagram of a USB link test system according to an embodiment of the present invention;
[0030] Figure 4 is a flow chart of a link testing method according to an embodiment of the present invention;
[0031] Figure 5 is a flow chart of another link testing method according to an embodiment of the present invention;
[0032] Figure 6 is a structural block diagram of a link testing device according to an embodiment of the present invention;
[0033] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0035] In the related art, the BMC / BIOS firmware (also called the board card) is upgraded through the USB link, and the USB link is tested to see whether it is normal by whether the upgrade is successful. Figure 1 As shown, Figure 1It is a schematic diagram of the related test method 1 of the embodiment of the present invention. The factory tester burns the FW firmware parameters of version A to the BMC board offline, and the board performs normal production and front-end testing. After that, the board performs functional testing (FCT) and is powered on, and the FW firmware parameters of version B are refreshed to the BMC board under the operating system (OS); after that, the tester restarts or turns off the power and restarts the machine to check whether the FW version is version B. If so, the USB link is tested to be normal; if not, the USB link is tested to be abnormal.
[0036] In related technologies, such as Figure 2 As shown, Figure 2 It is a schematic diagram of the related test method 2 of an embodiment of the present invention. The BMC board is produced normally, the board is powered on at the FCT workstation, and the tester uses an additional computer to log in to the BMC web to test the BMC board. If the test is successful, the USB link is normal; if the test fails, the USB link is abnormal.
[0037] In the above two related technologies, it is necessary to restart or power off after the upgrade to determine whether the BMC / BIOS firmware is successfully upgraded, which takes a long time and has a low efficiency in testing the USB link. Alternatively, an additional computer is required for testing and manual operation by an operator is required, which is costly.
[0038] In order to solve the above technical problems, an embodiment of the present invention provides a link testing method, which includes: when the USB link is enabled, a ping test is performed on the USB link to determine whether the USB link passes the ping test; when the USB link passes the ping test, a flow test is performed on the USB link through a preset tool to obtain the network speed and test information of the USB link, and the test information includes the packet loss rate or bit error rate of the flow test; when the network speed is greater than a preset threshold and the packet loss rate or bit error rate meets the preset conditions, it is determined that the USB link is normal. This method can improve the testing efficiency of the USB link.
[0039] Below Figure 3 Taking the architecture diagram of the USB link test system according to the embodiment of the present invention as an example, the method provided by the embodiment of the present application is described. Figure 3 It is only a schematic diagram and does not constitute a limitation on the applicable scenarios of the technical solution provided in this application.
[0040] like Figure 3 As shown, Figure 3 4 is an architecture diagram of a USB link test system according to an embodiment of the present invention. Figure 3 In the example, a USB link test system 300 includes a processor 301 and a BMC 302 .
[0041] The processor (also referred to as a link testing device) in the embodiment of the present invention, for example, the processor 301, can be any processor with computing and communication functions. For example, the processor is a central processing unit CPU.
[0042] The BMC in the embodiment of the present invention, for example, BMC302, can be a core component in the server management system defined by the IPMI (Intelligent Platform Management Interface) protocol, i.e., the intelligent platform management interface, and a hardware manager integrated in servers, network devices, and other computer systems. The BMC is used to monitor the hardware status of the device, perform remote management operations, and provide monitoring and control functions for the device.
[0043] Figure 3 The USB link test system 300 shown is only used as an example and is not used to limit the technical solution of the present application. Those skilled in the art should understand that in the specific implementation process, the USB link test system 300 can also include more devices, and the number of devices can also be determined according to specific needs without limitation.
[0044] According to an embodiment of the present invention, a test embodiment of a USB link is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0045] In this embodiment, a link testing method is provided, which can be used for the above-mentioned processor, the processor is provided with a USB virtual network card, and the USB virtual network card is used to establish a USB link with a USB network card of a baseboard management controller BMC; Figure 4 is a flow chart of a link testing method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0046] S401: When the USB link is enabled, a ping test is performed on the USB link to determine whether the USB link passes the ping test.
[0047] In some optional embodiments, when the USB link is enabled, the processor sends a ping command to the USB network card through the USB virtual network card, where the ping command is used to perform N ping tests on the USB link, where N ≥ 1 and is a positive integer; receives response information from the USB network card, where the response information includes the number of successful ping tests M, where 0 ≤ M ≤ N and is a positive integer; when M is consistent with N, determines that the USB link ping test is qualified; when M is less than N, determines that the USB link is not pinged and the USB link is abnormal.
[0048] For example, the ping command can be "ping 169.254.0.17-c 5". "169.254.0.17" is the IP address of the USB network card. "c 5" is the number of ping tests N is 5.
[0049] In some optional embodiments, before the USB link is enabled, the processor sends a fourth command to the BMC through a preset link; if return information is received from the BMC within a preset time period, a new USB virtual network card is added, and the USB link between the USB virtual network card and the USB network card is enabled; if no return information is received within the preset time period, and the network card name of the operating system is in a preset format, it is determined that the USB link enabling has failed.
[0050] The fourth command is used to enable the USB interface function of the BMC. For example, the fourth command may be an ipmitool command. The USB interface function may be a lan over usb function of the BMC.
[0051] In the embodiment of the present invention, the returned information is used to indicate that the USB interface function is enabled successfully.
[0052] In the embodiment of the present invention, the preset format may be a conventional network interface naming format, for example, ethX (e.g., eth0, eth1), where eth represents Ethernet, and X is a number that increases in the order in which the network interface is recognized by the system.
[0053] In the embodiment of the present invention, the preset link may be a link of any protocol between the processor and the BMC, for example, an Intelligent Platform Management Interface (IPMI) protocol link.
[0054] In one example, if the processor does not receive return information within a preset time period and the network card name of the operating system is not in a preset format, the processor obtains the configuration file of the operating system and adds configuration information to the configuration file to modify the network card name of the operating system to the preset format; and again sends a fourth command to the BMC through the preset link to enable the USB link.
[0055] The configuration file may be a grub.cfg file.
[0056] In the embodiment of the present invention, the configuration information may be "net.ifnames=0".
[0057] It can be understood that before sending the fourth command to the BMC again through the preset link, the operating system needs to be powered off and restarted to make the modification of the network card name of the operating system take effect.
[0058] In some optional implementations, before performing a ping test on the USB link, the processor sends a fifth command to the BMC; receives the IP address of the USB network card from the BMC; and sets the IP address of the USB virtual network card under the operating system to be in the same network segment as the IP address of the USB network card.
[0059] The fifth command is used to obtain the IP address of the USB network card.
[0060] For example, taking the IP address of the USB network card as "169.254.0.17", the processor can send a setting command to the USB virtual network card to set the IP address of the USB virtual network card under the operating system to be in the same network segment as the IP address of the USB network card. The setting command can be "ifconfig usb0169.254.0.10". "169.254.0.10" is the IP address of the USB virtual network card set by the processor. "usb0" is the name of the USB virtual network card.
[0061] It can be understood that the processor determines whether the USB link passes the ping test by comparing the number of successful ping tests with the number of ping tests sent, so as to facilitate further flow testing of the USB link.
[0062] S402: When the USB link ping test is qualified, a flow test is performed on the USB link through a preset tool to obtain the network speed and test information of the USB link.
[0063] The test information includes the packet loss rate or bit error rate of the traffic test.
[0064] In the embodiment of the present invention, the preset tool may be a network performance testing tool. For example, the network performance testing tool is an Iperf tool.
[0065] In some optional implementations, when the USB link ping test is qualified, the processor copies the network performance test tool under its own operating system to the BMC, and the BMC starts the service process of the server end of the network performance test tool; runs the network performance test tool under the operating system, and starts the service process of the client end of the network performance test tool, so that the USB virtual network card and the USB network card can communicate wirelessly to complete the traffic test of the USB link and obtain the network speed and test information.
[0066] Exemplarily, when the USB link ping test is qualified, the processor sends an scp command to the BMC through the USB virtual network card, copies the Iperf tool under its own operating system to the BMC, and sends an iperf command to the BMC to log in to the BMC, so that the BMC starts the Iperf service process of the Iperf tool, so that the USB network card acts as the server. The processor runs the Iperf tool under the operating system, starts the client service process of the Iperf tool, and performs an iperf flow test with the server, so that the USB virtual network card and the USB network card can communicate wirelessly to complete the flow test of the USB link, and obtain the network speed and test information.
[0067] The scp command can be "scp / usr / bin / iperf sysadmin@169.254.0.17: / usr / bin / ". " / usr / bin / " is the storage location of the Iperf tool.
[0068] In the embodiment of the present invention, the iperf command may be "iperf -B 169.254.0.17 -sD".
[0069] It can be understood that after the processor performs a flow test on the USB link, the test information and network speed can be obtained.
[0070] Optionally, when the USB link ping test fails, it is determined that the USB link is abnormal.
[0071] S403: When the network speed is greater than a preset threshold and the packet loss rate or the bit error rate meets a preset condition, determine that the USB link is normal.
[0072] The preset threshold value can be set according to actual needs without limitation. For example, the preset threshold value can be 930 Mbps.
[0073] In some optional embodiments, when the network speed is greater than a preset threshold, the processor queries the packet loss rate or bit error rate of the USB link through the first command, the second command, and the third command of the network configuration tool; or, when the network speed is greater than the preset threshold, the processor queries the packet loss rate or bit error rate of the USB link through the preset command of the network card command line tool; when the packet loss rate of the USB link during the traffic test is 0, the bit error rate when receiving data during the traffic test is 0, and the bit error rate when sending data during the traffic test is 0, it is determined that the packet loss rate or bit error rate of the USB link meets the preset conditions and the USB link is normal.
[0074] The network configuration tool may be an ifconfig tool. The first command is used to query the bit error rate of the USB link when receiving data during the flow test. The first command may be ifconfig usb0|grep "RX errors".
[0075] In the embodiment of the present invention, the second command is used to query the bit error rate of the USB link when sending data during the flow test. The second command may be ifconfig usb0|grep "TX errors".
[0076] In the embodiment of the present invention, the third command is used to query the packet loss rate of the USB link during the flow test process. The third command may be ifconfig usb0|grep "dropped".
[0077] In an embodiment of the present invention, the network card command line tool may be an ethtool tool. The preset command is used to query the packet loss rate of the USB link during the flow test, the bit error rate when receiving data during the flow test, and the bit error rate when sending data during the flow test. The preset command may be ethtool -S usb0 | grep -iE "ail | error | drop".
[0078] Optionally, the processor determines that the USB link is abnormal when the network speed is less than or equal to a preset threshold, or the packet loss rate or the bit error rate does not meet a preset condition.
[0079] Based on the above S401-S403, the processor can perform a ping test on the USB link when the USB link is enabled, and when the USB link ping test is qualified, perform a traffic test on the USB link through a preset tool to obtain the network speed of the USB link and the packet loss rate or bit error rate of the traffic test. When the network speed is greater than a preset threshold and the packet loss rate or bit error rate meets the preset conditions, the USB link is determined to be normal.
[0080] When the USB link is enabled, the USB link is first ping-through tested to test whether the USB link is in an on state. Afterwards, if the USB link ping-through test is qualified, the USB link is flow tested through a preset tool to test whether the network speed of the USB link is greater than a preset threshold, and to test the packet loss and bit error during data transmission through the USB link. The quality of the USB link is determined by comprehensively considering whether the USB is in an on state, whether the network speed is greater than a preset threshold, and whether there are bit errors or packet loss, and then the USB link is determined to be normal, while improving the test efficiency of the USB link and the test coverage.
[0081] In this embodiment, another link testing method is provided, which can be used for the above-mentioned processor, the processor is provided with a USB virtual network card, and the USB virtual network card is used to establish a USB link with a USB network card of a baseboard management controller BMC; Figure 5 FIG. 1 is a flow chart of another link testing method according to an embodiment of the present invention. Figure 5 As shown, the process includes the following steps:
[0082] S501: When the USB link is enabled, perform a ping test on the USB link;
[0083] S502: Determine whether the USB link ping test is successful;
[0084] S503: If not, it is determined that the USB link is abnormal.
[0085] S504: If yes, a flow test is performed on the USB link using a preset tool to obtain the network speed and packet loss rate or bit error rate of the USB link.
[0086] S505: Determine whether the network speed is greater than a preset threshold;
[0087] S507: When the network speed is less than or equal to the preset threshold, determine that the USB link is abnormal.
[0088] S508: When the network speed is greater than a preset threshold, determining whether the packet loss rate or the bit error rate is 0;
[0089] S509: If yes, determine that the USB link is normal.
[0090] S510: If not, it is determined that the USB link is abnormal.
[0091] In this embodiment, a link test device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0092] This embodiment provides a link testing device, such as Figure 6 As shown, Figure 6 1 is a structural block diagram of a link test device according to an embodiment of the present invention; the device is provided with a USB virtual network card, and the USB virtual network card is used to establish a USB link with a USB network card of a baseboard management controller BMC; the device includes:
[0093] The testing module 601 is used to perform a ping test on the USB link when the USB link is enabled, and determine whether the USB link passes the ping test.
[0094] The test module 601 is also used to perform a flow test on the USB link through a preset tool when the USB link ping test is qualified, to obtain the network speed and test information of the USB link, wherein the test information includes the packet loss rate or bit error rate of the flow test.
[0095] The processing module 602 is used to determine that the USB link is normal when the network speed is greater than a preset threshold and the packet loss rate or the bit error rate meets a preset condition.
[0096] In some optional embodiments, the test module 601 is specifically used to send a ping command to the USB network card through the USB virtual network card when the USB link is enabled, and the ping command is used to perform N ping tests on the USB link, where N≥1 and is a positive integer; the test module 601 is also specifically used to receive response information from the USB network card, and the response information includes the number of successful ping tests M, where 0≤M≤N and is a positive integer; the test module 601 is also specifically used to determine that the USB link ping test is qualified when M is consistent with N; the test module 601 is also specifically used to determine that the USB link is not pinged and the USB link is abnormal when M is less than N.
[0097] In some optional implementations, the preset tool is a network performance testing tool, and the test module 601 is also specifically used to copy the network performance testing tool under its own operating system to the BMC when the USB link ping test is qualified, so that the BMC starts the service process of the server end of the network performance testing tool; the test module 601 is also specifically used to run the network performance testing tool under the operating system, and start the service process of the client end of the network performance testing tool, so that the USB virtual network card and the USB network card can communicate wirelessly to complete the traffic test of the USB link and obtain the network speed and test information.
[0098] In some optional embodiments, the test module 601 is also specifically used to query the packet loss rate or bit error rate of the USB link through the first command, the second command and the third command of the network configuration tool when the network speed is greater than a preset threshold. The first command is used to query the bit error rate of the USB link when receiving data during the traffic test, the second command is used to query the bit error rate of the USB link when sending data during the traffic test, and the third command is used to query the packet loss rate of the USB link during the traffic test.
[0099] Alternatively, the test module 601 is also specifically used to query the packet loss rate or bit error rate of the USB link through a preset command of the network card command line tool when the network speed is greater than a preset threshold. The preset command is used to query the packet loss rate of the USB link during the traffic test, the bit error rate when receiving data during the traffic test, and the bit error rate when sending data during the traffic test.
[0100] The test module 601 is also specifically used to determine that the packet loss rate or bit error rate of the USB link meets the preset conditions and the USB link is normal when the packet loss rate of the USB link during the traffic test is 0, the bit error rate when receiving data during the traffic test is 0, and the bit error rate when sending data during the traffic test is 0.
[0101] In some optional implementations, the processing module 602 is further configured to determine that the USB link is abnormal when the network speed is less than or equal to a preset threshold, or when the packet loss rate or the bit error rate does not meet a preset condition.
[0102] In some optional embodiments, before the USB link is enabled, the processing module 602 is also used to send a fourth command to the BMC through a preset link, and the fourth command is used to enable the USB interface function of the BMC; the processing module 602 is also used to add a USB virtual network card and enable the USB link between the USB virtual network card and the USB network card if return information is received from the BMC within a preset time period, and the return information is used to indicate that the USB interface function is successfully enabled; the processing module 602 is also used to determine that the USB link enabling has failed if no return information is received within the preset time period and the network card name of the operating system is in a preset format.
[0103] In some optional embodiments, before performing a ping test on the USB link, the processing module 602 is also used to send a fifth command to the BMC, and the fifth command is used to obtain the IP address of the USB network card; the processing module 602 is also used to receive the IP address of the USB network card from the BMC; the processing module 602 is also used to set the IP address of the USB virtual network card under the operating system to be in the same network segment as the IP address of the USB network card.
[0104] The further functional description of each of the above modules is the same as that of the above corresponding embodiments and will not be repeated here.
[0105] The link test device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0106] The embodiment of the present invention also provides a computer device having the above Figure 6 The test setup of the link is shown.
[0107] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.
[0108] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0109] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0110] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0111] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0112] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0113] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0114] Part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0115] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A link testing method, It is characterized in that Applied to a processor, the processor is provided with a USB virtual network card, the USB virtual network card is used to establish a USB link with a USB network card of a baseboard management controller BMC, the method comprises: When the USB link is enabled, performing a ping test on the USB link to determine whether the USB link passes the ping test; If the USB link ping test is qualified, a flow test is performed on the USB link through a preset tool to obtain the network speed and test information of the USB link, wherein the test information includes a packet loss rate or a bit error rate of the flow test; When the network speed is greater than a preset threshold and the packet loss rate or the bit error rate meets a preset condition, it is determined that the USB link is normal.
2. The method according to claim 1, It is characterized in that When the USB link is enabled, performing a ping test on the USB link to determine whether the USB link passes the ping test includes: When the USB link is enabled, a ping command is sent to the USB network card through the USB virtual network card, where the ping command is used to perform N ping tests on the USB link, where N ≥ 1 and is a positive integer; Receive response information from the USB network card, where the response information includes the number of times the ping test succeeds, M, where 0≤M≤N is a positive integer; When M and N are consistent, it is determined that the USB link ping test is qualified; When M is smaller than N, it is determined that the USB link is not pinged through and the USB link is abnormal.
3. The method according to claim 1, It is characterized in that The preset tool is a network performance test tool. When the USB link ping test is qualified, the USB link is subjected to a flow test by the preset tool to obtain the network speed and test information of the USB link, including: If the USB link ping test is qualified, copy the network performance test tool under its own operating system to the BMC, so that the BMC starts the service process of the server end of the network performance test tool; Run the network performance test tool under the operating system, start the service process of the client of the network performance test tool, so that the USB virtual network card and the USB network card can communicate wirelessly to complete the traffic test of the USB link, and obtain the network speed and the test information.
4. The method according to claim 1, It is characterized in that When the network speed is greater than a preset threshold and the packet loss rate or the bit error rate meets a preset condition, determining that the USB link is normal includes: In the case where the network speed is greater than the preset threshold, the packet loss rate or the bit error rate of the USB link is queried through the first command, the second command and the third command of the network configuration tool, wherein the first command is used to query the bit error rate of the USB link when receiving data during the flow test, the second command is used to query the bit error rate of the USB link when sending data during the flow test, and the third command is used to query the packet loss rate of the USB link during the flow test; Alternatively, when the network speed is greater than the preset threshold, the packet loss rate or the bit error rate of the USB link is queried through a preset command of the network card command line tool, and the preset command is used to query the packet loss rate of the USB link during the flow test, the bit error rate when receiving data during the flow test, and the bit error rate when sending data during the flow test; When the packet loss rate of the USB link during the traffic test is 0, the bit error rate when receiving data during the traffic test is 0, and the bit error rate when sending data during the traffic test is 0, it is determined that the packet loss rate or the bit error rate of the USB link meets the preset condition and the USB link is normal.
5. The method according to claim 1, It is characterized in that The method further comprises: When the network speed is less than or equal to the preset threshold, or the packet loss rate or the bit error rate does not meet the preset condition, it is determined that the USB link is abnormal.
6. The method according to claim 1, It is characterized in that Before the USB link is enabled, the method further includes: Sending a fourth command to the BMC via a preset link, wherein the fourth command is used to enable a USB interface function of the BMC; If the return information from the BMC is received within the preset time period, the USB virtual network card is added, and the USB link between the USB virtual network card and the USB network card is enabled, and the return information is used to indicate that the USB interface function is enabled successfully; If the return information is not received within the preset time period, and the network card name of the operating system is in a preset format, it is determined that the USB link activation fails.
7. The method according to any one of claims 1 to 6, It is characterized in that Before performing a ping test on the USB link, the method further includes: Sending a fifth command to the BMC, wherein the fifth command is used to obtain the IP address of the USB network card; Receiving the IP address of the USB network card from the BMC; Set the IP address of the USB virtual network card under the operating system and the IP address of the USB network card to be in the same network segment.
8. A link testing device, It is characterized in that The device is provided with a USB virtual network card, and the USB virtual network card is used to establish a USB link with a USB network card of a baseboard management controller BMC; the device comprises: A testing module, used for performing a ping test on the USB link when the USB link is enabled, to determine whether the USB link passes the ping test; The test module is further configured to, if the USB link ping test is qualified, perform a flow test on the USB link through a preset tool to obtain the network speed and test information of the USB link, wherein the test information includes a packet loss rate or a bit error rate of the flow test; The processing module is used to determine that the USB link is normal when the network speed is greater than a preset threshold and the packet loss rate or the bit error rate meets a preset condition.
9. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the link testing method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the link testing method according to any one of claims 1 to 7.
Citation Information
Cited By
Network communication link fault detection and positioning method, device, equipment and medium
CN120658561A
