Mirror test method, device, computer equipment and storage medium
By pre-built test servers on the cloud platform and automatically distribute test scripts, the problems of low mirror testing efficiency and high missed test rate are solved, and efficient and accurate mirror testing is achieved.
Patent Information
- Application Number
- CN202010120604.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-26
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-02-26
AI Technical Summary
The existing mirror test is low efficiency and high missed test rate, resulting in wasting time for testers and prone to missed tests.
By placing the shell script of the test template on the pre-built server in advance, ensure that each available partition of the cloud platform has a pre-built server. After receiving the template test task, the shell script of the template test is automatically distributed to the corresponding one. The cloud host performs testing, executes and returns the test results.
It improves the efficiency and success rate of tests, reduces the missed test rate of human operations, simplifies the test process, and reduces the learning cost.
Smart Images

Figure CN111427768B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the computer field, and in particular to a mirror testing method, apparatus, computer equipment and storage medium. Background Art
[0002] An image is a basic element for creating a cloud host. There are many types of images on the market, including centos, ubuntu, debian, rhel, windows, gpu-centos, and gpu-windows. The update speed is relatively fast, and there is usually a new version every six months. In each major version, there will also be a small version update. The images on the market are updated and iterated quickly. In order to meet user needs, the latest image versions need to be continuously put on the shelves, so testers have a large number of test tasks to test the images; the usual test process is to test in the test environment first, and then put it on the shelves for production testing. Due to the architecture of cloud computing cloudstack, each image needs to be uploaded to each available partition so that users can flexibly select available partitions and deploy their own services. The image needs to be tested again in each available partition. The repeated mechanical testing process greatly wastes the working time of testers, is inefficient, and is prone to missed tests. Summary of the invention
[0003] The main purpose of this application is to provide a mirror testing method, aiming to solve the technical problems of low efficiency and high missed detection rate of existing mirror testing.
[0004] This application proposes a mirror testing method, including:
[0005] Deploy the shell script to be tested on the image template to the server of the first partition of the cloud platform for executing the template test according to the deployment script, wherein the shell script is pre-written and includes various parameters when executing the template test, the first partition is any one of all the partitions in the cloud platform, and each partition in the cloud platform corresponds to a server;
[0006] Create a cloud host corresponding to the image to be tested according to a preset creation script, where the cloud host carries the IP address, user name and password of the cloud host;
[0007] The IP, user name and password carried by the cloud host are transmitted to the server of the first partition of the cloud platform for testing the image to be tested, so as to realize the association connection between the server of the first partition and the cloud host;
[0008] Determine whether the server of the first partition is called;
[0009] If yes, control the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host;
[0010] Obtain the test result returned by the cloud host executing the shell script.
[0011] Preferably, the parameters include operating system os, cpu, memory and host name, and the step of determining whether the server of the first partition is called includes:
[0012] Obtain the operating system os, cpu, memory and host name of the cloud host;
[0013] Determine whether the operating system os, cpu, memory and host name of the cloud host are identical to the operating system os, cpu, memory and host name carried by the shell script in the server of the first partition;
[0014] If they are the same, the corresponding check instructions are called in sequence to check whether ntp matches, whether the yum source is configured, whether dns matches, and whether various processes required to initialize the cloud host have been configured, including snapshot processes, request sending processes, monitoring processes, and security processes;
[0015] If both are matched, it is determined that the server of the first partition is called.
[0016] Preferably, the same partition of the cloud platform corresponds to a plurality of different cloud hosts, and the step of controlling the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host comprises:
[0017] Determine whether the first cloud host calls the server of the first partition, wherein the first cloud host is a cloud host corresponding to any image to be tested in the first partition;
[0018] If so, the parameters corresponding to the first cloud host are transmitted to the server of the first partition;
[0019] Determine whether the first cloud host has called all servers in the first partition;
[0020] If yes, releasing the server of the first partition;
[0021] Determine whether the second cloud host calls the server of the first partition, wherein the second cloud host is a cloud host corresponding to any image to be tested in the first partition;
[0022] If yes, passing the parameters corresponding to the second cloud host to the server of the first partition;
[0023] The mirror test of each cloud host in the first partition is completed in sequence according to the test process of the first cloud host and the second cloud host.
[0024] Preferably, the same partition of the cloud platform corresponds to a plurality of different cloud hosts, and the step of controlling the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host comprises:
[0025] Obtain a parameter list of all cloud hosts that match the servers in the first partition;
[0026] Matching the parameters of each cloud host in the parameter list of all cloud hosts with the servers in the first partition one by one;
[0027] If all of them match, a test sequence is formed according to the arrangement order of each cloud host in the parameter list, and the parameters of each cloud host in the parameter list are uploaded to the server of the first partition in sequence according to the arrangement order of each cloud host in the parameter list;
[0028] The servers of the first partition are called in sequence according to the test sequence to complete the mirror test of each cloud host in the parameter list.
[0029] Preferably, before the step of forming a test sequence according to the arrangement order of each cloud host in the parameter list, the step includes:
[0030] Obtaining a test tag of each cloud host in the parameter list, wherein the test tag includes a test priority level;
[0031] Rearrange the test priorities from high to low to form a priority ranking;
[0032] Determine whether multiple cloud hosts are included in the same priority sorting number;
[0033] If yes, then obtain the matching time of the parameters of each cloud host in the same priority sorting number and the server parameters of the first partition respectively;
[0034] According to the matching time from far to near, the order of each cloud host in the same priority order is adjusted to form the test order.
[0035] Preferably, the step of controlling the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host includes:
[0036] Determine whether there is a third cloud host sending multiple instructions to call multiple partitioned servers at a current moment, wherein the multiple partitions include at least a second partition and a third partition, and the second partition and the third partition are any one of all the partitions in the cloud platform;
[0037] If yes, the parameters corresponding to the third cloud host are sent to the servers corresponding to the second partition and the third partition, respectively, wherein the IP addresses of the servers corresponding to the second partition and the third partition are different;
[0038] The third cloud host is tested simultaneously on servers corresponding to the second partition and the third partition respectively.
[0039] Preferably, the step of controlling the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host includes:
[0040] Determine whether there are multiple designated cloud hosts that have instructions to call multiple designated partition servers one by one at the current moment;
[0041] If so, determining whether each of the designated cloud hosts has a one-to-one correspondence with the server of the partition it calls;
[0042] If yes, then according to the corresponding matching relationship, the parameters corresponding to each of the designated cloud hosts are sent to the servers corresponding to each of the designated partitions respectively;
[0043] The designated cloud hosts that match each other are tested synchronously on the servers of the designated partitions.
[0044] The present application also provides a mirror test device, comprising:
[0045] A deployment module, used for deploying a shell script to be tested on the image template to a server of a first partition of the cloud platform for executing the template test according to the deployment script, wherein the shell script is pre-written and includes various parameters when executing the template test, the first partition is any one of all the partitions in the cloud platform, and each partition in the cloud platform corresponds to a server;
[0046] A creation module is used to create a cloud host corresponding to the image to be tested according to a preset creation script, wherein the cloud host carries the IP address, user name and password of the cloud host;
[0047] An association module is used to transmit the IP, user name and password carried by the cloud host to the server of the first partition of the cloud platform for testing the image to be tested, so as to realize the association connection between the server of the first partition and the cloud host;
[0048] A judging module, used to judge whether the server of the first partition is called;
[0049] A control module, configured to, if yes, control the server of the first partition to upload a shell script of the image template test corresponding to the image to be tested to the cloud host;
[0050] The acquisition module is used to obtain the test result returned by the cloud host when executing the shell script.
[0051] The present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0052] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.
[0053] This application places the shell script of the test template on a pre-built svr (svrver, server, abbreviated as svr) in advance, and ensures that each available partition of the cloud platform has a pre-built svr. When receiving a template test task, you only need to call svr to automatically distribute the shell script of the template test to the corresponding cloud host for testing, execution and return of the test results, thereby improving the efficiency and success rate of the test. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A flowchart of a mirror testing method according to an embodiment of the present application;
[0055] Figure 2 A schematic diagram of the structure of a mirror image testing device according to an embodiment of the present application;
[0056] Figure 3 A schematic diagram of the internal structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0058] Reference Figure 1 , a mirror testing method according to an embodiment of the present application includes:
[0059] S1: Deploy the shell script to be tested on the image template to the server of the first partition of the cloud platform for executing the template test according to the deployment script, wherein the shell script is pre-written and includes various parameters when executing the template test, the first partition is any one of all the partitions in the cloud platform, and each partition in the cloud platform corresponds to a server.
[0060] S2: Create a cloud host corresponding to the image to be tested according to a preset creation script, where the cloud host carries the IP address, user name and password of the cloud host.
[0061] S3: The IP address, user name and password carried by the cloud host are transmitted to the server of the first partition of the cloud platform for testing the image to be tested, so as to realize the association connection between the server of the first partition and the cloud host.
[0062] S4: Determine whether the server of the first partition is called.
[0063] S5: If yes, control the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host.
[0064] S6: Obtain the test result returned by the cloud host executing the shell script.
[0065] This application places the shell script of the test template on a pre-built svr (svrver, server, abbreviated as svr) in advance, and ensures that each available partition of the cloud platform has a pre-built svr. The shell script is placed and transferred to the corresponding Linux server through the sz command. After receiving the template test task, you only need to call svr to automatically distribute the shell script of the template test to the corresponding cloud host for mirror testing, execute and return the test results, and improve the efficiency and success rate of the test through the template test mirror. When you click Run during the test, the cloud platform will automatically initiate an http request to svr, and then svr will automatically connect to the corresponding cloud host, and then upload the shell script to the cloud host for testing. The above cloud host is created by the user in advance on the cloud through a preset creation script. Each cloud host corresponds to a preset creation script. After successful creation, the unique host IP corresponding to the cloud host will be generated according to the encoding information of the creation script and the partition information of the cloud platform; and the user name and password of the corresponding cloud host will be generated according to the name information and password information set in the preset creation script; the unique host IP of the corresponding cloud host and the test image of the cloud host are sent to the cloud host through the name of the preset creation script, so as to fix the program of the cloud host through the program information in the creation script. According to the cloud host corresponding to the image to be tested, the svr correspondence between the image to be tested and the partition is realized. For example, when creating a cloud host in South China, the South China svr is used, and when creating a cloud host in North China, the North China svr is used, so that the test personnel can control the test situation in time. The above parameters include the operating system, cpu, memory, host name, ntp, yum source, dns corresponding to the template test, and various agents required to initialize the cloud host. The above agent refers to software or hardware entities that can act autonomously, such as various processes. Each partition's SVR has a unique IP address. The deployment script includes the information data of the IP address of the pre-deployed partition's SVR. The deployment script and the partition's SVR are associated one-to-one through the same IP address. The shell script and the deployment script are associated one-to-one through the file number. When the shell script is replaced to the SVR of another partition, the IP address information data in the corresponding deployment script is updated to replace and call the SVR of another partition, making the operation more convenient.
[0066] Furthermore, the parameters include operating system os, cpu, memory and host name, and step S4 of determining whether the server of the first partition is called includes:
[0067] S41: Obtain the operating system os, cpu, memory and host name of the cloud host;
[0068] S42: Determine whether the operating system os, cpu, memory and host name of the cloud host correspond to the operating system os, cpu, memory and host name carried by the shell script in the server of the first partition;
[0069] S43: If they are the same, the corresponding check instructions are called in sequence to check whether ntp matches, whether the yum source is configured, whether dns matches, and whether various processes required to initialize the cloud host have been configured, including snapshot processes, request sending processes, monitoring processes, and security processes;
[0070] S44: If both are matched, it is determined that the server of the first partition is called.
[0071] This application realizes the association between the first partition server and the cloud host by making the parameters of the cloud host correspond to the parameters carried by the shell script in the partitioned server one by one, thereby improving the accurate matching of the server to the image test. By detecting that all the running configurations after the association of the first partition server and the cloud host have been matched and perfected, that is, the running configuration of the cloud host has met the test requirements, it is considered that the first partition server is called by the cloud host corresponding to the current image. In other embodiments of the present application, when the running configurations after the association of the first partition server and the cloud host are not matched and perfect, or after the matching fails, they can be called by other cloud hosts to improve the utilization rate of the partition server. The NTP check is to execute the date command to check whether the time can be displayed correctly; the Yum check uses the yum install command to install any package to see if it can succeed; the DNS check uses the nslookup command to check whether the configured DNS can be resolved; the Agent check follows the ps-elf|grep agent command to check which processes the cloud host has started. Execute ps–elf|grep agent to display all agents in parallel.
[0072] Furthermore, the same partition of the cloud platform corresponds to a plurality of different cloud hosts, and step S5 of controlling the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host includes:
[0073] S51: Determine whether a first cloud host calls a server in the first partition, wherein the first cloud host is a cloud host corresponding to any image to be tested in the first partition;
[0074] S52: If yes, then transmit the parameters corresponding to the first cloud host to the server of the first partition;
[0075] S53: Determine whether the first cloud host has called all servers in the first partition;
[0076] S54: If yes, release the server of the first partition;
[0077] S55: Determine whether the second cloud host calls the server of the first partition, wherein the second cloud host is a cloud host corresponding to any image to be tested in the first partition;
[0078] S56: If yes, passing the parameter corresponding to the second cloud host to the server of the first partition;
[0079] S57: Complete the mirror test of each cloud host in the first partition in sequence according to the test process of the first cloud host and the second cloud host.
[0080] In this embodiment, a partition of the cloud platform has only one SVR. It is determined which partition's SVR is called to test the test image of the cloud host, and the SVR is fixed; the SVR of the same partition can support the test images of different cloud hosts for separate testing, and the SVR of the partition is called in turn for associated testing to improve the utilization rate of the partition's SVR. In this embodiment, by analyzing the action of outputting the test report, it is determined whether the SVR has been called. After the test is completed, whether the test fails or succeeds, a test report will be output to give feedback on the test results. In this embodiment, when the SVR of the same partition tests the test images of different cloud hosts separately, it is called in sequence by uploading parameters, completing the test, and then releasing the server to improve the test accuracy. The above-mentioned terms such as "first" and "second" are only used for distinction and are not used for limitation. Similar terms in other places have the same function and are not repeated.
[0081] Furthermore, the same partition of the cloud platform corresponds to a plurality of different cloud hosts, and step S5 of controlling the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host includes:
[0082] S501: Obtain a parameter list of all cloud hosts that match the server in the first partition;
[0083] S502: Match the parameters of each cloud host in the parameter list of all cloud hosts with the servers in the first partition one by one;
[0084] S503: If all are matched, forming a test sequence according to the arrangement order of each cloud host in the parameter list, and uploading the parameters of each cloud host in the parameter list to the server of the first partition in sequence according to the arrangement order of each cloud host in the parameter list;
[0085] S504: Call the servers of the first partition in sequence according to the test sequence to complete the mirror test of each cloud host in the parameter list.
[0086] In this embodiment, when the SVR of the same partition supports the test images of different cloud hosts, the upload parameters are uniformly executed through the parameter list, and the partitioned servers are called in sequence under a specific test order. After the unified test is completed, the servers are released to perform batch testing, thereby improving the test efficiency. The above test order includes the sorting in the parameter list, and also includes the sorting optimized according to the parameter list.
[0087] Furthermore, before the step S503 of forming a test sequence according to the arrangement order of each cloud host in the parameter list, the following steps are included:
[0088] S503a: Obtain a test tag of each cloud host in the parameter list, wherein the test tag includes a test priority level;
[0089] S503b: re-arrange the test priorities from high to low to form a priority ranking;
[0090] S503c: Determine whether the same priority ranking number includes multiple cloud hosts;
[0091] S503d: If yes, obtain the matching time between the parameters of each cloud host in the same priority sorting number and the server parameters of the first partition respectively;
[0092] S503e: Adjust the order of each cloud host in the same priority sorting number according to the matching time from far to near, so as to form the test order.
[0093] This embodiment optimizes the test sequence to meet the needs of special test tasks, and then calls the partitioned servers in sequence according to the optimized test sequence. The above-mentioned optimized test sequence includes the test priority sorting, and is formed in combination with the original sorting in the parameter list. For example, the sorting in the parameter list includes A, B, C, D, E, F, G, H, I, J, K, L, M, N, and the highest priority includes D, H, F, M; the second highest priority includes B, J, K; the lower priority includes A, C, N, E; the lowest priority includes: G, I, L. Then the final optimized test sequence is D, F, H, M, B, J, K, A, C, E, N, G, I, L.
[0094] Further, step S5 of controlling the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host includes:
[0095] S58: Determine whether there is a third cloud host sending multiple instructions to call multiple partitioned servers at the current moment, wherein the multiple partitions include at least a second partition and a third partition, and the second partition and the third partition are any one of all the partitions in the cloud platform;
[0096] S59: If yes, send the parameters corresponding to the third cloud host to the servers corresponding to the second partition and the third partition respectively, wherein the IP addresses of the servers corresponding to the second partition and the third partition respectively are different;
[0097] S60: Testing the third cloud host simultaneously on servers corresponding to the second partition and the third partition respectively.
[0098] In this embodiment, the test images of the same cloud host can be supported for synchronous testing by calling the svr of different partitions, so that the test reports after the svr of each partition tests the same third cloud host can be used to evaluate the operating performance of the svr of each partition, including the evaluation of the operating rate, the fluency of test data retrieval, etc. The above-mentioned third cloud host is a cloud host created by any preset creation script. The parameters corresponding to the third cloud host are sent to the servers corresponding to the second partition and the third partition respectively. They can be sent at the same time, or they can be sent in sequence within the preset time range without limitation, but the interval time should not be too long to prevent the evaluation results of the partitioned servers from being affected by the performance changes of the cloud host itself. Each test report is defined by the IP of the server, so that the operating performance of each partitioned server can be accurately compared and evaluated through the test report.
[0099] Further, step S5 of controlling the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host includes:
[0100] S505: Determine whether there are multiple instructions for specifying cloud hosts to call multiple servers of specified partitions in a one-to-one correspondence at the current moment;
[0101] S506: If yes, determining whether each of the designated cloud hosts has a one-to-one correspondence with the server of the partition it calls;
[0102] S507: If yes, then according to the corresponding matching relationship, the parameters corresponding to each of the designated cloud hosts are sent to the servers corresponding to each of the designated partitions respectively;
[0103] S508: Synchronously test the designated cloud hosts that match each other on the servers of the designated partitions.
[0104] During the test, multiple images to be tested can be supported by servers in different partitions at the same time. It is only necessary to use different creation scripts to create each designated cloud host, and test the test images of each designated cloud host in different partitions to achieve simultaneous and parallel testing of multiple test images. In the actual test process, not every test image of the designated cloud host may pass the test. When an error occurs during the execution of a shell script by a test image, because the svr called is different, the test processes of each test image do not interfere with each other and will not affect the test of other test images; similarly, when a test of an available partition fails, it does not affect the test of other available partitions. Using this solution for template testing greatly improves the efficiency of test image use. There is no need to repeat the test image in each available partition. The test results of any available partition for the test image can be directly transferred to other available partitions. It is also possible to test the test images that are simultaneously on different available partitions together. It is also possible to test by calling svr in turn on the same available partition to meet the various test scheme designs of testers and improve test efficiency. Testers directly call the svr of the test image without rebuilding the test platform. It is quick and convenient, and the learning cost is not high. Before testing the image, you only need to learn the test tool, which reduces the learning cost, and you can directly use the tool to test. For images that fail the test, you only need to analyze the failure results based on the corresponding failure cases, reducing the missed detection rate caused by manual operation.
[0105] Reference Figure 2 , a mirror image testing device according to an embodiment of the present application comprises:
[0106] Deployment module 1 is used to deploy the shell script to be tested on the image template to the server of the first partition of the cloud platform for executing the template test according to the deployment script, wherein the shell script is pre-written and includes various parameters when executing the template test. The first partition is any one of all the partitions in the cloud platform, and each partition in the cloud platform corresponds to a server.
[0107] Creation module 2, used to create a cloud host corresponding to the image to be tested according to a preset creation script, and the cloud host carries the IP address, user name and password of the cloud host;
[0108] The association module 3 is used to transmit the IP, user name and password carried by the cloud host to the server of the first partition of the cloud platform for testing the image to be tested, so as to realize the association connection between the server of the first partition and the cloud host;
[0109] A judgment module 4 is used to judge whether the server of the first partition is called;
[0110] Control module 5, for controlling the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host if so;
[0111] The acquisition module 6 is used to obtain the test result returned by the cloud host when executing the shell script.
[0112] This application places the shell script of the test template on a pre-built svr (svrver, server, abbreviated as svr) in advance, and ensures that each available partition of the cloud platform has a pre-built svr. The shell script is placed and transferred to the corresponding Linux server through the sz command. After receiving the template test task, you only need to call svr to automatically distribute the shell script of the template test to the corresponding cloud host for mirror testing, execute and return the test results, and improve the efficiency and success rate of the test through the template test mirror. When you click Run during the test, the cloud platform will automatically initiate an http request to svr, and then svr will automatically connect to the corresponding cloud host, and then upload the shell script to the cloud host for testing. The above cloud host is created by the user in advance on the cloud through a preset creation script. Each cloud host corresponds to a preset creation script. After successful creation, the unique host IP corresponding to the cloud host will be generated according to the encoding information of the creation script and the partition information of the cloud platform; and the user name and password of the corresponding cloud host will be generated according to the name information and password information set in the preset creation script; the unique host IP of the corresponding cloud host and the test image of the cloud host are sent to the cloud host through the name of the preset creation script, so as to fix the program of the cloud host through the program information in the creation script. The svr correspondence between the image to be tested and the partition is realized according to the cloud host corresponding to the image to be tested. For example, the south China svr is used to create the cloud host in South China in Ping An Cloud, and the north China svr is used to create the cloud host in North China, so that the test personnel can control the test situation in time. The above parameters include the operating system, cpu, memory, host name, ntp, yum source, dns and various agents required to initialize the cloud host corresponding to the template test. The above agent refers to software or hardware entities that can act autonomously, such as various processes. Each partition's SVR has a unique IP address. The deployment script includes the information data of the IP address of the pre-deployed partition's SVR. The deployment script and the partition's SVR are associated one-to-one through the same IP address. The shell script and the deployment script are associated one-to-one through the file number. When the shell script is replaced to the SVR of another partition, the IP address information data in the corresponding deployment script is updated to replace and call the SVR of another partition, making the operation more convenient.
[0113] Furthermore, the parameters include operating system os, cpu, memory and host name, and the judgment module 4 includes:
[0114] A first acquisition unit is used to acquire the operating system os, cpu, memory and host name of the cloud host;
[0115] A first judgment unit is used to judge whether the operating system os, cpu, memory and host name of the cloud host are the same as the operating system os, cpu, memory and host name carried by the shell script in the server of the first partition;
[0116] The calling unit is used to call the corresponding checking instructions in sequence to check whether ntp matches, whether yum source is configured, whether dns matches, and whether various processes required for initializing the cloud host have been configured, if they are the same, including snapshot process, request sending process, monitoring process and security process;
[0117] A determination unit is configured to determine that the server of the first partition is called if all are matched.
[0118] This application realizes the association between the first partition server and the cloud host by making the parameters of the cloud host correspond to the parameters carried by the shell script in the partitioned server one by one, thereby improving the accurate matching of the server to the image test. By detecting that all the running configurations after the association of the first partition server and the cloud host have been matched and perfected, that is, the running configuration of the cloud host has met the test requirements, it is considered that the first partition server is called by the cloud host corresponding to the current image. In other embodiments of the present application, when the running configurations after the association of the first partition server and the cloud host are not matched and perfect, or after the matching fails, they can be called by other cloud hosts to improve the utilization rate of the partition server. The NTP check is to execute the date command to check whether the time can be displayed correctly; the Yum check uses the yum install command to install any package to see if it can succeed; the DNS check uses the nslookup command to check whether the configured DNS can be resolved; the Agent check follows the ps-elf|grep agent command to check which processes the cloud host has started. Execute ps–elf|grep agent to display all agents in parallel.
[0119] Furthermore, the same partition of the cloud platform corresponds to a plurality of different cloud hosts, and the control module 5 includes:
[0120] A second judgment unit is used to judge whether the first cloud host calls the server of the first partition, wherein the first cloud host is a cloud host corresponding to any image to be tested in the first partition;
[0121] a first transmission unit, configured to transmit the parameter corresponding to the first cloud host to the server of the first partition;
[0122] A third judgment unit, used to judge whether the first cloud host has called all servers in the first partition;
[0123] a releasing unit, configured to release the server of the first partition if yes;
[0124] a fourth determination unit, configured to determine whether a second cloud host calls a server in the first partition, wherein the second cloud host is a cloud host corresponding to any image to be tested in the first partition;
[0125] a second transmission unit, configured to transmit the parameter corresponding to the second cloud host to the server of the first partition;
[0126] The first testing unit is used to sequentially complete the mirroring test of each cloud host in the first partition according to the testing process of the first cloud host and the second cloud host.
[0127] In this embodiment, a partition of the cloud platform has only one SVR. It is determined which partition's SVR is called to test the test image of the cloud host, and the SVR is fixed; the SVR of the same partition can support the test images of different cloud hosts for separate testing, and the SVR of the partition is called in turn for associated testing to improve the utilization rate of the partition's SVR. In this embodiment, by analyzing the action of outputting the test report, it is determined whether the SVR has been called. After the test is completed, whether the test fails or succeeds, a test report will be output to give feedback on the test results. In this embodiment, when the SVR of the same partition tests the test images of different cloud hosts separately, it is called in sequence by uploading parameters, completing the test, and then releasing the server to improve the test accuracy. The above-mentioned terms such as "first" and "second" are only used for distinction and are not used for limitation. Similar terms in other places have the same function and are not repeated.
[0128] Furthermore, the same partition of the cloud platform corresponds to a plurality of different cloud hosts, and the control module 5 includes:
[0129] A second acquisition unit is used to acquire a parameter list of all cloud hosts that match the servers in the first partition;
[0130] A matching unit, used for matching the parameters of each cloud host in the parameter list of all cloud hosts with the servers in the first partition one by one;
[0131] a forming unit, configured to form a test sequence according to the arrangement order of each cloud host in the parameter list if all are matched, and upload the parameters of each cloud host in the parameter list to the server of the first partition in sequence according to the arrangement order of each cloud host in the parameter list;
[0132] The second testing unit is used to call the servers of the first partition in sequence according to the testing sequence to complete the mirroring test of each cloud host in the parameter list.
[0133] In this embodiment, when the SVR of the same partition supports the test images of different cloud hosts, the upload parameters are uniformly executed through the parameter list, and the partitioned servers are called in sequence under a specific test order. After the unified test is completed, the servers are released to perform batch testing, thereby improving the test efficiency. The above test order includes the sorting in the parameter list, and also includes the sorting optimized according to the parameter list.
[0134] Furthermore, the control module 5 comprises:
[0135] a third acquisition unit, configured to acquire a test tag of each cloud host in the parameter list, wherein the test tag includes a test priority level;
[0136] A sorting unit, used for re-sorting the test priorities from high to low to form a priority sorting;
[0137] A fifth determination unit, configured to determine whether a plurality of cloud hosts are included in the same priority ranking number;
[0138] a fourth acquisition unit, configured to, if yes, acquire the matching time between the parameters of each cloud host in the same priority sorting number and the server parameters of the first partition;
[0139] The adjustment unit is used to adjust the order of each cloud host in the same priority order number in a manner of the matching time from far to near to form the test order.
[0140] This embodiment optimizes the test sequence to meet the needs of special test tasks, and then calls the partitioned servers in sequence according to the optimized test sequence. The above-mentioned optimized test sequence includes the test priority sorting, and is formed in combination with the original sorting in the parameter list. For example, the sorting in the parameter list includes A, B, C, D, E, F, G, H, I, J, K, L, M, N, and the highest priority includes D, H, F, M; the second highest priority includes B, J, K; the lower priority includes A, C, N, E; the lowest priority includes: G, I, L. Then the final optimized test sequence is D, F, H, M, B, J, K, A, C, E, N, G, I, L.
[0141] Furthermore, the control module 5 comprises:
[0142] a sixth judgment unit, configured to judge whether a third cloud host sends a plurality of instructions for invoking a plurality of partitioned servers at a current moment, wherein the plurality of partitions include at least a second partition and a third partition, and the second partition and the third partition are respectively any one of all the partitions in the cloud platform;
[0143] A first sending unit is configured to send the parameters corresponding to the third cloud host to the servers corresponding to the second partition and the third partition, respectively, wherein the IP addresses of the servers corresponding to the second partition and the third partition are different;
[0144] The third testing unit is used to simultaneously test the third cloud host on the servers corresponding to the second partition and the third partition respectively.
[0145] In this embodiment, the test images of the same cloud host can be supported for synchronous testing by calling the svr of different partitions, so that the test reports after the svr of each partition tests the same third cloud host can be used to evaluate the operating performance of the svr of each partition, including the evaluation of the operating rate, the fluency of test data retrieval, etc. The above-mentioned third cloud host is a cloud host created by any preset creation script. The parameters corresponding to the third cloud host are sent to the servers corresponding to the second partition and the third partition respectively. They can be sent at the same time, or they can be sent in sequence within the preset time range without limitation, but the interval time should not be too long to prevent the evaluation results of the partitioned servers from being affected by the performance changes of the cloud host itself. Each test report is defined by the IP of the server, so that the operating performance of each partitioned server can be accurately compared and evaluated through the test report.
[0146] Furthermore, the control module 5 comprises:
[0147] A seventh determination unit is used to determine whether there are instructions for multiple designated cloud hosts to call multiple designated partition servers in a one-to-one correspondence at the current moment;
[0148] An eighth judgment unit, configured to, if yes, respectively judge whether each of the designated cloud hosts has a one-to-one correspondence with the server of the partition it calls;
[0149] A second sending unit is used to send the parameters corresponding to each of the designated cloud hosts to the servers corresponding to each of the designated partitions according to the corresponding matching relationship.
[0150] The fourth testing unit is used to synchronously test the designated cloud hosts that are matched with each other on the servers of the designated partitions.
[0151] During the test, multiple images to be tested can be supported by servers in different partitions at the same time. It is only necessary to use different creation scripts to create each designated cloud host, and test the test images of each designated cloud host in different partitions to achieve simultaneous and parallel testing of multiple test images. In the actual test process, not every test image of the designated cloud host may pass the test. When an error occurs during the execution of a shell script by a test image, because the svr called is different, the test processes of each test image do not interfere with each other and will not affect the test of other test images; similarly, when a test of an available partition fails, it does not affect the test of other available partitions. Using this solution for template testing greatly improves the efficiency of test image use. There is no need to repeat the test image in each available partition. The test results of any available partition for the test image can be directly transferred to other available partitions. It is also possible to test the test images that are simultaneously on different available partitions together. It is also possible to test by calling svr in turn on the same available partition to meet the various test scheme designs of testers and improve test efficiency. Testers directly call the svr of the test image without rebuilding the test platform. It is quick and convenient, and the learning cost is not high. Before testing the image, you only need to learn the test tool, which reduces the learning cost, and you can directly use the tool to test. For images that fail the test, you only need to analyze the failure results based on the corresponding failure cases, reducing the missed detection rate caused by manual operation.
[0152] Reference Figure 3 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store all data required for the mirror test process. The network interface of the computer device is used to communicate with an external end through a network connection. The computer program is executed by the processor to implement the mirror test method.
[0153] The processor executes the image testing method, deploys the shell script of the image template test to the server of the first partition of the cloud platform for executing the template test according to the deployment script, wherein the shell script is pre-written and includes various parameters when executing the template test, the first partition is any one of all the partitions in the cloud platform, and each partition in the cloud platform corresponds to a server; creates a cloud host corresponding to the image to be tested according to a preset creation script, and the cloud host carries the IP, user name and password of the cloud host; transmits the IP, user name and password carried by the cloud host to the server of the first partition of the cloud platform for testing the image to be tested, so as to realize the association connection between the server of the first partition and the cloud host; determines whether the server of the first partition is called; if so, controls the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host; obtains the test result returned by the cloud host executing the shell script.
[0154] The above computer device places the shell script of the test template on a pre-built svr (svrver, server, abbreviated as svr) in advance, and ensures that each available partition of the cloud platform has a pre-built svr. When receiving a template test task, it only needs to call svr to automatically distribute the shell script of the template test to the corresponding cloud host for testing, execute and return the test results, thereby improving the efficiency and success rate of the test.
[0155] In one embodiment, the parameters include an operating system os, cpu, memory, and host name, and the step in which the processor determines whether the server of the first partition is called includes: obtaining the operating system os, cpu, memory, and host name of the cloud host; determining whether the operating system os, cpu, memory, and host name of the cloud host correspond one-to-one to the operating system os, cpu, memory, and host name carried by the shell script in the server of the first partition; if they are the same, calling the corresponding check instructions in sequence to check whether ntp matches, whether yum source is configured, whether dns matches, and whether various processes required to initialize the cloud host have been configured, the processes including snapshot processes, request sending processes, monitoring processes, and security processes; if they are all matched, determining that the server of the first partition is called.
[0156] In one embodiment, the same partition of the cloud platform corresponds to multiple different cloud hosts, and the processor controls the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host, including: judging whether the first cloud host calls the server of the first partition, wherein the first cloud host is the cloud host corresponding to any image to be tested in the first partition; if so, passing the parameters corresponding to the first cloud host to the server of the first partition; judging whether the first cloud host has called the servers of the first partition; if so, releasing the servers of the first partition; judging whether the second cloud host calls the servers of the first partition, wherein the second cloud host is the cloud host corresponding to any image to be tested in the first partition; if so, passing the parameters corresponding to the second cloud host to the servers of the first partition; and completing the image test of each cloud host in the first partition in sequence according to the test process of the first cloud host and the second cloud host.
[0157] In one embodiment, the same partition of the cloud platform corresponds to multiple different cloud hosts, and the processor controls the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host, including: obtaining a parameter list of all cloud hosts corresponding to the server of the first partition; matching the parameters of each cloud host in the parameter list of all cloud hosts with the server of the first partition one by one; if all match, forming a test sequence according to the arrangement order of each cloud host in the parameter list, and uploading the parameters of each cloud host in the parameter list to the server of the first partition in sequence according to the arrangement order of each cloud host in the parameter list; calling the server of the first partition in sequence according to the test sequence to complete the image test of each cloud host in the parameter list.
[0158] In one embodiment, before the step of forming a test sequence according to the arrangement order of each cloud host in the parameter list, the processor includes: obtaining a test tag of each cloud host in the parameter list, wherein the test tag includes a test priority level; re-arranging the test priorities from high to low to form a priority ranking; determining whether the same priority ranking number includes multiple cloud hosts; if so, obtaining the matching time of the parameters of each cloud host in the same priority ranking number with the server parameters of the first partition; and adjusting the ranking of each cloud host in the same priority ranking number in a manner from far to near according to the matching time to form the test sequence.
[0159] In one embodiment, the processor controls the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host, comprising: determining whether there is a third cloud host sending multiple instructions to call servers of multiple partitions at the current moment, wherein the multiple partitions include at least the second partition and the third partition, and the second partition and the third partition are any one of all partitions in the cloud platform; if so, sending the parameters corresponding to the third cloud host to the servers corresponding to the second partition and the third partition respectively, wherein the IPs of the servers corresponding to the second partition and the third partition are different; and testing the third cloud host simultaneously on the servers corresponding to the second partition and the third partition respectively.
[0160] In one embodiment, the processor controls the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host, comprising: determining whether there are multiple designated cloud hosts at the current moment that correspond one-to-one to the instructions of calling multiple designated partition servers; if so, determining whether each of the designated cloud hosts matches one-to-one with the servers of the partitions they call; if so, sending the parameters corresponding to each of the designated cloud hosts to the servers corresponding to each of the designated partitions according to the corresponding matching relationships; and synchronously testing the designated cloud hosts that match each other on the servers of the designated partitions.
[0161] Those skilled in the art will understand that Figure 3 The structure shown in is merely a block diagram of a portion of the structure related to the present application solution and does not constitute a limitation on the computer device to which the present application solution is applied.
[0162] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, an image testing method is implemented. A shell script for the image template test to be tested is deployed to a server of a first partition of a cloud platform that performs a template test according to a deployment script, wherein the shell script is pre-written and includes various parameters when performing a template test. The first partition is any one of all partitions in the cloud platform, and each partition in the cloud platform corresponds to a server; a cloud host corresponding to the image to be tested is created according to a preset creation script for the image to be tested, and the cloud host carries the IP, user name and password of the cloud host; the IP, user name and password carried by the cloud host are transmitted to a server of a first partition of the cloud platform that tests the image to be tested, so as to realize an association connection between the server of the first partition and the cloud host; it is determined whether the server of the first partition is called; if so, the server of the first partition is controlled to upload the shell script for the image template test corresponding to the image to be tested to the cloud host; and the test result returned by the cloud host when the shell script is executed is obtained.
[0163] The computer-readable storage medium places the shell script of the test template on a pre-built SVR in advance, and ensures that each available partition of the cloud platform has a pre-built SVR. When a template test task is received, it only needs to call the SVR to automatically distribute the shell script of the template test to the corresponding cloud host for testing, execution and return of the test results, thereby improving the efficiency and success rate of the test.
[0164] In one embodiment, the parameters include an operating system os, cpu, memory, and host name, and the step in which the processor determines whether the server of the first partition is called includes: obtaining the operating system os, cpu, memory, and host name of the cloud host; determining whether the operating system os, cpu, memory, and host name of the cloud host correspond one-to-one to the operating system os, cpu, memory, and host name carried by the shell script in the server of the first partition; if they are the same, calling the corresponding check instructions in sequence to check whether ntp matches, whether yum source is configured, whether dns matches, and whether various processes required to initialize the cloud host have been configured, the processes including snapshot processes, request sending processes, monitoring processes, and security processes; if they are all matched, determining that the server of the first partition is called.
[0165] In one embodiment, the same partition of the cloud platform corresponds to multiple different cloud hosts, and the processor controls the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host, including: judging whether the first cloud host calls the server of the first partition, wherein the first cloud host is the cloud host corresponding to any image to be tested in the first partition; if so, passing the parameters corresponding to the first cloud host to the server of the first partition; judging whether the first cloud host has called the servers of the first partition; if so, releasing the servers of the first partition; judging whether the second cloud host calls the servers of the first partition, wherein the second cloud host is the cloud host corresponding to any image to be tested in the first partition; if so, passing the parameters corresponding to the second cloud host to the servers of the first partition; and completing the image test of each cloud host in the first partition in sequence according to the test process of the first cloud host and the second cloud host.
[0166] In one embodiment, the same partition of the cloud platform corresponds to multiple different cloud hosts, and the processor controls the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host, including: obtaining a parameter list of all cloud hosts corresponding to the server of the first partition; matching the parameters of each cloud host in the parameter list of all cloud hosts with the server of the first partition one by one; if all match, forming a test sequence according to the arrangement order of each cloud host in the parameter list, and uploading the parameters of each cloud host in the parameter list to the server of the first partition in sequence according to the arrangement order of each cloud host in the parameter list; calling the server of the first partition in sequence according to the test sequence to complete the image test of each cloud host in the parameter list.
[0167] In one embodiment, before the step of forming a test sequence according to the arrangement order of each cloud host in the parameter list, the processor includes: obtaining a test tag of each cloud host in the parameter list, wherein the test tag includes a test priority level; re-arranging the test priorities from high to low to form a priority ranking; determining whether the same priority ranking number includes multiple cloud hosts; if so, obtaining the matching time of the parameters of each cloud host in the same priority ranking number with the server parameters of the first partition; and adjusting the ranking of each cloud host in the same priority ranking number in a manner from far to near according to the matching time to form the test sequence.
[0168] In one embodiment, the processor controls the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host, comprising: determining whether there is a third cloud host sending multiple instructions to call servers of multiple partitions at the current moment, wherein the multiple partitions include at least the second partition and the third partition, and the second partition and the third partition are any one of all partitions in the cloud platform; if so, sending the parameters corresponding to the third cloud host to the servers corresponding to the second partition and the third partition respectively, wherein the IPs of the servers corresponding to the second partition and the third partition are different; and testing the third cloud host simultaneously on the servers corresponding to the second partition and the third partition respectively.
[0169] In one embodiment, the processor controls the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host, comprising: determining whether there are multiple designated cloud hosts at the current moment that correspond one-to-one to the instructions of calling multiple designated partition servers; if so, determining whether each of the designated cloud hosts matches one-to-one with the servers of the partitions they call; if so, sending the parameters corresponding to each of the designated cloud hosts to the servers corresponding to each of the designated partitions according to the corresponding matching relationships; and synchronously testing the designated cloud hosts that match each other on the servers of the designated partitions.
[0170] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the above-mentioned computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0171] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0172] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A mirror test method, It is characterized in that include: Deploy the shell script to be tested on the image template to the server of the first partition of the cloud platform for executing the template test according to the deployment script, wherein the shell script is pre-written and includes various parameters when executing the template test, the first partition is any one of all the partitions in the cloud platform, and each partition in the cloud platform corresponds to a server; Create a cloud host corresponding to the image to be tested according to a preset creation script, where the cloud host carries the IP address, user name and password of the cloud host; The IP, user name and password carried by the cloud host are transmitted to the server of the first partition of the cloud platform for testing the image to be tested, so as to realize the association connection between the server of the first partition and the cloud host; Determine whether the server of the first partition is called; If yes, control the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host; Obtain the test result returned by the cloud host executing the shell script.
2. The mirror test method according to claim 1, It is characterized in that The parameters include an operating system os, cpu, memory, and host name, and the step of determining whether the server of the first partition is called includes: Obtain the operating system os, cpu, memory and host name of the cloud host; Determine whether the operating system os, cpu, memory and host name of the cloud host are identical to the operating system os, cpu, memory and host name carried by the shell script in the server of the first partition; If they are the same, the corresponding check instructions are called in sequence to check whether ntp matches, whether the yum source is configured, whether dns matches, and whether various processes required to initialize the cloud host have been configured, including snapshot processes, request sending processes, monitoring processes, and security processes; If both are matched, it is determined that the server of the first partition is called.
3. The mirror image testing method according to claim 2, It is characterized in that The same partition of the cloud platform corresponds to a plurality of different cloud hosts, and the step of controlling the server of the first partition to upload a shell script of an image template test corresponding to the image to be tested to the cloud host comprises: Determine whether the first cloud host calls the server of the first partition, wherein the first cloud host is a cloud host corresponding to any image to be tested in the first partition; If so, the parameters corresponding to the first cloud host are transmitted to the server of the first partition; Determine whether the first cloud host has called all servers in the first partition; If yes, releasing the server of the first partition; Determine whether the second cloud host calls the server of the first partition, wherein the second cloud host is a cloud host corresponding to any image to be tested in the first partition; If yes, passing the parameters corresponding to the second cloud host to the server of the first partition; The mirror test of each cloud host in the first partition is completed in sequence according to the test process of the first cloud host and the second cloud host.
4. The mirror testing method according to claim 2, It is characterized in that The same partition of the cloud platform corresponds to a plurality of different cloud hosts, and the step of controlling the server of the first partition to upload a shell script of an image template test corresponding to the image to be tested to the cloud host comprises: Obtain a parameter list of all cloud hosts that match the servers in the first partition; Matching the parameters of each cloud host in the parameter list of all cloud hosts with the servers in the first partition one by one; If all of them match, a test sequence is formed according to the arrangement order of each cloud host in the parameter list, and the parameters of each cloud host in the parameter list are uploaded to the server of the first partition in sequence according to the arrangement order of each cloud host in the parameter list; The servers of the first partition are called in sequence according to the test sequence to complete the mirror test of each cloud host in the parameter list.
5. The mirror image testing method according to claim 4, It is characterized in that Before the step of forming a test sequence according to the arrangement order of each cloud host in the parameter list, the step includes: Obtaining a test tag of each cloud host in the parameter list, wherein the test tag includes a test priority level; Rearrange the test priorities from high to low to form a priority ranking; Determine whether multiple cloud hosts are included in the same priority sorting number; If yes, then obtain the matching time of the parameters of each cloud host in the same priority sorting number and the server parameters of the first partition respectively; According to the matching time from far to near, the order of each cloud host in the same priority order is adjusted to form the test order.
6. The mirror testing method according to claim 2, It is characterized in that The step of controlling the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host includes: Determine whether there is a third cloud host sending multiple instructions to call multiple partitioned servers at a current moment, wherein the multiple partitions include at least a second partition and a third partition, and the second partition and the third partition are any one of all the partitions in the cloud platform; If yes, the parameters corresponding to the third cloud host are sent to the servers corresponding to the second partition and the third partition, respectively, wherein the IP addresses of the servers corresponding to the second partition and the third partition are different; The third cloud host is tested simultaneously on servers corresponding to the second partition and the third partition respectively.
7. The mirror testing method according to claim 2, It is characterized in that The step of controlling the server of the first partition to upload the shell script of the image template test corresponding to the image to be tested to the cloud host includes: Determine whether there are multiple designated cloud hosts that have instructions to call multiple designated partition servers one by one at the current moment; If so, determining whether each of the designated cloud hosts has a one-to-one correspondence with the server of the partition it calls; If yes, then according to the corresponding matching relationship, the parameters corresponding to each of the designated cloud hosts are sent to the servers corresponding to each of the designated partitions respectively; The designated cloud hosts that match each other are tested synchronously on the servers of the designated partitions.
8. A mirror test device, It is characterized in that include: A deployment module, used for deploying a shell script to be tested on the image template to a server of a first partition of the cloud platform for executing the template test according to the deployment script, wherein the shell script is pre-written and includes various parameters when executing the template test, the first partition is any one of all the partitions in the cloud platform, and each partition in the cloud platform corresponds to a server; A creation module is used to create a cloud host corresponding to the image to be tested according to a preset creation script, wherein the cloud host carries the IP address, user name and password of the cloud host; An association module is used to transmit the IP, user name and password carried by the cloud host to the server of the first partition of the cloud platform for testing the image to be tested, so as to realize the association connection between the server of the first partition and the cloud host; A judging module, used to judge whether the server of the first partition is called; A control module, configured to control the server of the first partition to upload a shell script for testing the image template corresponding to the image to be tested to the cloud host if the server of the first partition is called; The acquisition module is used to obtain the test result returned by the cloud host when executing the shell script.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
