Network card testing method and device, computer equipment and storage medium
By randomly generating and executing different test contents in multiple nodes, the problem that the existing technology cannot effectively simulate the actual working status of multiple node multiplexing network cards is solved, and efficient network card testing and product development acceptance quality is achieved.
Patent Information
- Application Number
- CN202411495623.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-10-24
AI Technical Summary
The existing technology cannot effectively simulate the actual working status of the network card when multiple nodes perform different operations on the network card, and cannot meet the testing requirements of multiple nodes to multiplex a single network card.
By obtaining the test content set, randomly generating and sorting the test content serial numbers, selecting the appropriate amount of test content to be executed, and executing different test contents in multiple nodes, simulating the actual working scenario of multiple nodes in multiple network cards.
It realizes the simultaneous execution of different test contents in multiple nodes, effectively simulates the working scenario of multiple hosts' multiplexed network cards, and improves the acceptance quality of product development.
Smart Images

Figure CN119402386A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a network card testing method, device, computer equipment and storage medium. Background Art
[0002] Multi-Host (multiple host administration) technology is a powerful multi-host management and scheduling technology. By using a network card device that supports 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 realizes cross-host migration and scheduling of virtual machines or containers, improves resource utilization and service availability, and realizes efficient collaboration between multiple computing nodes.
[0003] In order to ensure the performance and stability of the network card, the network card needs to be tested. However, the current means of testing the network card is to test the function, performance, pressure, and power on / off stability of the network card exclusively used by a single node, and the test of the network card is mainly focused on a single test item of the network card. However, in the application scenario where multiple computing nodes and / or multiple storage nodes reuse the network card that supports the Multi-Host technology chip, each node operates independently, and each node has different usage and working status for the reused network card at the same time. The current means of testing the network card cannot effectively simulate the actual working status of multiple nodes reusing a single network card, and cannot simultaneously meet the working conditions of multiple different operations on the reused network card when each node operates independently.
[0004] Therefore, the related art has a problem that when testing a network card reused by multiple nodes, it is unable to simulate the actual working state of the network card when multiple nodes perform different operations on the network card. Summary of the invention
[0005] In view of this, the present invention provides a network card testing method, device, computer equipment and storage medium to solve the problem that when testing a network card reused by multiple nodes, the actual working state of the network card cannot be simulated when multiple nodes perform different operations on the network card.
[0006] In a first aspect, the present invention provides a network card testing method, comprising:
[0007] Acquire a test content set, wherein the test content set includes a first preset number of test contents;
[0008] 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 that share the network card, respectively, 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;
[0009] 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;
[0010] If they are the same, the subsequent steps are executed starting from obtaining a second preset number of candidate test contents in the test content set; if they are not the same, the candidate test contents are used as new test contents to be executed, the test contents to be executed are replaced by the new test contents to be executed, and the subsequent steps are executed starting from testing a second preset number of nodes respectively using the second preset number of test contents to be executed, until an end command is detected, then the process ends.
[0011] The network card testing method provided in this embodiment obtains a second preset number of candidate test contents in the test content set, and uses the second preset number of to-be-executed test contents to test the second preset number of nodes that share the network card, respectively, so as to execute different test contents in multiple nodes in the same time, effectively simulating specific scenarios in actual applications, covering the working scenarios of multi-host multiplexing network cards in actual applications, and testing the network cards in multiple rounds, thereby improving the acceptance quality of product development. The problem that when testing a network card multiplexing in multiple nodes, it is impossible to simulate the actual working state of the network card when multiple nodes perform different operations on the network card is solved.
[0012] In some optional implementations, obtaining a test content set includes:
[0013] Obtaining a first preset number of test contents;
[0014] Generate the first serial number corresponding to each test content;
[0015] A test content set including a first preset number of test contents and corresponding first serial numbers is generated.
[0016] In this embodiment, a test content set is generated that includes a first preset number of test contents and corresponding first serial numbers, which facilitates the subsequent selection of test contents to be executed from the test content set using the first serial number, thereby ensuring randomness during selection and covering the working scenarios of multi-host multiplexing network cards in actual applications.
[0017] In some optional implementations, determining whether the second preset number of candidate test contents are the same as the second preset number of to-be-executed test contents includes:
[0018] Obtain the first serial number of the candidate test content and the first serial number of the test content to be executed;
[0019] Sorting the first serial numbers of the candidate test contents according to a first preset order to obtain a first sequence;
[0020] Sort the first sequence numbers of the test contents to be executed according to the first preset sequence to obtain a second sequence;
[0021] It is determined whether the first sequence and the second sequence are the same. If they 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.
[0022] In this 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 sequence, and by comparing the two generated sequences, it is determined whether the second preset number of candidate test contents and the second preset number of test contents to be executed are the same. This is convenient and fast, saves computing resources, and avoids wasting system resources by executing the same test contents in two adjacent rounds of testing.
[0023] In some optional implementations, 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 the second preset number of nodes respectively, includes:
[0024] Using a first preset function, generating a first preset number of random numbers within a preset range, and generating a second sequence number of the random numbers;
[0025] Using a second preset function, the random numbers are sorted according to the size of the random numbers and the 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 the target random number;
[0027] The first serial number that is the same as the second serial number of the target random number is used as the target serial number, and the test content corresponding to the target serial number is obtained from the test content set according to the target serial number by using the third preset function as the test content to be executed;
[0028] The third serial number of the node is obtained, and the test content to be executed is allocated 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 allocated test content to be executed during the network card test process.
[0029] In this embodiment, random numbers are generated and sorted, the first second preset number of random numbers are selected as target random numbers, and the test content corresponding to the second sequence number of the target random number is obtained from the test content set as the test content to be executed. The method of permutation and combination in mathematics is used to randomly select the test content to be executed, covering the working scenarios of multi-host multiplexing network cards in actual applications.
[0030] In some optional embodiments, the method further comprises:
[0031] Get the running log of the node executing the test content to be executed;
[0032] According to the operation log, determine the test result status and test process information of the node;
[0033] Generates a test report containing test result status and process information.
[0034] In some optional embodiments, the method further comprises:
[0035] Get the test duration and the total amount of test content to be executed by the node;
[0036] If the test duration exceeds the first preset threshold, or the total amount exceeds the second preset threshold, an end command is generated.
[0037] In this embodiment, an end command is generated according to the test duration and the total amount of test content to be executed, and multiple rounds of testing on the network card are ended. The network card is tested in multiple rounds and different test contents are executed in multiple nodes during each round of testing, which effectively simulates the specific scenarios in actual applications and covers the working scenarios of multi-host multiplexing network cards in actual applications, thereby improving the acceptance quality of product development.
[0038] In some optional implementations, before using the second preset number of to-be-executed test contents to test the second preset number of nodes respectively, the method further includes:
[0039] Identify all nodes that share the network card;
[0040] A preset test tool is installed and configured on the node, wherein the node uses the preset test tool to execute the test content to be executed.
[0041] In a second aspect, the present invention provides a network card testing device, comprising:
[0042] A first acquisition module, configured to acquire a test content set, wherein the test content set includes a first preset number of test contents;
[0043] A first test 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 that share a network card, 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;
[0044] A second acquisition module, configured 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;
[0045] The second test module is used to execute subsequent steps by obtaining a second preset number of candidate test contents from the test content set if they are the same; if they are not the same, to 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 execute subsequent steps by testing a second preset number of nodes respectively with the second preset number of test contents to be executed, until an end command is detected, and then the process ends.
[0046] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the network card testing method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0047] 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 network card testing method of the first aspect or any corresponding embodiment thereof.
[0048] In a fifth aspect, the present invention provides a computer program product, including computer instructions, and the computer instructions are used to enable a computer to execute the network card testing method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 is a flow chart of a network card testing method according to an embodiment of the present invention;
[0051] Figure 2is a flow chart of a composite stability testing method for a multi-host multiplexing network card scenario according to an embodiment of the present invention;
[0052] Figure 3 is a structural block diagram of a network card testing device according to an embodiment of the present invention;
[0053] Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] 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.
[0055] Multi-Host technology is a powerful multi-host management and scheduling technology. By building a centralized control plane or using advanced network architecture, it realizes efficient connection, management and scheduling between multiple server nodes. The main advantage of this technology is that it can realize direct connection between multiple server nodes and centralized network controllers, thereby optimizing data access paths, reducing latency, and significantly improving data transmission efficiency and system density. Using network card devices equipped with chips that support Multi-Host technology, 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. It can realize that a single network card provides services for multiple hosts at the same time. This application can realize 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, realize efficient collaboration between multiple computing nodes, and accelerate scientific computing and data analysis tasks. This technology has broad application prospects in cloud computing, data centers, high-performance computing and other fields. However, the current testing method is to test the function, performance, pressure and power on / off stability of the network card exclusive to a single server node. However, in the application scenario where multiple computing nodes and storage nodes reuse a single network card that supports Multi-Host technology chips, each server node operates independently. Therefore, at the same time, each server will have different usage and working status of the reused single network card. Therefore, the same test operation performed at the same time cannot simultaneously meet the working conditions of multiple different operations when multiple server nodes reuse a single network card and each node operates independently.
[0056] Based on the above content, the embodiment of the present invention provides a network card testing method. On the basis of the testing method of using an exclusive network card for a single server node, the method of permutation and combination in mathematics is used to randomly generate different test item combinations, and the test item combination contains the same test content as the number of nodes. The computing nodes and storage nodes are tested using the test item combination, so that different network card test contents are executed in multiple server nodes that reuse a single network card that supports Multi-Host technology chips in the same time, effectively simulating specific scenarios in actual applications. In order to achieve a working state in which different network card test contents are executed in multiple server nodes that reuse a single network card that supports Multi-Host technology chips, the working scenarios of multi-host reused network cards in actual applications are covered in the test link, and the technical effect of improving the acceptance quality of product development is improved.
[0057] According to an embodiment of the present invention, a network card test embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer device with data processing capabilities, such as a computer, a server, etc., 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.
[0058] In this embodiment, a network card testing method is provided. Figure 1 is a flow chart of a network card testing method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0059] Step S101: obtaining a test content set, wherein the test content set includes a first preset number of test contents.
[0060] Specifically, a test content set is obtained, the test content is a test case, and 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 represents a plurality, and its specific value is set according to actual needs.
[0061] Step S102, 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 that share a network card, 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.
[0062] Specifically, the node is a server node, and the server node can be divided into computing nodes and storage nodes according to its function. The second preset number is the number of nodes, for example: 4, 5, and the specific value is set according to actual needs. Obtain a second preset number of different test contents in the test content set, for example: the number of nodes is 4, and 4 test contents are obtained in the test content set as the test contents to be executed. Use the second preset number of test contents to be executed to test the second preset number of nodes that share the network card, for example: control 4 nodes to execute 1 test content to be executed respectively, and 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. Therefore, selecting different test contents and making different nodes perform different test contents can better simulate actual application scenarios. However, since it is possible for two nodes to perform the same type of work at the same time, if there is a need, different nodes can also perform the same test content. For example, among the four nodes, both node 1 and node 2 perform the operating system restart test. However, this situation can be covered by all nodes of the entire machine performing the OS restart test at the same time.
[0064] The above content is as follows Figure 2 As shown, test contents are selected for nodes 1 to N in the test content set, and different nodes are controlled to execute corresponding test contents to perform the test.
[0065] Step S103: obtaining a second preset number of candidate test contents from the test content set, and determining whether the second preset number of candidate test contents are the same as the second preset number of to-be-executed test contents.
[0066] Specifically, it is necessary to perform multiple rounds of testing on the network card, and when the next round of testing after step S102 is executed, the test content to be executed needs to be re-acquired. In order to avoid the small probability of selecting the same test content to be executed in two adjacent rounds of testing, resulting in a single situation in both tests and wasting system resources, it is necessary to compare the test content to be executed selected in the two rounds of testing. If they are the same, the test content to be executed is re-selected in the next round of testing.
[0067] 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.
[0068] Step S104, if they are the same, then execute subsequent steps starting from obtaining a second preset number of candidate test contents in the test content set; if they are not the same, then 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 execute subsequent steps starting from testing a second preset number of nodes respectively with the second preset number of test contents to be executed, until an 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 are selected in two adjacent rounds of testing, and it is necessary to reselect the test contents to be executed and re-execute step S103. If they are not the same, the candidate test contents are used as new test contents to be executed, and the step S102 from "using the second preset number of test contents to be executed to test the second preset number of nodes that share the network card" to step S104 is re-executed.
[0070] When the network card test process meets the deadline conditions, the node generates an end command. When the end command is detected, the network card test is ended. The deadline conditions include: the test rounds reach 20 times, each node has executed each test content in the test content set at least once, and the total test time exceeds 10 minutes.
[0071] The above content is as follows Figure 2 As shown, after all nodes are tested in the first round of testing, test content is reselected for nodes 1 to N in the test content set, and compared with the previous test content combination. If they are consistent, reselection is performed. If they are inconsistent, the test is continued, and different nodes are controlled to execute the corresponding test content for execution testing. This round of testing is completed, and the above cycle is repeated.
[0072] The network card testing method provided in this embodiment obtains a second preset number of candidate test contents in the test content set, and uses the second preset number of to-be-executed test contents to test the second preset number of nodes that share the network card, respectively, so as to execute different test contents in multiple nodes in the same time, effectively simulate the specific scenarios in actual applications, cover the working scenarios of multiple host multiplexing network cards in actual applications, and test the network cards in multiple rounds, thereby improving the acceptance quality of product development. The problem that when testing a network card multiplexing in multiple nodes, it is impossible to simulate the actual working state of the network card when multiple nodes perform different operations on the network card is solved.
[0073] In some optional implementations, obtaining a test content set includes:
[0074] Obtaining a first preset number of test contents;
[0075] Generate the first serial number corresponding to each test content;
[0076] A test content set including a first preset number of test contents and corresponding first serial numbers is generated.
[0077] Specifically, a first preset number of test contents are obtained, 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, network card firmware upgrade test, network card NCSI (Network Controller Sideband Interface, a protocol defined for communication between baseboard management controller (BMC) and network card) stress test, network card NCSI and data network port interaction test, RoCE (RDMA over Converged Ethernet, a cluster network communication protocol that can perform RDMA on Ethernet) / RDMA (remote direct memory access, remote direct memory access) test, etc. The first preset number represents multiple, and its specific value is set according to actual needs.
[0078] Generate a first serial number corresponding to each test content, for example: the first serial number of the operating system (OS) restart test is 1, the first serial number of the server power on and off test is 2, the first serial number of the network card stress test is 3, the first serial number of the network card performance test is 4, the first serial number of the network card driver upgrade test is 5, the first serial number of the network card firmware upgrade test is 6, the first serial number of the network card NCSI stress test is 7, the first serial number of the network card NCSI and data network port interaction test is 8, and the first serial number of the RoCE / RDMA test is 9.
[0079] A test content set including a first preset number of test contents and corresponding first serial numbers is generated.
[0080] In this embodiment, a test content set is generated that includes a first preset number of test contents and corresponding first serial numbers, which facilitates the subsequent selection of test contents to be executed from the test content set using the first serial number, thereby ensuring randomness during selection and covering the working scenarios of multi-host multiplexing network cards in actual applications.
[0081] In some optional implementations, determining whether the second preset number of candidate test contents are the same as the second preset number of to-be-executed test contents includes:
[0082] Obtain the first serial number of the candidate test content and the first serial number of the test content to be executed;
[0083] Sorting the first serial numbers of the candidate test contents according to a first preset order to obtain a first sequence;
[0084] Sort the first sequence numbers of the test contents to be executed according to the first preset sequence to obtain a second sequence;
[0085] It is determined whether the first sequence and the second sequence are the same. If they 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.
[0086] Specifically, when step S101 to step S102 are executed, one round of testing is considered to be completed. The next round of testing needs to be performed, that is, step S103 to step S104 are executed. In step S102, the method of permutation and combination in mathematics is used to randomly select a second preset number of test contents to be executed. The method of selecting candidate test contents in step S103 is also the same. The probability that the candidate test contents are the same as the test contents to be executed in step S102 is relatively small.
[0087] However, in order to avoid the small probability of selecting the same test content to be executed in two adjacent rounds of testing, resulting in a single situation in both tests and a waste of system resources, it is necessary to compare the test content to be executed selected in the two rounds of testing. If they are the same, the test content to be executed is reselected in the next round of testing.
[0088] Obtain the first serial numbers of the candidate test contents and the first serial numbers of the test contents to be executed. For example, the first serial numbers of the candidate test contents include: 1, 3, 4, and the first serial numbers of the test contents to be executed include: 2, 4, 9.
[0089] The first preset order is, for example, from large to small. The first serial numbers of the candidate test contents are sorted according to the first preset order to obtain a first sequence, for example, 134. The first serial numbers of the test contents to be executed are sorted according to the first preset order to obtain a second sequence, for example, 249.
[0090] Determine whether the first sequence and the second sequence are the same. If they are the same, determine that 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 not the same, the second preset number of candidate test contents are not the same as the second preset number of test contents to be executed and can be used as new test contents to be executed.
[0091] In this 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 sequence, and by comparing the two generated sequences, it is determined whether the second preset number of candidate test contents and the second preset number of test contents to be executed are the same. This is convenient and fast, saves computing resources, and avoids wasting system resources by executing the same test contents in two adjacent rounds of testing.
[0092] In some optional implementations, 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 the second preset number of nodes respectively, includes:
[0093] Using a first preset function, generating a first preset number of random numbers within a preset range, and generating a second sequence number of the random numbers;
[0094] Using a second preset function, the random numbers are sorted according to the size of the random numbers and the second preset order to obtain a random number queue;
[0095] Selecting the first second preset number of random numbers from the random number queue as the target random number;
[0096] The first serial number that is the same as the second serial number of the target random number is used as the target serial number, and the test content corresponding to the target serial number is obtained from the test content set according to the target serial number by using the third preset function as the test content to be executed;
[0097] The third serial number of the node is obtained, and the test content to be executed is allocated 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 allocated test content to be executed during the network card test process.
[0098] Specifically, the first preset function is a function that can generate a number of random numbers within a preset range, and the preset range is, for example, (0, 1). The first preset function is used to generate a first preset number of random numbers between (0, 1), and a second serial number of the random number is generated in the order of random number generation, for example, the first preset number is 9, and the 9 random numbers and the corresponding second serial 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 a second preset order. The second preset order 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 their sizes and the second preset order to obtain a random number queue. For example, the second preset order 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 second preset number of random numbers are selected from the random number queue as target random numbers, for example: R2, R7, R1, R5.
[0101] The first serial number that is the same as the second serial number of the target random number is used as the target serial number, and the target serial numbers are 2, 7, 1, and 5. The third preset function is a function that searches for query results including the keyword in the search area according to the keyword, for example: using the third preset function, the target serial number is used as the keyword, the test content set is used as the search area, and the test content corresponding to the target serial number is obtained from the test content set according to the target serial number, that is, the query result, and the query result is used 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] Get the third serial number of the node, 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, assign the test content to be executed to the node, for example: execute "2. Server power on / off test" on node 1 that reuses the same Multi-host network card, execute "7. Network card NCSI stress test" on node 2, execute "1. Operating system (OS) restart test mapping" on node 3, and execute "5. Network card driver upgrade test" on node 4.
[0103] In addition, this embodiment may also adopt a more complex mathematical model to upgrade the method of selecting the test item combination to obtain a test combination that is more random and more simulated to the actual test combination.
[0104] In this embodiment, random numbers are generated and sorted, the first second preset number of random numbers are selected as target random numbers, and the test content corresponding to the second sequence number of the target random number is obtained from the test content set as the test content to be executed. The method of permutation and combination in mathematics is used to randomly select the test content to be executed, covering the working scenarios of multi-host multiplexing network cards in actual applications.
[0105] In some optional embodiments, the method further comprises:
[0106] Get the running log of the node executing the test content to be executed;
[0107] According to the operation log, determine the test result status and test process information of the node;
[0108] Generates a test report containing test result status and process information.
[0109] Specifically, when a node executes the test content to be executed, it needs to write process information, execution results and other information into the operation log.
[0110] Through the operation log, determine whether the node successfully executes the corresponding test content to be executed. If so, the node's test result status for this round is passed. Determine whether there is a fault code in the operation log. If so, a fault occurred during the execution process; through the operation log, determine the time it takes for the node to execute the test content to be executed. Whether a fault occurs, the time, etc. are included in the test process information. Generate a test report containing the test result status and process information.
[0111] In some optional embodiments, the method further comprises:
[0112] Get the test duration and the total amount of test content to be executed by the node;
[0113] If the test duration exceeds the first preset threshold, or the total amount exceeds the second preset threshold, an end command is generated.
[0114] Specifically, the cut-off conditions include: the number of test rounds reaches 20, the total amount of test content to be executed by the node is 100, each node has executed each test content in the test content set at least once, and the total test time exceeds 10 minutes.
[0115] Get the test duration of the network card test and the total amount of test content to be executed by the node. The first preset threshold is, for example, 10 minutes, 15 minutes, etc., and 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 means that the cutoff condition is met, the network card test is completed, and an end command is generated.
[0116] In this embodiment, an end command is generated according to the test duration and the total amount of test content to be executed, and multiple rounds of testing on the network card are ended. The network card is tested in multiple rounds and different test contents are executed in multiple nodes during each round of testing, which effectively simulates the specific scenarios in actual applications and covers the working scenarios of multi-host multiplexing network cards in actual applications, thereby improving the acceptance quality of product development.
[0117] In some optional implementations, before using the second preset number of to-be-executed test contents to test the second preset number of nodes respectively, the method further includes:
[0118] Identify all nodes that share the network card;
[0119] A preset test tool is installed and configured on the node, wherein the node uses the preset test tool to execute the test content to be executed.
[0120] Specifically, all nodes that share the network card, that is, server nodes that reuse the same Multi-host network card, are determined.
[0121] Preset test tools include Iperf3, Ethtool, Tcpdump, and Ping. Iperf3 is a widely used network performance test tool that can measure network bandwidth, throughput, and latency. Ethtool is a Linux command-line tool used to display and set network card parameters. Tcpdump is a tool used to capture network data packets and can be used for network monitoring and troubleshooting. Ping is a basic network diagnostic tool used to test network connectivity and response time. After installing and configuring the preset test tools on the node and then testing the network card, you need to use the preset test tools to execute the test content to be executed, such as operating system (OS) restart test, server power on and off test, network card stress test, network card performance test, network card driver upgrade test, etc.
[0122] In some optional implementations, the specific process of the node executing the test content to be executed may include step A1 and step 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 executed is the test cases to be executed. The knowledge base is shown in Table 1.
[0125] Table 1 Knowledge base example
[0126] Test Cases 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 each test case name, the component name 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 a scenario such as automatic regression testing, the test cases in the table can be historical test cases that have been executed.
[0128] For the test cases to be executed, the test platform type and test script associated with the test cases are determined based on the knowledge base. For example, the test platform type, test script address, component name, 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 are run varies according to the test cases, where 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, determine the test subset, i.e., the test suite, to which the test case belongs. For example, group the test cases of the same test platform type in one 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, which is suitable for parallel processing of multiple test suites. In addition, some test cases will cause damage to the system during execution, so the test platform cannot be shared between these test cases. Therefore, the division of test suites should not only consider improving the efficiency of the test, but also consider some other internal needs.
[0131] Based on the test script, the test cases in the test subset are executed. For example, based on the test platform type, a test environment for the test platform type is instantiated, and for each test suite, multiple test scripts associated with multiple test cases in the test suite are sequentially executed. During the execution of the test script, the operating parameters of the network card are obtained using the test script. During the test run, parameter replacement is performed, and exception handling and fault retry are automatically performed. After the execution of the test case is completed, the test results can be collected from the run log, and a test report can be generated based on the collected test results.
[0132] In this embodiment, in combination with step S102 and step S103, the test content to be executed is automatically obtained in the test content set, and the node is controlled to execute the test content to be executed using step A1 and step A2, and the network card is tested to achieve automatic generation and execution of the test content, improve the test operation efficiency, achieve 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-mentioned embodiments and preferred implementation modes, and the descriptions that have been made are not repeated here. 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.
[0134] This embodiment provides a network card testing device, such as Figure 3 As shown, including:
[0135] A first acquisition module 301 is used to acquire a test content set, wherein the test content set includes a first preset number of test contents;
[0136] A first test module 302 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 that share a network card, 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] A second acquisition module 303 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 to-be-executed test contents;
[0138] The second test module 304 is used to, if the two are the same, start executing subsequent steps by obtaining a second preset number of candidate test contents from the test content set; if they are not the same, 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 by testing a second preset number of nodes respectively with the second preset number of test contents to be executed, until an end command is detected.
[0139] In some optional implementations, the first acquisition module 301 acquires the test content set, including:
[0140] Obtaining a first preset number of test contents;
[0141] Generate the first serial number corresponding to each test content;
[0142] A test content set including a first preset number of test contents and corresponding first serial numbers is generated.
[0143] In some optional implementations, the second acquisition module 303 determines whether the second preset number of candidate test contents are the same as the second preset number of to-be-executed test contents, including:
[0144] Obtain the first serial number of the candidate test content and the first serial number of the test content to be executed;
[0145] Sorting the first serial numbers of the candidate test contents according to a first preset order to obtain a first sequence;
[0146] Sort the first sequence numbers of the test contents to be executed according to the first preset sequence to obtain a second sequence;
[0147] It is determined whether the first sequence and the second sequence are the same. If they 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 implementations, the first testing module 302 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 be executed to test the second preset number of nodes respectively, including:
[0149] Using a first preset function, generating a first preset number of random numbers within a preset range, and generating a second sequence number of the random numbers;
[0150] Using a second preset function, the random numbers are sorted according to the size of the random numbers and the second preset order to obtain a random number queue;
[0151] Selecting the first second preset number of random numbers from the random number queue as the target random number;
[0152] The first serial number that is the same as the second serial number of the target random number is used as the target serial number, and the test content corresponding to the target serial number is obtained from the test content set according to the target serial number by using the third preset function as the test content to be executed;
[0153] The third serial number of the node is obtained, and the test content to be executed is allocated 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 allocated test content to be executed during the network card test process.
[0154] In some optional embodiments, the device is used to:
[0155] Get the running log of the node executing the test content to be executed;
[0156] According to the operation log, determine the test result status and test process information of the node;
[0157] Generates a test report containing test result status and process information.
[0158] In some optional embodiments, the device is also used for:
[0159] Get the test duration and the total amount of test content to be executed by the node;
[0160] If the test duration exceeds the first preset threshold, or the total amount exceeds the second preset threshold, an end command is generated.
[0161] In some optional implementations, before using the second preset number of test contents to be executed to test the second preset number of nodes respectively, the apparatus is further used to:
[0162] Identify all nodes that share the network card;
[0163] A preset test tool is installed and configured on the node, wherein the node uses the preset test tool to execute the test content to be executed.
[0164] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0165] The network card testing 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.
[0166] The embodiment of the present invention also provides a computer device having the above Figure 3 The network card test setup shown.
[0167] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4 As 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 4 A processor 10 is taken as an example.
[0168] The processor 10 may be a central processing unit, a network processor or a combination thereof. The 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, a general purpose array logic or any combination thereof.
[0169] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0170] 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.
[0171] 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.
[0172] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0173] 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.
[0174] A part of the present invention 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 invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the 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 may be any available computer-readable storage medium or communication medium accessible to the computer.
[0175] 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 in this application.
Claims
1. A network card testing method, characterized in that: The method comprises: Acquire a test content set, wherein the test content set includes a first preset number of test contents; 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 that share a network card, respectively, wherein the second preset number is the number of the nodes, and the second preset number of test contents to be executed are included in the first preset number of test contents; 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; If they are the same, then 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, then 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, and then the subsequent steps are executed starting from testing a second preset number of nodes respectively by using the second preset number of test contents to be executed, until an end command is detected, then the step ends.
2. The method according to claim 1, characterized in that: The obtaining of the test content set includes: Obtaining the first preset number of test contents; Generate a first serial number corresponding to each of the test contents; Generate the test content set including the first preset number of test contents and the corresponding first serial numbers.
3. The method according to claim 2, characterized in that The determining whether the second preset number of candidate test contents is the same as the second preset number of to-be-executed test contents includes: Obtaining the first serial number of the candidate test content and the first serial number of the test content to be executed; Sorting the first serial numbers of the candidate test contents according to a first preset order to obtain a first sequence; Sorting the first sequence numbers of the to-be-executed test contents according to the first preset sequence to obtain a second sequence; It is determined whether the first sequence and the second sequence are the same; if they 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.
4. The method according to claim 2, characterized in that: The acquiring a second preset number of to-be-executed test contents from the test content set, and using the second preset number of to-be-executed test contents to test a second preset number of the nodes respectively, comprises: Using a first preset function, generating a first preset number of random numbers within a preset range, and generating a second serial number of the random numbers; Using a second preset function, the random numbers are sorted according to the size of the random numbers and a second preset order to obtain a random number queue; Selecting the first second preset number of random numbers from the random number queue as the target random number; Using the first serial number that is the same as the second serial number of the target random number as the 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 according to the target serial number as the test content to be executed; Obtain the third serial number of the node, and assign 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 assigned test content to be executed during the network card test process.
5. The method according to claim 1, characterized in that The method further comprises: Obtaining a running log of the node executing the test content to be executed; Determine the test result status and test process information of the node according to the operation log; A test report including the test result status and the process information is generated.
6. The method according to claim 1, characterized in that The method further comprises: Obtaining the test duration and the total amount of the test content to be executed by the node; If the test duration exceeds a first preset threshold, or the total amount exceeds a second preset threshold, the end command is generated.
7. The method according to claim 1, characterized in that Before using the second preset number of test contents to be executed to test the second preset number of nodes respectively, the method further includes: Determine all nodes that share the network card; A preset test tool is installed and configured on the node, wherein the node executes the test content to be executed using the preset test tool.
8. A network card testing device, characterized in that: The device comprises: A first acquisition module is used to acquire a test content set, wherein the test content set includes a first preset number of test contents; A first test module is used to obtain a second preset number of test contents to be executed in the test content set, and use the second preset number of test contents to be executed to test a second preset number of nodes that share a network card, wherein the second preset number is the number of the nodes, and the second preset number of test contents to be executed are included in the first preset number of test contents; A second acquisition module, configured 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 test module is used to, if the two are the same, start executing subsequent steps by obtaining a second preset number of candidate test contents in the test content set; if they are not the same, 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 by testing a second preset number of the nodes respectively with the second preset number of test contents to be executed, until an end command is detected, and then end.
9. A computer device, 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 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, and the computer instructions are used to enable a computer to execute the network card testing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Task scheduling method and device, and electronic equipment
CN111930476A
Multi-node test method and device for whole cabinet
CN113014438A
Method and device for automatically testing network card NCSI command, terminal and medium
CN115361327A
Dynamic testing method, system and device of multi-node server system and medium
CN116244125A
Multi-node management system and method, computer equipment and storage medium
CN116723190A