A test script generation method, device, cluster, product and storage medium

By updating the multi-cloud description information of the general test script to the single-cloud description information of the target cloud system, the problem of low testing efficiency for different cloud resources is solved, and efficient test script generation and execution are achieved.

CN122120174APending Publication Date: 2026-05-29HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
Filing Date
2024-11-28
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Because different cloud resources differ, existing technologies require the development of separate test scripts for each type of cloud resource, resulting in low testing efficiency.

Method used

By obtaining multi-cloud description information from a general test script and updating it with single-cloud description information for the target cloud system, a target test script is generated, avoiding the problem of developing separate test scripts for different cloud systems.

Benefits of technology

It improves the efficiency of test script generation and testing, and reduces the repetitive development work for different cloud systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122120174A_ABST
    Figure CN122120174A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a test script generation method and device, a cluster, a product and a storage medium, relate to the technical field of cloud services, and can improve test efficiency. The method is applied to a cloud management system, the cloud management system manages a plurality of cloud systems, the plurality of cloud systems include a first cloud system, and the method includes: obtaining a general test script for testing a first cloud service; the general test script includes multi-cloud description information of a first function unit, the first function unit is a function unit included in the first cloud service, and the multi-cloud description information of the first function unit includes parameters of the first function unit in the plurality of cloud systems; updating the multi-cloud description information of the first function unit in the general test script to single-cloud description information of the first function unit in the first cloud system to obtain a target test script; and the single-cloud description information of the first function unit in the first cloud system includes parameters of the first function unit in the first cloud system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud service technology, and in particular to a method, apparatus, cluster, product and storage medium for generating test scripts. Background Technology

[0002] Currently, multi-cloud management systems provide comprehensive multi-cloud management and control services. By integrating various types of cloud resources (e.g., cloud resources from different vendors), they improve cloud resource utilization, organizational flexibility, and management efficiency. Users deploy services using multiple cloud resources. Before using multiple cloud resources, testing is required. However, due to the differences between different cloud resources, separate test scripts need to be developed for each type, resulting in low testing efficiency. Summary of the Invention

[0003] This application provides a method, apparatus, cluster, product, and storage medium for generating test scripts, which can improve testing efficiency.

[0004] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0005] In a first aspect, embodiments of this application provide a method for generating a test script. This method is applied to a cloud management system that manages multiple cloud systems, including a first cloud system. The method includes: obtaining a general test script for testing a first cloud service; the general test script includes multi-cloud description information of a first functional unit, which is a functional unit included in the first cloud service; the multi-cloud description information of the first functional unit includes parameters of the first functional unit in the multiple cloud systems; updating the multi-cloud description information of the first functional unit in the general test script to single-cloud description information of the first functional unit in the first cloud system to obtain a target test script; the single-cloud description information of the first functional unit in the first cloud system includes parameters of the first functional unit in the first cloud system; the target test script is used to test the first cloud service provided by the first cloud system.

[0006] This application provides a method for generating a test script. The method includes: obtaining a general test script for testing a first cloud service. Since the general test script includes multi-cloud description information of the first functional unit contained in the first cloud service, wherein the multi-cloud description information of the first functional unit includes parameters of the first functional unit in multiple cloud systems; therefore, when it is necessary to test the first cloud service in a certain cloud system (e.g., the first cloud system), the multi-cloud description information of the first functional unit in the general test script is updated to the single-cloud description information of the first functional unit in the first cloud system (e.g., parameters of the first functional unit in the first cloud system), and a target test script for testing the first cloud service in the first cloud system can be obtained. It is not necessary to generate the target test script according to the test cases, thus improving the efficiency of generating the target test script, and thereby improving the efficiency of testing the first cloud service in the first cloud system.

[0007] In one possible implementation, updating the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script includes: obtaining a target mapping relationship; the target mapping relationship includes the correspondence between the multi-cloud description information of the first functional unit and the single-cloud description information of the first functional unit in the first cloud system; based on the target mapping relationship, updating the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script.

[0008] In this embodiment of the application, when testing a first cloud service in a first cloud system is required, a general test script for testing the first cloud service is obtained. Since this general test script includes multi-cloud description information of the first functional units contained in the first cloud service, and the multi-cloud description information of the first functional units includes parameters in various cloud systems, the general test script is directly converted into a target test script based on the aforementioned target mapping relationship. This eliminates the need to develop the target test script based on test cases, thereby improving the efficiency of obtaining the target test script and consequently improving testing efficiency.

[0009] In one possible implementation, before updating the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script, the method further includes: obtaining a set of description information; the set of description information includes the single-cloud description information of the first functional unit in the above-mentioned multiple cloud systems; and obtaining the single-cloud description information of the first functional unit in the first cloud system from the above-mentioned set of description information.

[0010] In one possible implementation, the general test script further includes: multi-cloud description information of a second functional unit that depends on the first cloud service; the second functional unit is a functional unit included in the second cloud system, and the multiple cloud systems include the second cloud system; updating the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script includes: updating the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system; and updating the multi-cloud description information of the second functional unit in the general test script to the single-cloud description information of the second functional unit in the second cloud system to obtain the target test script.

[0011] In the above embodiments, when a second functional unit of a specified cloud system exists in the general test script, the multi-cloud description information of the second functional unit in the general test script is updated to the single-cloud description information of the second functional unit in the cloud system specified by the second functional unit; and the multi-cloud description information of the first functional unit in the general test script is updated to the single-cloud description information of the first functional unit in the first cloud system; thereby avoiding the problem of developing test scripts separately for functional units in different cloud systems; thus, improving the efficiency of collaborative testing of different cloud systems.

[0012] In one possible implementation, obtaining the general test script for testing the first cloud service includes: displaying a first interface containing controls for the first functional unit; the controls for the first functional unit indicating multi-cloud description information of the first functional unit; obtaining test cases for the first cloud service in response to an operation on the controls of the first functional unit; the test cases for the first cloud service including multi-cloud description information of the first functional unit; and generating a general test script based on the test cases.

[0013] In one possible implementation, before obtaining the general test script for testing the first cloud service, the method further includes: generating multi-cloud description information of the first functional unit based on the semantics of the parameters of the first functional unit in the multiple cloud systems; the multi-cloud description information of the first functional unit includes parameters with the same semantics and parameters with different semantics in the first functional units of the multiple cloud systems.

[0014] In one possible implementation, a test configuration is received, which includes: the identifier of the first cloud system.

[0015] In one possible implementation, the multi-cloud description information of the first functional unit further includes: the unit name of the first functional unit, and / or the return type of the first functional unit; the single-cloud description information of the first functional unit in the first cloud system further includes: the unit name of the first functional unit in the first cloud system, and / or the return type of the functional unit in the first cloud system.

[0016] In the above embodiments, since the general test script includes the multi-cloud description information of the first functional unit, which also includes the unit name of the first functional unit and / or the return type of the first functional unit, and the single-cloud description information of the first functional unit in the first cloud system also includes the unit name of the first functional unit in the first cloud system and / or the return type of the first functional unit in the first cloud system, the problem of needing to develop test scripts separately for different cloud systems due to different unit names and / or different return types of the same functional unit in different cloud systems is avoided, thereby improving test efficiency.

[0017] Secondly, embodiments of this application provide a test script generation apparatus. This apparatus is applied to a cloud management system that manages multiple cloud systems, including a first cloud system. The generation apparatus includes a transceiver module and a processing module. The transceiver module acquires a general test script for testing the first cloud service. The general test script includes multi-cloud description information of a first functional unit, which is a functional unit included in the first cloud service. The multi-cloud description information of the first functional unit includes parameters of the first functional unit in the multiple cloud systems. The processing module updates the multi-cloud description information of the first functional unit in the general test script to single-cloud description information of the first functional unit in the first cloud system, obtaining a target test script. The single-cloud description information of the first functional unit in the first cloud system includes parameters of the first functional unit in the first cloud system. The target test script is used to test the first cloud service provided by the first cloud system.

[0018] In one possible implementation, the transceiver module is used to obtain the target mapping relationship; the target mapping relationship includes the correspondence between the multi-cloud description information of the first functional unit and the single-cloud description information of the first functional unit in the first cloud system; the processing module is used to update the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system based on the target mapping relationship, so as to obtain the target test script.

[0019] In one possible implementation, the transceiver module is used to obtain a set of description information; the set of description information includes single-cloud description information of the first functional unit in multiple cloud systems; the processing module is used to obtain the single-cloud description information of the first functional unit in the first cloud system from the set of description information.

[0020] In one possible implementation, the general test script further includes: multi-cloud description information of a second functional unit that depends on the first cloud service; the second functional unit is a functional unit included in the second cloud system, and multiple cloud systems include the second cloud system; the processing module is used to update the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system; and to update the multi-cloud description information of the second functional unit in the general test script to the single-cloud description information of the second functional unit in the second cloud system, thereby obtaining the target test script.

[0021] In one possible implementation, the above-mentioned generating device further includes: a display module; the display module is used to display a first interface, the first interface including controls of a first functional unit; the controls of the first functional unit are used to indicate multi-cloud description information of the first functional unit; a transceiver module is used to obtain test cases of the first cloud service in response to the operation of the controls of the first functional unit; the test cases of the first cloud service include multi-cloud description information of the first functional unit; and a processing module is used to generate a general test script based on the test cases.

[0022] In one possible implementation, the processing module is used to generate multi-cloud description information of the first functional unit based on the semantics of the parameters of the first functional unit in multiple cloud systems; the multi-cloud description information of the first functional unit includes parameters with the same semantics and parameters with different semantics in the first functional unit in multiple cloud systems.

[0023] In one possible implementation, the transceiver module is also used to receive test configuration, which includes: the identifier of the first cloud system.

[0024] In one possible implementation, the multi-cloud description information of the first functional unit further includes: the unit name of the functional unit, and / or the return type of the first functional unit; the single-cloud description information of the first functional unit in the first cloud system further includes: the unit name of the functional unit in the first cloud system, and / or the return type of the functional unit in the first cloud system.

[0025] Thirdly, this application provides a computing device cluster including at least one computing device, each computing device including a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, such that the computing device cluster performs the method described in the first aspect and any of its possible implementations.

[0026] Fourthly, this application provides a computer-readable storage medium having computer instructions stored thereon, which, when executed on a computing device, cause the computing device to perform the method described in any one of the first aspects and its possible implementations.

[0027] Fifthly, this application provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the method described in any one of the first aspects and their possible implementations.

[0028] It should be understood that the beneficial effects of the technical solutions of the second to fifth aspects of this application and the corresponding possible implementations can be referred to the above-described technical effects of the first aspect and its corresponding possible implementations, and will not be repeated here. Attached Figure Description

[0029] Figure 1 This is a schematic diagram of a test method provided in an embodiment of this application;

[0030] Figure 2 A schematic diagram of a cloud management architecture provided in an embodiment of this application;

[0031] Figure 3 This application provides a schematic diagram of the hardware structure of a computing device.

[0032] Figure 4 This is one of the flowcharts illustrating a method for generating a test script according to an embodiment of this application;

[0033] Figure 5 A logical diagram of a general test script provided in an embodiment of this application;

[0034] Figure 6 A second schematic diagram of a test script generation method provided in this application embodiment;

[0035] Figure 7 A third schematic diagram of a test script generation method provided in this application embodiment;

[0036] Figure 8 A fourth schematic diagram of a test script generation method provided in this application embodiment;

[0037] Figure 9 A schematic diagram of a first interface provided in an embodiment of this application;

[0038] Figure 10 A schematic diagram of a control for a functional unit that creates a VM, provided in an embodiment of this application;

[0039] Figure 11Fifth schematic diagram of a test script generation method provided in this application embodiment;

[0040] Figure 12 This is a schematic diagram of multi-cloud description information provided in an embodiment of this application;

[0041] Figure 13 A schematic diagram of a test script generation method provided in this application embodiment is shown in Figure 6.

[0042] Figure 14 A schematic diagram of a test script generation device provided in an embodiment of this application;

[0043] Figure 15 A schematic diagram of a computing device cluster provided in an embodiment of this application;

[0044] Figure 16 This is a schematic diagram of a network connection provided in an embodiment of this application. Detailed Implementation

[0045] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0046] The terms "first cloud system" and "second cloud system," etc., used in the specification and claims of this application are used to distinguish different cloud systems, rather than to describe a specific order of cloud systems. Similarly, "first functional unit" and "second functional unit," etc., are used to distinguish different functional units, rather than to describe a specific order of functional units.

[0047] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0048] In the description of the embodiments in this application, unless otherwise stated, "multiple" means two or more. For example, multiple functional units refer to two or more functional units.

[0049] Currently, multi-cloud management provides comprehensive multi-cloud management and control services, improving cloud resource utilization, organizational flexibility, and management efficiency by integrating various types of cloud resources (e.g., cloud resources from different vendors). Since functional units or services with the same functionality differ across different cloud resources (e.g., different parameters of functional units), how to test services across different cloud resources is a key focus in this field.

[0050] Common testing methods such as Figure 1 As shown: Assume the service to be tested is the Elastic Compute Service (ECS) service, which includes the functional units of creating VMs and creating storage disks.

[0051] When testing the ECS creation service in cloud resource A and cloud resource B separately based on the same business data, the parameter in the virtual machine (VM) creation functional unit (e.g., the VM creation interface) included in the ECS creation service in cloud resource A is "vm_name"; this VM creation functional unit is used to implement the sub-functions of the aforementioned ECS creation service. The parameter in the VM creation functional unit included in the ECS creation service in cloud resource B is "v2_name". Therefore, the parameters of the functional units included in the ECS creation service in cloud resource A and cloud resource B are different; hence, test cases need to be designed separately for the ECS creation service in cloud resource A and cloud resource B (e.g., test case A for cloud resource A, and test case B for cloud resource B). Specifically, the parameter in the VM creation functional unit in test case A is "vm_name"; the parameter in the VM creation functional unit in test case B is "v2_name". Then, develop test script A for test case A; develop test script B for test case B; finally, test the creation of ECS service in cloud resource A based on test script A, and test the creation of ECS service in cloud resource B based on test script B.

[0052] However, the above method requires developing separate test scripts for each cloud resource when testing the same service in different cloud resources based on the same business data (e.g., the parameter value of "vm_name" is "AA" and the parameter value of "v2_name" is also "AA"), thus reducing testing efficiency.

[0053] Based on this, embodiments of this application provide a method for generating test scripts. This method abstracts and aggregates parameters from the same functional unit in multiple cloud systems to obtain multi-cloud description information for that functional unit. This multi-cloud description information includes parameters of the functional unit in different cloud systems. Then, a general test script is generated based on the multi-cloud description information of the functional units included in the service under test. When testing the service under test provided by a certain cloud system (e.g., a first cloud system), the multi-cloud description information of the functional unit in the general test script is converted into parameters of that functional unit in the first cloud system, thus obtaining a target test script for testing the service under test provided by the first cloud system. It is not necessary to regenerate the target test script based on test cases, thereby improving the efficiency of generating the target test script and consequently improving the efficiency of testing the first cloud service in the first cloud system.

[0054] The test script generation method provided in this application embodiment can be applied to, for example, Figure 2 The cloud management architecture shown is as follows. This cloud management architecture includes a cloud management system and the cloud platforms managed by that cloud management system.

[0055] The aforementioned cloud platform is used to provide users with powerful computing or storage services; the cloud platform includes N cloud systems, each of which deploys x cloud services; where N and x are both positive integers greater than 0.

[0056] The aforementioned N cloud systems can be cloud systems provided by the same vendor or cloud systems provided by different vendors; and these N cloud systems can include cloud systems of the same type (e.g., all public clouds, all private clouds, hybrid clouds, or edge clouds) or cloud systems of different types.

[0057] There are dependencies between the above N cloud systems. For example, the first cloud system and the second cloud system among the N cloud systems can call each other.

[0058] The cloud system is used to deploy multiple cloud services, which provide services to the cloud management system. The specific embodiments of this application do not limit the functions of the cloud services deployed in the cloud system. For example, the multiple cloud services may include: ECS creation service, computing service, network service, storage service, middleware service, and gateway service.

[0059] It should be understood that the functions of the cloud services deployed in any two of the above N cloud systems may be the same or different. Specifically, the embodiments of this application do not limit the functions of the cloud services deployed in the cloud systems.

[0060] The aforementioned cloud service includes multiple cloud service controls (not shown in the figure), and any two cloud service controls may have a dependency relationship (such as a mutual calling relationship); wherein, the cloud service control is used to implement the sub-services in the cloud service.

[0061] For example, creating an ECS service includes: a cloud service control for creating a VM (i.e., a functional unit for creating a VM or an interface for creating a VM) and a cloud service control for creating a network; the dependency between the cloud service control for creating a VM and the cloud service control for creating a network is that the cloud service control for creating a VM calls the cloud service control for creating a network.

[0062] It should be understood that the cloud management system described above can be a cloud service within one of the N cloud systems, or it can be a cloud service independent of the N cloud systems. In specific embodiments of this application, the deployment location of the cloud management system is not limited.

[0063] The aforementioned cloud management system and cloud platform can be deployed on different computing devices or on the same computing device. Specifically, this application does not limit the computing device on which the cloud management system is deployed.

[0064] For example, Figure 3 It can be Figure 2 The diagram shows the hardware structure of the computing device on which the cloud management system is deployed. This computing device may include: a processor 301, a memory 302, and a communication interface 303. The processor 301, memory 302, and communication interface 303 can be connected via a bus 304 or other means.

[0065] Processor 301 includes one or more CPUs. The CPU can be a single-core CPU or a multi-core CPU. Optionally, processor 301 may also include a graphics processing unit (GPU), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), etc.

[0066] The memory 302 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical memory, disk storage media, or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer. In this embodiment, the memory 302 may store multi-cloud description information of functional units and information such as the operating system.

[0067] In one possible implementation, the memory 302 may exist independently of the processor 301. The memory 302 can be connected to the processor 301 via a bus 304 and is used to store data, instructions, or program code. When the processor 301 calls and executes the instructions or program code stored in the memory 302, it can implement the relevant steps in the test script generation method provided in the embodiments of this application.

[0068] In another possible implementation, the memory 302 can also be integrated with the processor 301.

[0069] The communication interface 303 can be a transceiver module used to communicate with other devices or communication networks, such as Ethernet, RAN, and wireless local area networks (WLAN). The communication interface 303 can receive commands, messages, or data. The transceiver module can be a transceiver or similar device.

[0070] Optionally, the communication interface 303 can also be a transceiver circuit located within the processor 301, used to implement signal input and signal output of the processor 301, such as acquiring the first data sent by the transmitting device. The communication interface 303 can be a wired interface (port), such as a fiber distributed data interface (FDDI) or a gigabit Ethernet (GE) interface, or the communication interface 303 can also be a wireless interface.

[0071] Bus 304 can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. This bus can be divided into address bus, data bus, control bus, etc. The bus can also be divided into serial bus and parallel bus. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0072] It should be understood that, Figure 5 The computing device mentioned is merely one example of a computing device; it can have more than Figure 5 The more or fewer components shown can be combined into two or more components, or they can have different component configurations. For example, a computing device can also include a smart network card, such as a data processing unit (DPU).

[0073] It should be noted that the system architecture and application scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0074] This application provides a cloud platform management method, which is applied to... Figure 2 The cloud management system in the middle is used to manage various cloud systems, which are used to provide cloud services; such as Figure 4 As shown, the method includes: S110-S120.

[0075] S110. Obtain the general test script for testing the first cloud service.

[0076] The aforementioned first cloud service is any service provided by the aforementioned cloud systems; for example, the first service may be a service for creating ECS, a data storage service, or a data synchronization service.

[0077] The general test script used to test the first cloud service includes: multi-cloud description information of the first functional unit, which is a functional unit (e.g., an interface) included in the first cloud service.

[0078] For example, suppose the first cloud service mentioned above is a service that creates ECS instances, which are virtual machines with network connectivity. Further suppose the execution logic of the general test script is as follows: Figure 5 As shown, the first functional unit in the ECS creation service includes: a VM creation unit, a VM acquisition unit, and a network creation unit; that is, the VM creation unit, VM acquisition unit, and network creation unit together provide the aforementioned ECS creation service (i.e., the first cloud server). The execution logic of the aforementioned general test script includes first calling the VM creation unit; then calling the VM acquisition unit; then determining whether the VM exists (i.e., whether the VM has been acquired); if the VM does not exist, performing a resource rollback; and if the VM exists, calling the network (NET) creation unit.

[0079] The descriptive information of the aforementioned first functional unit includes: parameters of the first functional unit in the aforementioned multiple cloud systems; that is, when the first functional unit includes multiple functional units, the multi-cloud descriptive information of each functional unit in the first functional unit (e.g., the functional unit that creates VMs) includes: parameters of that functional unit (i.e., the functional unit that creates VMs) in the multiple cloud systems. Specifically, the descriptive information of the aforementioned first functional unit includes: semantically identical parameters and semantically different parameters in the first functional units of the aforementioned multiple cloud systems.

[0080] It should be understood that the aforementioned cloud systems include cloud systems from different vendors and / or different types of cloud systems (such as public cloud, private cloud, and hybrid cloud).

[0081] For example, as shown in Table 1 below, suppose the parameters of the VM creation function unit in vendor A's cloud resources include: vm_name (VM name), ssd_name (storage disk name), and core_count (number of processing cores); the parameters of the VM creation function unit in vendor B's cloud resources include: v2_name (VM name), ssd_name (storage disk name), and float_ip (IP address); then, the multi-cloud description information of the VM creation function unit includes: vm_name or v2_name, ssd_name, core_count, and float_ip.

[0082] Table 1

[0083]

[0084] It should be noted that the implementation method of obtaining the general test script in S110 above can be to generate the general test script based on the test cases, or to obtain the general test script from historical test scripts. The specific implementation method of obtaining the general test script in this application embodiment is not limited.

[0085] It should be understood that when obtaining this general test script from historical test scripts, the general test script needs to be stored after the first cloud service in a cloud system is tested using this general test script for the first time. Specifically, when the first cloud service in the cloud system is tested using this general test script for the first time, this general test script is a test script generated based on test cases.

[0086] When generating this general test script based on test cases, the specific implementation method for generating this general test script is described in S210-S230 below, and will not be repeated here.

[0087] S120. Update the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script.

[0088] The aforementioned first cloud system is the cloud system for testing the first cloud service among the various cloud systems mentioned above.

[0089] Optionally, before S120 above, the process may include obtaining the identifier of the first cloud system; the specific implementation of obtaining the identifier of the first cloud system is described in S240 below, and will not be repeated here.

[0090] The aforementioned target test script is a script used to test the first cloud service provided by the aforementioned first cloud system; that is, the target test script is used to test the first cloud service provided by the aforementioned first cloud system.

[0091] The first functional unit in the aforementioned first cloud system is the same functional unit as the first functional unit in the aforementioned general test script.

[0092] For example, if the first functional unit in a general test script includes a functional unit for creating a VM, a functional unit for obtaining a VM, and a functional unit for creating a network, then the first functional unit in the aforementioned first cloud system refers to the functional unit for creating a VM, the functional unit for obtaining a VM, and the functional unit for creating a network in the first cloud system.

[0093] The single-cloud description information of the first functional unit (e.g., the VM creation functional unit) in the first cloud system mentioned above includes the parameters of the first functional unit (i.e., the VM creation functional unit) in the first cloud system; that is, the single-cloud description information of the VM creation functional unit in the first cloud system includes the parameters of the VM creation functional unit in the first cloud system, but does not include the parameters of the VM creation functional unit in other cloud systems (e.g., the second cloud system).

[0094] For example, as shown in Table 1 above, the parameters of the VM creation function unit in Vendor A's cloud system include: vm_name, ssd_name, and core_count; the parameters of the VM creation function unit in Vendor B's cloud system include: v2_name, ssd_name, and load_ip. Therefore, when the first cloud system is Vendor A's cloud system and the first function unit is the VM creation function unit, the single-cloud description information of the VM creation function unit in the first cloud system includes: vm_name, ssd_name, and core_count. When the first cloud system is Vendor B's cloud system and the first function unit is the VM creation function unit, the single-cloud description information of the VM creation function unit in the first cloud system includes: v2_name, ssd_name, and load_ip.

[0095] The implementation of S120 above includes: according to the conversion rules, updating the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system, thereby obtaining the target test script above.

[0096] It should be noted that the above conversion rule may specifically include the mapping relationship between the multi-cloud description information of the first functional unit and the single-cloud description information of the first functional unit in the first cloud system; or it may be a set of description information including the single-cloud description information of the first functional unit in the above multiple cloud systems; specifically, the embodiments of this application do not limit the specific form of the above conversion rule.

[0097] Given the above conversion rule and the above mapping relationship, the specific implementation of S120 is described in S120A-S120B below, and will not be repeated here.

[0098] When the above conversion rule is the above description information set, the specific implementation of the above S120 is shown in S120a-S120c below, and will not be repeated here.

[0099] For example, suppose the first functional units in the above general test script are a VM creation functional unit, a VM acquisition functional unit, and a network creation functional unit; wherein, the multi-cloud description information of the VM creation functional unit, as shown in Table 1 above, includes v2_name, ssd_name, core_count, and load_ip. If the single-cloud description information of the VM creation functional unit in the first cloud system includes vm_name, ssd_name, and core_count, the multi-cloud description information of the VM creation functional unit in the general test script is updated to the single-cloud description information of the VM creation functional unit in the first cloud system. That is, the updated general test script includes the single-cloud description information of the VM creation functional unit in the first cloud system (i.e., vm_name, ssd_name, and core_count). Similarly, the same operation is performed on the multi-cloud description information of the VM acquisition functional unit and the network creation functional unit in the general test script to obtain the updated general test script (i.e., the target test script), which includes the single-cloud description information of the first functional unit in the first cloud system.

[0100] It should be noted that if a parameter (e.g., `float_ip`) in the multi-cloud description information of a functional unit (e.g., the VM creation functional unit) does not have a parameter with the same semantics in the single-cloud description information of the same functional unit (i.e., the VM creation functional unit) in the first cloud system, then this parameter will be deleted when updating the multi-cloud description information of the functional unit based on the single-cloud description information. If parameter A (e.g., `v2_name`) in the multi-cloud description information of a functional unit exists as parameter B (e.g., `vm_name`) in the single-cloud description information of the same functional unit, but with a different parameter name, then parameter A will be updated to parameter B when updating the multi-cloud description information of the functional unit based on the single-cloud description information.

[0101] In one implementation, the multi-cloud description information of the first functional unit included in the above-mentioned general test script further includes: the unit name of the first functional unit, and / or the return type of the first functional unit; wherein, the return type of the functional unit is used to indicate the type of the return value after the functional unit is called.

[0102] It should be noted that the unit name of the first functional unit in the multi-cloud description information of the first functional unit mentioned above is determined based on the semantics of the first functional unit in multiple cloud systems. Specifically, the unit name in the multi-cloud description information of the first functional unit can be the unit name of any first functional unit in multiple cloud systems, or it can be the unit name with the highest repetition rate of the first functional unit in multiple cloud systems; this application does not specifically limit it in any particular embodiment.

[0103] Similarly, the single-cloud description information of the first functional unit in the first cloud system also includes: the unit name of the first functional unit in the first cloud system, and / or the return type of the first functional unit in the first cloud system.

[0104] For example, assuming the single-cloud description information of a functional unit includes: unit name, return type, and parameters, then the multi-cloud description information of the functional unit also includes: unit name, return type, and parameters; further assuming the first functional unit is the functional unit that creates a VM. As shown in Table 2 below: The single-cloud description information of the VM-creating functional unit in the first cloud system includes the unit name create_vm, the return type void, and the parameters as shown in Table 1 above. The single-cloud description information of the VM-creating functional unit in the second cloud system includes the unit name crea2_vm, the return type void, and the parameters as shown in Table 1 above. The multi-cloud single-cloud description information of the VM-creating functional unit includes the unit name crea2_vm, the return type void, and the parameters as shown in Table 1 above.

[0105] Table 2

[0106]

[0107] In the above embodiments, since the general test script includes the multi-cloud description information of the first functional unit, which also includes the unit name of the first functional unit and / or the return type of the first functional unit, and the single-cloud description information of the first functional unit in the first cloud system also includes the unit name of the first functional unit in the first cloud system and / or the return type of the first functional unit in the first cloud system, the problem of needing to develop test scripts separately for different cloud systems due to different unit names and / or different return types of the same functional unit in different cloud systems is avoided, thereby improving test efficiency.

[0108] Optionally, the above S120 may further include: testing the first cloud service in the first cloud system based on the target test script, and obtaining the test results; for specific implementation, please refer to relevant technologies, which will not be elaborated here.

[0109] This application provides a method for generating a test script. The method includes: obtaining a general test script for testing a first cloud service. Since the general test script includes multi-cloud description information of the first functional unit contained in the first cloud service, wherein the multi-cloud description information of the first functional unit includes parameters of the first functional unit in multiple cloud systems; therefore, when it is necessary to test the first cloud service in a certain cloud system (e.g., the first cloud system), the multi-cloud description information of the first functional unit in the general test script is updated to the single-cloud description information of the first functional unit in the first cloud system (e.g., parameters of the first functional unit in the first cloud system), and a target test script for testing the first cloud service in the first cloud system can be obtained. It is not necessary to generate the target test script according to the test cases, thus improving the efficiency of generating the target test script, and thereby improving the efficiency of testing the first cloud service in the first cloud system.

[0110] In one implementation, the specific implementation method of the above S120 is as follows: Figure 6 As shown, it includes: S120A-S120B.

[0111] S120A, Obtain the target mapping relationship.

[0112] The aforementioned target mapping relationship includes the correspondence between the multi-cloud description information of the first functional unit in the aforementioned general test script and the single-cloud description information of the first functional unit in the first cloud system.

[0113] For example, assuming the first functional unit mentioned above is a VM creation functional unit, the target mapping relationship is shown in Table 3 below; this target mapping relationship is the mapping relationship between the multi-cloud description information of the VM creation functional unit and the single-cloud description information of the VM creation functional unit in the first cloud system. The multi-cloud description information of the VM creation functional unit includes the parameters: vm_name, ssd_name, core_count, and load_ip; the single-cloud description information of the VM creation functional unit in the first cloud system (hereinafter referred to as: the first single-cloud description information) includes the parameters: v2_name, ssd_name, and load_ip. Among them, vm_name in the multi-cloud description information corresponds to v2_name in the first single-cloud description information (i.e., semantically the same), ssd_name in the multi-cloud description information corresponds to ssd_name in the first single-cloud description information, load_ip in the multi-cloud description information corresponds to load_ip in the first single-cloud description information, and core_count in the multi-cloud description information does not have a corresponding parameter in the first single-cloud description information.

[0114] Table 3

[0115]

[0116] The above-mentioned S120A can be implemented by obtaining the target mapping relationship from the host device of the cloud management system, or by obtaining the target mapping relationship from other devices or systems. The specific implementation of the above-mentioned S120A is not limited in the specific embodiments of this application.

[0117] S120B: Based on the target mapping relationship, update the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script.

[0118] The implementation of S120B includes: determining the single-cloud description information of the first functional unit in the first cloud system from the target mapping relationship; and then updating the multi-cloud description information of the first functional unit in the general test script based on the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script.

[0119] It should be noted that the specific implementation of updating the multi-cloud description information of the first functional unit in the general test script based on the single-cloud description information of the first functional unit in the first cloud system can be as follows: Each element (e.g., parameter) in the multi-cloud description information of each functional unit in the general test script can be converted into an element with the same or similar semantics in the single-cloud description information (hereinafter referred to as the first single-cloud description information) of that functional unit in the first cloud system. Alternatively, it can be that the difference elements in the multi-cloud description information of each functional unit in the general test script that are different from the element names (e.g., vm_name and v2_name) in the first single-cloud description information are updated with the element name (i.e., v2_name) of the difference element in the first single-cloud description information, and elements in the multi-cloud description information that do not exist in the first single-cloud description information (e.g., core_count) are deleted.

[0120] In the above embodiments, when testing a first cloud service in a first cloud system is required, a general test script for testing the first cloud service is obtained. Since this general test script includes multi-cloud description information of the first functional units contained in the first cloud service, and the multi-cloud description information of the first functional units includes parameters in various cloud systems, the general test script is directly converted into a target test script based on the target mapping relationship. This eliminates the need to develop the target test script based on test cases, thereby improving the efficiency of obtaining the target test script and ultimately improving testing efficiency.

[0121] In another implementation, the specific implementation method of S120 above is as follows: Figure 7As shown, it includes: S120a-S120c.

[0122] S120a, Obtain the set of description information.

[0123] The aforementioned set of descriptive information includes single-cloud descriptive information of the first functional unit in various cloud systems; wherein, the first functional unit is the first functional unit in a general test script.

[0124] For example, when the first functional unit includes a functional unit for creating a VM and a functional unit for creating a network, the above-mentioned set of description information, as shown in Table 4 below, includes: single-cloud description information of the functional unit for creating a VM in the first cloud system, single-cloud description information of the functional unit for creating a network in the first cloud system, single-cloud description information of the functional unit for creating a VM in the second cloud system, and single-cloud description information of the functional unit for creating a network in the second cloud system.

[0125] The functional unit for creating VMs in the first cloud system includes the following parameters in its single-cloud description information: vm_name, ssd_name, and core_count. The functional unit for creating VMs in the second cloud system includes the following parameters in its single-cloud description information: v2_name, ssd_name, and file_ip. The functional unit for creating networks in the first cloud system includes the following parameter in its single-cloud description information: net_name. The functional unit for creating networks in the first cloud system includes the following parameter in its single-cloud description information: network_name.

[0126] Table 4

[0127]

[0128] S120b: Obtain the single-cloud description information of the first functional unit in the first cloud system from the description information set.

[0129] The implementation of S120b includes: obtaining single-cloud description information of each functional unit in the first functional unit of the first cloud system from the description information set.

[0130] S120c: Based on the single-cloud description information of the first functional unit in the first cloud system, update the multi-cloud description information of the first functional unit in the general test script to obtain the target test script.

[0131] The implementation of S120c includes: replacing the multi-cloud description information of the first functional unit in the general test script with the single-cloud description information of the first functional unit in the first cloud system, based on the semantics (i.e., function) of the first functional unit in the general test script; wherein, the implementation method for determining the semantics of the functional unit is described in the relevant technology and will not be repeated here.

[0132] based on Figure 4 , Figure 6 or Figure 7 This application provides a specific implementation method, such as... Figure 8 As shown, the method includes: S210-S250.

[0133] S210, Display the first interface.

[0134] The first interface includes a control for the first functional unit in the general test script; wherein the control for the first functional unit is used to indicate the cloud description information of the first functional unit; that is, the first interface includes a control for representing the first functional unit; the control for the first functional unit includes the cloud description information of the first functional unit after it is opened.

[0135] It should be understood that the first interface may also include components of all functional units in various cloud services. For ease of description, this application embodiment uses the components of the first functional unit as an example for illustration. Specifically, this application embodiment does not limit the number of components of the functional unit displayed on the first interface.

[0136] For example, the first interface described above is as follows: Figure 9 The control shown includes controls for creating a VM, creating a network, obtaining a VM, and obtaining a network. Each control for a specific functional unit includes multi-cloud description information for that functional unit. Figure 10 As shown, the control of the VM creation function unit includes: multi-cloud description information of the VM creation function unit; the multi-cloud description information includes parameters such as vm_name, ssd_name, core_count, float_ip, and input boxes for the parameter values ​​of each parameter; the multi-cloud description information also includes: the identifier of the VM creation function unit: create_vm.

[0137] It should be noted that before executing S210 above, the cloud management system needs to generate multi-cloud description information of the first functional unit based on the semantics of the parameters of the first functional unit in the multiple cloud systems. The multi-cloud description information of the first functional unit includes: parameters with the same semantics and parameters with different semantics in the first functional unit in the multiple cloud systems. The specific method for generating the multi-cloud description information of the first functional unit is described in S310 below, and will not be repeated here.

[0138] The above-mentioned S210 is implemented by: obtaining the multi-cloud description information of the pre-generated first functional unit, and sending the description information of the first functional unit as the display information of the first interface to the display device, so that the display device displays the control of the first functional unit in the first interface.

[0139] S220. In response to an operation on the control of the first functional unit, obtain the test cases for the first cloud service.

[0140] The above-mentioned operation on the control of the first functional unit (hereinafter referred to as the generation operation) is an operation used to instruct (or generate) test cases for the first cloud service; that is, the generation operation is used to select the first functional unit from the first interface, assign values ​​to the parameters in the multi-cloud description information of each functional unit in the first functional unit, and establish the logical relationship between the first functional units.

[0141] The test cases for the aforementioned first cloud service include multi-cloud description information of the aforementioned first functional unit; wherein, the test cases also include parameter values ​​corresponding to the parameters in the multi-cloud description information, as well as the logical relationships between the first functional units.

[0142] For example, the operation of the control for the first functional unit described above can be from... Figure 9 In the first interface shown, select controls for the functional unit of creating a VM, the functional unit of creating a network, and the functional unit of obtaining a VM, and assign values ​​to the parameters included in the multi-cloud description information for each functional unit; then, establish the following for these three functional units: Figure 5 The logical relationships are shown. Subsequently, the test cases for the first cloud service obtained include: multi-cloud description information of the functional unit creating a VM and the parameter values ​​of the parameters in that multi-cloud description information; multi-cloud description information of the functional unit creating a network and the parameter values ​​of the parameters in that multi-cloud description information; multi-cloud description information of the functional unit obtaining a VM and the parameter values ​​of the parameters in that multi-cloud description information; and the relationships between the functional units creating a VM, obtaining a VM, and creating a network, as shown in the diagram. Figure 5 The logical relationship shown.

[0143] S230. Generate a general test script based on the test cases of the first cloud service.

[0144] The method described in S230 above includes converting the test case into a general test script based on the textual semantics of the test case. For the specific implementation of generating the test script based on the textual semantics of the test case, please refer to relevant technologies; it will not be elaborated here.

[0145] S240, Obtain the identifier of the first cloud system.

[0146] The method of obtaining the identifier of the first cloud system in S240 above can be obtained from the configuration file or from the display interface. The specific implementation of this application does not limit the above method of obtaining the identifier of the first cloud system.

[0147] The specific implementation of obtaining the identifier of the first cloud system from the display interface includes: outputting the display information of the selection interface, which includes the identifiers of multiple cloud systems; and then receiving the test configuration from the selection interface, which includes the identifier of the first cloud system of the first cloud service to be tested among multiple cloud systems.

[0148] S250. Update the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script.

[0149] It should be noted that the implementation of S250 is similar to that of S120. For a detailed description of S250, please refer to the relevant description of S120 above. It will not be repeated here.

[0150] In the above embodiments, test cases including multi-cloud description information of the first functional unit are obtained, and a general test script not specifically targeted at a particular cloud system is generated based on the test cases. Then, when it is necessary to test the first cloud service in a certain cloud system (e.g., the first cloud system), since the general test script includes multi-cloud description information of the first functional unit, wherein the multi-cloud description information of the first functional unit includes parameters of the first functional unit in multiple cloud systems, it is only necessary to update the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system (e.g., parameters of the first functional unit in the first cloud system), so as to obtain the target test script for testing the first cloud service in the first cloud system. It is not necessary to design test cases separately for the first cloud service in different cloud systems, thereby saving the time of designing test cases and improving the efficiency of testing the first cloud service in the first cloud system.

[0151] based on Figure 8This application provides another implementation method, which requires generating multi-cloud description information of the first functional unit before executing S210; the generation method is as follows: Figure 11 As shown, it includes: S310.

[0152] S310. Generate multi-cloud description information for the first functional unit based on the semantics of the parameters of the first functional unit in multiple cloud systems.

[0153] It should be noted that the semantics of a parameter of a functional unit can be determined based on the parameter name, the parameter annotation, the parameter type, the parameter name, and the identifier of the functional unit to which the parameter belongs. In this application embodiment, the method of determining the semantics of the parameter is not limited.

[0154] The implementation of S310 above includes: aggregating parameters with the same or similar semantics from multiple first functional units in multiple cloud systems to obtain a single parameter; abstracting the parameters with different semantics from the multiple first functional units so that the multi-cloud description information of the first functional unit includes the parameters with different semantics from the multiple first functional units; that is, the multi-cloud description information of the first functional unit includes the parameters of each of the multiple first functional units in multiple cloud systems.

[0155] For example, such as Figure 12 As shown, assume that the parameters of the VM creation function unit (hereinafter referred to as Function Unit A) in vendor A's cloud system include: vm_name (semantic: virtual machine name), ssd_name (semantic: virtual machine storage disk name), and core_count (semantic: number of virtual machine cores). Further assume that the parameters of the VM creation function unit (hereinafter referred to as Function Unit B) in vendor B's cloud system include: v2_name (semantic: virtual machine name), ssd_name (semantic: virtual machine storage disk name), and load_ip (semantic: virtual machine IP address).

[0156] Since the parameter `vm_name` in functional unit A and the parameter `v2_name` in functional unit B have the same semantics but different names, one parameter (e.g., `v2_name`) is selected from these two parameters (either arbitrarily or based on an algorithm) to be the parameter with that semantic meaning in the multi-cloud description information of this functional unit. The parameter `ssd_name` in functional unit A and the parameter `ssd_name` in functional unit B have the same semantics and name, so this parameter is selected as the parameter with that semantic meaning in the multi-cloud description information of this functional unit. The parameter `core_count` in functional unit A does not have a parameter with the same semantics in functional unit B, so `core_count` is selected as the parameter in the multi-cloud description information of this functional unit; the parameter `float_ip` in functional unit B does not have a parameter with the same semantics in functional unit A, so `float_ip` is selected as the parameter in the multi-cloud description information of this functional unit. Therefore, the resulting multi-cloud description information for the functional unit creating the VM includes: `v2_name`, `ssd_name`, `core_count`, and `float_ip`.

[0157] It should be noted that the multi-cloud description information of the above-mentioned functional units may also include: the unit name of the functional unit, and / or the return type of the functional unit; wherein, the unit name in the multi-cloud description information of a functional unit is generated based on the semantics of the unit name of the functional unit in multiple cloud systems; similarly, the return type of the functional unit in the above-mentioned multi-cloud description information is also generated based on the semantics of the return type of the functional unit in multiple cloud systems; the specific implementation method is similar to the generation method of the parameters in the above-mentioned multi-cloud description information, and will not be elaborated here.

[0158] In one implementation, after S310, the method further includes storing multi-cloud description information of the first functional unit.

[0159] This application provides yet another implementation method in the embodiments, such as Figure 13 As shown, it includes: S410-S450.

[0160] S410. Obtain the general test scripts and the identifier of the first cloud system used for testing the first cloud service.

[0161] It should be noted that the implementation of S410 is similar to that of S110 and S240. For a detailed description of S410, please refer to the relevant descriptions of S110 and S240 above. It will not be repeated here.

[0162] S420. Determine whether a second functional unit exists in the general test script.

[0163] The aforementioned second functional unit is a functional unit of a specified cloud system, that is, the second functional unit is a functional unit included in the second cloud system among the aforementioned multiple cloud systems.

[0164] It should be understood that the second functional unit is specified in the test cases that generate the aforementioned general test script; specifically, when selecting a functional unit from the first interface in S210, the cloud system is specified for the selected functional unit.

[0165] For example, suppose the general test script above includes: a functional unit for creating a VM, a functional unit for obtaining a VM, and a functional unit for creating a network; when the unified resource locator (URL) of the functional unit for creating a network has specified that the functional unit for creating a network is the functional unit for creating a network in the second cloud system, then the functional unit for creating a network in the general test script is the second functional unit.

[0166] It should be noted that the aforementioned second functional unit can be a functional unit located in the second cloud system, which is included in the first functional unit of the first cloud service; the aforementioned second functional unit can also be a functional unit in the second cloud service of the second cloud system, which is a cloud service that has a dependency relationship with the first cloud service; that is, the second functional unit in this application has a dependency relationship with the first cloud service. This dependency relationship includes: a mutual invocation relationship and a business-specified association relationship.

[0167] For example, if the first cloud service in the first cloud system is to store data and synchronize that data to the second cloud system, then the second functional unit is the functional unit in the second cloud system used to determine whether the synchronized data has been successfully synchronized.

[0168] The method for determining S420 above includes: by parsing the URL of each functional unit in the general test script, the functional unit with the cloud system identifier in the URL is determined as the second functional unit.

[0169] If a second functional unit exists in the above general test script, execute S430-S440.

[0170] If there is no second functional unit in the above general test script, execute S450.

[0171] S430. Update the multi-cloud description information of the second functional unit in the general test script to the single-cloud description information of the second functional unit in the second cloud system.

[0172] The aforementioned second cloud system is the cloud system specified by the second functional unit.

[0173] For example, based on the example in S420 above, the functional unit for creating a network in the general test script is a second functional unit; then, the multi-cloud description information of the functional unit for creating a network in the general test script is updated to the single-cloud description information of the functional unit for creating a network in the second cloud system specified by the functional unit for creating a network.

[0174] It should be noted that the implementation of S430 is similar to that of S120. For a detailed description of S430, please refer to the relevant description of S120 above. It will not be repeated here.

[0175] S440. Update the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script.

[0176] The aforementioned target test script includes: single-cloud description information of the second functional unit and single-cloud description information of the first functional unit; wherein, the single-cloud description information of the second functional unit is the single-cloud description information of the second functional unit in the cloud system specified by the second functional unit. The single-cloud description information of the first functional unit in the target test script is the single-cloud description information of the first functional unit in the first cloud system indicated by the identifier of the aforementioned first cloud system.

[0177] For example, based on the example in S430 above, the multi-cloud description information of the network creation functional unit (i.e., the second functional unit) in the general test script is updated to the single-cloud description information of the network creation functional unit in the second cloud system; and the multi-cloud description information of the VM creation functional unit and the VM acquisition functional unit in the general test script is updated to the single-cloud description information of the VM creation functional unit and the VM acquisition functional unit in the first cloud system.

[0178] It should be noted that the implementation method of S440 is the same as that of S120. For a detailed description of S440, please refer to the relevant description of S120 above. It will not be repeated here.

[0179] S450. Update the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script.

[0180] It should be noted that the implementation method of S450 is the same as that of S120. For a detailed description of S450, please refer to the relevant description of S120 above. It will not be repeated here.

[0181] In the above embodiments, when a second functional unit of a specified cloud system exists in the general test script, the multi-cloud description information of the second functional unit in the general test script is updated to the single-cloud description information of the second functional unit in the cloud system specified by the second functional unit; and the multi-cloud description information of the first functional unit in the general test script is updated to the single-cloud description information of the first functional unit in the first cloud system; thereby avoiding the problem of developing test scripts separately for functional units in different cloud systems; thus, improving the efficiency of collaborative testing of different cloud systems.

[0182] The foregoing mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, the test script generation apparatus includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0183] This application embodiment can, based on the above method, exemplarily divide the test script generation device into functional modules. For example, the test script generation device may include functional modules corresponding to each functional division, or two or more functions may be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division; in actual implementation, there may be other division methods.

[0184] When dividing each function into modules according to its corresponding function. Figure 14 This diagram illustrates a possible structural schematic of the test script generation apparatus involved in the above embodiments; the test script generation apparatus is deployed in... Figure 2 The cloud management architecture is shown below. Figure 14 As shown, the test script generation device includes a transceiver module 1401 and a processing module 1402.

[0185] The transceiver module 1401 is used to obtain a general test script for testing the first cloud service; for example, to execute step S110 in the above method embodiment.

[0186] The processing module 1402 is used to update the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script; for example, by executing step S120 in the above method embodiment.

[0187] Optionally, the transceiver module 1401 is used to obtain the target mapping relationship; for example, by performing step S120A in the above method embodiment.

[0188] The processing module 1402 is used to update the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system based on the target mapping relationship, so as to obtain the target test script; for example, by executing step S120B in the above method embodiment.

[0189] Optionally, the transceiver module 1401 is used to obtain a set of description information; for example, by performing step S120a in the above method embodiment.

[0190] The processing module 1402 is used to obtain single-cloud description information of the first functional unit in the first cloud system from the description information set; for example, to execute step S120b in the above method embodiment.

[0191] Optionally, the processing module 1402 is used to update the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system; and to update the multi-cloud description information of the second functional unit in the general test script to the single-cloud description information of the second functional unit in the second cloud system, to obtain the target test script; for example, by executing steps S430-S440 in the above method embodiment.

[0192] Optionally, the above-mentioned test script generation device further includes: a display module 1403;

[0193] The display module 1403 is used to display the first interface; for example, to execute step S210 in the above method embodiment.

[0194] The transceiver module 1401 is used to obtain test cases of the first cloud service in response to the operation of the control of the first functional unit; for example, to execute step S220 in the above method embodiment.

[0195] The processing module 1402 is used to generate a general test script based on the test cases; for example, to execute step S230 in the above method embodiment.

[0196] Optionally, the processing module 1402 is used to generate multi-cloud description information of the first functional unit based on the semantics of the parameters of the first functional unit in multiple cloud systems; for example, by performing step S310 in the above method embodiment.

[0197] Optionally, the transceiver module 1401 is also used to receive test configurations.

[0198] Optionally, the multi-cloud description information of the first functional unit may also include: the unit name of the functional unit, and / or the return type of the first functional unit; the single-cloud description information of the first functional unit in the first cloud system may also include: the unit name of the functional unit in the first cloud system, and / or the return type of the functional unit in the first cloud system.

[0199] The transceiver module 1401, processing module 1402, and display module 1403 can all be implemented in software or in hardware. For example, the implementation of processing module 1402 will be described below. Similarly, the implementation of transceiver module 1401 and display module 1403 can refer to the implementation of processing module 1402.

[0200] As an example of a software functional unit, processing module 1402 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, or a container. Further, the aforementioned computing instance may be one or more. For example, processing module 1402 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed within the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed within the same availability zone (AZ) or in different AZs, each AZ including one or more geographically proximate data centers. Typically, a region may include multiple AZs.

[0201] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.

[0202] As an example of a hardware functional unit, the processing module 1402 may include at least one computing device, such as a server. Alternatively, the processing module 1402 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), general-purpose array logic (GAL), or any combination thereof.

[0203] The processing module 1402 includes multiple computing devices that can be distributed in the same region or in different regions. Similarly, the processing module 1402 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the processing module 1402 can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0204] It should be noted that, in other embodiments, the processing module 1402 can be used to execute any step in the above-described test script generation method, the transceiver module 1401 can be used to execute any step in the above-described test script generation method, and the display module 1403 can be used to execute any step in the above-described test script generation method. The steps implemented by the processing module 1402, the transceiver module 1401, and the display module 1403 can be specified as needed. By implementing different steps in the above-described test script generation method through the processing module 1402, the transceiver module 1401, and the display module 1403 respectively, all functions of the management device can be realized.

[0205] This application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.

[0206] like Figure 15As shown, the computing device cluster includes at least one computing device 100. The memory 106 in one or more computing devices 100 within the computing device cluster may store the same instructions for executing the generation method of the test script described above.

[0207] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the method of generating the test script described above. In other words, a combination of one or more computing devices 100 can jointly execute the instructions for executing the method of generating the test script described above.

[0208] It should be understood that the processor and bus in the aforementioned computing device 100 are related to... Figure 3 The processor 301 and bus 304 in this computing device 100 are identical. For a detailed description of the processor and bus in this computing device 100, please refer to the description of the processor and bus in this computing device 100. Figure 3 The relevant descriptions will not be repeated here.

[0209] It should be noted that the memory 106 in different computing devices 100 within the computing device cluster can store different instructions, each used to execute a portion of the management device's functions. That is, the instructions stored in the memory 106 of different computing devices 100 can implement the functions of one or more modules among the processing module 1402, the transceiver module 1401, and the display module 1403.

[0210] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN) or a local area network (LAN), etc. Figure 16 One possible implementation is shown. For example... Figure 16 As shown, the two computing devices 100A and 100B are connected via a network. Specifically, they are connected to the network through communication interfaces in each computing device. In this possible implementation, the memory 106 in computing device 100A stores instructions for performing the functions of processing module 1402. Meanwhile, the memory 106 in computing device 100B stores instructions for performing the functions of transceiver module 1401 and display module 1403.

[0211] Figure 16 The connection method between the computing device clusters shown can be such that, considering the test script generation method provided in this application requires frequent data acquisition and transmission, the functions implemented by the display module 1403 and the transceiver module 1401 are delegated to the computing device 100B for execution.

[0212] It should be understood that Figure 16The functions of the computing device 100A shown can also be performed by multiple computing devices 100. Similarly, the functions of the computing device 100B can also be performed by multiple computing devices 100.

[0213] This application also provides another computing device cluster. The connection relationships between the computing devices in this computing device cluster can be similarly referred to... Figure 15 and Figure 16 The connection method of the computing device cluster is different in that the memory 106 of one or more computing devices 100 in the computing device cluster can store the same instructions for generating test scripts.

[0214] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the test script generation method. In other words, a combination of one or more computing devices 100 can jointly execute the instructions for executing the test script generation method.

[0215] This application also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any usable medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to execute a method for generating test scripts.

[0216] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct a computing device to execute a method for generating a test script.

[0217] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating test scripts, characterized in that, The method is applied to a cloud management system that manages multiple cloud systems, including a first cloud system. The method includes: Obtain a general test script for testing the first cloud service; the general test script includes multi-cloud description information of the first functional unit, the first functional unit is a functional unit included in the first cloud service, and the multi-cloud description information of the first functional unit includes: parameters of the first functional unit in the multiple cloud systems; The multi-cloud description information of the first functional unit in the general test script is updated to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script; the single-cloud description information of the first functional unit in the first cloud system includes: the parameters of the first functional unit in the first cloud system; the target test script is used to test the first cloud service provided by the first cloud system.

2. The method according to claim 1, characterized in that, The step of updating the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script includes: Obtain the target mapping relationship; the target mapping relationship includes the correspondence between the multi-cloud description information of the first functional unit and the single-cloud description information of the first functional unit in the first cloud system; Based on the target mapping relationship, the multi-cloud description information of the first functional unit in the general test script is updated to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script.

3. The method according to claim 1, characterized in that, Before updating the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script, the method further includes: Obtain a set of description information; the set of description information includes single-cloud description information of the first functional unit in the multiple cloud systems; From the set of description information, obtain the single-cloud description information of the first functional unit in the first cloud system.

4. The method according to any one of claims 1-3, characterized in that, The general test script also includes: multi-cloud description information of a second functional unit that depends on the first cloud service; the second functional unit is a functional unit included in the second cloud system, and the multiple cloud systems include the second cloud system. The step of updating the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system to obtain the target test script includes: The multi-cloud description information of the first functional unit in the general test script is updated to the single-cloud description information of the first functional unit in the first cloud system; and the multi-cloud description information of the second functional unit in the general test script is updated to the single-cloud description information of the second functional unit in the second cloud system to obtain the target test script.

5. The method according to any one of claims 1-4, characterized in that, The acquisition of the general test script for testing the first cloud service includes: The first interface is displayed, and the first interface includes controls for the first functional unit; the controls for the first functional unit are used to indicate the multi-cloud description information of the first functional unit. In response to an operation on the control of the first functional unit, test cases for the first cloud service are obtained; the test cases for the first cloud service include multi-cloud description information of the first functional unit. Generate the general test script based on the test cases.

6. The method according to any one of claims 1-5, characterized in that, Before obtaining the general test script for testing the first cloud service, the method further includes: Based on the semantics of the parameters of the first functional unit in the multiple cloud systems, multi-cloud description information of the first functional unit is generated; the multi-cloud description information of the first functional unit includes parameters with the same semantics and parameters with different semantics in the first functional unit in the multiple cloud systems.

7. The method according to any one of claims 1-6, characterized in that, The method further includes: Receive test configuration, which includes: the identifier of the first cloud system.

8. The method according to any one of claims 1-7, characterized in that, The multi-cloud description information of the first functional unit also includes: the unit name of the functional unit, and / or the return type of the first functional unit; The single-cloud description information of the first functional unit in the first cloud system also includes: the unit name of the functional unit in the first cloud system, and / or the return type of the functional unit in the first cloud system.

9. A test script generation apparatus, characterized in that, The generating device is applied to a cloud management system, which manages multiple cloud systems, including a first cloud system. The generating device includes a transceiver module and a processing module. The transceiver module is used to obtain a general test script for testing the first cloud service; the general test script includes multi-cloud description information of the first functional unit, the first functional unit is a functional unit included in the first cloud service, and the multi-cloud description information of the first functional unit includes: parameters of the first functional unit in the multiple cloud systems. The processing module is used to update the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system, thereby obtaining the target test script; the single-cloud description information of the first functional unit in the first cloud system includes: the parameters of the first functional unit in the first cloud system; the target test script is used to test the first cloud service provided by the first cloud system.

10. The generating apparatus according to claim 9, characterized in that, The transceiver module is used to obtain the target mapping relationship; the target mapping relationship includes the correspondence between the multi-cloud description information of the first functional unit and the single-cloud description information of the first functional unit in the first cloud system; The processing module is used to update the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system based on the target mapping relationship, so as to obtain the target test script.

11. The generating apparatus according to claim 9, characterized in that, The transceiver module is used to acquire a set of description information; the set of description information includes single-cloud description information of the first functional unit in the multiple cloud systems; The processing module is used to obtain the single-cloud description information of the first functional unit in the first cloud system from the description information set.

12. The generating apparatus according to any one of claims 9-11, characterized in that, The general test script also includes: multi-cloud description information of a second functional unit that depends on the first cloud service; the second functional unit is a functional unit included in the second cloud system, and the multiple cloud systems include the second cloud system. The processing module is configured to update the multi-cloud description information of the first functional unit in the general test script to the single-cloud description information of the first functional unit in the first cloud system; and to update the multi-cloud description information of the second functional unit in the general test script to the single-cloud description information of the second functional unit in the second cloud system, thereby obtaining the target test script.

13. The generating apparatus according to any one of claims 9-12, characterized in that, The generating device further includes: a display module; The display module is used to display a first interface, the first interface including controls of the first functional unit; the controls of the first functional unit are used to indicate the multi-cloud description information of the first functional unit. The transceiver module is used to obtain test cases of the first cloud service in response to operations on the controls of the first functional unit; the test cases of the first cloud service include multi-cloud description information of the first functional unit. The processing module is used to generate the general test script based on the test cases.

14. The generating apparatus according to any one of claims 9-13, characterized in that, The processing module is configured to generate multi-cloud description information of the first functional unit based on the semantics of the parameters of the first functional unit in the multiple cloud systems; the multi-cloud description information of the first functional unit includes parameters with the same semantics and parameters with different semantics in the first functional unit in the multiple cloud systems.

15. The generating apparatus according to any one of claims 9-14, characterized in that, The transceiver module is also used to receive test configuration, which includes: the identifier of the first cloud system.

16. The generating apparatus according to any one of claims 9-15, characterized in that, The multi-cloud description information of the first functional unit also includes: the unit name of the functional unit, and / or the return type of the first functional unit; the single-cloud description information of the first functional unit in the first cloud system also includes: the unit name of the functional unit in the first cloud system, and / or the return type of the functional unit in the first cloud system.

17. A computing device cluster, characterized in that, It includes at least one computing device, each computing device including a processor and memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the cluster of computing devices to perform the method as described in any one of claims 1 to 8.

18. A computer-readable storage medium, characterized in that, The device stores computer instructions that, when executed on a computing device, cause the computing device to perform the method as described in any one of claims 1 to 8.

19. A computer program product containing instructions, characterized in that, When the instruction is executed by the computing device cluster, the computing device cluster performs the method as described in any one of claims 1 to 8.