A method, device and medium for testing virtualization system upgrade
By acquiring the configuration information of the virtualization system, creating virtual machines based on the functional points affected by the upgrade, and verifying the basic functions and upgrade-affected functions of the virtual machines after the upgrade, the problem of low efficiency in virtualization platform upgrade testing is solved, and efficient layered testing and real-world scenario simulation are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN INSPUR DATA TECH CO LTD
- Filing Date
- 2023-02-16
- Publication Date
- 2026-05-29
Smart Images

Figure CN116069655B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of virtual machines, and in particular to a testing method, apparatus and medium for upgrading a virtualized system. Background Technology
[0002] With the rapid development and widespread adoption of virtualization technology, and the increasing number of users, bugs and new requirements are inevitable during operation. Software upgrades have become an important means to improve user experience and enhance software quality. However, virtualization platforms differ from general software; their complex architecture involves many components, and upgrade testing needs to cover different deployment architectures and historical versions, resulting in a huge workload. It is difficult for manual testing to simulate full data and cover all scenarios within a limited time, leading to decreased efficiency in upgrade testing.
[0003] Therefore, improving the efficiency of virtualization platform upgrade testing is a technical problem that urgently needs to be solved by those in this field. Summary of the Invention
[0004] The purpose of this application is to provide a testing method, apparatus, and medium for upgrading virtualization systems, so as to improve the efficiency of testing virtualization platform upgrades.
[0005] To address the aforementioned technical problems, this application provides a testing method for upgrading a virtualization system, comprising:
[0006] Obtain the configuration information of the virtualization system; wherein, the configuration information includes at least the environment information of the virtualization system, upgrade packages, and functionalities affected by the upgrade;
[0007] Create a virtual machine based on the functionalities affected by the upgrade;
[0008] After upgrading the virtualization system according to the upgrade package, the basic functions of the virtual machine and the functions affected by the upgrade are verified.
[0009] Preferably, creating a virtual machine based on the upgrade-affected functional points includes:
[0010] Determine the configuration file based on the functional points affected by the upgrade;
[0011] The configuration file is used to fit an object and the SDK interface is called to complete the creation of a preset number of virtual machines, wherein the preset number is determined according to the number configured in the configuration file.
[0012] Preferably, the configuration file includes fixed configurations and / or upgrade-impact configurations, wherein the fixed configurations include a first configuration, a second configuration, and a third configuration, with the importance levels of the first configuration, the second configuration, and the third configuration decreasing sequentially; determining the configuration file based on the upgrade-impact function points includes:
[0013] If the upgrade affects the virtual machine's functionality based on the upgrade-affected functional points, then the configuration file contains the fixed configuration and the upgrade-affected configuration.
[0014] Correspondingly, the preset quantity is the sum of the quantity of the fixed configuration and the quantity of the configuration affected by the upgrade;
[0015] If the scope of the upgrade impact is determined to be the first scope based on the upgraded functional points, and the function of the virtual machine is not affected, then the configuration file contains the first configuration and the second configuration.
[0016] Correspondingly, the preset quantity is the sum of the quantity in the first configuration and the quantity in the second configuration;
[0017] If the scope of the upgrade's impact is determined to be the second scope based on the upgraded functional points, and the virtual machine's functionality is not affected, then the configuration file contains the first configuration; the second scope is smaller than the first scope.
[0018] Correspondingly, the preset quantity is the quantity configured in the first configuration.
[0019] Preferably, after obtaining the configuration information of the virtualization system and before upgrading the virtualization system according to the upgrade package, the method further includes:
[0020] Determine whether platform-level issues need to be addressed based on the upgrade package;
[0021] If so, use SQL statements to inject data related to platform operation and maintenance into the database.
[0022] Preferably, after upgrading the virtualization system according to the upgrade package and before verifying the basic functions and upgrade-affected functions of the virtual machine, the method further includes:
[0023] Obtain the upgraded configuration file;
[0024] The upgraded configuration file is verified based on the configuration file before the upgrade, and the verification result is obtained;
[0025] If the verification result passes, proceed to the step of verifying the basic functions and upgrade impact functions of the virtual machine.
[0026] Preferably, the verification of the basic functions and upgrade impact functions of the virtual machine includes:
[0027] The interface is invoked to verify the basic functions of the virtual machine and obtain the verification results.
[0028] If the verification result is satisfactory, the impact of the upgrade on functionality will be verified.
[0029] Preferably, after upgrading the virtualization system according to the upgrade package, and before verifying the basic functions and upgrade-affected functions of the virtual machine, the method further includes:
[0030] Determine whether the upgrade affects the functionality of the virtual machine;
[0031] If so, a new virtual machine will be created based on the functionality of the virtual machine affected by the upgrade.
[0032] Preferably, the verification of the upgrade's impact on functionality includes:
[0033] Identify the functions to be verified;
[0034] Perform functional operations on the unverified functions of the virtual machine before the upgrade;
[0035] If the virtual machine before the upgrade does not have the necessary conditions for execution, perform the function operation on the function to be verified in the new virtual machine.
[0036] Preferably, performing functional operations on the function to be verified in the virtual machine includes:
[0037] The functions to be verified are sorted.
[0038] The function operations are performed on the corresponding functions to be verified in the virtual machine in a preset order.
[0039] Preferably, performing functional operations on the function to be verified in the virtual machine includes:
[0040] Obtain the number of functions to be verified;
[0041] Based on the number of functions to be verified, multiple sequential combinations of functions are determined.
[0042] Randomly select a preset number of the function combinations from all the said function combinations;
[0043] The functions in each of the selected function combinations are executed in the order they are arranged.
[0044] Preferably, performing functional operations on the function to be verified in the virtual machine includes:
[0045] Obtain the number of functions to be verified;
[0046] Based on the number of functions to be verified, multiple sequential combinations of functions are determined.
[0047] Execute the function operations of each function in each of the aforementioned function combinations in the order they are arranged, and obtain the current duration of the execution of the function operations;
[0048] If the current duration is less than or equal to the preset duration, return to the step of executing the function operation in the order of the function in each of the function combinations and obtaining the current duration of the function operation;
[0049] If the current duration exceeds the preset duration, the step of stopping the execution of the function operation on the virtual machine's function to be verified is initiated.
[0050] Preferably, performing functional operations on the function to be verified in the virtual machine includes:
[0051] If the current function to be verified does not meet the execution conditions, then the function operation is executed on the next function to be verified after the current function to be verified.
[0052] To address the aforementioned technical problems, this application also provides a testing apparatus for upgrading a virtualization system, comprising:
[0053] The acquisition module is used to acquire the configuration information of the virtualization system; wherein, the configuration information includes at least the environment information of the virtualization system, upgrade packages, and functional points affected by the upgrade;
[0054] Create a module to create virtual machines based on the functional points affected by the upgrade;
[0055] The verification module is used to verify the basic functions and upgrade-affected functions of the virtual machine after the virtualization system is upgraded according to the upgrade package.
[0056] To address the aforementioned technical problems, this application also provides a testing apparatus for upgrading a virtualization system, comprising:
[0057] Memory, used to store computer programs;
[0058] The processor is used to execute the computer program to implement the steps of the above-described test method for upgrading the virtualization system.
[0059] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned test method for upgrading a virtualized system.
[0060] The virtualization system upgrade testing method provided in this application includes: obtaining the configuration information of the virtualization system; wherein the configuration information includes at least the environment information of the virtualization system, the upgrade package, and the functional points affected by the upgrade; creating virtual machines based on the functional points affected by the upgrade; and verifying the basic functions and functional points affected by the upgrade of the virtual machines after upgrading the virtualization system according to the upgrade package. Compared with the previous method of upgrading and testing the entire architecture deployed in the virtualization platform, the method of this application only verifies the basic functions and functional points affected by the upgrade of the virtual machines after the upgrade. This greatly reduces the workload of upgrade testing and improves the efficiency of testing while ensuring the key functions after the upgrade. In addition, compared with upgrading and verifying in an unloaded environment, the method of this application creates virtual machines based on the functional points affected by the upgrade before the upgrade, which more closely simulates the real upgrade test scenario. Creating virtual machines based on the functional points affected by the upgrade enables targeted creation of virtual machines, avoids blind creation of virtual machines, and ensures the creation of core parameters.
[0061] In addition, this application also provides a test apparatus for upgrading a virtualization system and a computer-readable storage medium, which have the same or corresponding technical features as the test method for upgrading a virtualization system mentioned above, and have the same effect. Attached Figure Description
[0062] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0063] Figure 1 A flowchart illustrating a testing method for upgrading a virtualization system, provided in an embodiment of this application;
[0064] Figure 2 A flowchart illustrating a method for constructing background data as provided in an embodiment of this application;
[0065] Figure 3 A flowchart illustrating a method for verifying upgrade functionality provided in an embodiment of this application;
[0066] Figure 4 A structural diagram of a test apparatus for upgrading a virtualization system provided in an embodiment of this application;
[0067] Figure 5 A structural diagram of a test apparatus for upgrading a virtualization system provided in another embodiment of this application;
[0068] Figure 6 This is a flowchart illustrating an upgrade verification method provided in an embodiment of this application. Detailed Implementation
[0069] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0070] The core of this application is to provide a testing method, apparatus, and medium for upgrading virtualization systems, which can improve the efficiency of testing virtualization platform upgrades.
[0071] With the rapid development and widespread adoption of virtualization technology, and the increasing number of users, bugs and new requirements are inevitable during operation. Software upgrades have become an important means to improve user experience and enhance software quality. However, virtualization platforms differ from general software; their complex architecture involves many components, and upgrade testing needs to cover different deployment architectures and historical versions, resulting in a huge workload. It is difficult for manual testing to simulate all data and cover all scenarios within a limited time. Through testing and analysis, it was found that the factors affecting the quality and efficiency of upgrade testing are, on the one hand, the data creation before the upgrade, and on the other hand, the assurance of key functions after the upgrade. The testing of the virtualization system upgrade function in this application mainly includes the background data construction simulation before the upgrade and the functional verification after the upgrade. While ensuring the key functions after the upgrade, the workload of upgrade testing is greatly reduced, and the testing efficiency is improved.
[0072] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Figure 1 A flowchart illustrating a testing method for upgrading a virtualization system, as provided in this application embodiment, is shown below. Figure 1 As shown, the method includes:
[0073] S10: Obtain the configuration information of the virtualization system; the configuration information includes at least the environment information of the virtualization system, the upgrade package, and the functional points affected by the upgrade;
[0074] S11: Create virtual machines based on the functionalities affected by the upgrade;
[0075] S12: After upgrading the virtualization system according to the upgrade package, verify the basic functions of the virtual machine and the functions affected by the upgrade.
[0076] During the testing of the virtualization system upgrade function, the configuration information of the virtualization system is read first. The configuration information includes at least the virtualization system environment information, the upgrade package, and the functional points affected by the upgrade. Among them, the virtualization system environment information includes the management node IP information, the compute node IP information, and the username and password, forming an environment information table. Functional points affected by the upgrade: If there are any affected points, enter the relevant information in this format {(virtual machine function, []), (virtual machine configuration, [])}. If the virtual machine configuration and creation / deletion functions are affected, fill in the following: {(virtual machine function, [create, delete]), (virtual machine configuration, [disk, GeustOS, network card, central processing unit (CPU), memory])}. If there are no related effects, the relevant information is empty, i.e., {(virtual machine function, []), (virtual machine configuration, [])}.
[0077] The core of a virtualization platform is the virtual machine, making the construction of virtual machine-related data crucial. Upgrading and verifying an empty environment is largely meaningless; it only verifies the upgrade process and cannot simulate real-world customer scenarios. Therefore, this application describes the creation of background data, specifically in the case of virtual machines. In practice, platform-level data may also need to be constructed to ensure the background data construction closely reflects user upgrade scenarios. Creating virtual machines based on upgrade-affected functional points includes determining a configuration file based on these points; fitting objects according to the configuration file; and calling the Software Development Kit (SDK) interface to create a preset number of virtual machines, where the preset number is determined by the number configured in the configuration file.
[0078] After creating the background data for the environment, the system is upgraded according to the upgrade package. Verifying all functions is labor-intensive, leading to decreased efficiency in upgrade testing. Therefore, this embodiment performs layered testing of the upgraded functions, including basic function verification and focused testing of functions affected by the upgrade. Basic function verification mainly refers to the product's basic functional threshold test cases, which are completed by calling interfaces. When verifying functions affected by the upgrade, corresponding functional operations are executed to achieve functional verification.
[0079] The virtualization system upgrade testing method provided in this embodiment includes: obtaining the configuration information of the virtualization system; wherein the configuration information includes at least the environment information of the virtualization system, the upgrade package, and the upgrade-affected functional points; creating virtual machines according to the upgrade-affected functional points; and verifying the basic functions and upgrade-affected functions of the virtual machines after upgrading the virtualization system according to the upgrade package. Compared with the previous method of upgrading and testing the entire architecture deployed in the virtualization platform, the method in this embodiment only verifies the basic functions and upgrade-affected functions of the virtual machines after the upgrade. This greatly reduces the workload of upgrade testing and improves testing efficiency while ensuring the key functions after the upgrade. In addition, compared with upgrading and verifying in an unloaded environment, the method in this embodiment creates virtual machines according to the upgrade-affected functional points before the upgrade, which more closely simulates the real upgrade test scenario. Creating virtual machines according to the upgrade-affected functional points enables targeted creation of virtual machines, avoids blind creation of virtual machines, and ensures the creation of core parameters.
[0080] Based on the above embodiments, the data in the virtual machine contains important data and non-important data, i.e., data with different priorities. Therefore, the preferred method for determining the configuration file is that the configuration file includes fixed configurations and / or configurations affected by upgrades. The fixed configurations include a first configuration, a second configuration, and a third configuration, with the importance level of the first configuration, the second configuration, and the third configuration decreasing sequentially. The configuration file is determined based on the functional points affected by upgrades, including:
[0081] Once the functions affected by the upgrade are determined based on the functional points affected by the upgrade, it is determined that the configuration file contains both fixed configurations and configurations affected by the upgrade.
[0082] Correspondingly, the preset quantity is the sum of the fixed configuration quantity and the configuration quantity affected by the upgrade;
[0083] If the scope of the upgrade's impact is determined to be the first scope based on the functional points affected by the upgrade, and the functionality of the virtual machine is not affected, then the configuration file contains the first configuration and the second configuration.
[0084] Correspondingly, the preset quantity is the sum of the quantity in the first configuration and the quantity in the second configuration;
[0085] If the scope of the upgrade's impact is determined to be the second scope based on the functional points affected by the upgrade, and the virtual machine's functionality is not affected, then the configuration file contains the first configuration; the second scope is smaller than the first scope.
[0086] Correspondingly, the preset quantity is the quantity configured in the first setting.
[0087] The first configuration can be understood as the recommended configuration (core configuration), denoted as C1. The second configuration can be understood as the second recommended configuration, denoted as C2. The third configuration can be understood as the less frequently used configuration, denoted as C3. The virtual machine configuration affected by the upgrade can be denoted as C4.
[0088] The configuration file includes fixed configurations and configurations affected by upgrades. The fixed configurations include recommended configuration C1, second-best-recommended configuration C2, and less frequently used configurations C3. For the virtual machine configurations affected by upgrades (C4), you can customize the configuration file or determine the configuration based on the scope of the upgrade's impact.
[0089] Virtual machine creation process:
[0090] 1) If a version upgrade affects virtual machine functionality, then by default, all configured virtual machines (C1+C2+C3+C4) will be built. Objects will be fitted based on the configuration files, and the SDK interface will be called to complete the creation and checking of all virtual machines.
[0091] 2) If the version upgrade does not affect virtual machines, a C1+C2 virtual machine will be built by default. An object will be generated based on the configuration file, and the SDK interface will be called to complete the creation and checking of the C1+C2 virtual machines.
[0092] 3) If the version upgrade has a very small impact and does not involve virtual machines, the default is to build virtual machines for C1. Based on the configuration file, an object is fitted, and the SDK interface is called to complete the creation and checking of virtual machines for C1.
[0093] 4) Alternatively, the scope of the virtual machine to be built can be selected by passing parameters.
[0094] The following describes several virtual machine configurations.
[0095] 1) Virtual machine related parameters, including disk parameters A1, GuestOS type A2, network card parameters A3, CPU A4, memory A5, etc., so [C] A1 C A2 C A3 C A4 C A5 This creates a virtual machine parameter configuration file, resulting in a total of A1*A2*A3*A4*A5 virtual machine configuration files. Here, A1 represents the number of disk parameters that can be selected, and the option to choose one configuration from A1 is used.
[0096] 2) Based on the parameter-generated combinations A1*A2*A3*A4*A5, the configuration files are categorized into three levels: Recommended Configuration C1: The disk and network interface card (NIC) parameters are the product's recommended configuration, so this is marked as the first priority configuration file. Secondary Recommended Configuration C2: Only one of the disk and NIC parameters is the product's recommended configuration, so this is marked as the second priority configuration file. Infrequently Used Configuration C3: Neither the disk nor the NIC parameters are the product's recommended configuration, so this is marked as the third priority configuration file.
[0097] In the method provided in this embodiment, virtual machine parameter configuration combinations are designed according to the characteristics of the virtualization platform, and data overwriting with different priorities is selected according to different upgrade strategies, so that the selected configuration files are more reasonable.
[0098] When the upgrade package needs to address platform-level issues, in addition to creating virtual machines as mentioned above, it is also necessary to construct platform-level data. A preferred implementation method, after obtaining the virtualization system's configuration information and before upgrading the virtualization system according to the upgrade package, includes the following testing methods for the virtualization system upgrade:
[0099] Determine whether platform-level issues need to be addressed based on the upgrade package;
[0100] If so, use SQL statements to inject data related to platform operation and maintenance into the database.
[0101] The construction of platform-level data involves platform operation and maintenance-related data such as task records, alarms, and operation logs. This data has little impact on virtual machine functionality. Platform-level data construction is only initiated when an upgrade package needs to build a certain amount of background data to resolve platform-level issues. This is mainly achieved by using SQL statements to inject data into the database, simulating a large amount of data.
[0102] Figure 2 A flowchart illustrating a method for constructing background data as provided in an embodiment of this application. Figure 2 As shown, the method includes:
[0103] S13: Determine whether platform-type resources need to be created; if yes, proceed to step S14; if no, proceed to step S15.
[0104] S14: Create platform-class resources;
[0105] S15: Determine whether background data construction is specified; if yes, proceed to step S16; if no, proceed to step S17.
[0106] S16: Create a virtual machine according to the specified parameters;
[0107] S17: Determine whether the upgrade affects the virtual machine; if yes, proceed to step S18; if no, proceed to step S19.
[0108] S18: Virtual machine creation with fixed parameters and upgrades affecting parameter configuration;
[0109] S19: Virtual machine creation with fixed parameter configuration.
[0110] The data layer of the construction platform provided in this embodiment enables it to meet upgrade requirements.
[0111] During the upgrade of the virtualization platform, erroneous data may occur, leading to errors in the verification of virtual machine functions. Therefore, a preferred implementation method is that, after upgrading the virtualization system according to the upgrade package and before verifying the basic functions and upgrade-affected functions of the virtual machine, the testing method for the virtualization system upgrade also includes:
[0112] Obtain the upgraded configuration file;
[0113] Verify the upgraded configuration file based on the configuration file before the upgrade and obtain the verification result;
[0114] If the verification result passes, proceed to the step of verifying the basic functions and upgrade impact functions of the virtual machine.
[0115] In the method provided in this embodiment, the configuration file is verified first after the upgrade, and then the virtual machine function is verified. This can minimize the possibility of errors in the virtual machine function verification due to incorrect configuration files.
[0116] After upgrading the virtual machine system, further testing of its functionality is required. In this embodiment, layered testing of the upgraded functionality is performed, including basic test case verification and focused testing of the functions affected by the upgrade. Verification of the virtual machine's basic functions and the functions affected by the upgrade includes:
[0117] Call the interface to verify the basic functions of the virtual machine and obtain the verification results;
[0118] If the verification results are satisfactory, the impact of the upgrade on functionality will be verified.
[0119] This embodiment first verifies the basic functions and then verifies the functions affected by upgrades. Since the basic functions are the basic functional threshold use cases of the product, it is only meaningful to verify the functions affected by upgrades if the basic functions are normal.
[0120] During functional verification, the virtual machine before the upgrade may not meet the usage requirements. Therefore, a preferred implementation method is that, after upgrading the virtualization system according to the upgrade package, before verifying the basic functions of the virtual machine and the functions affected by the upgrade, the testing method for the virtualization system upgrade also includes:
[0121] Determine whether the upgrade affects the functionality of the virtual machine;
[0122] If so, create a new virtual machine based on the functionality of the virtual machine affected by the upgrade.
[0123] The method of creating a new virtual machine after the upgrade, as provided in this embodiment, can meet the requirements of functional testing.
[0124] Because there are virtual machines from before the upgrade and new virtual machines created after the upgrade, the verification of the upgrade's impact on functionality includes:
[0125] Identify the functions to be verified;
[0126] Perform functional operations on the unverified functions of the virtual machine before the upgrade;
[0127] If the virtual machine before the upgrade does not have the necessary conditions for execution, perform the function operation on the unverified function of the new virtual machine.
[0128] This section focuses on testing the impact of upgrades on key functionalities. By default, the scope and affected functionalities are determined through the upgrade package. Alternatively, parameters can be passed to specify which functionalities require focused verification. The system primarily automates scenario operations through a set of combined actions, covering the impact between different functionalities.
[0129] Performing functional operations on the virtual machine's unverified functionality includes at least one of the following methods:
[0130] Method 1: Sort the functions to be verified;
[0131] Perform functional operations on the corresponding functions to be verified on the virtual machine in a preset order.
[0132] Method 2: Obtain the number of functions to be verified;
[0133] The number of functions to be verified determines multiple combinations of functions in different orders;
[0134] Randomly select a preset number of function combinations from all available function combinations;
[0135] The functions in each selected function combination are executed in the order they are arranged.
[0136] Method 3: Obtain the number of functions to be verified;
[0137] The number of functions to be verified determines multiple combinations of functions in different orders;
[0138] Execute the function operations for each function in each function combination in the order they are arranged, and obtain the current duration of the function operation.
[0139] If the current duration is less than or equal to the preset duration, return to the steps of performing function operations on each function in each function combination in the order of arrangement and obtaining the current duration of the function operation;
[0140] If the current duration exceeds the preset duration, stop the steps of performing functional operations on the virtual machine's unverified functions.
[0141] Performing functional operations on the virtual machine's unverified functionality includes:
[0142] If the current function to be verified does not meet the execution conditions, then the function operation will be executed on the next function to be verified.
[0143] The specific testing process for key functionalities affected by the upgrade is as follows:
[0144] 1) Determine the operation set S. By default, the entire set of core virtual machine functions is used as the operation set, labeled as set S1, i.e., S = S1. If the upgrade affects virtual machine functions, and the affected functions are set S2, then the operation set is the union of S1 and S2, i.e., S = S1 U S2. Each virtualization platform supports slightly different functions; you can replace them accordingly based on the supported function list of your actual platform. For example, if the current platform supports functions such as [Create, Edit, Start, Restart, Create Backup, Create Snapshot, Online Migration, Delete Snapshot, Delete Backup, Shutdown], and the upgrade affects functions such as [Create Backup, Offline Migration], then these functions are labeled as set S2. Therefore, the operation set S = S1 U S2 = [Edit, Start, Restart, Create Backup, Create Snapshot, Online Migration, Offline Migration, Delete Snapshot, Delete Backup, Shutdown], which is the focus of this test.
[0145] 2) Virtual machine creation after environment upgrade. Based on the configuration files related to the virtual machine types affected by the upgrade, fit them into objects and create new virtual machines.
[0146] 3) Based on the defined operation set S, perform key module testing. Prioritize using virtual machines created before the upgrade, and secondarily choose virtual machines created after the upgrade. Given the function list in operation set S, if there are n functions, there are n! permutations. Randomly select one permutation from the n! permutations, representing a function combination with a defined order. Execute the functions sequentially according to this order. If the execution condition is not met, skip it and execute the next function until all functions in the permutation are executed. Generally, randomly selecting a few permutations from the n! permutations is sufficient for testing requirements; the default setting is 5 times. The number of permutations can also be set, such as N times. For some upgrade scenarios requiring long-term fatigue testing, an execution time can be set, and the n! permutations can be gradually traversed within the execution time. After execution, if the end time has not arrived, another permutation can be randomly selected for execution. Each operated permutation has a file record, supporting replay based on the file records.
[0147] Figure 3 This is a flowchart illustrating a method for verifying upgrade functionality provided in an embodiment of this application. Figure 3 As shown, the method includes:
[0148] S20: Determine whether the upgrade affects the virtual machine; if yes, proceed to step S21; if no, proceed to step S22.
[0149] S21: Create a new virtual machine based on the virtual machine configuration parameters affected by the upgrade;
[0150] S22: Determine the number of executions or time; if yes, proceed to step S23; if no, proceed to step S24.
[0151] S23: Perform key scenario tests according to the specified number of times or time;
[0152] S24: Default number of times to execute in key scenarios, N times.
[0153] In the above embodiments, the testing method for upgrading a virtualization system has been described in detail. This application also provides embodiments corresponding to a testing apparatus for upgrading a virtualization system. It should be noted that this application describes the embodiments of the apparatus from two perspectives: one based on functional modules and the other based on hardware.
[0154] Figure 4 A structural diagram of a test apparatus for upgrading a virtualization system provided in one embodiment of this application. This embodiment, based on functional modules, includes:
[0155] The acquisition module 10 is used to acquire the configuration information of the virtualization system; wherein, the configuration information includes at least the environment information of the virtualization system, the upgrade package, and the functional points affected by the upgrade;
[0156] Create module 11 to create virtual machines based on the functionalities affected by the upgrade;
[0157] Verification module 12 is used to verify the basic functions of the virtual machine and the functions affected by the upgrade after the virtualization system is upgraded according to the upgrade package.
[0158] Since the embodiments of the device part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the device part, which will not be repeated here. It has the same beneficial effect as the virtualization system upgrade test method mentioned above.
[0159] Figure 5 This is a structural diagram of a test apparatus for upgrading a virtualization system, provided as another embodiment of this application. This embodiment is based on a hardware perspective, such as… Figure 5 As shown, the test setup for virtualization system upgrades includes:
[0160] Memory 20 is used to store computer programs;
[0161] The processor 21 is configured to perform the steps of a method for testing a virtualization system upgrade as described in the above embodiments when executing a computer program.
[0162] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the CPU, is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0163] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the virtualization system upgrade testing method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the aforementioned virtualization system upgrade testing method.
[0164] In some embodiments, the testing apparatus for upgrading a virtualization system may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
[0165] Those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the test apparatus for upgrading virtualization systems and may include more or fewer components than shown.
[0166] The virtualization system upgrade testing apparatus provided in this application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: the virtualization system upgrade testing method, with the same effect as above.
[0167] This application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.
[0168] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0169] The computer-readable storage medium provided in this application includes the aforementioned test method for upgrading virtualization systems, and has the same effect.
[0170] To enable those skilled in the art to better understand the present application, the following description is provided in conjunction with the appendix. Figure 6 The present application will be further described in detail with reference to specific embodiments. Figure 6 This is a flowchart illustrating an upgrade verification method provided in an embodiment of this application. Figure 6 As shown, the method includes:
[0171] S25: Read configuration file;
[0172] S26: Background data construction;
[0173] S27: Environmental upgrade and testing verification;
[0174] S28: Environmental inspection and output of test report.
[0175] Read configuration information. Configuration information includes virtualization system environment information, upgrade packages, and functionalities affected by the upgrade.
[0176] Background data construction module. Includes the construction of virtual machine and platform layer data; Upgrade function testing and verification module. Performs layered testing on the upgraded functions, including basic test case verification and testing of functions affected by the upgrade.
[0177] Testing of the upgraded functionality is conducted in a scenario-based manner and supports test replay to ensure the stable operation of the upgraded functionality.
[0178] Environmental inspection and testing report output. Conduct a health check on the environment and compare the results with the expected results to complete the testing.
[0179] As can be seen, in this application, before the system upgrade, background data in the system is constructed to closely resemble the user's upgrade scenario. Based on the characteristics of the virtualization platform, virtual machine parameter configuration combinations are designed, and data coverage with different priorities is selected according to different upgrade strategies. This allows for targeted data creation based on the actual impact range, avoiding the blind creation of test data and ensuring the creation of core parameters. Post-upgrade functional verification is then performed. By combining the core functions of the virtualization platform with functions affecting the upgrade, scenario-based operations are implemented according to different operation sequences, and test replay is possible. This ensures the functionality of core modules while enhancing the testing of risk modules, thereby improving the quality of upgrade testing.
[0180] The foregoing provides a detailed description of a testing method, apparatus, and medium for upgrading a virtualization system. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
[0181] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A testing method for upgrading a virtualization system, characterized in that, include: Obtain the configuration information of the virtualization system; wherein, the configuration information includes at least the environment information of the virtualization system, upgrade packages, and functionalities affected by the upgrade; Create a virtual machine based on the functionalities affected by the upgrade; After upgrading the virtualization system according to the upgrade package, the basic functions of the virtual machine and the functions affected by the upgrade are verified. The process of creating a virtual machine based on the upgraded functional points includes: Determine the configuration file based on the functional points affected by the upgrade; The configuration file is used to fit an object and the SDK interface is called to complete the creation of a preset number of virtual machines, wherein the preset number is determined according to the number configured in the configuration file; The configuration file contains fixed configurations and / or upgrade-impact configurations. The fixed configurations include a first configuration, a second configuration, and a third configuration, with the importance level of the first configuration, the second configuration, and the third configuration decreasing sequentially. Determining the configuration file based on the upgrade-impact function points includes: If the upgrade affects the virtual machine's functionality based on the upgrade-affected functional points, then the configuration file contains the fixed configuration and the upgrade-affected configuration. Correspondingly, the preset quantity is the sum of the quantity of the fixed configuration and the quantity of the configuration affected by the upgrade; If the scope of the upgrade impact is determined to be the first scope based on the upgraded functional points, and the function of the virtual machine is not affected, then the configuration file contains the first configuration and the second configuration. Correspondingly, the preset quantity is the sum of the quantity in the first configuration and the quantity in the second configuration; If the scope of the upgrade's impact is determined to be the second scope based on the upgraded functional points, and the virtual machine's functionality is not affected, then the configuration file contains the first configuration; the second scope is smaller than the first scope. Correspondingly, the preset quantity is the quantity configured in the first configuration.
2. The testing method for upgrading a virtualization system according to claim 1, characterized in that, After obtaining the configuration information of the virtualization system and before upgrading the virtualization system according to the upgrade package, the method further includes: Determine whether platform-level issues need to be addressed based on the upgrade package; If so, use SQL statements to inject data related to platform operation and maintenance into the database.
3. The testing method for upgrading a virtualization system according to claim 1, characterized in that, After upgrading the virtualization system according to the upgrade package and before verifying the basic functions and upgrade impact functions of the virtual machine, the method further includes: Obtain the upgraded configuration file; The upgraded configuration file is verified based on the configuration file before the upgrade, and the verification result is obtained; If the verification result passes, proceed to the step of verifying the basic functions and upgrade impact functions of the virtual machine.
4. The testing method for upgrading a virtualization system according to claim 1, characterized in that, The verification of the basic functions and upgrade impact functions of the virtual machine includes: The interface is invoked to verify the basic functions of the virtual machine and obtain the verification results. If the verification result is satisfactory, the impact of the upgrade on functionality will be verified.
5. The testing method for upgrading a virtualization system according to claim 4, characterized in that, After upgrading the virtualization system according to the upgrade package, and before verifying the basic functions and upgrade-affected functions of the virtual machine, the method further includes: Determine whether the upgrade affects the functionality of the virtual machine; If so, a new virtual machine will be created based on the functionality of the virtual machine affected by the upgrade.
6. The testing method for upgrading a virtualization system according to claim 5, characterized in that, The verification of the upgrade's impact on functionality includes: Identify the functions to be verified; Perform functional operations on the unverified functions of the virtual machine before the upgrade; If the virtual machine before the upgrade does not have the necessary conditions for execution, perform the function operation on the function to be verified in the new virtual machine.
7. The testing method for upgrading a virtualization system according to claim 6, characterized in that, Performing functional operations on the function to be verified in the virtual machine includes: The functions to be verified are sorted. The function operations are performed on the corresponding functions to be verified in the virtual machine in a preset order.
8. The testing method for upgrading a virtualization system according to claim 6, characterized in that, Performing functional operations on the function to be verified in the virtual machine includes: Obtain the number of functions to be verified; Based on the number of functions to be verified, multiple sequential combinations of functions are determined. Randomly select a preset number of the function combinations from all the said function combinations; The functions in each of the selected function combinations are executed in the order they are arranged.
9. The testing method for upgrading a virtualization system according to claim 6, characterized in that, Performing functional operations on the function to be verified in the virtual machine includes: Obtain the number of functions to be verified; Based on the number of functions to be verified, multiple sequential combinations of functions are determined. Execute the function operations of each function in each of the aforementioned function combinations in the order they are arranged, and obtain the current duration of the execution of the function operations; If the current duration is less than or equal to the preset duration, return to the step of executing the function operation in the order of the function in each of the function combinations and obtaining the current duration of the function operation; If the current duration exceeds the preset duration, the step of stopping the execution of the function operation on the virtual machine's function to be verified is initiated.
10. The test method for upgrading a virtualization system according to any one of claims 6 to 9, characterized in that, Performing functional operations on the function to be verified in the virtual machine includes: If the current function to be verified does not meet the execution conditions, then the function operation is executed on the next function to be verified after the current function to be verified.
11. A testing device for upgrading a virtualization system, characterized in that, include: The acquisition module is used to acquire the configuration information of the virtualization system; wherein, the configuration information includes at least the environment information of the virtualization system, upgrade packages, and functional points affected by the upgrade; Create a module to create virtual machines based on the functional points affected by the upgrade; The verification module is used to verify the basic functions and upgrade-affected functions of the virtual machine after the virtualization system is upgraded according to the upgrade package; Creating a module specifically includes: Determine the configuration file based on the functional points affected by the upgrade; The configuration file is used to fit an object and the SDK interface is called to complete the creation of a preset number of virtual machines, wherein the preset number is determined according to the number configured in the configuration file; The configuration file contains fixed configurations and / or upgrade-impact configurations. The fixed configurations include a first configuration, a second configuration, and a third configuration, with the importance level of the first configuration, the second configuration, and the third configuration decreasing sequentially. Determining the configuration file based on the upgrade-impact function points includes: If the upgrade affects the virtual machine's functionality based on the upgrade-affected functional points, then the configuration file contains the fixed configuration and the upgrade-affected configuration. Correspondingly, the preset quantity is the sum of the quantity of the fixed configuration and the quantity of the configuration affected by the upgrade; If the scope of the upgrade impact is determined to be the first scope based on the upgraded functional points, and the function of the virtual machine is not affected, then the configuration file contains the first configuration and the second configuration. Correspondingly, the preset quantity is the sum of the quantity in the first configuration and the quantity in the second configuration; If the scope of the upgrade's impact is determined to be the second scope based on the upgraded functional points, and the virtual machine's functionality is not affected, then the configuration file contains the first configuration; the second scope is smaller than the first scope. Correspondingly, the preset quantity is the quantity configured in the first configuration.
12. A testing device for upgrading a virtualization system, characterized in that, include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the test method for upgrading a virtualized system as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the test method for upgrading a virtualized system as described in any one of claims 1 to 10.