Network card testing method and device, computer device and storage medium

By using mathematical permutation and combination methods to generate random test item combinations in a multi-node environment, the problem of the inability to simulate the actual working state of multi-node multiplexed network cards in existing technologies is solved, achieving more efficient test coverage and improved product development and acceptance quality.

CN119402386BActive Publication Date: 2025-12-12INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411495623.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-12-12
Estimated Expiration
2044-10-24

AI Technical Summary

Technical Problem

Existing technologies cannot effectively simulate the actual working state of multiple-node network interface cards (NICs), nor can they simulate different operating scenarios across multiple computing and storage nodes.

Method used

By employing mathematical permutation and combination methods, different combinations of test items are randomly generated. These combinations are then used to test computing nodes and storage nodes, enabling the execution of different test contents on multiple nodes within the same timeframe, thus simulating real-world work scenarios.

Benefits of technology

This improved the acceptance quality of product development, effectively covered the working scenarios of multi-host multiplexed network cards in practical applications, and improved the coverage and accuracy of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402386B_ABST
    Figure CN119402386B_ABST
Patent Text Reader

Abstract

The application relates to the computer technical field and discloses a network card testing method and device, computer equipment and a storage medium, the method comprises the following steps: obtaining a test content set; obtaining a second preset number of to-be-executed test contents in the test content set, and testing a second preset number of nodes sharing a network card by using the second preset number of to-be-executed test contents; obtaining a second preset number of candidate test contents in the test content set, and judging whether the candidate test contents are same as the to-be-executed test contents; if the candidate test contents are same as the to-be-executed test contents, the candidate test contents are reacquired; if the candidate test contents are not same as the to-be-executed test contents, the candidate test contents are taken as the to-be-executed test contents, and subsequent steps are executed from the step of testing the second preset number of nodes by using the second preset number of to-be-executed test contents until a detection end command is detected. The application solves the problem that when a network card multiplexed by multiple nodes is tested, the actual working state of the network card cannot be simulated when the multiple nodes perform different operations on the network card.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a network card testing method and device, computer equipment and storage medium. BACKGROUND

[0002] Multi-Host (multiple host administration) technology is a powerful multi-host management and scheduling technology. Using a network card device supporting Multi-Host technology chips, multiple computing nodes and / or multiple storage nodes can be interconnected with the outside world through a single network card, reducing the number of switches, network cards and cables, and using a single network card to provide services for multiple hosts at the same time. This implementation of virtual machine or container cross-host migration and scheduling improves resource utilization and service availability and enables efficient collaboration between multiple computing nodes.

[0003] In order to protect the performance and stability of the network card, the network card needs to be tested. However, the current method for testing the network card is to test the function, performance, pressure and stability of the network card when a single node exclusively uses the network card. Moreover, the testing of the network card mainly focuses on a single test item of the network card. However, in the application scenario of multiple computing nodes and / or multiple storage nodes using a network card supporting Multi-Host technology chips, each node operates independently, and each node has different usage and working conditions for the multiplexed network card at the same time. The current method for testing the network card cannot effectively simulate the actual working conditions of the multiplexed network card when multiple nodes operate the network card, and cannot simultaneously meet the working conditions of the multiplexed network card when each node operates independently.

[0004] Therefore, the related art has the problem that the multiplexed network card cannot be tested to simulate the actual working conditions of the network card when multiple nodes operate the network card differently. SUMMARY

[0005] Therefore, the present application provides a network card testing method and device, computer equipment and storage medium to solve the problem that the multiplexed network card cannot be tested to simulate the actual working conditions of the network card when multiple nodes operate the network card differently.

[0006] In a first aspect, the present application provides a network card testing method, comprising:

[0007] obtaining a test content set, wherein the test content set contains a first preset number of test contents;

[0008] Obtaining a second preset number of test contents to be executed in the test content set, and testing the second preset number of nodes sharing the network card by using the second preset number of test contents to be executed, wherein the second preset number is the number of nodes, and the second preset number of test contents to be executed is contained in the first preset number of test contents;

[0009] Obtaining a second preset number of candidate test contents in the test content set, and determining whether the second preset number of candidate test contents is same as the second preset number of test contents to be executed;

[0010] If the second preset number of candidate test contents is same as the second preset number of test contents to be executed, a subsequent step is executed from the second preset number of candidate test contents obtained in the test content set, if the second preset number of candidate test contents is not same as the second preset number of test contents to be executed, the candidate test content is used as a new test content to be executed, the new test content to be executed is used to replace the test content to be executed, and a subsequent step is executed from the testing of the second preset number of nodes by using the second preset number of test contents to be executed, until a stop command is detected, and then the method is ended.

[0011] The network card testing method provided in the embodiment obtains a second preset number of candidate test contents in the test content set, and tests the second preset number of nodes sharing the network card by using the second preset number of test contents to be executed, so that different test contents are executed in the multiple nodes in the same time, the specific scene in the actual application is effectively simulated, the working scene of the multiple-host multiplexing network card in the actual application is covered, and the multiple rounds of testing of the network card improve the acceptance quality of product development. The problem that the actual working state of the network card cannot be simulated when the multiple nodes multiplex the network card and perform different operations on the network card is solved.

[0012] In some optional embodiments, the test content set is obtained, including:

[0013] Obtaining a first preset number of test contents;

[0014] Generating a first serial number corresponding to each test content;

[0015] Generating a test content set containing the first preset number of test contents and the corresponding first serial numbers.

[0016] In the embodiment, the test content set containing the first preset number of test contents and the corresponding first serial numbers is generated, so that the test contents to be executed are selected in the test content set by using the first serial numbers in the subsequent step, the randomness in the selection is ensured, and the working scene of the multiple-host multiplexing network card in the actual application is covered.

[0017] In some optional embodiments, whether the second preset number of candidate test contents is same as the second preset number of test contents to be executed is determined, including:

[0018] obtain a first serial number of the candidate test content and a first serial number of the test content to be executed;

[0019] sort the first serial number of the candidate test content according to a first preset order to obtain a first sequence;

[0020] sort the first serial number of the test content to be executed according to the first preset order to obtain a second sequence;

[0021] determine whether the first sequence and the second sequence are the same, and if so, determine that the second preset number of candidate test contents are the same as the second preset number of test contents to be executed.

[0022] In the embodiment, by sorting the first serial number of the candidate test content and the first serial number of the test content to be executed according to the first preset order, and by comparing the two generated sequences, it is determined whether the second preset number of candidate test contents are the same as the second preset number of test contents to be executed. It is convenient and fast, saves computing resources, and avoids wasting system resources caused by adjacent two rounds of test executing the same test content.

[0023] In some optional embodiments, a second preset number of test contents to be executed are obtained in the test content set, and the second preset number of nodes are tested by using the second preset number of test contents to be executed, including:

[0024] using a first preset function, generating a first preset number of random numbers in a preset range, and generating a second serial number of the random numbers;

[0025] using a second preset function, sorting the random numbers according to the size of the random numbers and a second preset order to obtain a random number queue;

[0026] selecting the first second preset number of random numbers from the random number queue as target random numbers;

[0027] taking the first serial number same as the second serial number of the target random number as a target serial number, and using a third preset function to obtain the test content corresponding to the target serial number from the test content set as the test content to be executed according to the target serial number;

[0028] obtain a third serial number of the node, and distribute the test content to be executed to the node according to the position of the target random number in the random number queue and the third serial number, wherein the node is used to execute the distributed test content to be executed in the network card test process.

[0029] In the embodiment, the random numbers are generated and sorted, the first second preset number of random numbers are selected as target random numbers, the test content corresponding to the second serial number of the target random numbers is obtained from the test content set, and the test content is used as the to-be-executed test content. The to-be-executed test content is randomly selected by using the permutation and combination method in mathematics, and the working scene of the multi-host multiplexing network card in the actual application is covered.

[0030] In some optional embodiments, the method further comprises:

[0031] obtaining a running log of the node executing the to-be-executed test content;

[0032] determining the test result state and the test process information of the node according to the running log;

[0033] generating a test report containing the test result state and the process information.

[0034] In some optional embodiments, the method further comprises:

[0035] obtaining a test duration and a total amount of the to-be-executed test content executed by the node;

[0036] if the test duration exceeds a first preset threshold or the total amount exceeds a second preset threshold, generating an end command.

[0037] In the embodiment, the end command is generated according to the test duration and the total amount of the to-be-executed test content executed, and the multi-round test of the network card is ended. The network card is tested in multiple rounds, and different test contents are executed in multiple nodes in each test process, effectively simulating specific scenes in actual applications, covering the working scene of the multi-host multiplexing network card in the actual application, and improving the acceptance quality of product development.

[0038] In some optional embodiments, before the second preset number of to-be-executed test contents are used to test the second preset number of nodes, the method further comprises:

[0039] determining all nodes sharing the network card;

[0040] installing and configuring a preset test tool on the node, wherein the node executes the to-be-executed test content by using the preset test tool.

[0041] In the second aspect, the application provides a network card testing device, comprising:

[0042] a first obtaining module, configured to obtain a test content set, wherein the test content set contains a first preset number of test contents;

[0043] The first test module is configured to obtain a second preset number of test contents to be executed in the test content set, and test a second preset number of nodes sharing the network card by using the second preset number of test contents to be executed, wherein the second preset number is the number of nodes, and the second preset number of test contents to be executed is included in the first preset number of test contents.

[0044] The second obtaining module is configured to obtain a second preset number of candidate test contents in the test content set, and determine whether the second preset number of candidate test contents is the same as the second preset number of test contents to be executed.

[0045] The second test module is configured to, if the second preset number of candidate test contents is the same as the second preset number of test contents to be executed, execute the subsequent steps from obtaining the second preset number of candidate test contents in the test content set, if the second preset number of candidate test contents is not the same as the second preset number of test contents to be executed, replace the test contents to be executed with new test contents to be executed, and execute the subsequent steps from testing the second preset number of nodes by using the second preset number of test contents to be executed, until a stop command is detected, and then stop.

[0046] In a third aspect, the present application provides a computer device, comprising a memory and a processor, the memory and the processor are communicatively connected with each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the network card test method of the first aspect or any of the corresponding embodiments thereof.

[0047] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer instructions, and the computer instructions are used to make a computer execute the network card test method of the first aspect or any of the corresponding embodiments thereof.

[0048] In a fifth aspect, the present application provides a computer program product, which comprises computer instructions, and the computer instructions are used to make a computer execute the network card test method of the first aspect or any of the corresponding embodiments thereof. BRIEF DESCRIPTION OF DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the specific embodiments or the related art, the drawings needed in the specific embodiments or the related art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.

[0050] Figure 1 It is a flowchart of the network card test method according to the embodiments of the present application.

[0051] Figure 2is a flow chart of a composite stability test method for a multi-host multiplexing network card scenario according to an embodiment of the present application;

[0052] Figure 3 is a structural block diagram of a network card test device according to an embodiment of the present application;

[0053] Figure 4 is a hardware structure schematic diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0055] Multi-Host technology is a powerful multi-host management and scheduling technology that achieves efficient connection, management, and scheduling between multiple server nodes through the construction of a centralized control plane or the use of advanced network architecture. The main advantage of this technology is that it enables direct connection between multiple server nodes and a centralized network controller, thereby optimizing data access paths, reducing latency, and significantly improving data transmission efficiency and system density. Using a network card device that supports Multi-Host technology chips, multiple computing nodes and storage nodes can be interconnected with the outside world through a single network card, reducing the number of switches, network cards, and cables. A single network card can provide services for multiple hosts simultaneously. This application can achieve cross-host migration and scheduling of virtual machines or containers, improve resource utilization and service availability, optimize network architecture, reduce network latency and bandwidth bottlenecks, improve overall performance, enable efficient collaboration between multiple computing nodes, and accelerate scientific computing and data analysis tasks. This technology has wide application prospects in cloud computing, data centers, high-performance computing, and other fields. However, current testing methods only test the functionality, performance, stress, and power-on stability of a single server node's exclusive network card. However, in the application scenario of multiple computing nodes and storage nodes sharing a single network card that supports Multi-Host technology chips, each server node operates independently, so there are different usage and working conditions of the shared single network card at the same time. Therefore, the same test operation performed at the same time cannot satisfy the multiple different operation working conditions of each node operating independently in the multi-server node sharing a single network card scenario.

[0056] Based on the above, this invention provides a network interface card (NIC) testing method. Building upon the testing method for a single server node using a dedicated NIC, this method employs mathematical permutations and combinations to randomly generate different combinations of test items. Each test item combination contains test content equal to the number of nodes. These test item combinations are used to test compute and storage nodes. This allows for the execution of different NIC test contents across multiple server nodes using single NICs that support Multi-Host technology chips within the same timeframe, effectively simulating specific scenarios in real-world applications. This achieves the goal of executing different NIC test contents across multiple server nodes using single NICs that support Multi-Host technology chips, covering the operational scenarios of multi-host NIC reuse in real-world applications and improving the technical effectiveness of product development acceptance quality assessment.

[0057] According to an embodiment of the present invention, a network card testing embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer device with data processing capabilities, such as a computer, server, etc. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0058] This embodiment provides a network card testing method. Figure 1 This is a flowchart of a network card testing method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:

[0059] Step S101: Obtain the test content set, wherein the test content set contains a first preset number of test contents.

[0060] Specifically, obtain the test content set, where test content refers to test cases. The test content set includes a first preset number of test cases, such as: operating system (OS) restart test, server power on / off test, network card stress test, network card performance test, network card driver upgrade test, etc. The first preset number indicates multiple tests, and its specific value is set according to actual needs.

[0061] Step S102: Obtain a second preset number of test contents to be executed from the test content set, and use the second preset number of test contents to be executed to test the second preset number of nodes sharing the network card respectively. Here, the second preset number is the number of nodes, and the second preset number of test contents to be executed is included in the first preset number of test contents.

[0062] Specifically, the nodes are server nodes, and the server nodes can be divided into computing nodes and storage nodes according to their functions. The second preset number is the number of nodes, for example: 4, 5, and the specific value is set according to actual needs. In the test content set, a second preset number of different test contents are obtained, for example: if the number of nodes is 4, 4 test contents in the test content set are obtained as the test contents to be executed. The second preset number of nodes sharing the network card are tested by using the second preset number of test contents to be executed, for example: controlling 4 nodes to execute 1 test content to be executed respectively. At this time, different nodes execute different test contents.

[0063] It should be noted that different test contents are selected to simulate actual application scenarios. In normal applications, it is rare for multiple server nodes to perform the same type of work, so different test contents are selected to make different nodes execute different test contents, which can better simulate actual application scenarios. However, there is a possibility that two nodes perform the same type of work at the same time. If there is a demand, different nodes can also execute the same test content, for example: 4 nodes, node 1 and node 2 perform operating system restart test. However, this situation can be covered by the whole machine executing OS restart test at the same time.

[0064] The above content is as shown in Figure 2 The test contents for node 1 to node N are selected in the test content set, and different nodes are controlled to execute the corresponding test contents for execution test.

[0065] In step S103, a second preset number of candidate test contents are obtained in the test content set, and it is judged whether the second preset number of candidate test contents are the same as the second preset number of test contents to be executed.

[0066] Specifically, the network card needs to be tested for multiple rounds. After executing the next round of test after step S102, the test contents to be executed need to be reacquired. In order to avoid the situation that the same test content to be executed is selected in the adjacent two rounds of test with a small probability, resulting in a single test and wasting system resources, the test contents to be executed selected in the two rounds of test are compared. If they are the same, the test contents to be executed are reselected in the next round of test.

[0067] In the test content set, a second preset number of candidate test contents are obtained, and it is judged whether the second preset number of candidate test contents are the same as the second preset number of test contents to be executed.

[0068] Step S104: If they are the same, then start executing the subsequent steps from obtaining the second preset number of candidate test contents from the test content set. If they are different, then take the candidate test contents as the new test contents to be executed, replace the test contents to be executed with the new test contents to be executed, and start executing the subsequent steps from testing the second preset number of nodes with the second preset number of test contents to be executed respectively, until the end command is detected, then the process ends.

[0069] Specifically, if the second preset number of candidate test contents are the same as the second preset number of test contents to be executed, it means that the same test contents to be executed have been selected in two adjacent rounds of testing, and the test contents to be executed need to be reselected and step S103 needs to be executed again. If they are different, the candidate test contents are used as new test contents to be executed, and step S102, "using the second preset number of test contents to be executed to test the second preset number of nodes sharing the network card", is executed again up to step S104.

[0070] When the network card testing process meets the cutoff conditions, the node generates an end command. When the end command is detected, the network card test ends. Cutoff conditions include, for example, 20 test rounds, each node executing each test item in the test content set at least once, and the total test time exceeding 10 minutes.

[0071] The above content is as follows Figure 2 As shown, after all nodes have been tested in the first round, test content is reselected for nodes 1 to N in the test content set and compared with the previous test content combination. If they match, new test content is selected; otherwise, testing continues, controlling different nodes to execute the corresponding test content. This round of testing ends, and the above loop repeats.

[0072] The network interface card (NIC) testing method provided in this embodiment obtains a second preset number of candidate test contents from the test content set, and uses these second preset number of test contents to test a second preset number of nodes sharing a NIC. This allows for the execution of different test contents on multiple nodes within the same timeframe, effectively simulating specific scenarios in real-world applications. It covers the working scenarios of multi-host NIC reuse in practical applications, and the multiple rounds of testing improve the acceptance quality of product development. This solves the problem of being unable to simulate the actual working state of the NIC when multiple nodes perform different operations on it during testing of NICs reused by multiple nodes.

[0073] In some alternative implementations, the test content set is obtained, including:

[0074] Obtain the first preset number of test items;

[0075] Generate the first sequence number corresponding to each test item;

[0076] Generate a test content set containing a first preset number of test content items and their corresponding first sequence numbers.

[0077] Specifically, a first preset number of test items are acquired. These test items include, for example: operating system (OS) restart test, server power-on / off test, network card stress test, network card performance test, network card driver upgrade test, network card firmware upgrade test, network card NCSI (Network Controller Sideband Interface, a protocol defined for communication between the baseboard management controller (BMC) and the network card) stress test, network card NCSI and data port interaction test, RoCE (RDMA over Converged Ethernet, a cluster network communication protocol that enables RDMA over Ethernet) / RDMA (remote direct memory access) test, etc. The first preset number represents multiple items; its specific value is set according to actual needs.

[0078] Generate a first sequence number for each test item. For example: the first sequence number for the operating system (OS) restart test is 1, the first sequence number for the server power on / off test is 2, the first sequence number for the network card stress test is 3, the first sequence number for the network card performance test is 4, the first sequence number for the network card driver upgrade test is 5, the first sequence number for the network card firmware upgrade test is 6, the first sequence number for the network card NCSI stress test is 7, the first sequence number for the network card NCSI and data port interaction test is 8, and the first sequence number for the RoCE / RDMA test is 9.

[0079] Generate a test content set containing a first preset number of test content items and their corresponding first sequence numbers.

[0080] In this embodiment, a test content set is generated, which includes a first preset number of test contents and corresponding first sequence numbers. This facilitates the subsequent selection of test contents to be executed from the test content set using the first sequence numbers, ensuring randomness during selection and covering the working scenarios of multi-host multiplexed network cards in practical applications.

[0081] In some optional implementations, determining whether a second preset number of candidate test items are the same as a second preset number of test items to be executed includes:

[0082] Obtain the first sequence number of the candidate test content and the first sequence number of the test content to be executed;

[0083] The candidate test items are sorted according to the first preset order to obtain the first sequence;

[0084] According to the first preset order, the first serial numbers of the test contents to be executed are sorted to obtain a second sequence;

[0085] It is judged whether the first sequence and the second sequence are same. If they are same, it is determined that the second preset number of candidate test contents are same as the second preset number of test contents to be executed.

[0086] Specifically, after steps S101 to S102 are executed, it is considered that a round of test is executed. The next round of test needs to be executed, i.e. steps S103 to S104 are executed. In step S102, the second preset number of test contents to be executed are randomly selected by using the permutation and combination method in mathematics. In step S103, the candidate test contents are selected in the same way. The probability that the candidate test contents are same as the test contents to be executed in step S102 is relatively small.

[0087] However, in order to avoid that the same test contents to be executed are selected in the adjacent two rounds of test with a small probability, the same test contents to be executed are selected in the two rounds of test, the single test is caused, and the system resources are wasted. Therefore, the test contents to be executed selected in the two rounds of test are compared. If they are same, the test contents to be executed are reselected in the next round of test.

[0088] The first serial numbers of the candidate test contents and the first serial numbers of the test contents to be executed are obtained. For example, the first serial numbers of the candidate test contents include 1, 3 and 4, and the first serial numbers of the test contents to be executed include 2, 4 and 9.

[0089] The first preset order is, for example, from large to small. According to the first preset order, the first serial numbers of the candidate test contents are sorted to obtain a first sequence, for example, 134. According to the first preset order, the first serial numbers of the test contents to be executed are sorted to obtain a second sequence, for example, 249.

[0090] It is judged whether the first sequence and the second sequence are same. If they are same, it is determined that the second preset number of candidate test contents are same as the second preset number of test contents to be executed. If they are not same, the second preset number of candidate test contents are not same as the second preset number of test contents to be executed, which can be used as new test contents to be executed.

[0091] In the embodiment, by sorting the first serial numbers of the candidate test contents and the first serial numbers of the test contents to be executed according to the first preset order, and by comparing the two sequences generated, it is determined whether the second preset number of candidate test contents are same as the second preset number of test contents to be executed. The method is convenient and fast, saves the calculation resources, and avoids that the system resources are wasted due to the same test contents to be executed in the adjacent two rounds of test.

[0092] In some optional embodiments, the second preset number of test contents to be executed are obtained in the test content set, and the second preset number of nodes are tested respectively by using the second preset number of test contents to be executed, including:

[0093] The first preset function is used to generate the first preset number of random numbers in a preset range, and the second sequence number of the random numbers is generated;

[0094] The second preset function is used to sort the random numbers according to the size of the random numbers and the second preset sequence, and a random number queue is obtained;

[0095] The first preset number of random numbers in the random number queue are selected as target random numbers;

[0096] The first sequence number same as the second sequence number of the target random number is taken as a target sequence number, and the third preset function is used to obtain the test content corresponding to the target sequence number from the test content set according to the target sequence number, as the test content to be executed;

[0097] The third sequence number of the node is obtained, and the test content to be executed is distributed to the node according to the position of the target random number in the random number queue and the third sequence number, wherein the node is used to execute the distributed test content to be executed in the network card test process.

[0098] Specifically, the first preset function is a function that can generate a plurality of random numbers in a preset range, for example, (0, 1). The first preset function is used to generate the first preset number of random numbers between (0, 1), and the second sequence number of the random numbers is generated according to the sequence of the random numbers, for example, the first preset number is 9, and the 9 random numbers and the corresponding second sequence numbers are 0.73 (R1), 0.96 (R2), 0.05 (R3), 0.44 (R4), 0.51 (R5), 0.32 (R6), 0.89 (R7), 0.21 (R8), and 0.38 (R9).

[0099] The second preset function is a function that can sort numbers according to the second preset sequence. The second preset sequence is, for example, from large to small or from small to large. The second preset function is used to sort the random numbers according to the size of the random numbers and the second preset sequence, and a random number queue is obtained, for example, the second preset sequence is from large to small, and the random number queue is R2, R7, R1, R5, R4, R9, R6, R8, and R3.

[0100] The second preset number is the number of nodes, for example, 4. The first preset number of random numbers in the random number queue are selected as target random numbers, for example, R2, R7, R1, and R5.

[0101] The first serial number same as the second serial number of the target random number is taken as the target serial number, and the target serial number is 2, 7, 1, or 5. The third preset function is a function of querying a query result including the keyword in the search area according to the keyword, for example, using the third preset function, taking the target serial number as the keyword, and taking the test content set as the search area, obtaining the test content corresponding to the target serial number from the test content set according to the target serial number, taking the query result as the test content to be executed, for example, the test content to be executed includes "2. Server power-on / off test", "7. Network card NCSI stress test", "1. Operating system (OS) restart test mapping", and "5. Network card driver upgrade test".

[0102] The third serial number of the node is obtained, for example, the first server node is node 1, and the second server node is node 2. According to the position of the target random number in the random number queue and the third serial number, the test content to be executed is allocated to the node, for example, "2. Server power-on / off test" is executed on node 1 which multiplexes the same Multi-host network card, node 2 executes "7. Network card NCSI stress test", node 3 executes "1. Operating system (OS) restart test mapping", and node 4 executes "5. Network card driver upgrade test".

[0103] In addition, the embodiment can also use a more complex mathematical model to upgrade the selected test item combination selection method to obtain a more random and more simulated actual test combination.

[0104] In the embodiment, random numbers are generated and sorted, the first second preset number of random numbers are selected as target random numbers, the test content corresponding to the second serial number of the target random number is obtained from the test content set as the test content to be executed. Using the method of permutation and combination in mathematics, the test content to be executed is randomly selected, which covers the working scenario of the multi-host multiplexing network card in actual application.

[0105] In some optional embodiments, the method further includes:

[0106] Obtaining a running log of the node executing the test content to be executed;

[0107] According to the running log, the test result state and the test process information of the node are determined;

[0108] Generating a test report containing the test result state and the process information.

[0109] Specifically, during the process of the node executing the test content to be executed, the process information, execution result and other information need to be written into the running log.

[0110] By running the log, it is determined whether the node successfully executes the corresponding to-be-executed test content. If yes, the node test result state in this round is test passed. It is judged whether there is a fault code in the running log. If yes, a fault occurs in the execution process. The time used by the node to execute the to-be-executed test content is determined through the running log. Whether a fault occurs and the time used are included in the test process information. A test report including the test result state and the process information is generated.

[0111] In some optional embodiments, the method further comprises:

[0112] obtaining a test duration and a total amount of to-be-executed test content executed by the node;

[0113] If the test duration exceeds a first preset threshold, or the total amount exceeds a second preset threshold, an end command is generated.

[0114] Specifically, the cutoff condition is, for example, that the test round reaches 20 times, the total amount of to-be-executed test content executed by the node is 100, each node has executed each test content in the test content set at least once, the total test duration exceeds 10 minutes, etc.

[0115] The test duration and the total amount of to-be-executed test content executed by the node in the network card test are obtained. The first preset threshold is, for example, 10 minutes, 15 minutes, etc. The second preset threshold is, for example, 100, 150, etc. The specific value is set according to actual needs. If the test duration exceeds the first preset threshold, or the total amount exceeds the second preset threshold, it indicates that the cutoff condition is met, the network card test is completed, and an end command is generated.

[0116] In this embodiment, the end command is generated according to the test duration and the total amount of to-be-executed test content executed, and the multi-round test on the network card is ended. The network card is tested in multiple rounds, and different test contents are executed in multiple nodes in each test process. This effectively simulates specific scenarios in actual applications, covers the working scenarios of the multi-host multiplexing network card in actual applications, and improves the acceptance quality of product development.

[0117] In some optional embodiments, before the second preset number of nodes are tested by using the second preset number of to-be-executed test contents respectively, the method further comprises:

[0118] determining all nodes sharing the network card;

[0119] installing and configuring a preset test tool on the node, wherein the node executes the to-be-executed test content by using the preset test tool.

[0120] Specifically, all nodes sharing the network card, i.e., server nodes multiplexing the same Multi-host network card, are determined.

[0121] The preset test tools are, for example, Iperf3, Ethtool, Tcpdump, Ping, etc. Iperf3 is a widely used network performance test tool that can measure network bandwidth, throughput and latency. Ethtool is a Linux command line tool for displaying and setting network card parameters. Tcpdump is a tool for capturing network packets and can be used for network monitoring and troubleshooting. Ping is a basic network diagnostic tool for testing network connectivity and response time. When the node is installed and configured with the preset test tools, the preset test tools are used to perform the test content to be performed, such as operating system (OS) restart test, server power-on / off test, network card stress test, network card performance test, network card driver upgrade test, etc.

[0122] In some optional embodiments, the specific process of the node performing the test content to be performed can include steps A1 and A2.

[0123] Step A1, determining the test platform type and test script associated with the test case based on the knowledge base.

[0124] Specifically, the test content to be performed is a test case to be performed. The knowledge base is shown in Table 1.

[0125] Table 1: Knowledge base example

[0126] Test case Component name Test platform type Test script address Run time Use case 1 Component a Type 1 / ceshi / test case1.rb 120s Use case 2 Component a Type 1 / ceshi / test case2.rb 135s Use case 3 Component a Type 2 / ceshi / test case3.rb 68s

[0127] The example data table in Table 1 includes the name of each test case, the name of the component to which it belongs, the required test platform type, the corresponding test script address, and the running time required to run the test case. The test cases in the table can be pre-collected test cases. In the scenario of, for example, automatic regression testing, the test cases in the table can be historical test cases that have already been executed.

[0128] For the test case to be performed, the test platform type and test script associated with the test case are determined based on the knowledge base. For example, the test platform type, test script address, component name to which it belongs, and running information of each test case are determined by querying the knowledge base. The knowledge base can store multiple test cases written in various programming languages, and the test platform on which they run varies according to the test case. The test platform is the running platform of the test case, such as a hardware system and / or an operating system.

[0129] Step A2, determining the test subset to which the test case belongs according to the test platform type; and executing the test case in the test subset based on the test script.

[0130] Specifically, according to the test platform type, a test subset, i.e., a test suite, to which the test case belongs is determined, for example: test cases of the same test platform type are grouped in a test suite. When dividing the test suite, in addition to considering the test platform type of the test case, the running time of each test case can also be considered, so that the running time of all test suites is similar, to adapt to the parallel processing of multiple test suites. In addition, some test cases will cause damage to the system during execution, so the test platforms cannot be shared between these test cases. Therefore, the test suite division not only considers improving the efficiency of the test, but also considers some other internal needs.

[0131] Based on the test script, the test case in the test subset is executed. For example: based on the test platform type, a test environment for the test platform type is instantiated, and for each test suite, a plurality of test scripts associated with a plurality of test cases in the test suite are executed in sequence. During the execution of the test script, the running parameters of the network card are obtained by using the test script. During the test run, parameter substitution is performed, and abnormal handling and fault retry are automatically performed. After completing the execution of the test case, the test results can be collected from the running log, and a test report is generated based on the collected test results.

[0132] In this embodiment, in combination with steps S102 and S103, the test content to be executed is automatically obtained in the test content set, and the control node is used to execute the test content to be executed by using steps A1 and A2, so as to test the network card, realize the automatic generation and execution of the test content, improve the running efficiency of the test, realize reliable fault handling, and output a detailed test report.

[0133] In this embodiment, a network card testing device is also provided, which is used to implement the above-described embodiments and preferred embodiments, and details are not repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and is contemplated.

[0134] The embodiment provides a network card testing device, as shown in the following Figure 3 The device includes:

[0135] The first obtaining module 301 is configured to obtain a test content set, wherein the test content set contains a first preset number of test contents;

[0136] The first test module 302 is configured to obtain a second preset number of test contents to be executed from the test content set, and test a second preset number of nodes sharing the network card by using the second preset number of test contents to be executed, wherein the second preset number is the number of nodes, and the second preset number of test contents to be executed are included in the first preset number of test contents.

[0137] The second obtaining module 303 is configured to obtain a second preset number of candidate test contents from the test content set, and determine whether the second preset number of candidate test contents are the same as the second preset number of test contents to be executed.

[0138] The second test module 304 is configured to, if the second preset number of candidate test contents are the same as the second preset number of test contents to be executed, execute the subsequent steps from obtaining the second preset number of candidate test contents from the test content set, if the second preset number of candidate test contents are not the same as the second preset number of test contents to be executed, replace the test contents to be executed with new test contents to be executed, and execute the subsequent steps from testing the second preset number of nodes by using the second preset number of test contents to be executed, until a stop command is detected, and then stop.

[0139] In some optional embodiments, the first obtaining module 301 obtains the test content set, including:

[0140] Obtaining a first preset number of test contents;

[0141] Generating a first serial number corresponding to each test content;

[0142] Generating a test content set including the first preset number of test contents and the corresponding first serial numbers.

[0143] In some optional embodiments, the second obtaining module 303 determines whether the second preset number of candidate test contents are the same as the second preset number of test contents to be executed, including:

[0144] Obtaining a first serial number of the candidate test content and a first serial number of the test content to be executed;

[0145] According to the first preset order, the first serial number of the candidate test content is sorted to obtain a first sequence;

[0146] According to the first preset order, the first serial number of the test content to be executed is sorted to obtain a second sequence;

[0147] Determining whether the first sequence and the second sequence are the same, if the first sequence and the second sequence are the same, it is determined that the second preset number of candidate test contents are the same as the second preset number of test contents to be executed.

[0148] In some optional embodiments, the first test module 302 obtains a second preset number of test contents to be executed in the test content set, and respectively tests the second preset number of nodes by using the second preset number of test contents to be executed, including:

[0149] generating a first preset number of random numbers in a preset range by using a first preset function, and generating a second sequence number of the random numbers;

[0150] sorting the random numbers according to the sizes of the random numbers and a second preset sequence by using a second preset function, to obtain a queue of the random numbers;

[0151] selecting a first preset number of random numbers in front of the queue of the random numbers as target random numbers;

[0152] taking a first sequence number same as the second sequence number of the target random numbers as a target sequence number, and obtaining a test content corresponding to the target sequence number from the test content set by using a third preset function according to the target sequence number, as a test content to be executed;

[0153] obtaining a third sequence number of the node, and distributing the test content to be executed to the node according to the position of the target random number in the queue of the random numbers and the third sequence number, wherein the node is used to execute the distributed test content to be executed in the network card test process.

[0154] In some optional embodiments, the device is used for:

[0155] obtaining a running log of the node executing the test content to be executed;

[0156] determining a test result state and test process information of the node according to the running log;

[0157] generating a test report containing the test result state and the process information.

[0158] In some optional embodiments, the device is further used for:

[0159] obtaining a test duration and a total amount of the test content to be executed executed by the node;

[0160] if the test duration exceeds a first preset threshold, or the total amount exceeds a second preset threshold, generating an end command.

[0161] In some optional embodiments, before the second preset number of nodes are respectively tested by using the second preset number of test contents to be executed, the device is further used for:

[0162] determining all nodes sharing the network card;

[0163] installing and configuring a preset test tool in the node, wherein the node executes the test content to be executed by using the preset test tool.

[0164] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0165] In this embodiment, the network card testing device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0166] This invention also provides a computer device having the above-described features. Figure 3 The network card testing device shown.

[0167] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 4 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 4 Take a processor 10 as an example.

[0168] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include an 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 (FPGA), a general-purpose array logic (GPA), or any combination thereof.

[0169] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.

[0170] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system, application programs required for at least one function, etc. The data storage area can store data created by the computer device, etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-transitory memory such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid state memory device. In some alternative embodiments, the memory 20 can optionally include memory that is remotely located with respect to the processor 10, and which can be connected to the computer device through a network. Examples of such networks include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communications network, and combinations thereof.

[0171] The memory 20 can include a volatile memory, such as a random access memory, and / or can include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid state memory device. The memory 20 can also include an array of multi-state flash memory cells, which can be used to store data and / or instructions in multiple states.

[0172] The computer device also includes a communications interface 30 for communicating with other devices or communication networks.

[0173] The embodiments of the present application also provide a computer readable storage medium, and the method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or implemented as computer code to be originally stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and stored in a local storage medium, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid state disk, etc. Further, the storage medium can also include a combination of the above-mentioned kinds of storage. It can be understood that the computer, the processor, the microprocessor controller, or the 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 the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.

[0174] Part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, the method and / or technical solutions according to the present application can be called or provided. Those skilled in the art should understand that the form of computer program instructions in computer readable medium includes but is not limited to source file, executable file, installation package file and the like, and accordingly, the way of computer program instructions executed by computer includes but is not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions 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.

[0175] Although the embodiments of the present application are described in conjunction with the drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the present application.

Claims

1. A network card testing method, characterized in that, The method includes: Obtain a test content set, wherein the test content set contains a first preset number of test contents; A second preset number of test contents to be executed are obtained from the test content set. The second preset number of test contents to be executed are used to test the second preset number of nodes that share the network card, or the same test contents to be executed are used on different nodes. The second preset number is the number of nodes, and the second preset number of test contents to be executed is included in the first preset number of test contents. The step of obtaining a second preset number of test contents to be executed from the test content set, and using the second preset number of test contents to be executed to test a second preset number of nodes sharing a network card, includes: generating a first preset number of random numbers within a preset range using a first preset function; sorting the random numbers according to their size and a second preset order using a second preset function to obtain a random number queue; selecting the first second preset number of random numbers from the random number queue as target random numbers; obtaining a third sequence number of the node; and allocating the test contents to be executed to the node according to the position of the target random number in the random number queue and the third sequence number, wherein the node is used to execute the allocated test contents to be executed during the network card test. A second preset number of candidate test contents are obtained from the test content set, and it is determined whether the second preset number of candidate test contents are the same as the second preset number of test contents to be executed. If they are the same, the subsequent steps are executed starting from obtaining a second preset number of candidate test contents from the test content set. If they are not the same, the candidate test contents are used as new test contents to be executed, and the test contents to be executed are replaced by the new test contents to be executed. The subsequent steps are executed starting from testing the second preset number of nodes with the second preset number of test contents to be executed, until an end command is detected, at which point the process ends.

2. The method according to claim 1, characterized in that, The acquisition of the test content set includes: Obtain the first preset number of test items; Generate a first sequence number corresponding to each of the test contents; Generate the test content set containing the first preset number of test content items and their corresponding first sequence numbers.

3. The method according to claim 2, characterized in that, The step of determining whether the second preset number of candidate test contents are the same as the second preset number of test contents to be executed includes: Obtain the first sequence number of the candidate test content and the first sequence number of the test content to be executed; The candidate test contents are sorted according to the first preset order to obtain the first sequence; The first sequence number of the test content to be executed is sorted according to the first preset order to obtain the second sequence; Determine whether the first sequence and the second sequence are the same. If they are the same, then determine that the second preset number of candidate test contents are the same as the second preset number of test contents to be executed.

4. The method according to claim 2, characterized in that, The step of obtaining a second preset number of test items to be executed from the test content set, and using the second preset number of test items to be executed to test the second preset number of nodes respectively, includes: A second sequence number of the random number is generated; a first sequence number that is the same as the second sequence number of the target random number is taken as the target sequence number, and a third preset function is used to obtain the test content corresponding to the target sequence number from the test content set according to the target sequence number, which is taken as the test content to be executed.

5. The method according to claim 1, characterized in that, The method further includes: Obtain the execution log of the node executing the test content to be executed; Based on the operation log, determine the test result status and test process information of the node; Generate a test report that includes the test result status and the process information.

6. The method according to claim 1, characterized in that, The method further includes: Obtain the test duration and the total amount of test content to be executed by the node; If the test duration exceeds a first preset threshold, or the total test duration exceeds a second preset threshold, then the end command is generated.

7. The method according to claim 1, characterized in that, Before testing the second preset number of nodes using the second preset number of test contents to be executed, the method further includes: Identify all nodes that share the network interface card; A preset testing tool is installed and configured on the node, wherein the node uses the preset testing tool to execute the test content to be executed.

8. A network card testing device, characterized in that, The device includes: The first acquisition module is used to acquire a test content set, wherein the test content set contains a first preset number of test contents; The first testing module is used to obtain a second preset number of test contents to be executed from the test content set, and use the second preset number of test contents to be executed to test a second preset number of nodes sharing a network card, or to use different nodes to execute the same test contents to be executed, wherein the second preset number is the number of nodes, and the second preset number of test contents to be executed is included in the first preset number of test contents; The first testing module obtains a second preset number of test contents to be executed from the test content set, and uses the second preset number of test contents to test a second preset number of nodes sharing a network card, including: generating a first preset number of random numbers within a preset range using a first preset function; sorting the random numbers according to their size and a second preset order using a second preset function to obtain a random number queue; selecting the first second preset number of random numbers from the random number queue as target random numbers; obtaining a third sequence number of the node; and allocating the test contents to be executed to the node according to the position of the target random number in the random number queue and the third sequence number, wherein the node is used to execute the allocated test contents during the network card testing process; The second acquisition module is used to acquire a second preset number of candidate test contents from the test content set and determine whether the second preset number of candidate test contents are the same as the second preset number of test contents to be executed. The second testing module is used to, if they are the same, start executing subsequent steps from obtaining a second preset number of candidate test contents from the test content set; if they are different, use the candidate test contents as new test contents to be executed, replace the test contents to be executed with the new test contents to be executed, and start executing subsequent steps from testing the second preset number of nodes with the second preset number of test contents to be executed, until an end command is detected, then the process ends.

9. A computer device, characterized in that, include: A memory and a processor are interconnected, the memory stores computer instructions, and the processor executes the network card testing method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the network card testing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Dynamic testing method, system and device of multi-node server system and medium

    CN116244125A