Test environment deployment method and apparatus
By using automated deployment templates and scripted processes, the problem of low deployment efficiency in traditional test environments has been solved, enabling rapid and accurate deployment and delivery of test environments, thus meeting the needs of iterative software product development.
Patent Information
- Application Number
- CN202210586718.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-27
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2042-05-27
AI Technical Summary
Traditional test environment deployment methods rely on manual operations, which are time-consuming, labor-intensive, and prone to errors. They are difficult to adapt to the needs of agile iterative development of software products, and automated scripts cannot completely replace manual intervention, resulting in low deployment efficiency and unstable quality.
It employs automatic deployment templates and preset automated scripts to generate automatic deployment templates from required information. It uses one-click or partial deployment modes to automatically deploy the test environment and verifies the installation and startup status through test scripts, ensuring the integrity and accuracy of the environment.
It enables rapid deployment and delivery of the testing environment, reduces manual intervention, lowers the error rate, improves deployment quality and efficiency, and adapts to the needs of iterative development of software products.
Smart Images

Figure CN114924971B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and apparatus for deploying a testing environment. Background Technology
[0002] This section is intended to provide background or context for the embodiments of the invention set forth in the claims. The description herein is not an admission that it is prior art simply because it is included in this section.
[0003] In the internet age, various software products have become integrated into all aspects of social life. To seize market opportunities, the iteration and development cycle of software products is becoming increasingly tight. To provide secure, stable, and high-quality services, software testing has received high priority from enterprises.
[0004] Software product testers typically request test environment deployment based on the needs of software product deployment, operation, and upgrades. A test environment refers to the hardware, software, and information resources required to complete software product testing during the software development and testing process. The test environment deployment process can be divided into the following steps: 1. Obtaining the deployment request; 2. Allocating hardware and software resources such as servers, networks, and storage according to the request; 3. Deploying servers, middleware, and databases; 4. Performing customized configurations, such as modifying system parameters and file permissions; 5. Delivering the test environment, including server and user information; 6. Deploying the application software.
[0005] Deploying a test environment is a complex process involving the installation and configuration of various computer hardware and software. With the increasing demand for test environment deployment and the shrinking delivery cycle, improving quality and efficiency has become an unavoidable challenge for test environment deployment personnel. Traditional manual deployment methods rely heavily on manual operations to install and configure various hardware and software. Although automated scripts have been increasingly introduced into test environment deployment in recent years to reduce repetitive manual labor, many steps still require manual intervention. This is not only time-consuming and labor-intensive but also prone to errors, making it difficult to adapt to the new demands of agile iterative development of software products. Summary of the Invention
[0006] This invention provides a test environment deployment method to achieve automatic deployment of the test environment, reduce manual intervention in the deployment process, save time and manpower, and reduce the error rate. The method includes:
[0007] The system receives required information from the user regarding the test environment to be deployed. This required information includes basic information about the test environment, server information, middleware information, database information, and test user information.
[0008] Based on the required information, an automatic deployment template will be generated;
[0009] The test environment is deployed using an automated deployment template and preset automated scripts to obtain the first test environment;
[0010] The installation and startup status of the server, middleware, and database in the first test environment are tested using a pre-set test script.
[0011] Once the test results show that the server, middleware, and database are all installed and running, the first test environment is delivered.
[0012] This invention also provides a test environment deployment device for automatically deploying the test environment, reducing manual intervention in the deployment process, saving time and manpower, and reducing the error rate. The device includes:
[0013] The communication module is used to receive the required information of the test environment to be deployed input by the user. The required information includes the basic information of the test environment, server information, middleware information, database information and test user information.
[0014] The template generation module is used to generate an automatic deployment template based on the required information.
[0015] The deployment module is used to deploy the test environment using automatic deployment templates and preset automated scripts to obtain the first test environment;
[0016] The testing module is used to test the installation and startup status of the server, middleware, and database in the first test environment using preset test scripts;
[0017] The delivery module is used to deliver the first test environment when the test results show that the server, middleware, and database are all installed and started.
[0018] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described test environment deployment method.
[0019] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described test environment deployment method.
[0020] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described test environment deployment method.
[0021] In this embodiment of the invention, when a test environment needs to be deployed, the user inputs the required information for the test environment to be deployed. This required information generates an automated deployment template containing information on the resources allocated to the test environment. Based on the automated deployment template and the automated script, the required resources for the test environment, such as servers, middleware, and databases, can be allocated. After obtaining the first test environment using the automated deployment template and the automated script, the installation and startup status of the resources in the first test environment are tested. If all tests pass, it indicates that the test environment has been deployed successfully and is available. This method enables rapid deployment and delivery of the test environment based on information provided by a standardized automated deployment template and combined with automated scripts. This reduces repetitive manual labor during test environment deployment and eliminates the need for human intervention, avoiding issues such as inconsistent standards caused by personnel turnover or negligence, thus improving the quality and efficiency of test environment deployment. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0023] Figure 1 This is a flowchart of a test environment deployment method according to an embodiment of the present invention;
[0024] Figure 2 This is a flowchart of a specific execution step of step 102 in an embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram illustrating how to name a server and allocate a virtualization cluster to a server to be deployed, according to an embodiment of the present invention.
[0026] Figure 4 This is a schematic diagram illustrating the allocation of network and disk resources to a server to be deployed, according to an embodiment of the present invention.
[0027] Figure 5 This is a schematic diagram illustrating middleware or database configuration parameters in an embodiment of the present invention;
[0028] Figure 6 This is a flowchart illustrating the specific execution method of step 103 in the one-click deployment mode of this embodiment of the invention;
[0029] Figure 7 This is a flowchart illustrating the specific execution method of step 103 in the distributed deployment mode of this embodiment of the invention;
[0030] Figure 8 This is a schematic diagram of the structure of a test environment deployment device according to an embodiment of the present invention;
[0031] Figure 9 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0033] This invention provides a method for deploying a test environment, such as... Figure 1 As shown, the method includes the following steps 101 to 105:
[0034] Step 101: Receive the required information of the test environment to be deployed from the user.
[0035] The required information includes basic information about the test environment, server information, middleware information, database information, and test user information.
[0036] Basic information includes the name of the software product to be tested and its environment identifier; server information includes the server's functional identifier, operating system type, CPU type, network type, memory size, and storage size; middleware information includes detailed version information, architecture information, and configuration information; database information includes detailed version information, architecture information, and configuration information; and test user information includes the test user ID and permissions. The test user ID can include the IDs of multiple users and each test user's usage permissions within the test environment. When generating the test environment, it will be configured according to the test user IDs and permissions.
[0037] It should be noted that, unless otherwise specified, the server mentioned in the embodiments of the present invention refers to a virtual machine (VM).
[0038] Step 102: Generate an automatic deployment template based on the required information.
[0039] For details, see Figure 2 An automatic deployment template can be generated according to the methods in steps 1021 to 1025 below:
[0040] Step 1021: Based on the software product name, environment identifier, and server function identifier, determine the name of each server to be deployed in the test environment using preset naming rules.
[0041] The default naming rules can be set by the user according to their usage habits, etc. For example, the following default naming rules can be used: the first field identifies the environment, the second field identifies the software product name, the third field identifies the server function, and the fourth field identifies the serial number. For example, in... Figure 3 The system names six servers VM1 to VM6. Taking VM1's name E1BOCAPP1 as an example, E1 is the environment identifier, BOC is the software product name identifier corresponding to the software product name, APP is the server function identifier, and the last Arabic numeral 1 is used to identify the serial number.
[0042] Step 1022: Write the server information, middleware information, database information, and test user information into the installation configuration parameters.
[0043] In this step, the required information entered by the user in step 101 is written into the installation configuration parameters to prepare for the subsequent resource configuration of the server, middleware, and database.
[0044] Step 1023: Group the servers to be deployed according to the operating system type and network type, and allocate virtualization clusters to each group of servers to be deployed.
[0045] In this embodiment of the invention, a virtualization cluster only supports a few specific operating systems and network types. Therefore, firstly, the servers to be deployed are divided into different groups G1, G2, ..., G according to the operating system type (such as LINUX, UNIX, etc.). M Then, based on network type (such as intranet zone, DMZ zone, etc.), the servers to be deployed in each group are further divided into different groups, such as G i Divided into G i1 G i2 , ..., G iMi , i∈[1,2,...,M]. G will be determined based on the server operating system type and network type. ij All servers to be deployed are assigned to the corresponding virtualization clusters, where i∈[1,2,...M], j∈[1,2,...M] i ].
[0046] See Figure 3 As shown, the six servers named in step 1021 are divided into two virtualization clusters. Specifically, VM1, VM2, VM5 and VM6 are assigned to virtualization cluster 1, and VM3 and VM4 are assigned to virtualization cluster 2.
[0047] Step 1024: In each virtualization cluster, allocate network and disk resources to the servers to be deployed based on the middleware architecture information and database architecture information.
[0048] For example, see Figure 4 As shown, in step 1021, six servers VM1 to VM6 were identified, and network resources (i.e., IP addresses) and disk resources were allocated to them respectively. Specifically, the IP address corresponding to VM1 is IP1, and the disk resource is 100G.
[0049] Step 1025: Write the IP address of the server to be deployed into the installation configuration parameters according to the correspondence between the virtualization cluster and the name of the server to be deployed. The completed installation configuration parameters constitute the automatic deployment template.
[0050] See Figure 5 As shown, taking the middleware was_9.0.5.6_lin64 as an example, servers E1BOCAPP1 (IP address IP1) and E1BOCAPP2 (IP address IP2) form a WAS cluster, with the DMGR node server in the WAS cluster corresponding to IP address IP1; servers E1BOCAPP3 (IP address IP10) and E1BOCAPP4 (IP address IP11) form a second WAS cluster, with the DMGR node server in the cluster corresponding to IP address IP11. Two new groups (actually multiple groups are supported) are then created in the WAS configuration information, and the corresponding configuration parameters are automatically written.
[0051] After the parameters are configured, the automated deployment template is built.
[0052] Step 103: Deploy the test environment using the automatic deployment template and preset automated scripts to obtain the first test environment.
[0053] Considering users' needs for fully automated deployment of new test environments and modification of existing test environments, this embodiment of the invention provides two models for test environment deployment: one-click deployment mode and distributed deployment mode.
[0054] When a user selects the one-click deployment mode, such as Figure 6 As shown, step 103 utilizes the automatic deployment template and preset automated scripts to deploy the test environment, obtaining the first test environment, which can be executed as follows: steps 601 and 602:
[0055] Step 601: Based on the server information contained in the automatic deployment template, call the virtual machine template corresponding to the server information in the virtualization cluster to deploy the server;
[0056] Step 602: Following the preset middleware and database installation workflow, the automated scripts that complete the tasks of each node in the workflow are called in sequence. The automated scripts deploy the test environment according to the middleware information, database information, network resource information and disk resource information contained in the automated deployment template to obtain the first test environment.
[0057] In other words, in one-click deployment mode, each step in the deployment of servers, middleware, and databases can be encapsulated into atomic tasks. A workflow engine then orchestrates multiple atomic tasks according to a preset deployment process, automating the installation of middleware and databases. This mode is particularly convenient for deploying in new testing environments.
[0058] When a user selects the distributed deployment mode, such as Figure 7 As shown, step 103 utilizes the automatic deployment template and preset automated scripts to deploy the test environment, obtaining the first test environment, which can be executed as follows: steps 701 to 704:
[0059] Step 701: Receive the deployment request selected by the user for any server, middleware, or database;
[0060] Step 702: When the deployment request is for a server, the virtual machine template corresponding to the server information in the virtualization cluster to which the server belongs is called to deploy the server;
[0061] Step 703: When the deployment request is for middleware or database, according to the preset middleware or database installation workflow, the automated scripts that complete the tasks of each node in the workflow are called in sequence. The automated scripts deploy the middleware or database according to the middleware or database information, network resource information and disk resource information contained in the automated deployment template.
[0062] Step 704: Once the server, middleware, and database have been deployed, the first test environment is obtained.
[0063] The distributed deployment mode allows for the separate deployment of specific servers, middleware, or databases. This mode is designed to address situations frequently encountered in practice, such as horizontal scaling of existing test environments, middleware or database upgrades or reinstallations, where only modifications to a portion of the test environment are required. By decoupling the deployment of servers, middleware, and databases, each part of the resources can be deployed independently, making it more convenient for users.
[0064] Considering the different personalized needs of users, in this embodiment of the invention, optional information input by the user is also received. The optional information is used to modify the default parameters of the server. After deploying the test environment using the automatic deployment template and the preset automated script to obtain the first test environment, the optional information is used to modify the corresponding default parameters of the server to obtain the first test environment with modified parameters.
[0065] Correspondingly, when using the preset test script to test the installation and startup status of the server, middleware, and database in the first test environment, the preset test script is also used to test the installation and startup status of the server, middleware, and database in the first test environment after the parameters have been modified.
[0066] It should be noted that the default parameters of the server and the server information in the required fields are different types of information. Therefore, there will be no conflict between the optional and required information.
[0067] In another implementation, if the user does not enter any optional information, that is, when the optional information is empty, the default parameters do not change.
[0068] Step 104: Use the preset test script to test the installation and startup status of the server, middleware, and database in the first test environment.
[0069] To reduce the probability of errors in the delivered test environment, in this embodiment of the invention, after the first test environment is deployed, its installation and startup status are tested to test whether the server, middleware, and database are all installed and started. If they are installed and started, it indicates that the first test environment is usable; otherwise, it indicates that there is a problem with the first test environment, which needs to be modified or rebuilt.
[0070] In this embodiment of the invention, the test results of installation and startup can be visualized, and abnormal states can be marked with special colors or symbols to facilitate staff to troubleshoot and correct the problems.
[0071] Step 105: When the test results show that the server, middleware, and database are all installed and started, deliver the first test environment.
[0072] Under normal circumstances, once the test results show that the server, middleware, and database are all installed and running successfully, indicating that the test environment is usable, the delivery phase begins. When delivering the test environment, in addition to the test environment itself, a delivery list is generated based on the various configuration parameters included in the automated deployment template. This delivery list, similar to a description of the test environment, is provided to the user.
[0073] In another implementation, if the user needs to set a password for the test environment, they can enter the password in step 101, set the password during the subsequent automatic deployment of the test environment, and include the password in the generated delivery manifest.
[0074] In this embodiment of the invention, when a test environment needs to be deployed, the user inputs the required information for the test environment to be deployed. This required information generates an automated deployment template containing information on the resources allocated to the test environment. Based on the automated deployment template and the automated script, the required resources for the test environment, such as servers, middleware, and databases, can be allocated. After obtaining the first test environment using the automated deployment template and the automated script, the installation and startup status of the resources in the first test environment are tested. If all tests pass, it indicates that the test environment has been deployed successfully and is available. This method enables rapid deployment and delivery of the test environment based on information provided by a standardized automated deployment template and combined with automated scripts. This reduces repetitive manual labor during test environment deployment and eliminates the need for human intervention, avoiding issues such as inconsistent standards caused by personnel turnover or negligence, thus improving the quality and efficiency of test environment deployment.
[0075] This invention also provides a test environment deployment device, as described in the following embodiments. Since the principle by which this device solves the problem is similar to that of the test environment deployment method, the implementation of this device can refer to the implementation of the test environment deployment method; repeated details will not be elaborated further.
[0076] like Figure 8 As shown, the device 800 includes a communication module 801, a template generation module 802, a deployment module 803, a testing module 804, and a delivery module 805.
[0077] The communication module 801 is used to receive the required information of the test environment to be deployed input by the user. The required information includes the basic information of the test environment, server information, middleware information, database information and test user information.
[0078] Template generation module 802 is used to generate an automatic deployment template based on the required information;
[0079] Deployment module 803 is used to deploy the test environment using an automatic deployment template and preset automated scripts to obtain the first test environment;
[0080] Test module 804 is used to test the installation and startup status of the server, middleware and database in the first test environment using a preset test script;
[0081] Delivery module 805 is used to deliver the first test environment when the test results show that the server, middleware, and database are all installed and started.
[0082] In one implementation of this invention, the basic information includes the name of the software product to be tested and the environment identifier; the server information includes the server's function identifier, operating system type, CPU type, network type, memory size, and storage size; the middleware information includes detailed version information, architecture information, and configuration information of the middleware; the database information includes detailed version information, architecture information, and configuration information of the database; and the test user information includes the test user ID and permissions.
[0083] In one implementation of this invention, the deployment module is used for:
[0084] Based on the software product name, environment identifier, and server function identifier, the names of each server to be deployed in the test environment are determined using preset naming rules.
[0085] Write server information, middleware information, database information, and test user information into the installation configuration parameters;
[0086] The servers to be deployed are grouped according to their operating system type and network type, and virtualization clusters are allocated to each group of servers to be deployed.
[0087] In each virtualization cluster, network and disk resources are allocated to the servers to be deployed based on middleware architecture and database architecture information;
[0088] Write the IP address of the server to be deployed into the installation configuration parameters according to the correspondence between the virtualization cluster and the name of the server to be deployed. The completed installation configuration parameters constitute the automatic deployment template.
[0089] In one implementation of this invention, the test environment deployment includes a one-click deployment mode. When the user selects the one-click deployment mode, the deployment module is used for:
[0090] Based on the server information contained in the automatic deployment template, the virtual machine template corresponding to the server information in the virtualization cluster is called to deploy the server;
[0091] Following the preset workflow for middleware and database installation, the automated scripts that complete the tasks of each node in the workflow are called in sequence. The automated scripts then deploy the test environment according to the middleware information, database information, network resource information, and disk resource information contained in the automated deployment template, thus obtaining the first test environment.
[0092] In one implementation of this invention, the test environment deployment includes a distributed deployment mode. When the user selects the distributed deployment mode, the deployment module is used for:
[0093] Receive deployment requests from users for any server, middleware, or database;
[0094] When a deployment request is made to a server, the virtual machine template corresponding to the server information in the virtualization cluster to which the server belongs is used to deploy the server.
[0095] When a deployment request is made for middleware or a database, the automated scripts that complete the tasks of each node in the workflow are called sequentially according to the preset middleware or database installation workflow. The automated scripts then deploy the middleware or database according to the middleware or database information, network resource information, and disk resource information contained in the automated deployment template.
[0096] Once the server, middleware, and database have been deployed, the first test environment is obtained.
[0097] In one implementation of this invention,
[0098] The communication module is also used to receive optional information input by the user. The optional information is used to modify the server's default parameters. The server's default parameters and the server information in the required information are different types of information.
[0099] The device also includes:
[0100] The parameter modification module is used to modify the default parameters of the corresponding server using optional information, and obtain the first test environment after the parameters are modified.
[0101] The test module is used for:
[0102] The installation and startup status of the server, middleware, and database in the first test environment after parameter modification are tested using a preset test script.
[0103] In one implementation of this invention, the delivery module is configured to:
[0104] Once the test results indicate that the server, middleware, and database are all installed and running, a delivery list is generated based on the configuration parameters included in the automatic deployment template and provided to the user.
[0105] In this embodiment of the invention, when a test environment needs to be deployed, the user inputs the required information for the test environment to be deployed. This required information generates an automated deployment template containing information on the resources allocated to the test environment. Based on the automated deployment template and the automated script, the required resources for the test environment, such as servers, middleware, and databases, can be allocated. After obtaining the first test environment using the automated deployment template and the automated script, the installation and startup status of the resources in the first test environment are tested. If all tests pass, it indicates that the test environment has been deployed successfully and is available. This method enables rapid deployment and delivery of the test environment based on information provided by a standardized automated deployment template and combined with automated scripts. This reduces repetitive manual labor during test environment deployment and eliminates the need for human intervention, avoiding issues such as inconsistent standards caused by personnel turnover or negligence, thus improving the quality and efficiency of test environment deployment.
[0106] This invention also provides a computer device. Figure 9 This is a schematic diagram of a computer device in an embodiment of the present invention. This computer device is capable of implementing all steps in the test environment deployment method described in the above embodiments. Specifically, the computer device includes the following components:
[0107] Processor 901, memory 902, communications interface 903, and communication bus 904;
[0108] The processor 901, memory 902, and communication interface 903 communicate with each other through the communication bus 904; the communication interface 903 is used to realize information transmission between related devices.
[0109] The processor 901 is used to call the computer program in the memory 902, and when the processor executes the computer program, it implements the test environment deployment method in the above embodiments.
[0110] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described test environment deployment method.
[0111] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described test environment deployment method.
[0112] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0113] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0114] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0115] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0116] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method of test environment deployment, characterized by, The method comprises: receiving user inputted mandatory information of a test environment to be deployed, the mandatory information comprising basic information of the test environment, server information, middleware information, database information and test user information; generating an automatic deployment template according to the mandatory information; deploying the test environment by using the automatic deployment template and preset automatic scripts to obtain a first test environment; testing installation and startup of the server, middleware and database in the first test environment by using preset test scripts; delivering the first test environment when the test result is that the server, middleware and database are all installed and started; the basic information comprises a software product name to be tested and an environment identifier, the server information comprises a function identifier, an operating system type, a CPU type, a network type, a memory size and a storage size of the server, the middleware information comprises detailed version information, architecture information and configuration information of the middleware, the database information comprises detailed version information, architecture information and configuration information of the database, and the test user information comprises a test user ID and a permission; generating the automatic deployment template according to the mandatory information, comprising: determining names of each server to be deployed in the test environment by using a preset naming rule according to the software product name, the environment identifier and the function identifier of the server; wherein the naming rule is that a first field is used to identify the environment, a second field is used to identify the software product name, a third field is used to identify the server function, and a fourth field is used to identify a serial number; writing the server information, middleware information, database information and test user information into installation configuration parameters; dividing the servers to be deployed into different first groups according to the operating system type, and further dividing the servers to be deployed in each first group into different second groups according to the network type; and assigning all servers to be deployed in each second group to a corresponding virtualization cluster according to the operating system type and the network type of the server; allocating network resources and disk resources to the servers to be deployed according to the middleware architecture information and the database architecture information in each virtualization cluster; writing IP addresses of the servers to be deployed into the installation configuration parameters according to a corresponding relationship with the virtualization cluster and the server name, wherein the written installation configuration parameters constitute the automatic deployment template.
2. The method of claim 1, wherein, The test environment deployment comprises a one-key deployment mode, when the user selects the one-key deployment mode, the test environment is deployed by using the automatic deployment template and the preset automatic scripts to obtain the first test environment, comprising: deploying the server by calling a virtual machine template corresponding to the server information in the virtualization cluster according to the server information contained in the automatic deployment template; sequentially calling automatic scripts of each node in a preset middleware and database installation workflow to deploy the test environment by the automatic scripts according to the middleware information, the database information, network resource information and disk resource information contained in the automatic deployment template, to obtain the first test environment.
3. The method of claim 1, wherein, The test environment deployment includes a sub-deployment mode. When a user selects the sub-deployment mode, the test environment is deployed by using an automatic deployment template and preset automation scripts, and a first test environment is obtained, including: receiving a deployment request selected by a user for any server, middleware or database; when the deployment request is for a server, calling a virtual machine template corresponding to a version of server information in a virtualization cluster to which the server belongs to deploy the server; when the deployment request is for middleware or a database, sequentially calling automation scripts that complete tasks of each node in a preset workflow of middleware or database installation, and deploying the middleware or the database by the automation scripts according to middleware information or database information, information of network resources and information of disk resources included in the automatic deployment template; when the server, the middleware and the database are all deployed, obtaining the first test environment.
4. The method of claim 1, wherein, The method further includes: receiving selected information input by a user, the selected information being used to modify default parameters of the server, the default parameters of the server being different from the server information in the mandatory information; after the test environment is deployed by using the automatic deployment template and the preset automation scripts to obtain the first test environment, the method further includes: modifying the corresponding default parameters of the server by using the selected information to obtain the first test environment after modification of the parameters; testing installation and startup of the server, the middleware and the database in the first test environment by using a preset test script, including: testing installation and startup of the server, the middleware and the database in the first test environment after modification of the parameters by using the preset test script.
5. The method of claim 1, wherein, when the test result is that the server, the middleware and the database are all installed and started, delivering the first test environment, including: when the test result is that the server, the middleware and the database are all installed and started, generating a delivery list according to configuration parameters included in the automatic deployment template, and providing the delivery list to the user.
6. A test environment deployment apparatus characterized by comprising: The apparatus includes: a communication module configured to receive mandatory information of a test environment to be deployed input by a user, the mandatory information including basic information of the test environment, server information, middleware information, database information and test user information; a template generation module configured to generate an automatic deployment template according to the mandatory information; a deployment module configured to deploy the test environment by using the automatic deployment template and preset automation scripts to obtain a first test environment; a test module configured to test installation and startup of the server, the middleware and the database in the first test environment by using a preset test script; a delivery module configured to deliver the first test environment when the test result is that the server, the middleware and the database are all installed and started. The basic information includes a software product name to be tested and an environment identifier, the server information includes a function identifier, an operating system type, a CPU type, a network type, a memory size and a storage size of the server, the middleware information includes detailed version information, architecture information and configuration information of the middleware, the database information includes detailed version information, architecture information and configuration information of the database, and the test user information includes a test user ID and a permission; The template generation module is configured to: determine names of the servers to be deployed in the test environment according to the software product name, the environment identifier and the function identifier of the server by using a preset naming rule; the naming rule is that a first field is used to identify the environment, a second field is used to identify the software product name, a third field is used to identify the server function, and a fourth field is used to identify a serial number; write the server information, the middleware information, the database information and the test user information into installation configuration parameters; divide the servers to be deployed into different first groups according to the operating system types, further divide the servers to be deployed in each first group into different second groups according to the network types, and assign all the servers to be deployed in each second group to a corresponding virtualization cluster according to the operating system types and the network types of the servers; in each virtualization cluster, assign network resources and disk resources to the servers to be deployed according to the middleware architecture information and the database architecture information; write IP addresses of the servers to be deployed into the installation configuration parameters according to a corresponding relationship between the virtualization clusters and the names of the servers to be deployed, and the installation configuration parameters written into the installation configuration parameters form an automatic deployment template.
7. The apparatus of claim 6, wherein, The test environment deployment includes a one-key deployment mode, and when a user selects the one-key deployment mode, the deployment module is configured to: deploy the servers according to virtual machine templates corresponding to the server information in the virtualization cluster according to the server information contained in the automatic deployment template; according to a preset middleware and database installation workflow, sequentially call automatic scripts completing tasks of each node in the workflow, and perform test environment deployment on the middleware and the database according to the middleware information, the database information, network resource information and disk resource information contained in the automatic deployment template by the automatic scripts to obtain a first test environment.
8. The apparatus of claim 6, wherein, The test environment deployment includes a sub-deployment mode, and when a user selects the sub-deployment mode, the deployment module is configured to: receive a deployment request selected by the user for any server, middleware or database; when the deployment request is for a server, deploy the server according to virtual machine templates corresponding to the server information in a virtualization cluster to which the server belongs; when the deployment request is for middleware or a database, according to a preset middleware or database installation workflow, sequentially call automatic scripts completing tasks of each node in the workflow, and perform middleware or database deployment according to the middleware information or the database information, network resource information and disk resource information contained in the automatic deployment template by the automatic scripts; when the server, the middleware and the database are all deployed, a first test environment is obtained.
9. The apparatus of claim 6, wherein The communication module is further configured to receive user-inputted optional information, wherein the optional information is used to modify default parameters of the server, and the default parameters of the server are different from the server information in the mandatory information; The device further comprises: a parameter modification module configured to modify the corresponding default parameters of the server by using the optional information to obtain the first test environment after modification of the parameters; a test module configured to: test the installation and startup of the server, the middleware and the database in the first test environment after modification of the parameters by using a preset test script.
10. The apparatus of claim 6, wherein, a delivery module configured to: generate a delivery list according to the configuration parameters included in the automatic deployment template when the test result is that the server, the middleware and the database have all been installed and started, and provide the delivery list to the user.
11. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the method in any of claims 1 to 5 when executing the computer program.
12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program implements the method in any of claims 1 to 5 when executed by the processor.
13. A computer program product, characterised in that, The computer program product comprises a computer program, and the computer program implements the method in any of claims 1 to 5 when executed by the processor.
Citation Information
Patent Citations
Automatic test method and device, storage medium and electronic equipment
CN112286806A
Micro-service deployment method and device, electronic equipment and storage medium
CN113741909A