Cloud platform virtual machine object long-term stability test method, device and equipment and storage medium
Through the cloud platform virtual machine object long-stabilization test method, the test log is generated in real time and the test is adjusted according to the preset retry mechanism, the problem of poor stability of the S3 protocol long-stabilization test is solved, efficient and flexible testing is achieved, and resource waste is reduced and resource waste is reduced. Error handling time improves testing efficiency and reliability.
Patent Information
- Application Number
- CN202411138137.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-12-13
AI Technical Summary
In the prior art, the long-term stability test based on the S3 protocol is poor, the test time is long, the test is difficult, the error handling is not timely, and the configuration is cumbersome, resulting in waste of resources.
Provide a cloud platform virtual machine object long-term and stable testing method, which can generate test logs in real time, detect abnormal data and retest according to the preset retry mechanism, find processing strategy adjustment tests, and realize the re-pull test within the preset time. Support virtual mirror creation of virtual machines, use preset scripts for testing, including creating bucket structures, uploading, deleting operations, etc., to ensure closed-loop management of resources.
Improves the elasticity and security of long-term and stable testing, unlimited storage capacity based on cloud platform, avoids log space and virtual machine computing performance problems, supports multiple development platforms, is easy to integrate, improves testing efficiency and flexibility, and supports 2. The second development simplifies configuration and reduces resource waste.
Smart Images

Figure CN119135572A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing technology, and in particular to a method, device, equipment and storage medium for long-term stability testing of virtual machine objects on a cloud platform. Background Art
[0002] As one of the pioneers of the cloud computing era, Amazon S3 provides a storage service software development kit (SDK) to facilitate developers to use AWS S3 to implement data storage, management and retrieval functions; the success of the S3 protocol has promoted the development of the cloud storage market, and many other cloud service providers have also launched similar object storage services and follow the specifications of the S3 protocol.
[0003] However, there are also the following defects and shortcomings:
[0004] Test time and difficulty: Some tools such as cosbench can implement long-term PUT, GET, and DELETE operations within specified parameters, but cannot achieve "infinite" long-term stable testing; S3cmd encapsulates the relevant S3 SDK, which is cumbersome to configure and difficult to develop.
[0005] Test type: General test method without additional upload, object copy, folder creation test items, small monitoring scope.
[0006] Error handling: When interacting with AWS S3 services, you may encounter various errors or exceptions. Testing tools like Cosbench have high cohesion, and the output of error logs is fixed. Error handling is not timely enough, which reduces the stability and reliability of the code.
[0007] Complexity of long-term stability testing: Although the S3 service itself has high availability, in actual applications, there may be deficiencies in long-term stability testing, especially in performance and fault recovery capabilities under extreme conditions.
[0008] Test asset closed loop problem: General testing cannot form a closed loop in resource use, resulting in residual resources, which leads to resource waste in the entire long-term testing activities. Summary of the invention
[0009] The main purpose of the present invention is to provide a long-term stability test method, device, equipment and storage medium for cloud platform virtual machine objects, aiming to solve the problems of long-term stability test based on S3 protocol in the prior art, poor stability, long test time, high test difficulty, insufficient error handling, reduced stability and reliability of the code, and cumbersome configuration and large waste of resources.
[0010] In a first aspect, the present invention provides a method for long-term stability testing of a cloud platform virtual machine object, the method comprising the following steps:
[0011] Conduct long-term stable testing on the software to be tested and generate test logs in real time;
[0012] When abnormal data is detected in the test log, the software to be tested is re-tested for long-term stability according to a preset retry mechanism to obtain error information;
[0013] A corresponding processing strategy is searched according to the error information, a long-term stable test is adjusted according to the processing strategy, and the long-term stable test of the software to be tested is restarted within a preset test time.
[0014] Optionally, before performing a long-term stable test on the software to be tested and generating a test log in real time, the cloud platform virtual machine object long-term stable test method further includes:
[0015] Upload a preset virtual image, create a virtual machine on the cloud platform according to the preset virtual image, and transfer the script of the software to be tested to the virtual machine.
[0016] Optionally, the long-term stability test of the software to be tested and the real-time generation of the test log include:
[0017] Obtain the test environment of the current user, and obtain a matching preset long-term stable test script from a preset long-term stable test database according to the test environment;
[0018] The software to be tested is subjected to a long-term stable test according to the preset long-term stable test script, the object storage resources corresponding to the software to be tested are deleted, and a test log is generated in real time.
[0019] Optionally, performing a long-term stable test on the software to be tested according to the preset long-term stable test script, deleting the object storage resource corresponding to the software to be tested, and generating a test log in real time includes:
[0020] According to the preset long-term stable test script, the software to be tested is subjected to a long-term stable test of creating a bucket structure, uploading operations, deleting operations, appending objects, copying objects, and creating folders in the bucket, deleting the object storage resources corresponding to the software to be tested, and generating a test log in real time.
[0021] Optionally, when abnormal data is detected in the test log, re-performing a long-term stability test on the software to be tested according to a preset retry mechanism to obtain error information, including:
[0022] When abnormal data is detected in the test log, the long-term stability test of the software to be tested is re-performed for a preset number of times according to a preset retry mechanism;
[0023] When it is detected that the cumulative number of re-long stability tests reaches the preset number and the software to be tested still cannot be retried successfully, an error message is generated.
[0024] Optionally, when abnormal data is detected in the test log, before re-performing a preset number of long-term stability tests on the software to be tested according to a preset retry mechanism, the cloud platform virtual machine object long-term stability test method further includes:
[0025] The time node of the test log is obtained, and problem analysis and result checking are performed on the test log according to the time node.
[0026] Optionally, searching for a corresponding processing strategy according to the error information, adjusting the long-term stable test according to the processing strategy, and restarting the long-term stable test of the software to be tested within a preset test time includes:
[0027] Searching for a processing strategy corresponding to the error message from a preset strategy library, and adjusting a test script of a long-term stability test according to the processing strategy;
[0028] Restart the long-term stable test of the software to be tested within the preset test time until the preset test time ends, and generate a test report.
[0029] In a second aspect, in order to achieve the above-mentioned purpose, the present invention further proposes a cloud platform virtual machine object long-term stability testing device, the cloud platform virtual machine object long-term stability testing device comprising:
[0030] The log generation module is used to perform long-term stable testing on the software to be tested and generate test logs in real time;
[0031] An anomaly detection module is used to re-perform a long-term stability test on the software to be tested according to a preset retry mechanism to obtain error information when abnormal data appears in the test log;
[0032] The retest module is used to find the corresponding processing strategy according to the error information, adjust the long-term stable test according to the processing strategy, and restart the long-term stable test of the software to be tested within a preset test time.
[0033] In the third aspect, to achieve the above-mentioned purpose, the present invention also proposes a cloud platform virtual machine object long-term stability testing device, the cloud platform virtual machine object long-term stability testing device comprising: a memory, a processor, and a cloud platform virtual machine object long-term stability testing program stored in the memory and executable on the processor, the cloud platform virtual machine object long-term stability testing program being configured to implement the steps of the cloud platform virtual machine object long-term stability testing method as described above.
[0034] In a fourth aspect, in order to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a cloud platform virtual machine object long-term stability test program is stored, and when the cloud platform virtual machine object long-term stability test program is executed by a processor, the steps of the cloud platform virtual machine object long-term stability test method as described above are implemented.
[0035] The cloud platform virtual machine object long-term stability test method proposed by the present invention performs a long-term stability test on the software to be tested and generates a test log in real time; when abnormal data is detected in the test log, the software to be tested is re-tested according to a preset retry mechanism to obtain error information; the corresponding processing strategy is searched according to the error information, the long-term stability test is adjusted according to the processing strategy, and the long-term stability test of the software to be tested is restarted within the preset test time, which can improve the elasticity and security of the long-term stability test. Based on the almost unlimited storage capacity of the cloud platform, there is no need to worry about the log space and virtual machine computing and storage performance issues, and it can be flexibly expanded according to needs. At the same time, the security of the cloud platform is used to ensure the security of the virtual machine, thereby ensuring the security of the long-term stability behavior, and it has high availability, does not rely on fixed machines, improves test efficiency, supports multiple development platforms and programming languages, is easy to integrate into the existing cloud platform virtual machine test environment, and uses the virtual machine to directly run the corresponding script; it is independent of the CPU architecture, has good portability, and supports secondary development, which improves the flexibility of use and improves the speed and efficiency of the cloud platform virtual machine object long-term stability test. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;
[0037] Figure 2 This is a flow chart of the first embodiment of the long-term stability testing method for a cloud platform virtual machine object of the present invention;
[0038] Figure 3 This is a flow chart of a second embodiment of a method for long-term stability testing of a cloud platform virtual machine object according to the present invention;
[0039] Figure 4 It is a flowchart of the third embodiment of the long-term stability testing method of a cloud platform virtual machine object of the present invention;
[0040] Figure 5 This is a flow chart of a fourth embodiment of a method for long-term stability testing of a cloud platform virtual machine object according to the present invention;
[0041] Figure 6 This is a flow chart of a fifth embodiment of a method for long-term stability testing of a cloud platform virtual machine object according to the present invention;
[0042] Figure 7This is a functional module diagram of the first embodiment of the long-term stability testing device for a cloud platform virtual machine object of the present invention.
[0043] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0045] The solution of the embodiment of the present invention is mainly: by performing long-term stable testing on the software to be tested, a test log is generated in real time; when abnormal data is detected in the test log, the long-term stable test is re-performed on the software to be tested according to a preset retry mechanism to obtain error information; the corresponding processing strategy is searched according to the error information, and the long-term stable test is adjusted according to the processing strategy, and the long-term stable test of the software to be tested is restarted within the preset test time, which can improve the elasticity and security of the long-term stable test. Based on the almost unlimited storage capacity of the cloud platform, there is no need to worry about the log space and virtual machine computing and storage performance issues, and it can be flexibly expanded according to needs. At the same time, the security of the cloud platform is utilized to ensure the security of the virtual machine. The security of the virtual machine is guaranteed, thereby ensuring the security of long-term stable behavior, and it has high availability, is independent of fixed machines, improves test efficiency, supports multiple development platforms and programming languages, is easy to integrate into the existing cloud platform virtual machine test environment, and uses the virtual machine to directly run the corresponding script; it is independent of the CPU architecture, has good portability, and supports secondary development, which improves the flexibility of use, improves the speed and efficiency of long-term stable testing of cloud platform virtual machine objects, and solves the problems of long-term stable testing based on the S3 protocol in the existing technology, such as poor stability, long testing time, high testing difficulty, insufficient timely error handling, reduced code stability and reliability, and cumbersome configuration and large waste of resources.
[0046] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0047] like Figure 1As shown, the device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (Non-Volatile Memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
[0048] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0049] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating device, a network communication module, a user interface module, and a cloud platform virtual machine object long-term stability test program.
[0050] The device of the present invention calls the cloud platform virtual machine object long-term stability test program stored in the memory 1005 through the processor 1001, and performs the following operations:
[0051] Conduct long-term stable testing on the software to be tested and generate test logs in real time;
[0052] When abnormal data is detected in the test log, the software to be tested is re-tested for long-term stability according to a preset retry mechanism to obtain error information;
[0053] A corresponding processing strategy is searched according to the error information, a long-term stable test is adjusted according to the processing strategy, and the long-term stable test of the software to be tested is restarted within a preset test time.
[0054] The device of the present invention calls the cloud platform virtual machine object long-term stability test program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0055] Upload a preset virtual image, create a virtual machine on the cloud platform according to the preset virtual image, and transfer the script of the software to be tested to the virtual machine.
[0056] The device of the present invention calls the cloud platform virtual machine object long-term stability test program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0057] Obtain the test environment of the current user, and obtain a matching preset long-term stable test script from a preset long-term stable test database according to the test environment;
[0058] The software to be tested is subjected to a long-term stable test according to the preset long-term stable test script, the object storage resources corresponding to the software to be tested are deleted, and a test log is generated in real time.
[0059] The device of the present invention calls the cloud platform virtual machine object long-term stability test program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0060] According to the preset long-term stable test script, the software to be tested is subjected to a long-term stable test of creating a bucket structure, uploading operations, deleting operations, appending objects, copying objects, and creating folders in the bucket, deleting the object storage resources corresponding to the software to be tested, and generating a test log in real time.
[0061] The device of the present invention calls the cloud platform virtual machine object long-term stability test program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0062] When abnormal data is detected in the test log, the long-term stability test of the software to be tested is re-performed for a preset number of times according to a preset retry mechanism;
[0063] When it is detected that the cumulative number of re-long stability tests reaches the preset number and the software to be tested still cannot be retried successfully, an error message is generated.
[0064] The device of the present invention calls the cloud platform virtual machine object long-term stability test program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0065] The time node of the test log is obtained, and problem analysis and result checking are performed on the test log according to the time node.
[0066] The device of the present invention calls the cloud platform virtual machine object long-term stability test program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0067] Searching for a processing strategy corresponding to the error message from a preset strategy library, and adjusting a test script of a long-term stability test according to the processing strategy;
[0068] Restart the long-term stable test of the software to be tested within the preset test time until the preset test time ends, and generate a test report.
[0069] Through the above scheme, this embodiment generates a test log in real time by performing a long-term stable test on the software to be tested; when abnormal data is detected in the test log, the software to be tested is re-tested according to a preset retry mechanism to obtain error information; the corresponding processing strategy is searched according to the error information, the long-term stable test is adjusted according to the processing strategy, and the long-term stable test of the software to be tested is restarted within the preset test time, which can improve the elasticity and security of the long-term stable test. Based on the almost unlimited storage capacity of the cloud platform, there is no need to worry about log space and virtual machine computing and storage performance issues, and it can be flexibly expanded according to needs. At the same time, the security of the cloud platform is used to ensure the security of the virtual machine, thereby ensuring the security of the long-term stable behavior, and it has high availability, does not rely on fixed machines, improves testing efficiency, supports multiple development platforms and programming languages, is easy to integrate into the existing cloud platform virtual machine test environment, and can directly run corresponding scripts using virtual machines; it is independent of the CPU architecture, has good portability, and supports secondary development, which improves the flexibility of use and improves the speed and efficiency of long-term stable testing of cloud platform virtual machine objects.
[0070] Based on the above hardware structure, an embodiment of a long-term stability testing method for a cloud platform virtual machine object of the present invention is proposed.
[0071] Reference Figure 2 , Figure 2 It is a flow chart of the first embodiment of the long-term stability testing method of a cloud platform virtual machine object of the present invention.
[0072] In a first embodiment, the cloud platform virtual machine object long-term stability test method includes the following steps:
[0073] Step S10: Perform long-term stability testing on the software to be tested and generate a test log in real time.
[0074] It should be noted that the software to be tested is software that needs to be subjected to long-term stability testing. By conducting long-term stability testing on the software to be tested, a test log can be generated in real time.
[0075] Step S20: When abnormal data is detected in the test log, the software to be tested is re-tested for long-term stability according to a preset retry mechanism to obtain error information.
[0076] It is understandable that by analyzing the test log, when abnormal data is detected in the test log, the software to be tested can be re-tested for long-term stability according to a preset retry mechanism, thereby obtaining error information corresponding to the abnormal data.
[0077] Step S30: searching for a corresponding processing strategy according to the error information, adjusting the long-term stable test according to the processing strategy, and restarting the long-term stable test of the software to be tested within a preset test time.
[0078] It should be understood that a processing strategy corresponding to the error information can be found based on the error information, and relevant test parameters of the long-term stable test can be adjusted according to the processing strategy, and the long-term stable test of the software to be tested can be restarted within the preset test time.
[0079] Through the above scheme, this embodiment generates a test log in real time by performing a long-term stable test on the software to be tested; when abnormal data is detected in the test log, the software to be tested is re-tested according to a preset retry mechanism to obtain error information; the corresponding processing strategy is searched according to the error information, the long-term stable test is adjusted according to the processing strategy, and the long-term stable test of the software to be tested is restarted within the preset test time, which can improve the elasticity and security of the long-term stable test. Based on the almost unlimited storage capacity of the cloud platform, there is no need to worry about log space and virtual machine computing and storage performance issues, and it can be flexibly expanded according to needs. At the same time, the security of the cloud platform is used to ensure the security of the virtual machine, thereby ensuring the security of the long-term stable behavior, and it has high availability, does not rely on fixed machines, improves testing efficiency, supports multiple development platforms and programming languages, is easy to integrate into the existing cloud platform virtual machine test environment, and can directly run corresponding scripts using virtual machines; it is independent of the CPU architecture, has good portability, and supports secondary development, which improves the flexibility of use and improves the speed and efficiency of long-term stable testing of cloud platform virtual machine objects.
[0080] Further, Figure 3 FIG. 2 is a flow chart of a second embodiment of a method for long-term stability testing of a cloud platform virtual machine object according to the present invention. Figure 3 As shown, based on the first embodiment, a second embodiment of the cloud platform virtual machine object long-term stability test method of the present invention is proposed. In this embodiment, before the step S10, the cloud platform virtual machine object long-term stability test method further includes the following steps:
[0081] Step S01, uploading a preset virtual image, creating a virtual machine on a cloud platform according to the preset virtual image, and transmitting the script of the software to be tested to the virtual machine.
[0082] It should be noted that, by uploading a pre-made virtual image, a virtual machine can be created on the cloud platform according to the preset virtual image, and then the script of the software to be tested can be transmitted to the virtual machine.
[0083] In the specific implementation, you can upload the prepared virtual machine image, arm or x86 version, and create a virtual machine on the cloud platform to upload the script. The cloud platform provides almost unlimited storage capacity, so there is no need to worry about log space and virtual machine computing and storage performance issues, and it can be flexibly expanded according to needs. At the same time, the security of the cloud platform is used to ensure the security of the virtual machine, thereby ensuring the security of long-term stable behavior; and the cloud platform has its own high availability, providing high availability capabilities from the three dimensions of storage, computing, and network to ensure the high availability of the virtual machine. At the same time, the retry mechanism of the long-term stable code doubles the high availability of long-term stable operation. Through the S3 SDK, long-term stable execution can be automated in the cloud platform virtual machine, which does not rely on fixed machines and runs almost without human intervention, thereby improving test efficiency. The standard S3 protocol supports multiple development platforms and programming languages, and is easy to integrate into the existing cloud platform virtual machine test environment. The corresponding script can be directly run using the virtual machine, regardless of the CPU architecture, with good portability, and supports secondary development, which improves the flexibility of use.
[0084] Through the above scheme, this embodiment uploads a preset virtual image, creates a virtual machine on the cloud platform according to the preset virtual image, and transmits the scripts of the software to be tested to the virtual machine, which can quickly build a slave virtual machine, speed up the subsequent long-term stable testing process, and improve the speed and efficiency of long-term stable testing of cloud platform virtual machine objects.
[0085] Further, Figure 4 FIG. 1 is a flow chart of a third embodiment of a method for long-term stability testing of a cloud platform virtual machine object according to the present invention. Figure 4 As shown, a third embodiment of the long-term stability test method of a cloud platform virtual machine object of the present invention is proposed based on the first embodiment. In this embodiment, step S10 specifically includes the following steps:
[0086] Step S11: Acquire the test environment of the current user, and obtain a matching preset long-term stable test script from a preset long-term stable test database according to the test environment.
[0087] It should be noted that after obtaining the test environment of the current user, a matching preset long-term test script can be obtained from a preset long-term test database according to the test environment. Different test environments and different users correspond to different test scripts.
[0088] Step S12: perform a long-term stable test on the software to be tested according to the preset long-term stable test script, delete the object storage resources corresponding to the software to be tested, and generate a test log in real time.
[0089] It can be understood that according to the preset long-term stable test script, the software to be tested can be subjected to long-term stable testing, and the object storage resources corresponding to the software to be tested can be deleted at the same time. Each cycle ensures resource cleanup, completes the closed-loop management of resource usage for the test, avoids resource waste, and generates test logs in real time.
[0090] Furthermore, the step S12 specifically includes the following steps:
[0091] According to the preset long-term stable test script, the software to be tested is subjected to a long-term stable test of creating a bucket structure, uploading operations, deleting operations, appending objects, copying objects, and creating folders in the bucket, deleting the object storage resources corresponding to the software to be tested, and generating a test log in real time.
[0092] It should be noted that this embodiment can perform multi-monitoring item tests for the long-term stability test of the software to be tested. The test items include the usual bucket creation, upload, and deletion operations, as well as appending objects, copying objects, and creating folders in buckets, which more effectively ensures the object storage function of the cloud platform.
[0093] Through the above scheme, this embodiment obtains the test environment of the current user, obtains a matching preset long-term test script from a preset long-term test database according to the test environment, performs a long-term test on the software to be tested according to the preset long-term test script, deletes the object storage resources corresponding to the software to be tested, generates a test log in real time, and can provide detailed log output, ensuring the stability and reliability of the test. Each cycle ensures resource cleanup, completes the closed-loop management of resource use for the test, and avoids resource waste.
[0094] Further, Figure 5 FIG. 4 is a flow chart of a fourth embodiment of a method for long-term stability testing of a cloud platform virtual machine object according to the present invention. Figure 5 As shown, a fourth embodiment of the long-term stability test method of a cloud platform virtual machine object of the present invention is proposed based on the first embodiment. In this embodiment, step S20 specifically includes the following steps:
[0095] Step S21: when abnormal data is detected in the test log, re-perform a long-term stability test for a preset number of times on the software to be tested according to a preset retry mechanism.
[0096] It should be noted that when abnormal data is detected in the test log, the long-term stability test can be re-performed on the software to be tested for a preset number of times according to a preset retry mechanism.
[0097] Furthermore, before step S21, the cloud platform virtual machine object long-term stability test method further includes the following steps:
[0098] The time node of the test log is obtained, and problem analysis and result checking are performed on the test log according to the time node.
[0099] It should be understood that each log has a corresponding time, which is convenient for problem analysis and result checking. That is, after obtaining the time node of the test log, the test log can be analyzed and the result checked according to the time node, that is, the cause of the error can be checked in the background according to the time node.
[0100] Step S22: when it is detected that the cumulative number of re-long-term stability tests reaches the preset number and the software to be tested still cannot be retried successfully, an error message is generated.
[0101] It is understandable that if an exception occurs and the software cannot be retried successfully within the retry times, an error message is generated, that is, when it is detected that the cumulative number of re-long stability tests reaches the preset number and the software to be tested still cannot be retried successfully, an error message is generated.
[0102] This embodiment adopts the above scheme. When abnormal data is detected in the test log, the long-term stable test is performed on the software to be tested for a preset number of times according to the preset retry mechanism; when it is detected that the cumulative number of re-long-term stable tests reaches the preset number and the software to be tested still cannot be retried successfully, an error message is generated. An error handling and retry mechanism is added to the test process. If it cannot succeed within the specified number of retries, an error is reported. Detailed log output is provided, and each log has a corresponding time, which is convenient for problem analysis and result inspection, thereby ensuring the stability and reliability of the test.
[0103] Further, Figure 6 FIG. 5 is a flow chart of a fifth embodiment of a method for long-term stability testing of a cloud platform virtual machine object according to the present invention. Figure 6 As shown, based on the first embodiment, a fifth embodiment of the cloud platform virtual machine object long-term stability test method of the present invention is proposed. In this embodiment, the step S30 specifically includes the following steps:
[0104] Step S31: searching a preset strategy library for a processing strategy corresponding to the error message, and adjusting the test script of the long-term stability test according to the processing strategy.
[0105] It should be noted that the processing strategy corresponding to the error message can be found from a preset strategy library, and the test script of the long-term stability test can be adjusted according to the processing strategy.
[0106] In the specific implementation, the parameters in the long-term stable script can be re-edited and adjusted according to the processing strategy, and the corresponding Ak, Sk, Endpoint, etc. can be modified.
[0107] Step S32: restart the long-term stable test of the software to be tested within the preset test time, until the preset test time is over, and generate a test report.
[0108] It can be understood that if it is pulled up again within the retry range, long-term stability can be continued to ensure stability and achieve the purpose of long-term stable monitoring. The long-term stable test of the software to be tested is restarted within the retry time range, that is, the preset test time, until the preset test time is over, thereby generating a final test report. Each log in the detailed long-term stable report has a corresponding time. By analyzing the logs and checking the results, corresponding maintenance and inspection can be made.
[0109] It should be understood that compared with traditional object testing tools, the long-term test of this solution adds other monitoring points, such as appending objects, copying objects, creating folders in buckets, and adding error handling and retry mechanisms during the test process. If it fails within the specified number of retries, an error will be reported, and detailed log output will be provided. Each log has a corresponding time, which is convenient for problem analysis and result inspection, ensuring the stability and reliability of the test; each cycle ensures resource cleanup, completes the closed-loop management of resource use in the test, and avoids resource waste. The automation and intelligence of the long-term test script reduces manual operations and improves the independence and accuracy of the test.
[0110] Correspondingly, the present invention further provides a long-term stability testing device for a cloud platform virtual machine object.
[0111] Reference Figure 7 , Figure 7 This is a functional module diagram of the first embodiment of the long-term stability testing device for a cloud platform virtual machine object of the present invention.
[0112] In a first embodiment of a long-term stability test device for a cloud platform virtual machine object of the present invention, the cloud platform virtual machine object long-term stability test device comprises:
[0113] The log generation module 10 is used to perform long-term stability testing on the software to be tested and generate test logs in real time.
[0114] The abnormality detection module 20 is used to re-perform a long-term stability test on the software to be tested according to a preset retry mechanism to obtain error information when abnormal data is detected in the test log.
[0115] The retest module 30 is used to find a corresponding processing strategy according to the error information, adjust the long-term stable test according to the processing strategy, and restart the long-term stable test of the software to be tested within a preset test time.
[0116] The log generation module 10 is also used to upload a preset virtual image, create a virtual machine on the cloud platform according to the preset virtual image, and transmit the scripts of the software to be tested to the virtual machine.
[0117] The log generation module 10 is also used to obtain the test environment of the current user, and obtain a matching preset long-term stable test script from a preset long-term stable test database according to the test environment; perform a long-term stable test on the software to be tested according to the preset long-term stable test script, delete the object storage resources corresponding to the software to be tested, and generate a test log in real time.
[0118] The log generation module 10 is also used to perform long-term stable testing on the software to be tested by creating a bucket structure, uploading operations, deleting operations, appending objects, copying objects, and creating folders in the bucket according to the preset long-term stable testing script, deleting the object storage resources corresponding to the software to be tested, and generating test logs in real time.
[0119] The anomaly detection module 20 is also used to, when abnormal data is detected in the test log, re-perform a preset number of long-term stable tests on the software to be tested according to a preset retry mechanism; when it is detected that the cumulative number of re-long-term stable tests reaches the preset number and the software to be tested still cannot be retried successfully, generate an error message.
[0120] The anomaly detection module 20 is further used to obtain the time node of the test log, and perform problem analysis and result inspection on the test log according to the time node.
[0121] The retest module 30 is also used to search for a processing strategy corresponding to the error information from a preset strategy library, and adjust the test script of the long-term stable test according to the processing strategy; restart the long-term stable test of the software to be tested within the preset test time until the preset test time ends, and generate a test report.
[0122] Among them, the steps implemented by each functional module of the cloud platform virtual machine object long-term stability testing device can refer to the various embodiments of the cloud platform virtual machine object long-term stability testing method of the present invention, and will not be repeated here.
[0123] In addition, an embodiment of the present invention further provides a storage medium, on which a cloud platform virtual machine object long-term stability test program is stored. When the cloud platform virtual machine object long-term stability test program is executed by a processor, the following operations are implemented:
[0124] Conduct long-term stable testing on the software to be tested and generate test logs in real time;
[0125] When abnormal data is detected in the test log, the software to be tested is re-tested for long-term stability according to a preset retry mechanism to obtain error information;
[0126] A corresponding processing strategy is searched according to the error information, a long-term stable test is adjusted according to the processing strategy, and the long-term stable test of the software to be tested is restarted within a preset test time.
[0127] Furthermore, when the cloud platform virtual machine object long-term stability test program is executed by the processor, the following operations are also implemented:
[0128] A preset virtual image is transmitted, a virtual machine is created on the cloud platform according to the preset virtual image, and the scripts of the software to be tested are transmitted to the virtual machine.
[0129] Furthermore, when the cloud platform virtual machine object long-term stability test program is executed by the processor, the following operations are also implemented:
[0130] Obtain the test environment of the current user, and obtain a matching preset long-term stable test script from a preset long-term stable test database according to the test environment;
[0131] The software to be tested is subjected to a long-term stable test according to the preset long-term stable test script, the object storage resources corresponding to the software to be tested are deleted, and a test log is generated in real time.
[0132] Furthermore, when the cloud platform virtual machine object long-term stability test program is executed by the processor, the following operations are also implemented:
[0133] According to the preset long-term stable test script, the software to be tested is subjected to a long-term stable test of creating a bucket structure, uploading operations, deleting operations, appending objects, copying objects, and creating folders in the bucket, deleting the object storage resources corresponding to the software to be tested, and generating a test log in real time.
[0134] Furthermore, when the cloud platform virtual machine object long-term stability test program is executed by the processor, the following operations are also implemented:
[0135] When abnormal data is detected in the test log, the long-term stability test of the software to be tested is re-performed for a preset number of times according to a preset retry mechanism;
[0136] When it is detected that the cumulative number of re-long stability tests reaches the preset number and the software to be tested still cannot be retried successfully, an error message is generated.
[0137] Furthermore, when the cloud platform virtual machine object long-term stability test program is executed by the processor, the following operations are also implemented:
[0138] The time node of the test log is obtained, and problem analysis and result checking are performed on the test log according to the time node.
[0139] Furthermore, when the cloud platform virtual machine object long-term stability test program is executed by the processor, the following operations are also implemented:
[0140] Searching for a processing strategy corresponding to the error message from a preset strategy library, and adjusting a test script of a long-term stability test according to the processing strategy;
[0141] Restart the long-term stable test of the software to be tested within the preset test time until the preset test time ends, and generate a test report.
[0142] Those skilled in the art will appreciate that all or part of the steps in the above-mentioned implementation methods can be completed by instructions of a program, which is stored in a storage medium and includes a number of instructions for enabling a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the methods described in each implementation of the present application; and the aforementioned storage medium includes: various computer-readable storage media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0143] 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, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0144] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0145] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A cloud platform virtual machine object long-term stability test method, characterized in that: The cloud platform virtual machine object long-term stability test method includes: Conduct long-term stable testing on the software to be tested and generate test logs in real time; When abnormal data is detected in the test log, the software to be tested is re-tested for long-term stability according to a preset retry mechanism to obtain error information; A corresponding processing strategy is searched according to the error information, a long-term stable test is adjusted according to the processing strategy, and the long-term stable test of the software to be tested is restarted within a preset test time.
2. The cloud platform virtual machine object long-term stability testing method according to claim 1, characterized in that: Before performing a long-term stable test on the software to be tested and generating a test log in real time, the cloud platform virtual machine object long-term stable test method further includes: Upload a preset virtual image, create a virtual machine on the cloud platform according to the preset virtual image, and transfer the script of the software to be tested to the virtual machine.
3. The cloud platform virtual machine object long-term stability testing method according to claim 1, characterized in that: The long-term stable test of the software to be tested and the real-time generation of test logs include: Obtain the test environment of the current user, and obtain a matching preset long-term stable test script from a preset long-term stable test database according to the test environment; The software to be tested is subjected to a long-term stable test according to the preset long-term stable test script, the object storage resources corresponding to the software to be tested are deleted, and a test log is generated in real time.
4. The cloud platform virtual machine object long-term stability testing method according to claim 3, characterized in that: The method of performing a long-term stable test on the software to be tested according to the preset long-term stable test script, deleting the object storage resource corresponding to the software to be tested, and generating a test log in real time includes: According to the preset long-term stable test script, the software to be tested is subjected to a long-term stable test of creating a bucket structure, uploading operations, deleting operations, appending objects, copying objects, and creating folders in the bucket, deleting the object storage resources corresponding to the software to be tested, and generating a test log in real time.
5. The cloud platform virtual machine object long-term stability testing method according to claim 1, characterized in that: When abnormal data is detected in the test log, the software to be tested is re-tested for long-term stability according to a preset retry mechanism to obtain error information, including: When abnormal data is detected in the test log, the long-term stability test of the software to be tested is re-performed for a preset number of times according to a preset retry mechanism; When it is detected that the cumulative number of re-long stability tests reaches the preset number and the software to be tested still cannot be retried successfully, an error message is generated.
6. The cloud platform virtual machine object long-term stability test method according to claim 5, characterized in that: When abnormal data is detected in the test log, before re-performing a preset number of long-term stable tests on the software to be tested according to a preset retry mechanism, the cloud platform virtual machine object long-term stable testing method further includes: The time node of the test log is obtained, and problem analysis and result checking are performed on the test log according to the time node.
7. The cloud platform virtual machine object long-term stability testing method according to claim 1, characterized in that: The step of searching for a corresponding processing strategy according to the error information, adjusting the long-term stable test according to the processing strategy, and restarting the long-term stable test of the software to be tested within a preset test time includes: Searching for a processing strategy corresponding to the error message from a preset strategy library, and adjusting a test script of a long-term stability test according to the processing strategy; Restart the long-term stable test of the software to be tested within the preset test time, until the preset test time is over, and generate a test report.
8. A cloud platform virtual machine object long-term stability test device, characterized in that: The cloud platform virtual machine object long-term stability testing device comprises: The log generation module is used to perform long-term stable testing on the software to be tested and generate test logs in real time; An anomaly detection module is used to re-perform a long-term stability test on the software to be tested according to a preset retry mechanism to obtain error information when abnormal data appears in the test log; The retest module is used to find the corresponding processing strategy according to the error information, adjust the long-term stable test according to the processing strategy, and restart the long-term stable test of the software to be tested within a preset test time.
9. A cloud platform virtual machine object long-term stability test device, characterized in that: The cloud platform virtual machine object long-term stability testing device includes: a memory, a processor, and a cloud platform virtual machine object long-term stability testing program stored in the memory and executable on the processor, wherein the cloud platform virtual machine object long-term stability testing program is configured to implement the steps of the cloud platform virtual machine object long-term stability testing method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a cloud platform virtual machine object long-term stability test program, which, when executed by a processor, implements the steps of a cloud platform virtual machine object long-term stability test method as described in any one of claims 1 to 7.
