Testing method, system, device and storage medium for loading virtual network card on cloud platform

By generating and verifying the combination scenarios of virtual network card, the technical challenges of virtual network card health detection in Kubernetes clusters are solved, and comprehensive health detection and network smoothness of virtual network cards are achieved.

CN115567420BActive Publication Date: 2025-02-07INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211190466.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-28
Publication Date
2025-02-07
Estimated Expiration
2042-09-28

AI Technical Summary

Technical Problem

In Kubernetes cluster, how to effectively perform health testing of virtual network cards so that the detection results are not affected by business changes has become a technical challenge.

Method used

By determining the various physical network cards that are virtualized in the pod, a collection of scenarios including various possible combination scenarios of the virtual network card is generated, and these combination scenarios are selected in turn, the virtual network card information is mounted into the pod, and the network communication status is verified until all The combined scenario is verified.

Benefits of technology

A comprehensive health inspection of virtual network cards is realized, ensuring that the detection results are not affected by business changes, and ensuring the smoothness of network during use of virtual network cards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115567420B_ABST
    Figure CN115567420B_ABST
Patent Text Reader

Abstract

The present application discloses a test method, system, device and storage medium for loading a virtual network card on a cloud platform, which is applied to the technical field of cloud platforms, including: determining each physical network card to be virtualized in a pod, and generating a scene set including various possible combination scenes of a virtual network card according to each determined physical network card; selecting various combination scenes from the scene set in sequence, and after selecting any combination scene, mounting the virtual network card information in the combination scene to the pod, and verifying the network communication status of the pod under the combination scene, and selecting the next combination scene after the verification is completed; when any combination scene in the scene set is selected, the test result of the virtual network card of the cloud platform is obtained. Applying the scheme of the present application, the health test of the virtual network card can be carried out comprehensively and effectively without being affected by business changes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cloud platforms, and in particular to a test method, system, device and storage medium for loading a virtual network card on a cloud platform. Background Art

[0002] Kubernetes, or K8s for short, is an open source containerized application for managing multiple hosts in a cloud platform. The rise of Kubernetes has brought software development and architecture into the cloud-native era, and its inclusive and accommodative advantages have attracted a large number of developers to follow. For example, Kubernetes provides a device plugin mechanism, which provides corresponding interface standards for manufacturers to implement, and is perfectly compatible with the hardware of most hardware manufacturers, incorporating them into the management of Kubernetes clusters. The use of the CNI (Container Network Interface) mechanism has also greatly improved the scalability of the network topology of the Kubernetes cluster. The cooperation of multiple CNI network plug-ins has solved many network problems and enhanced the network topology capabilities of the cluster. The introduction of the Operator mode provides developers with a shortcut to quickly integrate into the logical management of Kubernetes clusters. As a master in this field, Kubernetes is also constantly developing, thereby promoting the implementation of more cloud-native projects.

[0003] sirov technology allows a single physical PCIe (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) device to virtualize multiple virtual PCIe devices. sirov technology introduces the concept of two types of functions: PF (Physical Function) and VF (Virtual Function). VF is the functional description of the device after virtualization. It is a lightweight PCIe function that can share one or more physical resources with the physical function and other VFs associated with the same physical function. Therefore, some of the current high-end network cards with this function will set a physical network card to use multiple VF virtual network cards, and this usage method is gradually being applied to Kubernetes clusters.

[0004] At present, how to load multiple VF network cards in a pod has become a problem that engineers need to face. This is similar to installing multiple physical network cards on a physical machine, but the VF network cards in the pod are virtual logic and need to be checked for health. If there is a problem with a VF virtual card in the pod, it may cause some business logic using the virtual network card to be blocked, such as some distributed training tasks that need to communicate through the VF network card. At present, when testing VF network cards, staff usually set relevant parameters and then perform testing. However, users' businesses often change, and the VF network cards or combinations of VF network cards required will also change accordingly. Therefore, even if the staff detects the health status of the VF network cards used by the current business, the business logic using the virtual network card will still be blocked from time to time during subsequent use.

[0005] In summary, how to effectively perform health detection of virtual network cards so that the detection results are not affected by business changes is a technical problem that technicians in this field urgently need to solve. Summary of the invention

[0006] The purpose of the present invention is to provide a test method, system, device and storage medium for loading a virtual network card on a cloud platform, so as to effectively perform health detection of the virtual network card so that the detection result is not affected by business changes.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0008] A test method for loading a virtual network card on a cloud platform, applied to any pod in the cloud platform, includes:

[0009] Determine each physical network card to be virtualized in the pod, and generate a scenario set including various possible combination scenarios of the virtual network card according to each of the determined physical network cards;

[0010] Select various combination scenarios from the scene set in sequence, and after selecting any combination scenario, mount the virtual network card information in the combination scenario to the pod, and verify the network communication status of the pod in the combination scenario, and select the next combination scenario after the verification is completed;

[0011] After any combination of scenarios in the scenario set is selected, the virtual network card test result of the cloud platform is obtained.

[0012] Preferably, the determining of each physical network card to be virtualized in the pod and generating a scenario set including various possible combination scenarios of the virtual network card according to each of the determined physical network cards include:

[0013] Determine each physical network card to be virtualized in the pod, and determine whether the total number n of determined physical network cards is greater than 1;

[0014] If not, a single physical network card in the pod is determined to be virtualized, and a scenario set including K combination scenarios is generated;

[0015] If yes, generating a scenario set including various possible combination scenarios of the virtual network cards based on the virtual network cards virtualized by the determined physical network cards;

[0016] Among them, for any combination scenario in the scene set, the combination scenario includes n virtual network cards virtualized by n physical network cards respectively; the virtual network card information of any two combination scenarios in the scene set is different; and K represents the total number of virtual network cards virtualized by the single physical network card.

[0017] Preferably, the selecting various combination scenes in sequence from the scene set includes:

[0018] Various combination scenes are selected in sequence from the scene set by means of a blocking queue.

[0019] Preferably, the verifying the network communication status of the pod in the combined scenario includes:

[0020] When the combined scenario includes only a single virtual network card, if the communication status of the single virtual network card is normal, it is determined that the network communication status of the pod in the combined scenario is normal;

[0021] When the combined scenario includes at least two virtual network cards, if the communication status between any two virtual network cards in the combined scenario is normal, it is determined that the network communication status of the pod in the combined scenario is normal.

[0022] Preferably, obtaining the test result of the virtual network card of the cloud platform includes:

[0023] When the network communication status of the pod in various combination scenarios is normal, a virtual network card test result of the cloud platform indicating that the test has passed is obtained;

[0024] When the network communication status of the pod in at least one of the combined scenarios is abnormal, a virtual network card test result of the cloud platform indicating that the test failed is obtained, and the virtual network card test result carries each of the combined scenarios that cause the network communication status of the pod to be abnormal.

[0025] Preferably, mounting the virtual network card information in the combined scenario into the pod includes:

[0026] Replace the virtual network card information currently allocated in the cloud platform with the virtual network card information in the combined scenario, so that the virtual network card information in the combined scenario is passed into the environment variable of the pod;

[0027] The environment variable is read from the target file of the cloud platform to obtain the virtual network card information in the combined scenario, and the obtained virtual network card information in the combined scenario is mounted into the pod.

[0028] Preferably, mounting the acquired virtual network card information in the combined scenario into the pod includes:

[0029] The obtained virtual network card information in the combined scenario is mounted into the pod through a preset plug-in.

[0030] A test system for loading a virtual network card on a cloud platform, applied to any pod in the cloud platform, includes:

[0031] A scenario set generation module, used to determine each physical network card to be virtualized in the pod, and generate a scenario set including various possible combination scenarios of the virtual network card according to each of the determined physical network cards;

[0032] A virtual network card information mounting module, used to select various combination scenarios from the scene set in sequence, and after selecting any combination scenario, mount the virtual network card information in the combination scenario to the pod, and verify the network communication status of the pod in the combination scenario, and select the next combination scenario after the verification is completed;

[0033] The virtual network card test result confirmation module is used to obtain the virtual network card test result of the cloud platform after any combination of scenarios in the scenario set is selected.

[0034] A test device for loading a virtual network card on a cloud platform, comprising:

[0035] Memory for storing computer programs;

[0036] A processor is used to execute the computer program to implement the steps of the test method for loading a virtual network card on a cloud platform as described above.

[0037] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the test method for loading a virtual network card on a cloud platform as described above.

[0038] Applying the technical solution provided by the embodiment of the present invention, considering that in the traditional solution, health monitoring is performed according to the current business usage of the virtual network card, resulting in insufficient comprehensiveness of the detection, in this regard, in the solution of the present application, all possible scenarios are listed one by one, so as to efficiently and comprehensively perform health detection of the virtual network card. Specifically, the present application will determine each physical network card virtualized in the pod, and generate a scene set including various possible combination scenes of the virtual network card according to each determined physical network card, that is, the different combination scenes in the scene set represent the combination of various virtual network cards that can be combined according to each determined physical network card. Therefore, various combination scenes are selected from the scene set in turn, and after the virtual network card information in the selected combination scene is mounted to the pod, the network communication status of the pod under the combination scene can be verified. When any combination scene in the scene set is selected, it means that all combination scenes have been verified, that is, the comprehensive virtual network card test results of the cloud platform can be obtained, which effectively guarantees the network smoothness of the business logic that needs to use the virtual network card, and will not be affected by business changes. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only 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.

[0040] Figure 1 This is a flow chart of an implementation of a test method for loading a virtual network card on a cloud platform in the present invention;

[0041] Figure 2 A schematic diagram of a scene set generated in a specific implementation manner of the present invention;

[0042] Figure 3 A schematic diagram of the structure of a test system for loading a virtual network card on a cloud platform in the present invention;

[0043] Figure 4 This is a structural schematic diagram of a test device for loading a virtual network card on a cloud platform in the present invention. DETAILED DESCRIPTION

[0044] The core of the present invention is to provide a testing method for loading a virtual network card on a cloud platform, which can comprehensively and effectively perform health tests on the virtual network card, effectively ensuring the network connectivity of the business logic that requires the use of the virtual network card, and will not be affected by business changes.

[0045] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0046] Please refer to Figure 1 , Figure 1 The present invention is a flow chart of an implementation of a test method for loading a virtual network card on a cloud platform. The test method for loading a virtual network card on a cloud platform can be applied to any pod in the cloud platform and may include the following steps:

[0047] Step S101: determine each physical network card to be virtualized in the pod, and generate a scenario set including various possible combination scenarios of the virtual network card according to each determined physical network card.

[0048] Specifically, the cloud platform of the present application can generally be a cloud platform based on Kubernetes. Multiple pods can be set in the cloud platform. Pod is the smallest container deployment unit in the cloud platform. The test method of loading a virtual network card on the cloud platform of the present application can be applied to any pod in the cloud platform. In other words, any pod can be selected to execute the solution of the present application and realize the monitoring test of the virtual network card.

[0049] First, it is necessary to determine the physical network cards that are virtualized in the pod, that is, collect all the PF physical network card information of the local machine, so as to count the number, and determine the number of virtual network cards managed by each physical network card. It is understandable that the number of virtual network cards virtualized by different physical network cards may be different, that is, the number of virtual network cards managed by different physical network cards may be different. Of course, there may be physical network cards that are not virtualized, then such physical network cards are not within the statistical scope of this application, that is, in step S101, only the physical network cards that are virtualized need to be determined.

[0050] Since each physical network card to be virtualized in the pod has been determined, the number of virtual network cards managed by each physical network card can be obtained, and then these virtual network cards can be combined into various possible combination scenarios to obtain a scenario set that includes all combination scenarios. That is, according to each determined physical network card, the virtual network cards belonging to different physical network cards are combined in various possible ways to obtain a scenario set that includes all possible combinations. In addition, it should be noted that, considering that the business usually does not need to use different virtual network cards managed under the same physical network card, therefore, in any one combination scenario, two or more virtual network cards from the same physical network card will not be placed at the same time.

[0051] In a specific implementation of the present invention, step S101 may specifically include:

[0052] Determine each physical network card to be virtualized in the pod, and determine whether the total number n of determined physical network cards is greater than 1;

[0053] If not, a single physical network card in the pod is determined to be virtualized, and a scenario set including K combination scenarios is generated;

[0054] If yes, then based on the virtual network cards virtualized by the determined physical network cards, a scenario set including various possible combination scenarios of the virtual network cards is generated;

[0055] Among them, for any combination scenario in the scenario set, the combination scenario includes n virtual network cards virtualized by n physical network cards respectively; the virtual network card information of any two combination scenarios in the scenario set is different; K represents the total number of virtual network cards virtualized by a single physical network card.

[0056] In this implementation, if the total number of physical network cards virtualized in the determined pod is n=1, that is, only a single physical network card is virtualized in the pod, a scenario set including K combination scenarios can be directly generated, where K represents the total number of virtual network cards virtualized by the single physical network card. And it can be understood that in the generated K combination scenarios, each combination scenario only includes 1 of the K virtual network cards. For example, in a specific scenario, only a single physical network card is virtualized in the pod, and the virtual network cards obtained after virtualization include virtual network card 1, virtual network card 2, and virtual network card 3. In this scenario, K=3, and the generated scenario set includes 3 combination scenarios, namely virtual network card 1, virtual network card 2, and virtual network card 3. It can be seen that when it is determined that only a single physical network card is virtualized in the pod, there are fewer combinations.

[0057] If the total number n of physical network cards virtualized in the determined pod is greater than 1, it is necessary to generate a scenario set including various possible combination scenarios of the virtual network cards based on the virtual network cards virtualized by each of the determined physical network cards.

[0058] For example Figure 2 In the specific case, there are two physical network cards in the pod for virtualization, and the virtual network cards obtained after the virtualization of physical network card A include virtual network card A-1, virtual network card A-2 and virtual network card A-3, and the virtual network cards obtained after the virtualization of physical network card B include virtual network card B-1, virtual network card B-2 and virtual network card B-3. In this case, the number of combined scenarios in the generated scenario set is 3×3=9, that is, Figure 2 "Virtual Network Card A-1 / Virtual Network Card B-1", "Virtual Network Card A-1 / Virtual Network Card B-2", "Virtual Network Card A-1 / Virtual Network Card B-3", "Virtual Network Card A-2 / Virtual Network Card B-1", "Virtual Network Card A-2 / Virtual Network Card B-2", "Virtual Network Card A-2 / Virtual Network Card B-3", "Virtual Network Card A-3 / Virtual Network Card B-1", "Virtual Network Card A-3 / Virtual Network Card B-2" and "Virtual Network Card A-3 / Virtual Network Card B-3" are shown.

[0059] For example, in another specific scenario, there are three physical network cards in the pod that are virtualized, and the virtual network cards obtained after the virtualization of physical network card A include virtual network card A-1 and virtual network card A-2. The virtual network cards obtained after the virtualization of physical network card B include virtual network card B-1, virtual network card B-2, and virtual network card B-3. The virtual network cards obtained after the virtualization of physical network card C include virtual network card C-1 and virtual network card C-2. In this case, the number of combined scenarios in the generated scenario set is 2×3×2=12. These 12 different combined scenarios can be represented as: "Virtual Network Card A-1 / Virtual Network Card B-1 / Virtual Network Card C-1", "Virtual Network Card A-1 / Virtual Network Card B-1 / Virtual Network Card C-2", "Virtual Network Card A-1 / Virtual Network Card B-2 / Virtual Network Card C-1", "Virtual Network Card A-1 / Virtual Network Card B-2 / Virtual Network Card C-2", "Virtual Network Card A-1 / Virtual Network Card B-3 / Virtual Network Card C-1", "Virtual Network Card A-1 / Virtual Network Card B-3 / Virtual Network Card C-1", Virtual Network Card A-1 / Virtual Network Card B-3 / Virtual Network Card C-2", "Virtual Network Card A-2 / Virtual Network Card B-1 / Virtual Network Card C-1", "Virtual Network Card A-2 / Virtual Network Card B-1 / Virtual Network Card C-2", "Virtual Network Card A-2 / Virtual Network Card B-2 / Virtual Network Card C-1", "Virtual Network Card A-2 / Virtual Network Card B-2 / Virtual Network Card C-2", "Virtual Network Card A-2 / Virtual Network Card B-3 / Virtual Network Card C-1", and "Virtual Network Card A-2 / Virtual Network Card B-3 / Virtual Network Card C-2".

[0060] It can be seen that in this implementation, for the generated scene set, the virtual network card information of different combination scenes is different, that is, there are no two completely identical combination scenes. Moreover, for any combination scene in the scene set, the combination scene includes n virtual network cards virtualized by n physical network cards, that is, the number of virtual network cards included in the combination scene is the same as the number of material network cards, that is, both are n, and for the n virtual network cards included in the combination scene, each physical network card contributes 1 out of the n. For example, Figure 2 In the implementation manner, each combination scenario includes 2 virtual network cards, and these 2 virtual network cards are respectively from physical network card A and physical network card B. In another implementation manner above, each combination scenario includes 3 virtual network cards, and these 3 virtual network cards are respectively from physical network card A, physical network card B and physical network card C.

[0061] In this implementation, the method of generating a scenario collection is relatively convenient, that is, the total number of combined scenarios in the generated scenario collection is the product of the number of virtual network cards managed by each physical network card, and each combined scenario includes n virtual network cards. This is because after adopting such a setting method, the subsequent virtual network card communication methods in various business scenarios can be covered, that is, the communication effectiveness between different virtual network cards can be effectively determined. Therefore, in the generated scenario collection, it is not necessary to set a combined scenario with less than n virtual network cards.

[0062] Step S102: various combination scenarios are selected from the scenario set in turn, and after any combination scenario is selected, the virtual network card information in the combination scenario is mounted to the pod, and the network communication status of the pod in the combination scenario is verified, and the next combination scenario is selected after the verification is completed.

[0063] After generating a scenario set including various possible combination scenarios of the virtual network card, various combination scenarios can be selected from the scenario set in turn, that is, each combination scenario needs to be verified once, thereby ensuring that the solution of the present application can realize comprehensive testing of the virtual network card.

[0064] Specifically, when various combination scenes are selected from the scene set in sequence, the specific order can be set and adjusted as needed, for example, they can be selected directly in sequence according to the numbers. Alternatively, they can be selected randomly, and after each random selection, the selected combination scene is removed from the scene set.

[0065] After selecting any combination scenario, the virtual network card information in the combination scenario needs to be mounted to the pod, so that the network communication status of the pod in the combination scenario can be verified. It can be understood that when the network communication status of the pod in the combination scenario is verified to be normal, it means that the combination scenario has passed the test, otherwise it means that there is a virtual network card with abnormal communication in the combination scenario.

[0066] In a specific implementation of the present invention, the sequentially selecting various combination scenes from the scene set described in step S102 may specifically include:

[0067] Various combination scenes are selected from the scene collection in sequence by means of a blocking queue.

[0068] As described above, in the solution of the present application, various combination scenes need to be selected from the scene set in sequence, and each combination scene needs to be verified once. In this implementation, in order to ensure that the next combination scene will not be selected from the scene set when the previous combination scene has not been verified, various combination scenes are selected from the scene set in sequence by blocking the queue.

[0069] The blocking queue can ensure that there is only one combination scene information in the queue. If this requirement is not met, the process will be blocked. In addition, in other implementations, other methods can be used to ensure that various combination scenes can be reliably selected from the scene set in sequence.

[0070] In a specific implementation of the present invention, mounting the virtual network card information in the combined scenario to the pod described in step S102 may specifically include:

[0071] Replace the virtual network card information currently allocated in the cloud platform with the virtual network card information in the combined scenario, so that the virtual network card information in the combined scenario is passed into the environment variables of the pod;

[0072] Read environment variables from the target file of the cloud platform to obtain virtual network card information in the combined scenario, and mount the obtained virtual network card information in the combined scenario into the pod.

[0073] Specifically, this implementation method takes into account that the virtual network card information in the combined scenario, such as the "virtual network card A-1 / virtual network card B-1 / virtual network card C-1" in the above example, can be used to replace the virtual network card information currently allocated in the cloud platform's allocate, so that the virtual network card information in the combined scenario can be passed into the environment variables of the pod.

[0074] After that, for example, you can use the CNI network plug-in to read the environment variables from the target file of the cloud platform, which is usually the check point file of the cloud platform. After reading the environment variables from the target file of the cloud platform, you can get the virtual network card information in the environment variables previously passed to the pod.

[0075] Finally, the virtual network card information in the obtained combined scenario can be mounted to the pod. For example, in a specific implementation, in order to improve the convenience of mounting, the virtual network card information in the obtained combined scenario can be mounted to the pod through a preset plug-in. Automatic mounting through a preset plug-in is more convenient and efficient. The preset plug-in can be, for example, a custom plug-in or a CNI plug-in, as long as it can achieve the mounting purpose of this application.

[0076] In a specific implementation of the present invention, the verification of the network communication status of the pod in the combined scenario described in step S102 may specifically include:

[0077] When the combined scenario includes only a single virtual network card, if the communication status of the single virtual network card is normal, it is determined that the network communication status of the pod in the combined scenario is normal;

[0078] When the combined scenario includes at least two virtual network cards, if the communication status between any two virtual network cards in the combined scenario is normal, it is determined that the network communication status of the pod in the combined scenario is normal.

[0079] Specifically, if the combined scenario includes only a single virtual network card, you can directly test the communication status of the single virtual network card. That is, when the communication status of the single virtual network card is normal, it can be determined that the network communication status of the pod in the combined scenario is normal. Conversely, when the communication status of the single virtual network card is abnormal, it can be determined that the network communication status of the pod in the combined scenario is abnormal.

[0080] In most cases, the combination scenario will include at least two virtual network cards. In the previous implementation method, the virtual network card information in the combination scenario is specifically "virtual network card A-1 / virtual network card B-1 / virtual network card C-1". It is necessary to determine whether the communication status between any two virtual network cards in the combination scenario is normal. For example, in this example, it is necessary to determine whether the communication status between virtual network card A-1 and virtual network card B-1 is normal, whether the communication status between virtual network card A-1 and virtual network card C-1 is normal, and whether the communication status between virtual network card B-1 and virtual network card C-1 is normal. If these three communication statuses are normal, it means that the communication status between the two virtual network cards in the combination scenario is normal, and then it can be determined that the network communication status of the pod in the combination scenario is normal. On the contrary, as long as the communication status between any two virtual network cards is abnormal, it can be determined that the network communication status of the pod in the combination scenario is abnormal.

[0081] Step S103: After any combination of scenarios in the scenario set is selected, the virtual network card test result of the cloud platform is obtained.

[0082] When any combination of scenarios in the scenario set is selected, the test result of the virtual network card of the cloud platform can be obtained. That is, when any combination of scenarios in the scenario set is selected and the network communication status of the pod under the combination scenario is verified, the test result of the virtual network card of the cloud platform can be obtained.

[0083] In a specific implementation of the present invention, obtaining the virtual network card test result of the cloud platform described in step S103 may specifically include:

[0084] When the network communication status of the pods in various combination scenarios is normal, the virtual network card test result of the cloud platform indicating that the test has passed is obtained;

[0085] When the network communication status of the pod in at least one combination scenario is abnormal, a virtual network card test result of the cloud platform indicating that the test failed is obtained, and the virtual network card test result carries each combination scenario that causes the network communication status of the pod to be abnormal.

[0086] It is understandable that if the network communication status of the pods in various combination scenarios is normal, the virtual network card test result of the cloud platform indicating that the test has passed can be directly obtained. Conversely, as long as the network communication status of the pods in one combination scenario is abnormal, the virtual network card test result of the cloud platform indicating that the test has failed will be obtained, even if these problematic combination scenarios are not used in the current business.

[0087] Furthermore, in order to assist the staff in handling abnormal situations in a timely manner, in this implementation mode, the virtual network card test results will carry each combination scenario that causes the pod's network communication status to be abnormal, that is, these problematic combination scenarios will be directly displayed in the virtual network card test results, which is convenient for the staff to locate and repair the faults later.

[0088] Applying the technical solution provided by the embodiment of the present invention, considering that in the traditional solution, health monitoring is performed according to the current business usage of the virtual network card, resulting in insufficient comprehensiveness of the detection, in this regard, in the solution of the present application, all possible scenarios are listed one by one, so as to efficiently and comprehensively perform health detection of the virtual network card. Specifically, the present application will determine each physical network card virtualized in the pod, and generate a scene set including various possible combination scenes of the virtual network card according to each determined physical network card, that is, the different combination scenes in the scene set represent the combination of various virtual network cards that can be combined according to each determined physical network card. Therefore, various combination scenes are selected from the scene set in turn, and after the virtual network card information in the selected combination scene is mounted to the pod, the network communication status of the pod under the combination scene can be verified. When any combination scene in the scene set is selected, it means that all combination scenes have been verified, that is, the comprehensive virtual network card test results of the cloud platform can be obtained, which effectively guarantees the network smoothness of the business logic that needs to use the virtual network card, and will not be affected by business changes.

[0089] Corresponding to the above method embodiment, an embodiment of the present invention further provides a test system for loading a virtual network card on a cloud platform, which can be referred to in correspondence with the above.

[0090] See also Figure 3 As shown, it is a structural schematic diagram of a test system for loading a virtual network card on a cloud platform in the present invention, which is applied to any pod in the cloud platform, including:

[0091] A scenario set generation module 301 is used to determine each physical network card to be virtualized in the pod, and generate a scenario set including various possible combination scenarios of the virtual network card according to each determined physical network card;

[0092] The virtual network card information mounting module 302 is used to select various combination scenarios from the scene set in sequence, and after selecting any combination scenario, mount the virtual network card information in the combination scenario to the pod, and verify the network communication status of the pod in the combination scenario, and select the next combination scenario after the verification is completed;

[0093] The virtual network card test result confirmation module 303 is used to obtain the virtual network card test result of the cloud platform after any combination of scenarios in the scenario set is selected.

[0094] In a specific implementation of the present invention, the scene set generation module 301 is specifically used to:

[0095] Determine each physical network card to be virtualized in the pod, and determine whether the total number n of determined physical network cards is greater than 1;

[0096] If not, a single physical network card in the pod is determined to be virtualized, and a scenario set including K combination scenarios is generated;

[0097] If yes, then based on the virtual network cards virtualized by the determined physical network cards, a scenario set including various possible combination scenarios of the virtual network cards is generated;

[0098] Among them, for any combination scenario in the scenario set, the combination scenario includes n virtual network cards virtualized by n physical network cards respectively; the virtual network card information of any two combination scenarios in the scenario set is different; K represents the total number of virtual network cards virtualized by a single physical network card.

[0099] In a specific implementation of the present invention, various combination scenes are selected in sequence from the scene set, including:

[0100] Various combination scenes are selected from the scene collection in sequence by means of a blocking queue.

[0101] In a specific implementation of the present invention, verifying the network communication status of the pod in the combined scenario includes:

[0102] When the combined scenario includes only a single virtual network card, if the communication status of the single virtual network card is normal, it is determined that the network communication status of the pod in the combined scenario is normal;

[0103] When the combined scenario includes at least two virtual network cards, if the communication status between any two virtual network cards in the combined scenario is normal, it is determined that the network communication status of the pod in the combined scenario is normal.

[0104] In a specific implementation of the present invention, obtaining a test result of a virtual network card of a cloud platform includes:

[0105] When the network communication status of the pods in various combination scenarios is normal, the virtual network card test result of the cloud platform indicating that the test has passed is obtained;

[0106] When the network communication status of the pod in at least one combination scenario is abnormal, a virtual network card test result of the cloud platform indicating that the test failed is obtained, and the virtual network card test result carries each combination scenario that causes the network communication status of the pod to be abnormal.

[0107] In a specific implementation of the present invention, mounting the virtual network card information in the combined scenario into the pod includes:

[0108] Replace the virtual network card information currently allocated in the cloud platform with the virtual network card information in the combined scenario, so that the virtual network card information in the combined scenario is passed into the environment variables of the pod;

[0109] Read environment variables from the target file of the cloud platform to obtain virtual network card information in the combined scenario, and mount the obtained virtual network card information in the combined scenario into the pod.

[0110] In a specific implementation of the present invention, mounting the acquired virtual network card information in the combined scenario into the pod includes:

[0111] The virtual network card information in the obtained combined scenario is mounted into the pod through the preset plug-in.

[0112] Corresponding to the above method and system embodiments, an embodiment of the present invention further provides a test device for loading a virtual network card on a cloud platform and a computer-readable storage medium, which can be referenced in correspondence with the above.

[0113] The computer readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the test method for loading a virtual network card on a cloud platform as in any of the above embodiments are implemented. The computer readable storage medium mentioned here includes random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the technical field.

[0114] See also Figure 4 , the test equipment for loading virtual network cards on the cloud platform may include:

[0115] Memory 401, used for storing computer programs;

[0116] The processor 402 is used to execute a computer program to implement the steps of the test method for loading a virtual network card on a cloud platform as in any of the above embodiments.

[0117] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0118] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0119] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the technical solution and core ideas of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A test method for loading a virtual network card on a cloud platform, characterized in that: Applicable to any pod in the cloud platform, including: Determine each physical network card to be virtualized in the pod, and generate a scenario set including various possible combination scenarios of the virtual network card according to each of the determined physical network cards; Select various combination scenarios from the scene set in sequence, and after selecting any combination scenario, mount the virtual network card information in the combination scenario to the pod, and verify the network communication status of the pod in the combination scenario, and select the next combination scenario after the verification is completed; After any combination of scenarios in the scenario set is selected, a virtual network card test result of the cloud platform is obtained; The determining of each physical network card to be virtualized in the pod, and generating a scenario set including various possible combination scenarios of the virtual network card according to each of the determined physical network cards, includes: Determine each physical network card to be virtualized in the pod, and determine whether the total number n of determined physical network cards is greater than 1; If not, a single physical network card in the pod is determined to be virtualized, and a scenario set including K combination scenarios is generated; If yes, generating a scenario set including various possible combination scenarios of the virtual network cards based on the virtual network cards virtualized by the determined physical network cards; Among them, for any combination scenario in the scenario set, the combination scenario includes n virtual network cards virtualized by n physical network cards respectively, and for the n virtual network cards included in the combination scenario, each physical network card contributes 1 of the n; the virtual network card information of any two combination scenarios in the scenario set is different; the K represents the total number of virtual network cards virtualized by the single physical network card; The verifying the network communication status of the pod in the combined scenario includes: When the combined scenario includes only a single virtual network card, if the communication status of the single virtual network card is normal, it is determined that the network communication status of the pod in the combined scenario is normal; When the combined scenario includes at least two virtual network cards, if the communication status between any two virtual network cards in the combined scenario is normal, it is determined that the network communication status of the pod in the combined scenario is normal; Among them, pod is the smallest container deployment unit in the cloud platform.

2. The test method for loading a virtual network card on a cloud platform according to claim 1, characterized in that: The various combination scenes are selected in sequence from the scene set, including: Various combination scenes are selected in sequence from the scene set by means of a blocking queue.

3. The test method for loading a virtual network card on a cloud platform according to claim 1, characterized in that: The obtaining of the virtual network card test result of the cloud platform includes: When the network communication status of the pod in various combination scenarios is normal, a virtual network card test result of the cloud platform indicating that the test has passed is obtained; When the network communication status of the pod in at least one of the combined scenarios is abnormal, a virtual network card test result of the cloud platform indicating that the test failed is obtained, and the virtual network card test result carries each of the combined scenarios that cause the network communication status of the pod to be abnormal.

4. The method for testing a cloud platform loading a virtual network card according to any one of claims 1 to 3, characterized in that: The step of mounting the virtual network card information in the combined scenario into the pod includes: Replace the virtual network card information currently allocated in the cloud platform with the virtual network card information in the combined scenario, so that the virtual network card information in the combined scenario is passed into the environment variable of the pod; The environment variable is read from the target file of the cloud platform to obtain the virtual network card information in the combined scenario, and the obtained virtual network card information in the combined scenario is mounted into the pod.

5. The test method for loading a virtual network card on a cloud platform according to claim 4, characterized in that: The step of mounting the acquired virtual network card information in the combined scenario into the pod includes: The obtained virtual network card information in the combined scenario is mounted into the pod through a preset plug-in.

6. A test system for loading a virtual network card on a cloud platform, characterized in that: Applicable to any pod in the cloud platform, including: A scenario set generation module, used to determine each physical network card to be virtualized in the pod, and generate a scenario set including various possible combination scenarios of the virtual network card according to each of the determined physical network cards; A virtual network card information mounting module, used to select various combination scenarios from the scene set in sequence, and after selecting any combination scenario, mount the virtual network card information in the combination scenario to the pod, and verify the network communication status of the pod in the combination scenario, and select the next combination scenario after the verification is completed; A virtual network card test result confirmation module, used to obtain the virtual network card test result of the cloud platform after any combination of scenarios in the scenario set is selected; The scene set generation module is specifically used for: Determine each physical network card to be virtualized in the pod, and determine whether the total number n of determined physical network cards is greater than 1; If not, a single physical network card in the pod is determined to be virtualized, and a scenario set including K combination scenarios is generated; If yes, then based on the virtual network cards virtualized by the determined physical network cards, a scenario set including various possible combination scenarios of the virtual network cards is generated; Among them, for any combination scenario in the scenario set, the combination scenario includes n virtual network cards virtualized by n physical network cards respectively, and for the n virtual network cards included in the combination scenario, each physical network card contributes 1 of the n; the virtual network card information of any two combination scenarios in the scenario set is different; K represents the total number of virtual network cards virtualized by a single physical network card; Verify the network communication status of the pod in the combined scenario, including: When the combined scenario includes only a single virtual network card, if the communication status of the single virtual network card is normal, it is determined that the network communication status of the pod in the combined scenario is normal; When the combined scenario includes at least two virtual network cards, if the communication status between any two virtual network cards in the combined scenario is normal, it is determined that the network communication status of the pod in the combined scenario is normal; Among them, pod is the smallest container deployment unit in the cloud platform.

7. A test device for loading a virtual network card on a cloud platform, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program to implement the steps of the test method for loading a virtual network card on a cloud platform as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the test method for loading a virtual network card on a cloud platform as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Network card SR-IOV function test method and device, terminal and storage medium

    CN109802866A

  • Network card testing method based on virtualization scene

    CN112600723A